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

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. Only superusers and users with the appropriate SET >

Re: Logging statement having any threat?

2024-04-20 Thread Adrian Klaver
On 4/20/24 07:02, Lok P wrote: 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

Re: Logging statement having any threat?

2024-04-20 Thread Adrian Klaver
On 4/20/24 07:02, Lok P wrote: Hello All, Its postgres version 15.4 and its RDS, in which our dev team gets the infrastructure code from another third party team which provides us base infrastructure code to build a postgres database, in which we will be able to do change DB parameter values

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,

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
On 12/4/19 3:20 PM, Rich Shepard wrote: 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

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

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

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

Re: Logging

2018-06-12 Thread Andrew Bartley
Thanks All, It seems that the related DETAIL message appears if the query is successful. On error the DETAIL log line is missing... This makes debugging difficult, considering the insert is coming from Dreamfactory via a rest POST. I am finding it very difficult navigating my way through the

Re: Logging

2018-06-12 Thread Adrian Klaver
On 06/12/2018 08:25 PM, David G. Johnston wrote: On Tuesday, June 12, 2018, Andrew Bartley > 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 Andrew Bartley
Ok, thanks. will try On Wed, 13 Jun 2018 at 13:25 David G. Johnston wrote: > 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

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 value you were directed to use is what causes

Re: Logging

2018-06-12 Thread Andrew Bartley
On Wed, 13 Jun 2018 at 12:43 Laurenz Albe wrote: > 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,

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). > > I have tried many different logging options