Re: [SQL] add column if doesn't exist

2005-09-28 Thread Brandon Metcalf
c == [EMAIL PROTECTED] writes: c> I set up a stored procedure to do this for Slony-I... Replace c> @NAMESPACE@ with your favorite namespace, and slon_quote_brute can c> likely be treated as an identity function unless you use silly c> namespace names :-). Thanks. -- Brandon --

Re: [SQL] add column if doesn't exist

2005-09-27 Thread Chris Browne
[EMAIL PROTECTED] ("Brandon Metcalf") writes: > p == [EMAIL PROTECTED] writes: > > p> Brandon Metcalf wrote: > p> > Is there a way to check for the existence of a column in a table > p> > other than, say, doing a SELECT on that column name and checking the > p> > output? > > p> SELECT * FROM

Re: [SQL] add column if doesn't exist

2005-09-27 Thread Brandon Metcalf
p == [EMAIL PROTECTED] writes: p> Brandon Metcalf wrote: p> > Is there a way to check for the existence of a column in a table p> > other than, say, doing a SELECT on that column name and checking the p> > output? p> SELECT * FROM information_schema.columns; p> Customize to taste. Yes, t

Re: [SQL] add column if doesn't exist

2005-09-26 Thread Peter Eisentraut
Brandon Metcalf wrote: > Is there a way to check for the existence of a column in a table > other than, say, doing a SELECT on that column name and checking the > output? SELECT * FROM information_schema.columns; Customize to taste. -- Peter Eisentraut http://developer.postgresql.org/~petere/

[SQL] add column if doesn't exist

2005-09-26 Thread Brandon Metcalf
Is there a way to check for the existence of a column in a table other than, say, doing a SELECT on that column name and checking the output? I'm basically looking to do an ALTER TABLE foo ADD COLUMN bar if bar doesn't exist. Thanks. -- Brandon ---(end of broadcast)