Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread David G Johnston
Medhavi Mahansaria wrote > Hi Bill, > > Thanks! > > But savepoint concept will not work for me as desired. > > Is there any other way apart from SAVEPOINT that can be incorporated. > > I am not using a script. I am writing a c++ program. > > My problem is that I have 2 cases: > > Case 1

Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread Medhavi Mahansaria
Hi Bill, Thanks! But savepoint concept will not work for me as desired. Is there any other way apart from SAVEPOINT that can be incorporated. I am not using a script. I am writing a c++ program. My problem is that I have 2 cases: Case 1: When Q2 fails (we delete the error), i want to co

Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread Medhavi Mahansaria
Hi Kevin, Thanks! But savepoint concept will not work for me as desired. Is there any other way apart from SAVEPOINT that can be incorporated. I am not using a script. I am writing a c++ program. My problem is that I have 2 cases: Case 1: When Q2 fails (we delete the error), i want to continu

Re: [GENERAL] Starting new cluster from base backup

2015-02-18 Thread Adrian Klaver
On 02/18/2015 01:48 PM, Guillaume Drolet wrote: So if I understand correctly you have: 1) On source machine a directory E:\Data\Database. 2) On the source machine in Postgres you have a created a tablespace that points at E:\Data\Database. 3) On destination machine you

Re: [GENERAL] Fwd: Data corruption after restarting replica

2015-02-18 Thread Tomas Vondra
On 16.2.2015 11:44, Novák, Petr wrote: > Hello, > > sorry for posting to second list, but as I've received no reply > there, I'm trying my luck here. > > Thanks > Petr > > > -- Forwarded message -- > From: Novák, Petr > Date: Tue, Feb 10, 2015 at 12:49 PM > Subject: Data corru

Re: [GENERAL] Fwd: Data corruption after restarting replica

2015-02-18 Thread dinesh kumar
Hi, On Mon, Feb 16, 2015 at 2:44 AM, Novák, Petr wrote: > Hello, > > sorry for posting to second list, but as I've received no reply > there, I'm trying my luck here. > > Thanks > Petr > > > -- Forwarded message -- > From: Novák, Petr > Date: Tue, Feb 10, 2015 at 12:49 PM > Sub

Re: [GENERAL] Starting new cluster from base backup

2015-02-18 Thread Guillaume Drolet
2015-02-18 16:11 GMT-05:00 Adrian Klaver : > On 02/18/2015 11:51 AM, Guillaume Drolet wrote: > >> >> >> 2015-02-18 13:40 GMT-05:00 Adrian Klaver > >: >> >> On 02/18/2015 10:24 AM, Guillaume Drolet wrote: >> >> >> >> 2015-02-18 11:06 GMT-05:00 Adrian Kl

Re: [GENERAL] Fwd: Data corruption after restarting replica

2015-02-18 Thread Adrian Klaver
On 02/16/2015 02:44 AM, Novák, Petr wrote: Hello, sorry for posting to second list, but as I've received no reply there, I'm trying my luck here. Thanks Petr -- Forwarded message -- From: Novák, Petr Date: Tue, Feb 10, 2015 at 12:49 PM Subject: Data corruption after restarti

Re: [GENERAL] Starting new cluster from base backup

2015-02-18 Thread Adrian Klaver
On 02/18/2015 11:51 AM, Guillaume Drolet wrote: 2015-02-18 13:40 GMT-05:00 Adrian Klaver mailto:adrian.kla...@aklaver.com>>: On 02/18/2015 10:24 AM, Guillaume Drolet wrote: 2015-02-18 11:06 GMT-05:00 Adrian Klaver mailto:adrian.kla...@aklaver.com>

Re: [GENERAL] Starting new cluster from base backup

2015-02-18 Thread Guillaume Drolet
2015-02-18 13:40 GMT-05:00 Adrian Klaver : > On 02/18/2015 10:24 AM, Guillaume Drolet wrote: > >> >> >> 2015-02-18 11:06 GMT-05:00 Adrian Klaver > >: >> >> > >> So is E:\ a network drive shared by both machines? >> >> >> No, E:\ is a local drive on which I cre

