Обсуждение: see previous queries
hi i am a new user in postgresql. problem:- in postgresql there is any command to see history (previous day queries) like as history command in linux. thank you
Dear Ashok, Hope you are not using Postgresql 7.4 if this is the case I think some insert /update statements are waiting for commit command Regards, V Kashyap >hi >i am a new user in postgresql. >problem:- in postgresql there is any command to see history (previous >day queries) like as history command in linux. >thank you > >---------------------------(end of broadcast)--------------------------- >TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > >. > > >
On Wed, 4 Dec 2003, Ashok Chauhan wrote: > i am a new user in postgresql. > problem:- in postgresql there is any command to see history (previous > day queries) like as history command in linux. Not precisely. For the backend, you can log the statements that are run by changing the postgresql.conf and use the log. In psql, you can get something similar to history with \s I believe, but that's only for your history not the entire server's history.
On Thu, 4 Dec 2003, Sai Hertz And Control Systems wrote: > > Dear Ashok, > > Hope you are not using > Postgresql 7.4 > if this is the case I think some insert /update statements are waiting > for commit command > > Regards, > V Kashyap > > >hi > >i am a new user in postgresql. > >problem:- in postgresql there is any command to see history (previous > >day queries) like as history command in linux. > >thank you > > postgres will log your queries. You need to configure it to do so. 7.4 also logs queries that take a long time. The logs go either to file or the system message log. depending on how you set it up in postgresql.conf. The log can not be used to rebuild your database :( psql also has a shell like history function. Peter Childs
Look in postgresql.conf file: # # Message display # server_min_messages = info # Values, in order of decreasing detail: # debug5, debug4, debug3, debug2, debug1, # info, notice, warning, error, log, fatal, # panic client_min_messages = info # Values, in order of decreasing detail: # debug5, debug4, debug3, debug2, debug1, # log, info, notice, warning, error #silent_mode = false log_connections = true #log_pid = false log_statement = true log_duration = true log_timestamp = true These are the main log settings. After you modify this data's reload the configuration files. (pg_ctl ... reload). Best r. Andy. ----- Original Message ----- From: "Peter Childs" <blue.dragon@blueyonder.co.uk> Cc: <pgsql-admin@postgresql.org> Sent: Thursday, December 04, 2003 12:26 PM Subject: Re: [ADMIN] see previous queries > > > On Thu, 4 Dec 2003, Sai Hertz And Control Systems wrote: > > > > > Dear Ashok, > > > > Hope you are not using > > Postgresql 7.4 > > if this is the case I think some insert /update statements are waiting > > for commit command > > > > Regards, > > V Kashyap > > > > >hi > > >i am a new user in postgresql. > > >problem:- in postgresql there is any command to see history (previous > > >day queries) like as history command in linux. > > >thank you > > > > > postgres will log your queries. You need to configure it to do so. > 7.4 also logs queries that take a long time. The logs go either to file or > the system message log. depending on how you set it up in postgresql.conf. > The log can not be used to rebuild your database :( > psql also has a shell like history function. > > Peter Childs > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org
Dear Ashok , >hi >i am a new user in postgresql. > > If you are from Kalculate team which developed first Financial software in India with QT and PostgreSQL as back end then for me this is a prank that a member of Kalculate team addresses himself to be new to PostgreSQL. Chauhan saab give us some of your knowledge and please do not address yourself as NEW TO PostgreSQL. Regards, V Kashyap
> problem:- in postgresql there is any command to see history (previous > day queries) like as history command in linux. In addition to server and client logging levels adjusted via the postgresql.config file, psql also has a command history like bash that is preserved between sessions. The command history of psql can be adjusted by setting variables in the ~/.psqlrc config file. See the PostgresSQL reference document for more info on psql. http://www.postgresql.org/docs/current/static/app-psql.html http://www.postgresql.org/docs/current/interactive/app-psql.html Some examples below: HISTCONTROL If this variable is set to ignorespace, lines which begin with a space are not entered into the history list. If set to a value of ignoredups, lines matching the previous history line are not entered. A value of ignoreboth combines the two options. If unset, or if set to any other value than those above, all lines read in interactive mode are saved on the history list. Note: This feature was shamelessly plagiarized from bash. HISTSIZE The number of commands to store in the command history. The default value is 500. Note: This feature was shamelessly plagiarized from bash. ----- Original Message ----- From: "Ashok Chauhan" <ashok@kalculate.com> To: <pgsql-admin@postgresql.org> Sent: Thursday, December 04, 2003 1:13 AM Subject: [ADMIN] see previous queries > > > hi > i am a new user in postgresql. > problem:- in postgresql there is any command to see history (previous > day queries) like as history command in linux. > thank you > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > >
Look in postgresql.conf file: # # Message display # server_min_messages = info # Values, in order of decreasing detail: # debug5, debug4, debug3, debug2, debug1, # info, notice, warning, error, log, fatal, # panic client_min_messages = info # Values, in order of decreasing detail: # debug5, debug4, debug3, debug2, debug1, # log, info, notice, warning, error #silent_mode = false log_connections = true #log_pid = false log_statement = true log_duration = true log_timestamp = true These are the main log settings. After you modify this data's reload the configuration files. (pg_ctl ... reload). Best r. Andy. ----- Original Message ----- From: "Peter Childs" <blue.dragon@blueyonder.co.uk> Cc: <pgsql-admin@postgresql.org> Sent: Thursday, December 04, 2003 12:26 PM Subject: Re: [ADMIN] see previous queries > > > On Thu, 4 Dec 2003, Sai Hertz And Control Systems wrote: > > > > > Dear Ashok, > > > > Hope you are not using > > Postgresql 7.4 > > if this is the case I think some insert /update statements are waiting > > for commit command > > > > Regards, > > V Kashyap > > > > >hi > > >i am a new user in postgresql. > > >problem:- in postgresql there is any command to see history (previous > > >day queries) like as history command in linux. > > >thank you > > > > > postgres will log your queries. You need to configure it to do so. > 7.4 also logs queries that take a long time. The logs go either to file or > the system message log. depending on how you set it up in postgresql.conf. > The log can not be used to rebuild your database :( > psql also has a shell like history function. > > Peter Childs > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org