Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread Tom Lane
Melvin Davidson writes: > Yes, Stephen, I certainly understand making changes to system catalogs > _when necessary_. That being said, the first change was the renaming of > pid to procpid in pg_stat_activity. However, I contend that was more > because someone felt that it was more to make the co

Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread Stephen Frost
Greetings Melvin, * Melvin Davidson (melvin6...@gmail.com) wrote: > On Thu, Mar 15, 2018 at 10:14 PM, Stephen Frost wrote: > > Changes will continue to be made between major versions of PostgreSQL > > when they're deemed necessary; I'd suggest those applications be > > prepared to adjust on a per

Re: PgBackrest questions

2018-03-15 Thread Stephen Frost
Greetings, * chiru r (chir...@gmail.com) wrote: > On Wed, Mar 14, 2018 at 6:17 PM, Stephen Frost wrote: > > * chiru r (chir...@gmail.com) wrote: > > > I am testing Pgbackrest and I have few questions. > > > > Great! > > > > > 1. I used postures user to perform backups and restores with Pgbackrest

Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread Melvin Davidson
On Thu, Mar 15, 2018 at 10:14 PM, Stephen Frost wrote: > Greetings Melvin, > > * Melvin Davidson (melvin6...@gmail.com) wrote: > > >I guess with your query I can figure out which connection holds a lock, > > but it seems I cannot correlate those locks to the rows which actually > are > > locked,

Re: PgBackrest questions

2018-03-15 Thread Stephen Frost
Greetings, * chiru r (chir...@gmail.com) wrote: > Please respond to my PgBackrest questions,if any one tested. Please don't spam the lists repeatedly like this. The responses to this mailing list are provided by the community on a volunteer basis and repeated emails are more likely to discourage

Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread Stephen Frost
Greetings Melvin, * Melvin Davidson (melvin6...@gmail.com) wrote: > >I guess with your query I can figure out which connection holds a lock, > but it seems I cannot correlate those locks to the rows which actually are > locked, since pg_locks seems not to reference this in any way. > > *FWIW, I r

Re: PgBackrest questions

2018-03-15 Thread chiru r
Greetings, Please respond to my PgBackrest questions,if any one tested. On Wed, Mar 14, 2018 at 10:54 PM, chiru r wrote: > Hi Stephen, > > Thank you very much for your quick reply. > > > On Wed, Mar 14, 2018 at 6:17 PM, Stephen Frost wrote: > >> Greetings, >> >> * chiru r (chir...@gmail.com) w

Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread Melvin Davidson
>I guess with your query I can figure out which connection holds a lock, but it seems I cannot correlate those locks to the rows which actually are locked, since pg_locks seems not to reference this in any way. *Enrico,* *FWIW, I really don't understand your need to identify the actual rows t

Re: Want to disable fully qualified table names on pg_dump in pg_dump (PostgreSQL) 9.6.8

2018-03-15 Thread Adrian Klaver
On 03/15/2018 04:00 PM, Foolish Ewe wrote: Hello All: A number of our team members and I use pg_dump to export schema in an Ubuntu 16.04 environment, I happen to have a postgress 9.6.4 server that runs in a docker container, and in some cases I see the following select statement and fully qual

Want to disable fully qualified table names on pg_dump in pg_dump (PostgreSQL) 9.6.8

2018-03-15 Thread Foolish Ewe
Hello All: A number of our team members and I use pg_dump to export schema in an Ubuntu 16.04 environment, I happen to have a postgress 9.6.4 server that runs in a docker container, and in some cases I see the following select statement and fully qualified table names in the CREATE TABLE and ALT

Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread Stephen Frost
Greetnigs, * Enrico Thierbach (e...@open-lab.org) wrote: > I guess with your query I can figure out which connection holds a lock, but > it seems I cannot correlate those locks to the rows which actually are > locked, since `pg_locks` seems not to reference this in any way. What I gave you would

Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread Enrico Thierbach
Hi Melvin, hi everyone else, thank you for your support, and for your query example. And oh yes, I forgot to mention the postgres version, which is 9.6; but if I find a solution which works in Version 10 then I could probably update. I guess with your query I can figure out which connection h

Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread Melvin Davidson
On Thu, Mar 15, 2018 at 4:48 PM, Stephen Frost wrote: > Greetings, > > * Enrico Thierbach (e...@open-lab.org) wrote: > > I am using `SELECT * FROM queue ... FOR UPDATE SKIP LOCKED` to implement > a > > queueing system. > > > > Now I wonder if it is possible, given the id of one of the locked rows

Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread Stephen Frost
Greetings, * Enrico Thierbach (e...@open-lab.org) wrote: > I am using `SELECT * FROM queue ... FOR UPDATE SKIP LOCKED` to implement a > queueing system. > > Now I wonder if it is possible, given the id of one of the locked rows in > the queue table, to find out which connection/which transaction

Re: psql output result

