Обсуждение: SQL History

Поиск
Список
Период
Сортировка

SQL History

От
Hrishikesh Deshmukh
Дата:
Hi All,

Does Postgresql have a "sql history of queries run" capability?
Any ideas/pointers will be a great help. Could one capture the order
and SQL queries run?!

Thanks in advance and your help is appreciated.

Hrishi

Re: SQL History

От
Scott Marlowe
Дата:
On Fri, 2005-05-06 at 12:48, Hrishikesh Deshmukh wrote:
> Hi All,
>
> Does Postgresql have a "sql history of queries run" capability?
> Any ideas/pointers will be a great help. Could one capture the order
> and SQL queries run?!
>
> Thanks in advance and your help is appreciated.

There's a setting in postgresql.conf that will let you log all queries.
I'm not sure if it gets the order exactly right, or anything like that.

Re: SQL History

От
"Joshua D. Drake"
Дата:
Hrishikesh Deshmukh wrote:
> Hi All,
>
> Does Postgresql have a "sql history of queries run" capability?
> Any ideas/pointers will be a great help. Could one capture the order
> and SQL queries run?!

If you are using psql there is .psql_history.

>
> Thanks in advance and your help is appreciated.
>
> Hrishi
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend


--
Your PostgreSQL solutions company - Command Prompt, Inc. 1.800.492.2240
PostgreSQL Replication, Consulting, Custom Programming, 24x7 support
Managed Services, Shared and Dedication Hosting
Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/

Re: SQL History

От
Michael Ben-Nes
Дата:
You can set postgresql.conf to log all queries to a file.

Sadly you cant distinguish between the databases.


Hrishikesh Deshmukh wrote:

>Hi All,
>
>Does Postgresql have a "sql history of queries run" capability?
>Any ideas/pointers will be a great help. Could one capture the order
>and SQL queries run?!
>
>Thanks in advance and your help is appreciated.
>
>Hrishi
>
>---------------------------(end of broadcast)---------------------------
>TIP 8: explain analyze is your friend
>
>

--
--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
Cel: 972-52-8555757
Fax: 972-4-6990098
http://www.canaan.net.il
--------------------------


Re: SQL History

От
Tom Lane
Дата:
Michael Ben-Nes <miki@canaan.co.il> writes:
> You can set postgresql.conf to log all queries to a file.
> Sadly you cant distinguish between the databases.

See log_line_prefix in 8.0.

            regards, tom lane