Re: [HACKERS] Updating column on row update
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Craig Ringer <craig@postnewspapers.com.au>, Scott Marlowe <scott.marlowe@gmail.com>, Thom Brown <thombrown@gmail.com>, PGSQL Mailing List <pgsql-general@postgresql.org>, pgsql-hackers@postgresql.org
Date: 2009-11-23T04:20:33Z
Lists: pgsql-hackers, pgsql-general
On Sun, Nov 22, 2009 at 6:51 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Craig Ringer <craig@postnewspapers.com.au> writes: >> I do think this comes up often enough that a built-in trigger "update >> named column with result of expression on insert" trigger might be >> desirable. > > There's something of the sort in contrib already, I believe, though > it's so old it still uses abstime :-( > >> So might "CREATE LANGUAGE ... IF NOT EXISTS". Maybe even "CREATE ROLE >> ... IF NOT EXISTS" and "CREATE USER ... IF NOT EXISTS" - I know I'd find >> them really handy. > > CREATE IF NOT EXISTS has been proposed and rejected before, more than > once. Please see the archives. Search for CINE to find the discussions. This is a good place to start: http://archives.postgresql.org/pgsql-hackers/2009-05/msg00252.php Despite Tom's assertions to the contrary, I am unable to find a clear consensus against this feature in the archives, and still think it would be useful. MySQL and SQLite both support it, at least in the specific case of CREATE TABLE IF NOT EXISTS. But I've exhausted my quota of beating my head against a brick wall on this issue. ...Robert