2018-03-15 Thread Tiffany Thang
Thanks Geoff and Adrian! On Thu, Mar 15, 2018 at 11:03 AM, Adrian Klaver wrote: > On 03/15/2018 07:57 AM, Tiffany Thang wrote: > >> Hi, >> I have a SQL script that does some DDLs, inserts and counts. >> >> The command I ran is >> psql dbname -c "\i crscript.sql" > output.txt >> >> In output.txt,

Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread David G. Johnston
On Thu, Mar 15, 2018 at 1:30 PM, Enrico Thierbach wrote: > Now I wonder if it is possible, given the id of one of the locked rows in > the queue table, to find out which connection/which transaction owns the > lock > ​I'd start here:​ https://www.postgresql.org/docs/10/static/view-pg-locks.html

Re: SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread pinker
Check out here: https://wiki.postgresql.org/wiki/Lock_Monitoring -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

SELECT .. FOR UPDATE: find out who locked a row

2018-03-15 Thread Enrico Thierbach
Hello, I am using `SELECT * FROM queue ... FOR UPDATE SKIP LOCKED` to implement a queueing system. Now I wonder if it is possible, given the id of one of the locked rows in the queue table, to find out which connection/which transaction owns the lock. Any help is greatly appreciated. Than

ERROR: right sibling's left-link doesn't match: block 5 links to 8 instead of expected 2 in index "pg_toast_2619_index"

2018-03-15 Thread Raghavendra Rao J S V
*Hi All,* *We are facing below error in my postgres 9.2 production database. Please help us how to resolve and why we are facing this issue and impact of the issue. * *ERROR: right sibling's left-link doesn't match: block 5 links to 8 instead of expected 2 in index "pg_toast_2619_index"* *CO

Re: wiki Disk Usage, table size: ERROR: could not open relation with OID 0

2018-03-15 Thread Hans Schou
On Thu, Mar 15, 2018 at 12:44 AM, Tom Lane wrote: > > The query does fail on < 9.2, because on rows with no reltoastrelid > Thats, fine. I will live with that until upgrade. > But hey, it's a wiki; > if you feel more ambitious, edit away. > I tried but it said: "The site you are trying to log

Re: wiki Disk Usage, table size: ERROR: could not open relation with OID 0

2018-03-15 Thread Hans Schou
On Thu, Mar 15, 2018 at 12:32 AM, Michael Paquier wrote: > > I'm running version 9.1.9 so it should be working according to the > > wiki. > > You should update and upgrade. 9.1 has fallen out of community support > I will recommend that to the database owner. Thanks

Re: psql output result

2018-03-15 Thread Adrian Klaver
On 03/15/2018 07:57 AM, Tiffany Thang wrote: Hi, I have a SQL script that does some DDLs, inserts and counts. The command I ran is psql dbname -c "\i crscript.sql" > output.txt In output.txt, I got something like INSERT 0 1 INSERT 0 1 CREATE TABLE INSERT 0 2  count --- 9 (1 row) Is

Re: psql output result

2018-03-15 Thread Geoff Winkless
On 15 March 2018 at 14:57, Tiffany Thang wrote: > Is there a way to output the SQLs and DDLs so that I could easily identify > what statements were executed? > > ​ -a, --echo-all echo all input from script Geoff​

psql output result

2018-03-15 Thread Tiffany Thang
Hi, I have a SQL script that does some DDLs, inserts and counts. The command I ran is psql dbname -c "\i crscript.sql" > output.txt In output.txt, I got something like INSERT 0 1 INSERT 0 1 CREATE TABLE INSERT 0 2 count --- 9 (1 row) Is there a way to output the SQLs and DDLs so that

Change ON UPDATE behavior of fkey

2018-03-15 Thread Mike Rylander
I'm wanting to change the ON UPDATE behavior of several foreign keys. I know this has been "asked and answered" in the past, and I have a query that will generate one-statement-per-fkey DDL, but while tailoring that query I noticed that pg_constraint's confupdtype could just be changed to 'c' direc

Re: How to monitor logical replication initial sync?

2018-03-15 Thread bricklen
On Wed, Mar 7, 2018 at 3:23 PM, Doug Gorley wrote: > Good day, > > How does one monitor the status or progress of an initial sync under > logical replication? For example: > > * I create a publication in database db_pub > * I create a subscription in database db_sub > * In 15 minutes I want to c

Re: Snapshot recovery or rolling back commited

2018-03-15 Thread rob stone
Hello Marc-Antoine, On Thu, 2018-03-15 at 10:43 +0100, Marc-Antoine Nüssli wrote: > Hi there, > > I saw there was a question about a similar topic recently but my use > case is quite different so there may be a different answer. > Roughly, I have a database which is updated by a single stream of

Snapshot recovery or rolling back commited

2018-03-15 Thread Marc-Antoine Nüssli
Hi there, I saw there was a question about a similar topic recently but my use case is quite different so there may be a different answer. Roughly, I have a database which is updated by a single stream of updates (through jdbc), so I have a single write transaction at any time. However, sometimes