SQL History

Started by Hrishikesh Deshmukhalmost 21 years ago5 messagesgeneral
Jump to latest
#1Hrishikesh Deshmukh
hdeshmuk@gmail.com

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

#2Scott Marlowe
smarlowe@g2switchworks.com
In reply to: Hrishikesh Deshmukh (#1)
Re: SQL History

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.

#3Joshua D. Drake
jd@commandprompt.com
In reply to: Hrishikesh Deshmukh (#1)
Re: SQL History

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/

#4Ben-Nes Michael
miki@canaan.co.il
In reply to: Hrishikesh Deshmukh (#1)
Re: SQL History

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
--------------------------

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ben-Nes Michael (#4)
Re: SQL History

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