Re: how to completely turn off statement error logging

2024-05-13 Thread David G. Johnston
On Monday, May 13, 2024, Zwettler Markus (OIZ) wrote: > > > but I do not want to suppress errors that are related to infrastructure > problems, i.e. "could not open file..." > > The server doesn’t classify the errors it emits into scope, “application errors” and ”infrastructure errors”, or

AW: [Extern] Re: how to completely turn off statement error logging

2024-05-13 Thread Zwettler Markus (OIZ)
> Von: Tom Lane > Gesendet: Montag, 13. Mai 2024 16:26 > An: Zwettler Markus (OIZ) > Cc: pgsql-general@lists.postgresql.org > Betreff: [Extern] Re: how to completely turn off statement error logging > > "Zwettler Markus (OIZ)" writes: > > I don't want

Re: how to completely turn off statement error logging

2024-05-13 Thread Tom Lane
though. > I set "log_min_error_statement = panic" according to the docs: > To effectively turn off logging of failing statements, set this parameter to > PANIC. This setting controls whether the STATEMENT: detail is appended to a message, but not the basic choice of whether to emit the message.

how to completely turn off statement error logging

2024-05-13 Thread Zwettler Markus (OIZ)
I don't want to log statement errors in the server logfile - whether the statement string nor the error message. I set "log_min_error_statement = panic" according to the docs: To effectively turn off logging of failing statements, set this parameter to PANIC. But error messages

Re: Logging statement having any threat?

2024-04-21 Thread Adrian Klaver
On 4/21/24 02:35, Lok P wrote: On Sat, Apr 20, 2024 at 10:02 PM Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: Have you tried?: https://www.postgresql.org/docs/current/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT <https://www.postgresql.org/docs/curren

Re: Logging statement having any threat?

2024-04-21 Thread Lok P
On Sat, Apr 20, 2024 at 10:02 PM Adrian Klaver wrote: > > Have you tried?: > > > https://www.postgresql.org/docs/current/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT > > " > log_statement (enum) > ><...> > > The default is none. Onl

Re: Logging statement having any threat?

2024-04-20 Thread Adrian Klaver
threat and if any option to get this logging enabled (which will help us debug performance issues) at same time addressing the threat too? I should have added to previous post, if you have access to the database the security wall has already been breached. Regards Lok -- Adrian Klaver

Re: Logging statement having any threat?

2024-04-20 Thread Adrian Klaver
hich means no statement(SELECT/DML/DDL etc) can be logged. Have you tried?: https://www.postgresql.org/docs/current/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT " log_statement (enum) <...> The default is none. Only superusers and users with the appropriate SET

Logging statement having any threat?

2024-04-20 Thread Lok P
gged. Now when we reach out to the infrastructure team , they are saying these variables(pg_cluster_log_statement,pg_instance_log_statement) were removed due to potential security threat. So I want to understand from experts here , how this is really a security threat and if any option to get th

Re: Exclude certain application pgaudit logging?

2024-02-06 Thread Adrian Klaver
On 2/6/24 10:18 AM, Adrian Klaver wrote: On 2/6/24 10:11 AM, Ron Johnson wrote: Currently, we use Object audit logging to capture all READ access to columns FOO_1, FOO_2 and FOO_3 in table BAR.SCRABBLE.  (They are the three columns have PII data.) Using what audit software? Memo

Re: Exclude certain application pgaudit logging?

2024-02-06 Thread Christophe Pettus
> On Feb 6, 2024, at 10:11, Ron Johnson wrote: > Thus, I'd like to exclude reads from "Postgresql JDBC Driver". (Currently, I > filter that out using "grep -v" in a shell script that runs hourly from cron, > but I find that unsatisfactory.) pgAudit doesn't currently include filters by

Re: Exclude certain application pgaudit logging?

2024-02-06 Thread Adrian Klaver
On 2/6/24 10:11 AM, Ron Johnson wrote: Currently, we use Object audit logging to capture all READ access to columns FOO_1, FOO_2 and FOO_3 in table BAR.SCRABBLE.  (They are the three columns have PII data.) Using what audit software? The problem is that the application legitimately

Exclude certain application pgaudit logging?

