Re: Add column if not exists (CINE)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>, Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>, Kjell Rune Skaaraas <kjella79@yahoo.no>, pgsql-hackers@postgresql.org
Date: 2010-04-28T16:31:09Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes: > Actually, that's a good idea. But how will you handle tables? Well, tables are a special case, mainly because it's not clear how to avoid accidentally throwing away data. (In particular if some column in the existing table isn't there in the new definition. It's a bit scary to just drop the column, IMO.) I don't see that that argument applies to doing an automatic ALTER COLUMN, though, especially since the only column type alterations that will go through without a USING clause are reasonably straightforward. regards, tom lane