Re: [GENERAL] Do not INSERT if UPDATE fails

2017-08-04 Thread Alexander Farber
Hello, I have followed David's suggestion (thank you!) - On Wed, Aug 2, 2017 at 6:40 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wed, Aug 2, 2017 at 8:58 AM, Alexander Farber < > alexander.far...@gmail.com> wrote: > >> However if the user record is not found or the user alread

Re: [GENERAL] hot standby questions

2017-08-04 Thread armand pirvu
Thank you guys I think I kinda shot myself in the foot. I took a look at the wiki and I put in -x and so far so good — Armand > On Aug 3, 2017, at 11:03 PM, Lucas Possamai wrote: > > > > 2017-08-04 5:58 GMT+12:00 Jeff Janes >: > On Wed, Aug 2, 2017 at 8:19 PM

[GENERAL] Lifetime of PQexecPrepared() returned value

2017-08-04 Thread Igor Korot
Hi, ALL, I have a following piece of code: [code] PGresult *res = PQexecPrepared(); status = PQresultStatue( res ); if( status == PGRES_TUPLES_OK ) { for( int j = 0; j < PQntuples( res ); j++ ) { char *foo = PQgetValue( res, j, 0 ); char *bar = PQgetValue( res, j, 1 );

Re: [GENERAL] Lifetime of PQexecPrepared() returned value

2017-08-04 Thread Michael Paquier
On Fri, Aug 4, 2017 at 9:12 PM, Igor Korot wrote: > Am I missing something? How do I fix the crash? Based on what I can see here, I see nothing wrong. Now it is hard to reach any conclusion with the limited information you are providing. -- Michael -- Sent via pgsql-general mailing list (pgsq

Re: [GENERAL] Lifetime of PQexecPrepared() returned value

2017-08-04 Thread Igor Korot
Hi, Michael, On Fri, Aug 4, 2017 at 3:26 PM, Michael Paquier wrote: > On Fri, Aug 4, 2017 at 9:12 PM, Igor Korot wrote: >> Am I missing something? How do I fix the crash? > > Based on what I can see here, I see nothing wrong. Now it is hard to > reach any conclusion with the limited information

Re: [GENERAL] Lifetime of PQexecPrepared() returned value

2017-08-04 Thread Tom Lane
Igor Korot writes: > I have a following piece of code: > [code] > PGresult *res = PQexecPrepared(); > status = PQresultStatue( res ); > if( status == PGRES_TUPLES_OK ) > { > for( int j = 0; j < PQntuples( res ); j++ ) > { > char *foo = PQgetValue( res, j, 0 ); > char *bar