Re: [GENERAL] Logging the fact that a log was shipped

2017-08-28 Thread Stephen Frost
* Christoph Moench-Tegeder (c...@burggraben.net) wrote: > ## Stephen Frost (sfr...@snowman.net): > > > Worse, such scripts run the serious risk of losing WAL if a crash > > happens because nothing is ensuring that the WAL has been sync'd to disk > > before returning from the archive_command. > >

Re: [GENERAL] Logging the fact that a log was shipped

2017-08-28 Thread Christoph Moench-Tegeder
## Ron Johnson (ron.l.john...@cox.net): > > I'd put a wrapper around your rsync (a short shell script > > would be sufficient) in the lines of rsync ... && logger "done", > > that way you'd get the information via syslog. > > And if logging to stderr? In that case your original approach could ha

Re: [GENERAL] Logging the fact that a log was shipped

2017-08-28 Thread Christoph Moench-Tegeder
## Stephen Frost (sfr...@snowman.net): > Worse, such scripts run the serious risk of losing WAL if a crash > happens because nothing is ensuring that the WAL has been sync'd to disk > before returning from the archive_command. That risk already exists when using rsync/scp/scp/... and should be mi

Re: [GENERAL] Logging the fact that a log was shipped

2017-08-28 Thread Ron Johnson
On 08/28/2017 08:22 AM, Stephen Frost wrote: * Christoph Moench-Tegeder (c...@burggraben.net) wrote: ## Ron Johnson (ron.l.john...@cox.net): How is this done in v8.4? (I tried adding "date; rsync ..." but pg didn't like that *at all*.) There's a DEBUG1-level log message on successful archive

Re: [GENERAL] Logging the fact that a log was shipped

2017-08-28 Thread Stephen Frost
* Christoph Moench-Tegeder (c...@burggraben.net) wrote: > ## Ron Johnson (ron.l.john...@cox.net): > > > How is this done in v8.4? (I tried adding "date; rsync ..." but pg > > didn't like that *at all*.) > > There's a DEBUG1-level log message on successful archive_command > completion - that woul

Re: [GENERAL] Logging the fact that a log was shipped

2017-08-28 Thread Ron Johnson
On 08/28/2017 06:06 AM, Christoph Moench-Tegeder wrote: ## Ron Johnson (ron.l.john...@cox.net): How is this done in v8.4? (I tried adding "date; rsync ..." but pg didn't like that *at all*.) There's a DEBUG1-level log message on successful archive_command completion - that would give you a lo

Re: [GENERAL] Logging the fact that a log was shipped

2017-08-28 Thread Christoph Moench-Tegeder
## Ron Johnson (ron.l.john...@cox.net): > How is this done in v8.4? (I tried adding "date; rsync ..." but pg > didn't like that *at all*.) There's a DEBUG1-level log message on successful archive_command completion - that would give you a lot of other low-prio log messages wich you probably don'

[GENERAL] Logging the fact that a log was shipped

2017-08-27 Thread Ron Johnson
Hi, How is this done in v8.4? (I tried adding "date; rsync ..." but pg didn't like that *at all*.) Thanks -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Logging failed connections

2017-08-16 Thread Jerry Sievers
Stephen Cook writes: > Hello! > > When a client gets the error message about "remaining connection slots > are reserved for non-replication superuser connections", is this logged? > What should I be grep-ing for? Grep for the token FATAL in your logs. > > Thanks! > > > -- Stephen -- Jerry Sie

[GENERAL] Logging failed connections

2017-08-16 Thread Stephen Cook
Hello! When a client gets the error message about "remaining connection slots are reserved for non-replication superuser connections", is this logged? What should I be grep-ing for? Thanks! -- Stephen -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to yo

[GENERAL] Logging in Code vs SQL-WHERE was: Row based permissions: at DB or at Application level?

2017-08-01 Thread Thomas Güttler
I have been thinking about this again. Doing perm checking in code (I use Python) has the advantage that you can do logging: def has_perm(item, user): if user.is_superuser: logger.debug('Access to %s for %s allowed, since user is superuser' % (item, user)) return True

Re: [GENERAL] Logging at schema level

2017-07-21 Thread Scott Mead
On Fri, Jul 21, 2017 at 2:11 AM, Nikhil wrote: > Schema = tenant. So basically tenant level logging. > If each tenant uses a separate user, you could parse this by that user. You can't separate the logs by user, but, you could use a tool like pgBadger to parse reports for each individual user (t

Re: [GENERAL] Logging at schema level

2017-07-20 Thread Michael Paquier
On Fri, Jul 21, 2017 at 8:21 AM, John R Pierce wrote: > if you have per schema logging, where should that get logged ? > > you could implement per DATABASE logging, if you A) add the database name to > the log_prefix, and B) feed your logs to a program that understands this and > splits them out t