2024-02-06 Thread Ron Johnson
Currently, we use Object audit logging to capture all READ access to columns FOO_1, FOO_2 and FOO_3 in table BAR.SCRABBLE. (They are the three columns have PII data.) The problem is that the application legitimately reads these columns thousands of times per day. Thus, the log fills up

Re: Help understanding server-side logging (and more...)

2023-12-21 Thread Adrian Klaver
On 12/21/23 03:05, Dominique Devienne wrote: If by any chance, anyone has seen this kind of behavior before, in a similar context or not, and has suggestions on how we could further troubleshoot this (on the PostgreSQL server-side, but also the Node.JS client-side, why not), that would be

Re: Help understanding server-side logging (and more...)

2023-12-21 Thread Peter J. Holzer
On 2023-12-21 12:05:41 +0100, Dominique Devienne wrote: > FWIW, the symptoms they are experiencing is that initially all queries > are fast, then they start to get longer and longer, to the point all > services accessing PostgreSQL grind to a halt and basically hang. > While that happens, one can

Re: Help understanding server-side logging (and more...)

2023-12-21 Thread Julien Rouhaud
Hi, On Thu, Dec 21, 2023 at 12:05:41PM +0100, Dominique Devienne wrote: > Hi. Another team (than mine) has been trying to troubleshoot hang issues in > their Node/JS/TS-based mid-tier services, > after a switch from MySQL to PostgreSQL. They run PostgreSQL in a Linux > container (see PID [1]

Help understanding server-side logging (and more...)

2023-12-21 Thread Dominique Devienne
Hi. Another team (than mine) has been trying to troubleshoot hang issues in their Node/JS/TS-based mid-tier services, after a switch from MySQL to PostgreSQL. They run PostgreSQL in a Linux container (see PID [1] below), unlike us. They started looking at the PostgreSQL server-side logs, but with

Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread Adrian Klaver
On 9/25/23 19:30, shashidhar Reddy wrote: Thank you Adrian! I will apply the patch and see. Just to be clear 11.21 represents the changes from 16 different minor releases. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread shashidhar Reddy
<mailto:e...@ewie.name>> wrote: > > > > On 2023-09-25 16:54 +0530, shashidhar Reddy wrote: > > > We are using postgres 11.5 on Ubuntu we have enabled logging and > set > > > log_statements to all but when I checked the statements in the >

Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread shashidhar Reddy
Ubuntu we have enabled logging and set > > log_statements to all but when I checked the statements in the logs I can > > see only first few lines of the query and also when I check in pgadmin > for > > current queries I could see only few lines. Some one please help me to >

Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread Adrian Klaver
to 11.21 and then see if the issue persists. On Mon, 25 Sept, 2023, 5:33 pm Erik Wienhold, <mailto:e...@ewie.name>> wrote: On 2023-09-25 16:54 +0530, shashidhar Reddy wrote: > We are using postgres 11.5 on Ubuntu we have enabled logging and set > log_statements to

Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread Erik Wienhold
On 2023-09-25 16:54 +0530, shashidhar Reddy wrote: > We are using postgres 11.5 on Ubuntu we have enabled logging and set > log_statements to all but when I checked the statements in the logs I can > see only first few lines of the query and also when I check in pgadmin for > curre

Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread shashidhar Reddy
Hi Laurenz, Iog is also showing few lines that is incomplete statement. On Mon, 25 Sept, 2023, 5:05 pm Laurenz Albe, wrote: > On Mon, 2023-09-25 at 16:54 +0530, shashidhar Reddy wrote: > > We are using postgres 11.5 on Ubuntu we have enabled logging and set > > log_statements to

Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread Laurenz Albe
On Mon, 2023-09-25 at 16:54 +0530, shashidhar Reddy wrote: > We are using postgres 11.5 on Ubuntu we have enabled logging and set > log_statements to all but when I checked the statements in the logs I > can see only first few lines of the query I don't know about pgAdmin, bu

Postgres 11.5 not logging all sqls

2023-09-25 Thread shashidhar Reddy
Hello We are using postgres 11.5 on Ubuntu we have enabled logging and set log_statements to all but when I checked the statements in the logs I can see only first few lines of the query and also when I check in pgadmin for current queries I could see only few lines. Some one please help me

Re: logging_collector is off, but the logging is opening

2023-07-26 Thread Adrian Klaver
amp; logfile. Can someone give me some advice? https://www.postgresql.org/docs/current/runtime-config-logging.html Note It is possible to log to stderr without using the logging collector; the log messages will just go to wherever the server's stderr is directed. However, that method is only s

logging_collector is off, but the logging is opening

2023-07-26 Thread Wen Yi
Hi community, When I use the postgres, I check the log.(I use the -l open the log) As you can see, I type code like this: postgres=# show logging_collector; logging_collector --- off (1 row) postgres=# ^C Follow the document, when logging_collector is off, there's no log

Re: Suppress logging of "pg_hba.conf rejects connection for host"

2023-04-17 Thread Ron
in my logs. But, I failed to find a parameter for it. Is it possible to turn this specific message logging off? 1. Why do you need that line, instead of just allowing in the addresses you want? 2. Why are you getting so many "illegal" connection attempts? 3. Auditors like to see t

Re: Suppress logging of "pg_hba.conf rejects connection for host"

2023-04-16 Thread Erik Wienhold
If possible, I do not want to see these lines in my logs. But, I failed to > find a parameter for it. > > Is it possible to turn this specific message logging off? There's no special config for this specific error message. It is logged as FATAL so the only way to silence it *and any

Suppress logging of "pg_hba.conf rejects connection for host"

2023-04-16 Thread ertan.kucukoglu
for it. Is it possible to turn this specific message logging off? Thanks & Regards, Ertan

Re: Logging the query executed on the server

2022-07-24 Thread Steve Baldwin
On Sun, Jul 24, 2022 at 4:29 PM Igor Korot wrote: > > 2 things: > 1. How do I turn this off? ;-) > When you change the setting via 'set', that change is only for the current session. You can revert it with 'set {some param} to default;' or just terminate the session. If you want to make the