Re: [GENERAL] postgresql93-9.3.5: deadlock when updating parent table expected?

2015-02-18 Thread dinesh kumar
Hi, If you feel FOR UPDATE is taking much time, then I believe,we can solve this kind of issues using advisory locks , . Regards, Dinesh manojadinesh.blogspot.com On Wed, Feb 18, 2015 at 10:45 AM, Bill Moran wrote: > On Wed, 18

Re: [GENERAL] postgresql93-9.3.5: deadlock when updating parent table expected?

2015-02-18 Thread Bill Moran
On Wed, 18 Feb 2015 18:30:09 + Dmitry O Litvintsev wrote: > > Yes, deadlock occurs when there are multiple processes insert > concurrently into file table with the same volume id field. > I used "sometimes" as opposed to "all the time". I resonded in that way since I frequently hear peopl

Re: [GENERAL] Starting new cluster from base backup

2015-02-18 Thread Adrian Klaver
On 02/18/2015 10:24 AM, Guillaume Drolet wrote: 2015-02-18 11:06 GMT-05:00 Adrian Klaver mailto:adrian.kla...@aklaver.com>>: So is E:\ a network drive shared by both machines? No, E:\ is a local drive on which I created a tablespace, in order to have enough space for my database. In

Re: [GENERAL] postgresql93-9.3.5: deadlock when updating parent table expected?