Re: [GENERAL] Logging at schema level

2017-07-20 Thread Andreas Kretschmer
Am 21.07.2017 um 08:11 schrieb Nikhil: Schema = tenant. So basically tenant level logging. On 21-Jul-2017 11:21 AM, "Andreas Kretschmer" > wrote: On 21 July 2017 07:10:42 GMT+02:00, Nikhil mailto:nikhilsme...@gmail.com>> wrote: >Hello, > >I am

Re: [GENERAL] Logging at schema level

2017-07-20 Thread John R Pierce
On 7/20/2017 11:11 PM, Nikhil wrote: Schema = tenant. So basically tenant level logging. select from schema1.table1 join schema2.table2 on where .; if you have per schema logging, where should that get logged ? you could implement per DATABASE logging, if you A) add the

Re: [GENERAL] Logging at schema level

2017-07-20 Thread Nikhil
Schema = tenant. So basically tenant level logging. On 21-Jul-2017 11:21 AM, "Andreas Kretschmer" wrote: > On 21 July 2017 07:10:42 GMT+02:00, Nikhil wrote: > >Hello, > > > >I am using postgresql schema feature for multi-tenancy. can we get > >postgresql logs at schema level. Currently it is fo

Re: [GENERAL] Logging at schema level

2017-07-20 Thread Andreas Kretschmer
On 21 July 2017 07:10:42 GMT+02:00, Nikhil wrote: >Hello, > >I am using postgresql schema feature for multi-tenancy. can we get >postgresql logs at schema level. Currently it is for the whole database >server (pg_log) > What do you want to achieve? Logging of data-changes per tenant? Regards, An

Re: [GENERAL] Logging at schema level

2017-07-20 Thread Michael Paquier
On Fri, Jul 21, 2017 at 7:10 AM, Nikhil wrote: > I am using postgresql schema feature for multi-tenancy. can we get > postgresql logs at schema level. Currently it is for the whole database > server (pg_log) Not directly. All the log-related parameters can be controlled by a superuser, so you cou

Re: [GENERAL] Logging at schema level

2017-07-20 Thread John R Pierce
On 7/20/2017 10:10 PM, Nikhil wrote: I am using postgresql schema feature for multi-tenancy. can we get postgresql logs at schema level. Currently it is for the whole database server (pg_log) if you /were/ able to split the logs by schema, and a query touched multiple schemas, then where wo

[GENERAL] Logging at schema level

2017-07-20 Thread Nikhil
Hello, I am using postgresql schema feature for multi-tenancy. can we get postgresql logs at schema level. Currently it is for the whole database server (pg_log) Best Regards, Nikhil

Re: [GENERAL] logging of application level user in audit trigger

2017-05-10 Thread Rajesh Mallah
Ok , i do see there is already the handling of application_name in the trigger , this is quite sufficient for my current needs. regds mallah. On Wed, May 10, 2017 at 10:58 PM, Rajesh Mallah wrote: > Hi Scott / List , > > Thanks for the response, > > the application_name usage seems to be more

Re: [GENERAL] logging of application level user in audit trigger

2017-05-10 Thread Rajesh Mallah
Hi Scott / List , Thanks for the response, the application_name usage seems to be more natural as it is something inbuilt. the audit trigger repo seems to have got update only in past 2 years . are there other more active projects doing the same thing ? in my opinion (which may be flawed) pgaud

Re: [GENERAL] logging of application level user in audit trigger

2017-05-09 Thread Scott Mead
On Tue, May 9, 2017 at 2:50 PM, Rajesh Mallah wrote: > Hi , > > I am referring to audit trigger as described in > > https://wiki.postgresql.org/wiki/Audit_trigger_91plus OR > https://wiki.postgresql.org/wiki/Audit_trigger > > Although there are documented limitations for these systems , but > I

[GENERAL] logging of application level user in audit trigger

2017-05-09 Thread Rajesh Mallah
Hi , I am referring to audit trigger as described in https://wiki.postgresql.org/wiki/Audit_trigger_91plus OR https://wiki.postgresql.org/wiki/Audit_trigger Although there are documented limitations for these systems , but I would like to mention and seek suggestion on a limitation that I feel

Re: [GENERAL] Logging broken messages