Re: Logging the query executed on the server

2022-07-24 Thread Igor Korot
Hi, Steve, On Sun, Jul 24, 2022 at 12:51 AM Steve Baldwin wrote: > > Hi Igor, > > Before you issue your query, try something like this: > > (from psql, but hopefully you get the idea) > > b2bcreditonline=# set log_min_duration_statement to 0; > SET > b2bcreditonline=# set log_statement to 'all';

Re: Logging the query executed on the server

2022-07-23 Thread Steve Baldwin
Hi Igor, Before you issue your query, try something like this: (from psql, but hopefully you get the idea) b2bcreditonline=# set log_min_duration_statement to 0; SET b2bcreditonline=# set log_statement to 'all'; SET Ref: https://www.postgresql.org/docs/current/sql-set.html,

Logging the query executed on the server

2022-07-23 Thread Igor Korot
Hi, Is it possible to log the query that will be executed on the server? I'm writing an application that connects to the server through ODBC and libpq. For some reason ODBC interface is failing - it desn't return any rows So I'm thinking if I have a proof that the query I am actually executing

Re: INSERT ALL with DML ERROR Logging replacement in PostgreSQL

2022-06-23 Thread Jagmohan Kaintura
Hi ALl, Any other thought on this thread. On Tue, Jun 21, 2022 at 2:24 PM Gilles Darold wrote: > Le 21/06/2022 à 10:28, Jagmohan Kaintura a écrit : > > Hi Gilles, > > I was going though this earlier today but didn't compiled it as I read it > may not be able to capture the errors if we have

Re: INSERT ALL with DML ERROR Logging replacement in PostgreSQL

2022-06-21 Thread Gilles Darold
Le 21/06/2022 à 10:28, Jagmohan Kaintura a écrit : Hi Gilles, I was going though this earlier today but didn't compiled it as I read it may not be able to capture the errors if we have below type of statement and most of our statements are of INSERT .. SELECT statements only. The form

Re: INSERT ALL with DML ERROR Logging replacement in PostgreSQL

2022-06-21 Thread Jagmohan Kaintura
Gilles Darold wrote: > Le 21/06/2022 à 09:08, Jagmohan Kaintura a écrit : > > Hi Team, > We are working on a project where we are moving from Oracle to PostgreSQL > and working on a migration tool which mostly have statements for inserting > the records which are correct and

