Re: Want to acquire lock on tables where primary of one table is foreign key on othere

2018-10-11 Thread Alban Hertroys
You forgot to CC the list. Also, top-posting is generally not appreciated here. > On Thu, Oct 11, 2018 at 8:26 PM Alban Hertroys wrote: > On Thu, 11 Oct 2018 at 16:38, Abhishek Tripathi > wrote: > > Actually I have acquired a "Select for Update" on a table whose id is > > refrence as a foreign

Re: how to identify the timeline of specified recovery_target_time when do multiple PITR

2018-10-11 Thread Laurenz Albe
magodo wrote: > > How can you know how many WAL segments there are on timeline 1, and if > > there is one that extends past 2018-10-11 12:00:00 or not? > > This is the exact problem I want to figure out. My approach is as you said, > I will parse each archived WAL segment via `pg_xlogdump -r Trans

Re: Code of Conduct plan

2018-10-11 Thread Bruce Momjian
On Thu, Sep 20, 2018 at 07:12:22AM +0200, Chris Travers wrote: > If we have a committer who loudly and proudly goes to neo-nazi rallies or > pickup artist / pro-rape meetups, then actually yes, I have a problem with > that. That impacts my ability to work in the community, impacts every

no queryId in post_parse_analyze hook when row is locked

2018-10-11 Thread legrand legrand
Hello, When playing with extension pgsentinel, it seems that post_parse_analyze hook doesn't return query->queryId (initialized by a similar hook in pg_stat_statements) when current row is locked. Is that possible ? More details found at https://github.com/pgsentinel/pgsentinel/issues/19 Thanks

Re: COPY threads

2018-10-11 Thread Ravi Krishna
> > Well the result is not what I expected. > > this is the sql I used > > copy TEST.TABLE1 from '/var/lib/postgresql/data/rkrishna/copytesting/xaa' > with delimiter '|' NULL as '' CSV HEADER; > > From another session > > copy TEST.TABLE1 from '/var/lib/postgresql/data/rkrishna/copytesting/xa

Re: COPY threads

2018-10-11 Thread Ravi Krishna
>>> >> Thank you. Let me test it and see the benefit. We have a use case for this. > Well the result is not what I expected. this is the sql I used copy TEST.TABLE1 from '/var/lib/postgresql/data/rkrishna/copytesting/xaa' with delimiter '|' NULL as '' CSV HEADER; From another session copy

Re: something weird happened - can select by column value although column value exist

2018-10-11 Thread Tom Lane
Ron writes: > On 10/11/2018 03:17 PM, Dmitry O Litvintsev wrote: >> Today the following happened: >> < 2018-10-11 13:31:52.587 CDT >ERROR: insert or update on table "file" >> violates foreign key constraint "$1" >> < 2018-10-11 13:31:52.587 CDT >DETAIL: Key (volume)=(155303) is not present >>

Re: something weird happened - can select by column value although column value exist

2018-10-11 Thread Ron
On 10/11/2018 03:17 PM, Dmitry O Litvintsev wrote: Hi, Today the following happened: Found this error in my production log: < 2018-10-11 13:31:52.587 CDT >ERROR: insert or update on table "file" violates foreign key constraint "$1" < 2018-10-11 13:31:52.587 CDT >DETAIL: Key (volume)=(155303

Re: COPY threads

2018-10-11 Thread Thomas Kellerer
Rob Sargent schrieb am 10.10.2018 um 00:45:> Can anyone here tell me whether or not the CopyManager facility in JDBC via org.postgresql:postgresql:42.1.4 is internally multithreaded? Running on CentOS 7 (all participants), java8, postgres 10.5 An alternative to creating your own multi-threaded

something weird happened - can select by column value although column value exist

2018-10-11 Thread Dmitry O Litvintsev
Hi, Today the following happened: Found this error in my production log: < 2018-10-11 13:31:52.587 CDT >ERROR: insert or update on table "file" violates foreign key constraint "$1" < 2018-10-11 13:31:52.587 CDT >DETAIL: Key (volume)=(155303) is not present in table "volume". < 2018-10-11 13

Re: COPY threads

2018-10-11 Thread Peter J. Holzer
On 2018-10-10 17:19:50 -0400, Ravi Krishna wrote: > > On Oct 10, 2018, at 17:18 , Andres Freund wrote: > > On October 10, 2018 2:15:19 PM PDT, Ravi Krishna wrote: > >> If I have a large file with say 400 million rows, can I first split it > >> into 10 files of 40 million rows each and then fire u

Re: how to identify the timeline of specified recovery_target_time when do multiple PITR

2018-10-11 Thread Laurenz Albe
magodo wrote: > On Thu, 2018-10-11 at 06:35 +0200, Laurenz Albe wrote: > > magodo wrote: > > > OK... Just take another example: > > > > > > A B > > > BASE-+-+--o1 (recover to > > > A) 1 > > > | | C > > > +.|.

RE: RHEL 7 (systemd) reboot

2018-10-11 Thread Bryce Pepper
I disabled and removed the CTM_Postgre.service as it didn't help (and I didn't want too many moving parts left out there). I did find a post https://superuser.com/questions/1016827/how-do-i-run-a-script-before-everything-else-on-shutdown-with-systemd that I think is getting me closer. I tried

Re: RHEL 7 (systemd) reboot

2018-10-11 Thread Adrian Klaver
On 10/11/18 7:53 AM, Bryce Pepper wrote: Adrian, I tried changing the Before to After but the postgresql instance was still shutdown too early. In an earlier post you had: cat ControlM_Shutdown.service [Unit] Description=Run mycommand at shutdown Requires=network.target CTM_Postgre.service

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 via a nightly routine downloading

parallel PITR for HA setup

2018-10-11 Thread magodo
Hello, I have a HA setup, a standby following a primary. At beginning, when I do PITR for it, I just recover the primary the first, then remake the standby by doing a basebackup against primary and restart the standby with recovery.conf properly. This works well, however, it takes long time wh

Re: Want to acquire lock on tables where primary of one table is foreign key on othere

2018-10-11 Thread Alban Hertroys
On Thu, 11 Oct 2018 at 16:38, Abhishek Tripathi wrote: > Actually I have acquired a "Select for Update" on a table whose id is > refrence as a foreign key on another table So I want those table won't update > until there is lock. Is it possible? Becuase postgres is acquiring lock but > AccessSh

RE: RHEL 7 (systemd) reboot

2018-10-11 Thread Bryce Pepper
Adrian, I tried changing the Before to After but the postgresql instance was still shutdown too early. I appreciate all of the help but think I'm going to ask the patching group to ensure they stop the control-m services prior to reboot. Bryce Oct 11 09:19:57 kccontrolmt01 su[9816]: pam_uni

Fwd: Want to acquire lock on tables where primary of one table is foreign key on othere

2018-10-11 Thread Abhishek Tripathi
-- Forwarded message - From: Abhishek Tripathi Date: Thu, Oct 11, 2018 at 3:18 PM Subject: Want to acquire lock on tables where primary of one table is foreign key on othere To: Dear Concerned Person, I write this email to get the information about locking which I am not gettin

Re: RHEL 7 (systemd) reboot

2018-10-11 Thread Adrian Klaver
On 10/11/18 6:33 AM, Bryce Pepper wrote: Adrian, Thanks for being willing to dig into this. You are correct there are other scripts being called from mine (delivered by BMC with their software). In order to stay in support and work with their updates I use the vendor supplied scripts/progra

RE: RHEL 7 (systemd) reboot

2018-10-11 Thread Bryce Pepper
Adrian, Thanks for being willing to dig into this. You are correct there are other scripts being called from mine (delivered by BMC with their software). In order to stay in support and work with their updates I use the vendor supplied scripts/programs. The Control-M product is installed

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 strategy > > > > I have loggin set

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 populated via a nightly routine down

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 in enor

Re: how to identify the timeline of specified recovery_target_time when do multiple PITR

2018-10-11 Thread magodo
On Thu, 2018-10-11 at 06:35 +0200, Laurenz Albe wrote: > magodo wrote: > > OK... Just take another example: > > > > A B > > BASE-+-+--o1 (recover to > > A) 1 > > | | C > > +.|...+---o2 (regret, reco