2015-02-18 Thread Dmitry O Litvintsev
Thank you, Bill, Yes, deadlock occurs when there are multiple processes insert concurrently into file table with the same volume id field. I used "sometimes" as opposed to "all the time". I think you advise to retry transaction or add select for update prior to insert. I will pursue this (to

Re: [GENERAL] Starting new cluster from base backup

2015-02-18 Thread Guillaume Drolet
2015-02-18 11:06 GMT-05:00 Adrian Klaver : > On 02/18/2015 04:26 AM, Guillaume Drolet wrote: > >> >> >> 2015-02-17 17:14 GMT-05:00 Adrian Klaver > >: >> >> >> On 02/17/2015 06:54 AM, Guillaume Drolet wrote: >> >> Adrian: thanks for this information. >>

Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread David G Johnston
Medhavi Mahansaria wrote > I need to execute a series of queries in a transaction, say Q1, Q2, Q3. > [...] > Is there a way to turn autocommit off? I assume you meant turn Autocommit on? So, do you want to execute the queries in a transaction or do you want to autocommit each one? Autocommit is

Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread Kevin Grittner
Medhavi Mahansaria wrote: > I need to execute a series of queries > in a transaction, say Q1, Q2, Q3. > > Q1 -> success > Q2 -> Failed > Q3 -> Success > > My issue is that after Q2 fails all > the queries that follow give error"ERROR: current transaction > is aborted, commands ignored until end

Re: [GENERAL] Starting new cluster from base backup

2015-02-18 Thread Adrian Klaver
On 02/18/2015 04:26 AM, Guillaume Drolet wrote: 2015-02-17 17:14 GMT-05:00 Adrian Klaver mailto:adrian.kla...@aklaver.com>>: On 02/17/2015 06:54 AM, Guillaume Drolet wrote: Adrian: thanks for this information. I tried running pg_basebackup in plain format with option -X s

Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread Bill Moran
On Wed, 18 Feb 2015 20:36:45 +0530 Medhavi Mahansaria wrote: > I need to execute a series of queries in a transaction, say Q1, Q2, Q3. > > Q1 -> success > Q2 -> Failed > Q3 -> Success > > My issue is that after Q2 fails all the queries that follow give error "E > RROR: current transaction is a

Re: [GENERAL] Failure loading materialized view with pg_restore

2015-02-18 Thread Tom Lane
Brian Sutherland writes: > If I run this set of commands against PostgreSQL 9.4.1 I pg_restore > throws an error with a permission problem. Why it does so is a mystery > to me, given that the user performing the restore is a superuser: The same thing would happen without any dump and restore: re

[GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread Medhavi Mahansaria
Hi, I need to execute a series of queries in a transaction, say Q1, Q2, Q3. Q1 -> success Q2 -> Failed Q3 -> Success My issue is that after Q2 fails all the queries that follow give error "E RROR: current transaction is aborted, commands ignored until end of transaction block" I want to move

Re: [GENERAL] Missing table from in INSERT RETURNING

2015-02-18 Thread Rémi Cura
Hey folks, thanks for the answers. As you guessed it is just a synthetic example, (so of course RETURNING some_value / 10 is possible in this case, but not in general when the function is much more complicated than "/10"). Same wise, adding a column is just not a serious option. It correspond to

Re: [GENERAL] BDR Monitoring, missing pg_stat_logical_decoding view

2015-02-18 Thread Andres Freund
Hi, On 2015-02-17 22:37:43 +, Steve Boyle wrote: > I'm trying to setup replication monitoring for BDR, following the doc here: > https://wiki.postgresql.org/wiki/BDR_Monitoring > > My BDR installs seem to be missing the pg_stat_logical_decoding view. Is > there something specific I need to

Re: [GENERAL] segmentation fault postgres 9.3.5 core dump perlu related ?

2015-02-18 Thread Day, David
Update/Information sharing: ( FreeBSD 10.0 (amd64) – Postgres 9.3.5 – Perl 5.18 ) I have converted our Postgres plperlu functions to plpython2u to see if the postgres segmentation faults disappear. Lacking a known way to reproduce the error on demand, I will have to wait a few weeks for the ab

Re: [GENERAL] Failure loading materialized view with pg_restore

2015-02-18 Thread Rémi Cura
Hey, pg_hba is to manage who has *access* to database. Your problem seems to be who has* SELECT permission* to x table. Cheers, Rémi-C 2015-02-18 12:03 GMT+01:00 BladeOfLight16 : > On Wed, Feb 18, 2015 at 5:48 AM, Brian Sutherland > wrote: > >> # dump and reload >> pg_dump --username sup

Re: [GENERAL] Starting new cluster from base backup

2015-02-18 Thread Guillaume Drolet
2015-02-17 17:14 GMT-05:00 Adrian Klaver : > On 02/17/2015 06:54 AM, Guillaume Drolet wrote: > >> Adrian: thanks for this information. >> >> I tried running pg_basebackup in plain format with option -X stream >> (pg_basebackup -D "F:\208376PT\db" -X stream -l "208376PT17022015" -U >> postgres -P)

Re: [GENERAL] postgresql93-9.3.5: deadlock when updating parent table expected?

2015-02-18 Thread Alvaro Herrera
Dmitry O Litvintsev wrote: > Hi, > > I recently updated to postgresql93-9.3.5 (from 9.2.9). I see frequent > deadlocks > when updating parent table in insert into child table. There is foreign key > constraint between > child table and parent table. Parent table is updated on by trigger in in

[GENERAL] Advise on unit testing framework enhancement

2015-02-18 Thread Sid
There are many postgres unit testing libraries like pgtap , PGUnit and Epic . But I think there might be some important things that are missing that makes using these tools easier, so I wrote pypgTAP

Re: [GENERAL] postgresql93-9.3.5: deadlock when updating parent table expected?

2015-02-18 Thread Bill Moran
On Wed, 18 Feb 2015 04:55:47 + Dmitry O Litvintsev wrote: > Hi, > > I recently updated to postgresql93-9.3.5 (from 9.2.9). I see frequent > deadlocks > when updating parent table in insert into child table. There is foreign key > constraint between > child table and parent table. Parent

Re: [GENERAL] Failure loading materialized view with pg_restore

2015-02-18 Thread BladeOfLight16
On Wed, Feb 18, 2015 at 5:48 AM, Brian Sutherland wrote: > # dump and reload > pg_dump --username super --format c -f dump.dump orig > createdb copied > It might be helpful to dump in the plain SQL format and look at what it's doing.

[GENERAL] Failure loading materialized view with pg_restore

2015-02-18 Thread Brian Sutherland
Hi, If I run this set of commands against PostgreSQL 9.4.1 I pg_restore throws an error with a permission problem. Why it does so is a mystery to me, given that the user performing the restore is a superuser: # superuser creates database and materialized view createuser -s super creat