Re: INSERT ALL with DML ERROR Logging replacement in PostgreSQL

2022-06-21 Thread Gilles Darold
Le 21/06/2022 à 09:08, Jagmohan Kaintura a écrit : Hi Team, We are working on a project where we are moving from Oracle to PostgreSQL and working on a migration tool which mostly have statements for inserting the records which are correct and logging the errors in error table using ORACLE

INSERT ALL with DML ERROR Logging replacement in PostgreSQL

2022-06-21 Thread Jagmohan Kaintura
Hi Team, We are working on a project where we are moving from Oracle to PostgreSQL and working on a migration tool which mostly have statements for inserting the records which are correct and logging the errors in error table using ORACLE inbuilt statement for INSERT ALL with DML ERROR logging

Re: Exclude logging certain connections?

2020-03-15 Thread Paul Förster
gt; > psql (12.1) > Type "help" for help. > > test=# \x > Expanded display is on. > test=# select * from pg_settings where name = 'log_connections'; > -[ RECORD 1 ]---+---- > name| log_connections > setting

Re: Exclude logging certain connections?

2020-03-15 Thread Adrian Klaver
ay is on. test=# select * from pg_settings where name = 'log_connections'; -[ RECORD 1 ]---+ name| log_connections setting | off unit| category| Reporting and Logging / What to Log short_desc | Logs each successful connection.

Exclude logging certain connections?

2020-03-15 Thread Paul Förster
Hi, is there a way to exclude certain connections, for example recurring monitoring connections, from the postgres.log? I found this from in old post on stackexchange.com: postgres=# create role mon login; CREATE ROLE postgres=# alter role mon set log_connections=off; ERROR: parameter

Re: Logging [RESOLVED]

2019-12-06 Thread Peter J. Holzer
On 2019-12-04 16:03:24 -0800, Rich Shepard wrote: > On Wed, 4 Dec 2019, Stephen Eilert wrote: > > Usually, this is done by logrotate or a similar mechanism in your system. > > You’ll likely find that other logs in your system follow a similar > > pattern, not just Postgresql. > > I just checked

Re: Logging

2019-12-04 Thread Rich Shepard
On Wed, 4 Dec 2019, Adrian Klaver wrote: Take a look at the logging section of postgresql.conf to see if Postgres is handing off to the system and logrotate Adrian, That conf file is in several places (different flavors). I'll check them all. Thanks, Rich

Re: Logging [RESOLVED]

2019-12-04 Thread Rich Shepard
On Wed, 4 Dec 2019, Stephen Eilert wrote: Usually, this is done by logrotate or a similar mechanism in your system. You’ll likely find that other logs in your system follow a similar pattern, not just Postgresql. Stephen, Other logs, controlled by logrotate, rotate daily for a maximum of 4

Re: Logging

2019-12-04 Thread Adrian Klaver
Oct 23 04:40 postgresql-11.7.gz I assume that they're an automatic backup that runs every 3-4 days. What's backed up and where is this controlled? Looks like logrotate. Take a look at the logging section of postgresql.conf to see if Postgres is handing off to the system and logrotate I ask

Re: Logging

2019-12-04 Thread Stephen Eilert
Usually, this is done by logrotate or a similar mechanism in your system. You’ll likely find that other logs in your system follow a similar pattern, not just Postgresql. — Stephen On Dec 4, 2019, 3:21 PM -0800, Rich Shepard , wrote: > Running Slackware-14.2/x86_64 and postgresql-11.5. > > In

Logging

2019-12-04 Thread Rich Shepard
Running Slackware-14.2/x86_64 and postgresql-11.5. In /var/log/ are these files: -rw-r- 1 postgres wheel 0 Nov 23 04:40 postgresql-11 -rw-r- 1 postgres wheel 723 Nov 23 04:40 postgresql-11.1 -rw-r- 1 postgres wheel 324 Nov 20 04:40 postgresql-11.2.gz -rw-r- 1 postgres wheel

Re: logging proxy

2019-11-07 Thread Bruce Momjian
On Fri, Nov 1, 2019 at 01:58:10AM +0300, Олег Самойлов wrote: > Does anyone know PostgresQL proxy which can log queries with username, > ip and affected rows for security reason. PostgresQL itself can log > almost all, except affected rows. You can use the server logs to get the non-row

