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 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>

[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)

Re: [SQL] query for records based on date

2005-02-21 Thread Brandon Metcalf
m == martin@bugs.unl.edu.ar writes: m> El Lun 21 Feb 2005 17:00, Brandon Metcalf escribió: m> > If I have a table with an attribute of type "timestamp without time m> > zone", what is the best way to query that table for records that are m> > older than, say, on

[SQL] query for records based on date

2005-02-21 Thread Brandon Metcalf
If I have a table with an attribute of type "timestamp without time zone", what is the best way to query that table for records that are older than, say, one week. I suppose I could get the current time in epoch seconds and the time of the attribute in the same, and select those records where the