2017-02-07 Thread John DeSoi
> On Feb 6, 2017, at 11:21 AM, Rui Pacheco wrote: > > I’m trying to implement a version of the wire protocol but I’ve hit a > problem: whenever I send a Close Statement message to the remote, it just > hangs indefinitely. I suspect the problem could be on my side but I can’t > find anything o

Re: [GENERAL] Logging broken messages

2017-02-07 Thread Tom Lane
Steve Atkins writes: >> On Feb 6, 2017, at 9:21 AM, Rui Pacheco wrote: >> I’m trying to implement a version of the wire protocol but I’ve hit a >> problem: whenever I send a Close Statement message to the remote, it just >> hangs indefinitely. I suspect the problem could be on my side but I can

Re: [GENERAL] Logging broken messages

2017-02-07 Thread Steve Atkins
> On Feb 6, 2017, at 9:21 AM, Rui Pacheco wrote: > > Hello, > > I’m trying to implement a version of the wire protocol but I’ve hit a > problem: whenever I send a Close Statement message to the remote, it just > hangs indefinitely. I suspect the problem could be on my side but I can’t > find

[GENERAL] Logging broken messages

2017-02-07 Thread Rui Pacheco
Hello, I’m trying to implement a version of the wire protocol but I’ve hit a problem: whenever I send a Close Statement message to the remote, it just hangs indefinitely. I suspect the problem could be on my side but I can’t find anything on my code that doesn’t match the manual

Re: [GENERAL] Logging for 2 instances of PostgreSQL

2016-11-30 Thread George Weaver
On 30/11/2016 9:16 PM, John R Pierce wrote: On 11/30/2016 3:01 PM, George Weaver wrote: I have set up 2 instances of PostgreSQL 9.6 on the same Windows server. I noticed when I ran initdb for the second instance that it did not create a pg_log folder in the new cluster, and that all logging

Re: [GENERAL] Logging for 2 instances of PostgreSQL

2016-11-30 Thread John R Pierce
On 11/30/2016 3:01 PM, George Weaver wrote: I have set up 2 instances of PostgreSQL 9.6 on the same Windows server. I noticed when I ran initdb for the second instance that it did not create a pg_log folder in the new cluster, and that all logging is going to the pg_log folder in the original

Re: [GENERAL] Logging for 2 instances of PostgreSQL

2016-11-30 Thread David G. Johnston
On Wed, Nov 30, 2016 at 4:01 PM, George Weaver wrote: > Good afternoon, > > I have set up 2 instances of PostgreSQL 9.6 on the same Windows server. I > noticed when I ran initdb for the second instance that it did not create a > pg_log folder in the new cluster, and that all logging is going to

[GENERAL] Logging for 2 instances of PostgreSQL

2016-11-30 Thread George Weaver
Good afternoon, I have set up 2 instances of PostgreSQL 9.6 on the same Windows server. I noticed when I ran initdb for the second instance that it did not create a pg_log folder in the new cluster, and that all logging is going to the pg_log folder in the original cluster. Is it possible t

Re: [GENERAL] logging of Logical Decoding

2014-12-24 Thread Adrian Klaver
On 12/24/2014 08:50 AM, Tom Lane wrote: Adrian Klaver writes: On 12/24/2014 07:53 AM, Andrey Lizenko wrote: 2014-12-24 10:45:23 EST LOG: starting logical decoding for slot "regression_slot" 2014-12-24 10:45:23 EST STATEMENT: SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL,

Re: [GENERAL] logging of Logical Decoding

2014-12-24 Thread Tom Lane
Adrian Klaver writes: > On 12/24/2014 07:53 AM, Andrey Lizenko wrote: >> 2014-12-24 10:45:23 EST LOG: starting logical decoding for slot >> "regression_slot" >> 2014-12-24 10:45:23 EST STATEMENT: SELECT * FROM >> pg_logical_slot_get_changes('regression_slot', NULL, NULL); >> 2014-12-24 10:45:23

Re: [GENERAL] logging of Logical Decoding

2014-12-24 Thread Adrian Klaver
On 12/24/2014 07:53 AM, Andrey Lizenko wrote: I've restarted server once again to be sure. For this commands: postgres@ubuntu12-vm:/mnt/data4$ psql psql (9.4.0) Type "help" for help. postgres=# show log_error_verbosity ; log_error_verbosity -

Re: [GENERAL] logging of Logical Decoding