logging proxy

2019-10-31 Thread Олег Самойлов
Does anyone know PostgresQL proxy which can log queries with username, ip and affected rows for security reason. PostgresQL itself can log almost all, except affected rows.

Re: GSSAPI: logging principal

2019-10-09 Thread Stephen Frost
Greetings, * Allan Jensen (pgl...@winge-jensen.dk) wrote: > I have GSSAPI-login and user mapping to postgres working fine. Great! > Whenever i login to postgres I get a line like the following in the > logfile: > > connection authorized: user=testrole database=testdb SSL enabled >

GSSAPI: logging principal

2019-10-09 Thread Allan Jensen
Hi, I have GSSAPI-login and user mapping to postgres working fine. Whenever i login to postgres I get a line like the following in the logfile: connection authorized: user=testrole database=testdb SSL enabled (protocol=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384, bits=256, compression=off) What

Re: logging "raise" to file

2019-07-28 Thread wambacher
Thank Georg, regards walter > the red part writes your "raise notice" to your log > > psql (+your connection string) -f /path/to/file.sql *> > /path/to/log/xxx.log 2>&1* > > -- My projects: Admin Boundaries of the World Missing Boundaries

Re: logging "raise" to file

2019-07-28 Thread Georg H.
Hi, Am 28.07.2019 um 12:32 schrieb wambac...@posteo.de: Hi, is there a way to log output from "raise ..." to a local file? \o file does not work (for me). regards walter the red part writes your "raise notice" to your log psql (+your connection string) -f /path/to/file.sql *>

Re: logging "raise" to file

2019-07-28 Thread Guillaume Lelarge
Hi, Le dim. 28 juil. 2019 à 12:32, a écrit : > Hi, > > is there a way to log output from "raise ..." to a local file? \o file > does not work (for me). > No, RAISE messages can only go to log files. You would need to call a function that could write to a file (though without calling RAISE).

logging "raise" to file

2019-07-28 Thread wambacher
Hi, is there a way to log output from "raise ..." to a local file? \o file does not work (for me). regards walter -- My projects: Admin Boundaries of the World Missing Boundaries

Re: query logging of prepared statements

2019-02-09 Thread Justin Pryzby
RBOSE, for both SQL EXECUTE and PQexecPrepared. I'd like to be able to continue logging DETAIL (including bind parameters), so want like to avoid setting "TERSE" just to avoid redundant messages. With attached patch, I'm not sure if !*portal_name && !portal->prepStmtName w

query logging of prepared statements

2019-02-08 Thread Justin Pryzby
61bf1ce0b51019db31c5572dac18b664e02f1 |Author: Bruce Momjian |Date: Fri Aug 4 18:53:46 2006 + | |Improve logging of protocol-level prepared statements. Justin

Re: Function for Exception Logging

2018-11-05 Thread Alexey Bashtanov
Even more difficult in PG functions as they have no commit / rollback capability.  I haven't played with stored procedures in in PG11 yet. You can simulate oracle autonomous transaction feature in postgres by connecting to the same db using dblink. As for implicit passing of error

Re: Function for Exception Logging

2018-10-31 Thread Tony Shelver
logging / error messages to a logging file on the fire system, directly from PL/SQL. This file can then be monitored for error messages via a messaging solutions. Regards On Mon, 29 Oct 2018 at 19:13, Patrick FICHE wrote: > Hi community, > > > > I would like to implement a func

Function for Exception Logging

2018-10-29 Thread Patrick FICHE
Hi community, I would like to implement a function that would log managed Exceptions into a dedicated table. For example, I have some code like : BEGIN Code generation exception EXCEPTION WHEN OTHERS THEN Log_Error(); END; The Log_Error function would be able to get the exception context /

Function for Exception Logging

2018-10-29 Thread Patrick FICHE
Hi community, I would like to implement a function that would log managed Exceptions into a dedicated table. For example, I have some code like : BEGIN Code generation exception EXCEPTION WHEN OTHERS THEN Log_Error(); END; The Log_Error function would be able to get the exception context /

Re: Advice on logging strategy

