Re: replication commands and log_statements - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: replication commands and log_statements
Date
Msg-id CAHGQGwFGcrExrCCgicDVjNPvjskmr1D3cwBfhdCNpc7OBmBVaA@mail.gmail.com
Whole thread Raw
In response to Re: replication commands and log_statements  (Stephen Frost <sfrost@snowman.net>)
Responses Re: replication commands and log_statements
List pgsql-hackers
On Thu, Aug 14, 2014 at 9:26 AM, Stephen Frost <sfrost@snowman.net> wrote:
> * Amit Kapila (amit.kapila16@gmail.com) wrote:
>> On Wed, Aug 13, 2014 at 4:24 AM, Stephen Frost <sfrost@snowman.net> wrote:
>> > Not entirely sure what you're referring to as 'internally generated'
>> > here..
>>
>> Here 'internally generated' means that user doesn't execute those
>> statements, rather the replication/backup code form these statements
>> (IDENTIFY_SYSTEM, TIMELINE_HISTORY, BASE_BACKUP, ...)
>> and send to server to get the appropriate results.
>
> You could argue the same about pg_dump..  I'd not thought of it before,
> but it might be kind of neat to have psql support "connect in
> replication mode" and then allow the user to run replication commands.

You can do that by specifying "replication=1" as the conninfo when
exexcuting psql. For example,

$ psql -d "replication=1"
psql (9.5devel)
Type "help" for help.

postgres=# IDENTIFY_SYSTEM;     systemid       | timeline |  xlogpos  | dbname
---------------------+----------+-----------+--------6047222920639525794 |        1 | 0/1711678 |
(1 row)


>> Agreed, I also think both are different and shouldn't be logged
>> with one GUC.  Here the important thing to decide is which is
>> the better way to proceed for allowing logging of replication
>> commands such that it can allow us to extend it for more
>> things.  We have discussed below options:
>>
>> a. Make log_statement a list of comma separated options
>> b. Have a separate parameter something like log_replication*
>> c. Log it when user has mentioned option 'all' in log_statement.
>
> Regarding this, I'm generally in the camp that says to just include it
> in 'all' and be done with it- for now.  This is just another example
> of where we really need a much more granular and configurable framework
> for auditing and we're not going to get through GUCs, so let's keep the
> GUC based approach simple and familiar to our users and build a proper
> auditing system.

+1

Regards,

-- 
Fujii Masao



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: jsonb format is pessimal for toast compression
Next
From: Andrew Dunstan
Date:
Subject: Re: jsonb format is pessimal for toast compression