2014-12-24 Thread Andrey Lizenko
I've restarted server once again to be sure. For this commands: postgres@ubuntu12-vm:/mnt/data4$ psql > psql (9.4.0) > Type "help" for help. > postgres=# show log_error_verbosity ; > log_error_verbosity > - > terse > (1 row) > postgres=# SELECT * FROM pg_logical_slot_get_cha

Re: [GENERAL] logging of Logical Decoding

2014-12-24 Thread Adrian Klaver
On 12/24/2014 02:29 AM, Andrey Lizenko wrote: Hello, every execute of 'pg_logical_slot_get_changes' is logged by 2014-12-23 11:41:53 EST STATEMENT: SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL); 2014-12-23 11:42:21 EST LOG: starting logical decoding for

[GENERAL] logging of Logical Decoding

2014-12-24 Thread Andrey Lizenko
Hello, every execute of 'pg_logical_slot_get_changes' is logged by 2014-12-23 11:41:53 EST STATEMENT: SELECT * FROM > pg_logical_slot_get_changes('regression_slot', NULL, NULL); > 2014-12-23 11:42:21 EST LOG: starting logical decoding for slot > "regression_slot" > 2014-12-23 11:42:21 EST DETAI

Re: [GENERAL] logging hook

2014-05-13 Thread Alan Nilsson
Ah yes once again if I’ld just RTFM….. Thanks for pointing that out, I think I can work with that. alan On May 13, 2014, at 2:59 PM, Susan Cassidy wrote: > You can log to syslog, and use the syslog definitions file (syslog.conf) to > pipe the output to a program that can do whatever you want

Re: [GENERAL] logging hook

2014-05-13 Thread Susan Cassidy
You can log to syslog, and use the syslog definitions file (syslog.conf) to pipe the output to a program that can do whatever you want with it. Susan On Tue, May 13, 2014 at 2:29 PM, Alan Nilsson wrote: > All > > Is there a hook that someone could direct me to that I can use to redirect > logg

[GENERAL] logging hook

2014-05-13 Thread Alan Nilsson
All Is there a hook that someone could direct me to that I can use to redirect logging output? I.e. I would like to write a small module that pre loads and substitutes the loggers file descriptor with my own to redirect that output. Possible? thanks alan -- Sent via pgsql-general mailin

Re: [GENERAL] Logging authentication requests with GSSAPI

2014-04-30 Thread Stephen Frost
Joshua, * Joshua Warburton (j.warbur...@irax.com) wrote: > I'm authenticating to postgres using GSSAPI and (for audit reasons) > I need to be able to log the principle name that connects as well as > the username it is mapped to. Is there any way I can get postgres to > log this without cranking u

[GENERAL] Logging authentication requests with GSSAPI

2014-04-30 Thread Joshua Warburton
Hello, I'm authenticating to postgres using GSSAPI and (for audit reasons) I need to be able to log the principle name that connects as well as the username it is mapped to. Is there any way I can get postgres to log this without cranking up the log level for everything? Thanks very much , J

Re: [GENERAL] logging statements in PostgreSQL

2013-10-01 Thread Jayadevan M
Hi, I was looking for options to make sure SQLs executed as part of functions also get logged. Since this is a production system, I wanted to do it without the EXPLAIN also written to the logs. May be that is not possible? Regards, Jayadevan On Mon, Sep 30, 2013 at 5:08 PM, Albe Laurenz wrote: >

Re: [GENERAL] logging statements in PostgreSQL

2013-09-30 Thread Albe Laurenz
Jayadevan M wrote: > Thanks for the pointer. I do not really want to log the plans of queries, > just the queries, execution > time and a couple of other details (database,user). If I use the auto-explain > module, it will end up > printing the plan for all query execution in the log files? You

Re: [GENERAL] logging statements in PostgreSQL

2013-09-25 Thread Jayadevan M
Thanks for the pointer. I do not really want to log the plans of queries, just the queries, execution time and a couple of other details (database,user). If I use the auto-explain module, it will end up printing the plan for all query execution in the log files? On Wed, Sep 25, 2013 at 1:43 PM, A

Re: [GENERAL] logging statements in PostgreSQL

2013-09-25 Thread Amit Langote
On Wed, Sep 25, 2013 at 12:18 PM, Jayadevan M wrote: > Hi all, > I am planning to use pgbadger for analyzing queries. Documentation for > pgbadger says "Do not enable log_statement as their log format will not be > parsed by pgBadger. " > I have > log_min_duration_statement = 0 > I do see quite a

[GENERAL] logging statements in PostgreSQL