2018-10-12 Thread Mike Martin
Thanks! On Fri, 12 Oct 2018 at 14:33, David Steele wrote: > On 10/11/18 11:26 AM, Mike Martin wrote: > > > > This results in enormous log files which take ages to import using copy > > becuase each execute statement is logged with the parameters chosen > > > > Is there any way around this? > >

Re: Advice on logging strategy

2018-10-12 Thread David Steele
On 10/11/18 11:26 AM, Mike Martin wrote: This results in enormous log files which take ages to import using copy becuase each execute statement is logged with the parameters chosen Is there any way around this? I cant find any way to filter dml statements pgAudit

Re: Advice on logging strategy

2018-10-11 Thread Jeff Janes
On Thu, Oct 11, 2018 at 6:27 AM Mike Martin wrote: > I have a question on logging strategy > > I have loggin set to > log_statement = 'all' on a network database with logging set to csv so I > can import it to a logging table > > However the database is populated

Re: Advice on logging strategy

2018-10-11 Thread Mike Martin
I suppose the ideal would be to log the prepared statement once and detail only if error rather than one per execution On Thu, 11 Oct 2018 at 11:33, Rob Sargent wrote: > > > > On Oct 11, 2018, at 4:26 AM, Mike Martin wrote: > > > > I have a question on logging strate

Re: Advice on logging strategy

2018-10-11 Thread Rob Sargent
> On Oct 11, 2018, at 4:26 AM, Mike Martin wrote: > > I have a question on logging strategy > > I have loggin set to > log_statement = 'all' on a network database with logging set to csv so I can > import it to a logging table > > However the database is popu

Advice on logging strategy

2018-10-11 Thread Mike Martin
I have a question on logging strategy I have loggin set to log_statement = 'all' on a network database with logging set to csv so I can import it to a logging table However the database is populated via a nightly routine downloading data via REST APIusing prepared statements This results

Re: Suggestion about logging only every n-th statement

2018-06-24 Thread Adrien Nayrat
On 06/20/2018 03:06 PM, Janning Vygen wrote: >> FYI in made this patch which seems do what you want : >> https://www.postgresql.org/message-id/flat/c30ee535-ee1e-db9f-fa97-146b9f62caed%40anayrat.info#c30ee535-ee1e-db9f-fa97-146b9f62c...@anayrat.info >> >> >> I will add an entry in september's

Re: Suggestion about logging only every n-th statement

2018-06-20 Thread Adrien Nayrat
On 06/20/2018 03:08 PM, Andreas Kretschmer wrote: > I would suggest using of pg_stat_statements for that. I agree, but sometimes it is not sufficient. For example, if you need query's parameters. -- Adrien NAYRAT signature.asc Description: OpenPGP digital signature

Re: Suggestion about logging only every n-th statement

2018-06-20 Thread Andreas Kretschmer
ng usage patterns it would be very nice to have this >combined with a sample_rate for logging. > > logging_sample_rate = n > >So each n-th statement will get logged regardless of execution time. > >What do you think? > >regards >Janning I would suggest usin

Re: Suggestion about logging only every n-th statement

2018-06-20 Thread Janning Vygen
Am 20.06.2018 um 14:53 schrieb Adrien NAYRAT: On 06/20/2018 01:51 PM, Janning Vygen wrote: Back in 2009 I made a suggestion which is not implemented yet but would still be very valuable and easy to implement in my opinion (not for me as I am not speaking C):

Re: Suggestion about logging only every n-th statement

2018-06-20 Thread Geoff Winkless
On Wed, 20 Jun 2018 at 12:51, Janning Vygen wrote: > But for analyzing usage patterns it would be very nice to have this > combined with a sample_rate for logging. > >logging_sample_rate = n > > So each n-th statement will get logged regardless of execution time. > I

Suggestion about logging only every n-th statement

2018-06-20 Thread Janning Vygen
still can't afford to log each and every statement as we have too many and we don't want to afford more disk performance/space. Therefore we log only statements slower than 50ms. But for analyzing usage patterns it would be very nice to have this combined with a sample_rate for logging

Re: Logging

