Re: [HACKERS] remove upsert example from docs

2011-02-17 Thread Bruce Momjian
Marko Tiikkaja wrote: > On 2011-02-17 8:37 PM +0200, Bruce Momjian wrote: > > Marko Tiikkaja wrote: > >> The problem with the "safe" way is that it's not safe if called in a > >> transaction with isolation level set to SERIALIZABLE. > > > > Good analysis. Documentation patch attached and applied.

Re: [HACKERS] remove upsert example from docs

2011-02-17 Thread Marko Tiikkaja
On 2011-02-17 8:37 PM +0200, Bruce Momjian wrote: Marko Tiikkaja wrote: The problem with the "safe" way is that it's not safe if called in a transaction with isolation level set to SERIALIZABLE. Good analysis. Documentation patch attached and applied. The "safe way" I was referring to above

Re: [HACKERS] remove upsert example from docs

2011-02-17 Thread Bruce Momjian
Marko Tiikkaja wrote: > On 8/5/2010 9:44 PM, Merlin Moncure wrote: > > On Thu, Aug 5, 2010 at 2:09 PM, Tom Lane wrote: > >> I was not persuaded that there's a real bug in practice. IMO, his > >> problem was a broken trigger not broken upsert logic. Even if we > >> conclude this is unsafe, simply

Re: [HACKERS] remove upsert example from docs

2010-08-07 Thread Marko Tiikkaja
On 8/5/2010 9:44 PM, Merlin Moncure wrote: On Thu, Aug 5, 2010 at 2:09 PM, Tom Lane wrote: I was not persuaded that there's a real bug in practice. IMO, his problem was a broken trigger not broken upsert logic. Even if we conclude this is unsafe, simply removing the example is of no help to a

Re: [HACKERS] remove upsert example from docs

2010-08-05 Thread Tom Lane
Merlin Moncure writes: > On Thu, Aug 5, 2010 at 2:09 PM, Tom Lane wrote: >> I was not persuaded that there's a real bug in practice.  IMO, his >> problem was a broken trigger not broken upsert logic.  Even if we >> conclude this is unsafe, simply removing the example is of no help to >> anyone.

Re: [HACKERS] remove upsert example from docs

2010-08-05 Thread Merlin Moncure
On Thu, Aug 5, 2010 at 2:09 PM, Tom Lane wrote: > Merlin Moncure writes: >> Attached is a patch to remove the upsert example from the pl/pgsql >> documentation.  It has a serious bug (see: >> http://www.spinics.net/lists/pgsql/msg112560.html) which is nontrivial >> to fix.  IMNSHO, our code examp

Re: [HACKERS] remove upsert example from docs

2010-08-05 Thread Andrew Dunstan
On 08/05/2010 02:09 PM, Tom Lane wrote: Merlin Moncure writes: Attached is a patch to remove the upsert example from the pl/pgsql documentation. It has a serious bug (see: http://www.spinics.net/lists/pgsql/msg112560.html) which is nontrivial to fix. IMNSHO, our code examples should encoura

Re: [HACKERS] remove upsert example from docs

2010-08-05 Thread Tom Lane
Merlin Moncure writes: > Attached is a patch to remove the upsert example from the pl/pgsql > documentation. It has a serious bug (see: > http://www.spinics.net/lists/pgsql/msg112560.html) which is nontrivial > to fix. IMNSHO, our code examples should encourage good practices and > style. I was

Re: [HACKERS] remove upsert example from docs

2010-08-05 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > Attached is a patch to remove the upsert example from the pl/pgsql > documentation. It has a serious bug (see: > http://www.spinics.net/lists/pgsql/msg112560.html) which is nontrivial > to fix. IMNSHO, our code examples should encourage good

Re: [HACKERS] remove upsert example from docs

2010-08-05 Thread Kevin Grittner
Merlin Moncure wrote: > Attached is a patch to remove the upsert example from the pl/pgsql > documentation. It has a serious bug (see: > http://www.spinics.net/lists/pgsql/msg112560.html) which is > nontrivial to fix. IMNSHO, our code examples should encourage > good practices and style. > >

[HACKERS] remove upsert example from docs

2010-08-05 Thread Merlin Moncure
Attached is a patch to remove the upsert example from the pl/pgsql documentation. It has a serious bug (see: http://www.spinics.net/lists/pgsql/msg112560.html) which is nontrivial to fix. IMNSHO, our code examples should encourage good practices and style. The 'correct' way to do race free upser