2013-09-24 Thread Jayadevan M
Hi all, I am planning to use pgbadger for analyzing queries. Documentation for pgbadger says "Do not enable log_statement as their log format will not be parsed by pgBadger. " I have log_min_duration_statement = 0 I do see quite a few SELECTs, INSERTS etc in the log files, function calls too, for e

Re: [GENERAL] Logging successful SELECTS?

2013-01-24 Thread Pavel Stehule
2013/1/24 Matthew Vernon : > Hi, > > I can get postgres to log unsuccessful queries, including the user who > wrote them, but I'm missing how to get postgres to log the successful > queries too (I don't need a store of the answer, just the query > itself). How do I do this? use log_min_duration_s

Re: [GENERAL] Logging successful SELECTS?

2013-01-24 Thread Виктор Егоров
2013/1/24 Matthew Vernon : > I can get postgres to log unsuccessful queries, including the user who > wrote them, but I'm missing how to get postgres to log the successful > queries too (I don't need a store of the answer, just the query > itself). How do I do this? You can use either log_min_dura

[GENERAL] Logging successful SELECTS?

2013-01-24 Thread Matthew Vernon
Hi, I can get postgres to log unsuccessful queries, including the user who wrote them, but I'm missing how to get postgres to log the successful queries too (I don't need a store of the answer, just the query itself). How do I do this? Thanks, Matthew -- Matthew Vernon Quantitative Veterinary

Re: [GENERAL] Logging affected rows

2013-01-18 Thread Raghavendra
On Sat, Jan 19, 2013 at 12:53 PM, Raghavendra < raghavendra@enterprisedb.com> wrote: > On Thu, Jan 17, 2013 at 9:18 AM, classical_89 wrote: > >> When i run a query , i just only want to the affected rows are logged to >> log >> file,What can i do ? .Is there a parameter in postgresql.conf to d

Re: [GENERAL] Logging affected rows

2013-01-18 Thread Raghavendra
On Thu, Jan 17, 2013 at 9:18 AM, classical_89 wrote: > When i run a query , i just only want to the affected rows are logged to > log > file,What can i do ? .Is there a parameter in postgresql.conf to do that ? > .Thanks in advance > > AFAIK, I don't think we can log only affected rows of the que

[GENERAL] Logging affected rows

2013-01-18 Thread classical_89
When i run a query , i just only want to the affected rows are logged to log file,What can i do ? .Is there a parameter in postgresql.conf to do that ? .Thanks in advance -- View this message in context: http://postgresql.1045698.n5.nabble.com/Logging-affected-rows-tp5740689.html Sent from the

[GENERAL] logging query result size?