2018-06-12 Thread Andrew Bartley
w Bartley > <mailto:ambart...@gmail.com>> wrote: > > > > > > > > On Wed, 13 Jun 2018 at 12:43 Laurenz Albe > <mailto:laurenz.a...@cybertec.at>> wrote: > > > > > > log_min_duration_statement = 0 > > > > [...] >

Re: Logging

2018-06-12 Thread Adrian Klaver
n_statement = 0 [...] log_min_duration_statement -1 You've disabled statement logging altogether.  The zero value you were directed to use is what causes everything to be logged. Actually no: https://www.postgresql.org/docs/10/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHEN log_min_duration_sta

Re: Logging

2018-06-12 Thread Andrew Bartley
> >> >> log_min_duration_statement -1 >> > > You've disabled statement logging altogether. The zero value you were > directed to use is what causes everything to be logged. > > David J. > > >

Re: Logging

2018-06-12 Thread David G. Johnston
On Tuesday, June 12, 2018, Andrew Bartley wrote: > > > On Wed, 13 Jun 2018 at 12:43 Laurenz Albe > wrote: > >> >> log_min_duration_statement = 0 >> > [...] > > log_min_duration_statement -1 > You've disabled statement logging altogether. The zero

Re: Logging

2018-06-12 Thread Andrew Bartley
onsumer_id", "create_datetime") values ($1, $2). > > > > I have tried many different logging options and combinations. > > That should automatically be logged as a DETAIL message. > > log_min_duration_statement = 0 > log_min_error_statement = log or better &

Re: Logging

2018-06-12 Thread Laurenz Albe
Andrew Bartley wrote: > Can someone please tell me how to log the values being inserted in this > example.. > > 2018-06-12 22:31:49 UTC-5b2049d4.434ac-STATEMENT: insert into > "api_consumers" ("consumer_id", "create_datetime") values ($1, $2). >

Logging

2018-06-12 Thread Andrew Bartley
Hi all, Can someone please tell me how to log the values being inserted in this example.. 2018-06-12 22:31:49 UTC-5b2049d4.434ac-STATEMENT: insert into "api_consumers" ("consumer_id", "create_datetime") values ($1, $2). I have tried many different logging opt

Re: Feature request: separate logging

2018-02-27 Thread Greg Stark
to support older versions would be to publish it separately as an extension like the jsonlog extension. There's a hook for logging so it should be possible. But it might not be easy. The existing jsonlog extension has some quirky bits to deal with messages at startup for example. -- greg

pg_dump and logging

2017-12-11 Thread marcelo
When pg_dump runs on a database, is it warranted that the log is fully impacted, or at least, taken into account for the dumping? TIA

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-12-04 Thread David Pacheco
Thanks again for helping out. On Mon, Dec 4, 2017 at 2:12 PM, Andres Freund wrote: > On 2017-12-04 13:57:52 -0800, David Pacheco wrote: > > On Mon, Dec 4, 2017 at 12:23 PM, Andres Freund > wrote: > > > FWIW, I'd like to see a report of this around the

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-12-04 Thread Andres Freund
On 2017-12-04 13:57:52 -0800, David Pacheco wrote: > On Mon, Dec 4, 2017 at 12:23 PM, Andres Freund wrote: > > FWIW, I'd like to see a report of this around the time the issue > > occurred before doing anything further here. > > > > > This failure begins when this process

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-12-04 Thread David Pacheco
On Mon, Dec 4, 2017 at 12:23 PM, Andres Freund wrote: > Hi, > > On 2017-11-20 11:12:08 -0800, David Pacheco wrote: > > $ ps -opid,rss,vsz,args -p 37627 > > PID RSS VSZ COMMAND > > 37627 2980 14968 /opt/postgresql/9.2.4/bin/postgres -D /manatee/pg/data > > > > I'm not sure

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-12-04 Thread David Pacheco
On Mon, Nov 20, 2017 at 11:12 AM, David Pacheco wrote: > I understand if the community isn't interested in fixing this case if > other users aren't seeing it much, but surely it's still a bug that this > unusual case can result in a deadlock? > I've filed bug 14945 to cover

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-11-20 Thread David Pacheco
ipe. I was able to extract the > contents of the pipe while the system was hung, and it was more of these giant > query strings. Andres Freund wrote: > Note that there's plenty of cases where you could run into this even > without being unable to fork new processes. Yo