2012-05-02 Thread Ben Chobot
I'm not seeing anything in the docs, but is there a way in 9.1 to log the size of the query result in the same way that we can log the duration of the query? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailp

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Ivan Radovanovic
On 01/25/12 20:02, Misa Simic napisa: Thanks Bill, Make sense... db_link is probably then solution... Everything depends on concrete problem... But I still think security should be reconsidered (I would use db_link just in case there is no other options - if we must let users to have direct ac

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Ivan Radovanovic
On 01/25/12 18:38, Greg Sabino Mullane napisa: You would need to break out of the transaction somehow within that function and make a new call to the database, for example using dblink or plperlu. I've done the latter before and it wasn't too painful. The general idea is: - --- $dbh = DBI->conn

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Misa Simic
Thanks Bill, Make sense... db_link is probably then solution... Everything depends on concrete problem... But I still think security should be reconsidered (I would use db_link just in case there is no other options - if we must let users to have direct access to DB)... I mean, in that case when

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Bill Moran
In response to Misa Simic : > > But maybe it would be better to reorganise security on the way that users > who do not need to have access to some data - simply do not have it > (instead of to give them data and latter check log to confirm they have > taken it...) In many cases that's not enough.

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Bill Moran
In response to Misa Simic : > > But maybe it would be better to reorganise security on the way that users > who do not need to have access to some data - simply do not have it > (instead of to give them data and latter check log to confirm they have > taken it...) In many cases that's not enough.

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Misa Simic
Well, You could use dblink in your access_function() to log it... But maybe it would be better to reorganise security on the way that users who do not need to have access to some data - simply do not have it (instead of to give them data and latter check log to confirm they have taken it...) Dep

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > If this protected data is read only using postgres function , and if in > the same function I add something like "insert into log_table (blah blah > blah)", somebody could simply do > begin; > select * from access_function(); /* assuming acc

[GENERAL] Logging access to data in database table

2012-01-25 Thread Ivan Radovanovic
Hello, I need to log access to certain data in database in some log (I prefer to have that both in syslog and table in database), and I find it easy to write to syslog, but I can't solve the problem of writing this to database table. If this protected data is read only using postgres functio

Re: [GENERAL] Logging not working

2011-11-19 Thread Phoenix Kiula
On Sun, Nov 20, 2011 at 3:38 AM, Tomas Vondra wrote: > > What about log_destination and log_collector? Thanks. This was it! Much appreciated. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-

Re: [GENERAL] Logging not working

2011-11-19 Thread Tomas Vondra
On 19 Listopad 2011, 20:29, Phoenix Kiula wrote: > Hi. PG 9.0.5, on CentOS 5 with 64 bit. > > Here's the logging related items from my config file: > > log_directory = 'pg_log' > log_filename= 'pglog.postgresql-%Y-%m-%d_%H%M%S.log' > log_rotation_age

[GENERAL] Logging not working

2011-11-19 Thread Phoenix Kiula
Hi. PG 9.0.5, on CentOS 5 with 64 bit. Here's the logging related items from my config file: log_directory = 'pg_log' log_filename= 'pglog.postgresql-%Y-%m-%d_%H%M%S.log' log_rotation_age= 1d log_min_duration_statement = 5000 # In m

Re: [GENERAL] Logging ALL output from psql

2011-10-19 Thread Raymond O'Donnell
On 19/10/2011 22:10, Bobby Dewitt wrote: > I can not find a way to log ALL output from a psql session when running > a script. Basically, I'm running a large deployment script that has > thousands of SQL statements and I need to know which statements fail. I > want the output generated when runni

[GENERAL] Logging ALL output from psql

2011-10-19 Thread Bobby Dewitt
I can not find a way to log ALL output from a psql session when running a script. Basically, I'm running a large deployment script that has thousands of SQL statements and I need to know which statements fail. I want the output generated when running the script to be saved to a log file so tha

Re: [GENERAL] Logging queries cancelled due to replication timeouts

2011-10-11 Thread Bruce Momjian
Christophe Pettus wrote: > Greetings, > > Is there a combination of options that will cause a hot standby replica to > log queries that are cancelled due to a replication timeout > (max_standby_streaming_delay)? Sure, how about the system view pg_stat_database_conflicts in PG 9.1? Our docs say

[GENERAL] Logging queries cancelled due to replication timeouts

2011-10-10 Thread Christophe Pettus
Greetings, Is there a combination of options that will cause a hot standby replica to log queries that are cancelled due to a replication timeout (max_standby_streaming_delay)? -- -- Christophe Pettus x...@thebuild.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

[GENERAL] Logging planner estimates.

2011-02-14 Thread pasman pasmański
Hi. Is it possible to log plans which planner discard? I want to tune planner settings for some queries. -- pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] logging postgres to syslog on centos, truncates the postgres message.

2010-09-09 Thread Chris Barnes
On separate lines it is, thanks Tom. > To: compuguruchrisbar...@hotmail.com > CC: pgsql-general@postgresql.org > Subject: Re: [GENERAL] logging postgres to syslog on centos, truncates the > postgres message. > Date: Thu, 9 Sep 2010 10:39:10 -0400 > From: t...@sss.pgh.pa.us

Re: [GENERAL] logging postgres to syslog on centos, truncates the postgres message.

2010-09-09 Thread Tom Lane
Chris Barnes writes: > I am logging postgres to syslog on a CentOS release 5.4 (Final) ( > 2.6.18-164.el5 ). When I look for an update statement it appears to > be truncated and missing the whole statement. Our code for logging to syslog does split long lines into multiple messages --- are you

[GENERAL] logging postgres to syslog on centos, truncates the postgres message.

2010-09-09 Thread Chris Barnes
Hoping someone can help me with this problem. I am logging postgres to syslog on a CentOS release 5.4 (Final) ( 2.6.18-164.el5 ). When I look for an update statement it appears to be truncated and missing the whole statement. Is there a quick way to resolve this? Is it linux or postgres? Tha

Re: [GENERAL] Logging in as console crashes the database

2010-06-04 Thread Craig Ringer
On 05/06/10 01:02, Rob Richardson wrote: > We have a customer who is running PostgreSQL 8.4 on a Windows Server > 2003 box. The Postgres service is set up to store data on the > computer's H drive, which is actually an iSCSI connection to a folder of > a disk drive on a separate computer. The sam

Re: [GENERAL] Logging in as console crashes the database

2010-06-04 Thread John R Pierce
Rob Richardson wrote: We have a customer who is running PostgreSQL 8.4 on a Windows Server 2003 box. The Postgres service is set up to store data on the computer's H drive, which is actually an iSCSI connection to a folder of a disk drive on a separate computer. The same computer that runs P

[GENERAL] Logging in as console crashes the database

2010-06-04 Thread Rob Richardson
We have a customer who is running PostgreSQL 8.4 on a Windows Server 2003 box. The Postgres service is set up to store data on the computer's H drive, which is actually an iSCSI connection to a folder of a disk drive on a separate computer. The same computer that runs PostgreSQL also runs the Kep

Re: [GENERAL] Logging statement/duration on the same line

2010-02-10 Thread Baron Schwartz
Thanks Tom, Depesz, On Wed, Feb 10, 2010 at 1:15 PM, Tom Lane wrote: > turn off log_statement and instead set > log_min_duration_statement = 0 to log everything via duration logging. That does the trick. Time to write more test cases. Thanks Baron -- Sent via pgsql-general mailing list (pgsq

Re: [GENERAL] Logging statement/duration on the same line

2010-02-10 Thread Tom Lane
Baron Schwartz writes: > I'm writing a log parser front-end. I've seen some log samples that > look like this, with the duration and statement on the same line: > LOG: duration: 1.565 ms statement: SELECT * FROM users WHERE user_id='692' > But in my 8.3.9 test installation, durations are alwa

Re: [GENERAL] Logging statement/duration on the same line

2010-02-10 Thread hubert depesz lubaczewski
On Wed, Feb 10, 2010 at 12:55:03PM -0500, Baron Schwartz wrote: > I'm writing a log parser front-end. I've seen some log samples that > look like this, with the duration and statement on the same line: > > LOG: duration: 1.565 ms statement: SELECT * FROM users WHERE user_id='692' > > But in my

[GENERAL] Logging statement/duration on the same line

2010-02-10 Thread Baron Schwartz
I'm writing a log parser front-end. I've seen some log samples that look like this, with the duration and statement on the same line: LOG: duration: 1.565 ms statement: SELECT * FROM users WHERE user_id='692' But in my 8.3.9 test installation, durations are always logged on a separate line. I

Re: [GENERAL] logging statements from hibernate to valid SQL

2010-02-10 Thread Willy-Bas Loos
On Wed, Feb 10, 2010 at 8:52 AM, Andy Dale wrote: > Hi, > > I would consider telling Hibernate to log the SQL it is generating to a > file. This can be done by setting the logging category org.hibernate.SQL to > debug, and for the parameters used in the prepared statements I think you > must also

Re: [GENERAL] logging statements from hibernate to valid SQL

2010-02-09 Thread Andy Dale
Hi, I would consider telling Hibernate to log the SQL it is generating to a file. This can be done by setting the logging category org.hibernate.SQL to debug, and for the parameters used in the prepared statements I think you must also enable org.hibernate.type on debug (I have not managed to get

[GENERAL] logging statements from hibernate to valid SQL

2010-02-09 Thread Willy-Bas Loos
Hi, I'm trying to log statements that are being fired from hibernate, so that i can benchmark them without hibernate itself. I want to fire the SQL at the database directly and see what difference i can make by tweaking things. But when i set log_statement = 'all', the logging looks like this: 20

Re: [GENERAL] Logging statements with errors in PostgreSQL 8.1

2009-10-26 Thread John R Pierce
Radcon Entec wrote: Is there any way to get a PostgreSQL 8.1 installation to report the statements that caused the error, as the 8.3 installation does? see http://www.postgresql.org/docs/8.1/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT specifically, log_statement, and log

Re: [GENERAL] Logging statements with errors in PostgreSQL 8.1

2009-10-26 Thread Adrian Klaver
On Monday 26 October 2009 5:48:42 am Radcon Entec wrote: > Greetings! > > I am using PostgreSQL 8.3, as are most of our customers. But we still have > at least one who is using PostgreSQL 8.1. The log files from that customer > are showing repeated syntax errors, but they are not giving me any >

[GENERAL] Logging statements with errors in PostgreSQL 8.1

2009-10-26 Thread Radcon Entec
Greetings! I am using PostgreSQL 8.3, as are most of our customers. But we still have at least one who is using PostgreSQL 8.1. The log files from that customer are showing repeated syntax errors, but they are not giving me any information about where the errors are coming from. Here's a sam

Re: [GENERAL] Logging statements longer than 1000ms doesn't appear to work

2009-09-22 Thread Scott Marlowe
On Tue, Sep 22, 2009 at 3:55 PM, Gurjeet Singh wrote: > Sometimes, your current postgresql.conf might not be in sync with server > settings, for various reasons. I'd suggest looking at the output of: > > select name, setting, source from pg_settings where name like E'log\\_%'; Or psql dbname sho

Re: [GENERAL] Logging statements longer than 1000ms doesn't appear to work

2009-09-22 Thread Gurjeet Singh
compuguruchrisbar...@hotmail.com> wrote: > Hello, > > I looked for log_statement and it appears to be off? Strange. > > #log_statement = 'none' > #log_statement_stats = off > > > To: compuguruchrisbar...@hotmail.com > > CC: pgsql-general@postgres

Re: [GENERAL] Logging statements longer than 1000ms doesn't appear to work

2009-09-22 Thread Chris Barnes
Hello, I looked for log_statement and it appears to be off? Strange. #log_statement = 'none' #log_statement_stats = off > To: compuguruchrisbar...@hotmail.com > CC: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Logging statements longer than 1000ms doesn&

Re: [GENERAL] Logging statements longer than 1000ms doesn't appear to work

2009-09-22 Thread Chris Barnes
I checked and this is the only refererences. Were usng 8.3.3. #log_statement = 'none' # none, ddl, mod, all #log_statement_stats = off > To: compuguruchrisbar...@hotmail.com > CC: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Logging statements

Re: [GENERAL] Logging statements longer than 1000ms doesn't appear to work

2009-09-22 Thread Tom Lane
Chris Barnes writes: > I've have set the parameter in my postgresql.conf file and have restarted > postgres. > When reviewing the log file I am finding that all of the statements are being > logged (0.108 ms)? Perhaps you also set log_statement = all, or some other reason that would cause them

[GENERAL] Logging statements longer than 1000ms doesn't appear to work

2009-09-22 Thread Chris Barnes
I've have set the parameter in my postgresql.conf file and have restarted postgres. When reviewing the log file I am finding that all of the statements are being logged (0.108 ms)? Is there some other parameter that I have missed? log_min_duration_statement = 1000 # -1 is disab

Re: [GENERAL] Logging on Gentoo

2009-01-14 Thread Thom Brown
Tsk... that was it after all. I didn't have logging_collector set to on, and thanks to that helpful query you mentioned, I could see that the default was "off". The reason I didn't change it was because I was trying to copy the settings from a server I use at work which does output logging, but t

Re: [GENERAL] Logging on Gentoo

2009-01-14 Thread Richard Huxton
Thom Brown wrote: > Hi, > > I've configured Postgres to log to stderr and defined my log directory > correctly with permissions to postgres on both user and group. I've > restarted postgres (not reloaded) but nothinig is coming out. Upon reading > the documentation for using stderr, it mentions

[GENERAL] Logging on Gentoo

2009-01-14 Thread Thom Brown
Hi, I've configured Postgres to log to stderr and defined my log directory correctly with permissions to postgres on both user and group. I've restarted postgres (not reloaded) but nothinig is coming out. Upon reading the documentation for using stderr, it mentions the need to change the system'

[GENERAL] Logging configuration with syslog-ng

2008-11-19 Thread A B
I'd like to get my postgresql logging sent to the file /var/log/postgresql.log, and have that file rotated to postgresql.log.0.gz etc. my postgresql.conf says log_destination = 'stderr,syslog' syslog_facility = 'LOCAL0' syslog_ident = 'postgres' but the messages goes into /var/log/messages. Does

Re: [GENERAL] Logging in function with exception

2008-11-10 Thread Asko Oja
One of the simplest ways to do it is with plProxy call into same database in exception block. Get plproxy installed in your database and after that it is as simple as function call. test=# create table log ( msg text ); CREATE TABLE test=# create function add_logg ( i_msg text ) returns void as $$

[GENERAL] Logging in function with exception

2008-11-10 Thread Gerhard Heift
Hello, I write funktions in pl/pgsql and want to abort it. For this I use raise exception, to undo all changes for this transaction. Now I want to log these exceptions somewhere. DECLARE a integer; log_id integer; BEGIN SELECT a INTO b FROM c WHERE d = 10; IF NOT FOUND THEN INSERT INT

Re: [GENERAL] logging SQL statements

2008-10-09 Thread Greg Smith
On Thu, 9 Oct 2008, c k wrote: Is it possible to log all sql statements submitted to database server in a table in that database it self? It's possible to cobble together something to appoximate that without too much trouble if you're running V8.3. You can use the CSV log format to make the

  1   2   3   >