Re: [SQL] uuid type (moved from HACKERS)

2005-09-07 Thread Greg Stark
Josh Berkus writes: > Mark, Nathan, > > I'm moving this over to the PGSQL-SQL list, away from -hackers, as it's no > longer a -hackers type discussion. Hope you don't mind! > > > On Wed, Sep 07, 2005 at 11:31:16AM -0700, Josh Berkus wrote: > > > I'm also a little baffled to come up with any

Re: [SQL] column names, types, properties for a table

2005-09-07 Thread Roger Tannous
OK, I found the solution ( after a little bit of research and testing :) ) Does anyone have recommendations regarding the following query ? SELECT pg_attribute.attname, pg_attribute.attnotnull, pg_attribute.atthasdef, pg_type.typname, pg_attrdef.adsrc AS default_value, pg_constraint.contype, pg_

Re: [SQL] Searching for results with an unknown amount of data

2005-09-07 Thread DownLoad X
> Now, I want to find all objects that have at most properties 1,2,3, say (so > something with (1,2) is okay, as is (1,2,3)). I can't see a way to do this > -- can anyone help? It sounds like you are trying to find all objects that do not have any properties outside of a specific list. One w

Re: [SQL] Help with multistage query

2005-09-07 Thread Matt Emmerton
  - Original Message - From: Russell Simpkins To: pgsql-sql@postgresql.org Sent: Wednesday, September 07, 2005 4:05 PM Subject: Re: [SQL] Help with multistage query   I have a perl script that issues a series of SQL statements to perform some que

Re: [SQL] column names, types, properties for a table

2005-09-07 Thread Philip Hallstrom
Is it possible to issue an SQL query that lists column names, types (int, varchar, boolean, etc.), properties (like NOT NULL or UNIQUE) for a given table name ? Start psql with the -E option. Then "\d yourtable". It will print out the queries that are run internally to show you the table info

[SQL] column names, types, properties for a table

2005-09-07 Thread Roger Tannous
Hi, Is it possible to issue an SQL query that lists column names, types (int, varchar, boolean, etc.), properties (like NOT NULL or UNIQUE) for a given table name ? Regards, Roger Tannous. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the be

Re: [SQL] Help with multistage query

2005-09-07 Thread Russell Simpkins
  I have a perl script that issues a series of SQL statements to perform some queries.  The script works, but I believe there must be a more elegant way to do this.   The simplified queries look like this:   SELECT id FROM t1 WHERE condition1;   ;returns about 2k record

Re: [SQL] uuid type (moved from HACKERS)

2005-09-07 Thread Josh Berkus
Mark, Nathan, I'm moving this over to the PGSQL-SQL list, away from -hackers, as it's no longer a -hackers type discussion. Hope you don't mind! > On Wed, Sep 07, 2005 at 11:31:16AM -0700, Josh Berkus wrote: > > I'm also a little baffled to come up with any real application where > > making an

[SQL] Help with multistage query

2005-09-07 Thread Rick Schumeyer
I have a perl script that issues a series of SQL statements to perform some queries.  The script works, but I believe there must be a more elegant way to do this.   The simplified queries look like this:   SELECT id FROM t1 WHERE condition1;   ;returns about 2k records which are stored

Re: [SQL] AGE function

2005-09-07 Thread Michael Fuhr
On Wed, Sep 07, 2005 at 08:24:54AM -0600, Michael Fuhr wrote: > On Tue, Sep 06, 2005 at 10:05:06PM -0700, Louise Catherine wrote: > > 1. How does postgre 7.3.3 calculate AGE function? > > 2. Why the result produced by postgre 7.3.3 > > is different from postgre 8.0.3 ? > > The change appears to h

Re: [SQL] AGE function

2005-09-07 Thread Tom Lane
Louise Catherine <[EMAIL PROTECTED]> writes: > When I execute this statement : > select AGE(TO_DATE('20041101','mmdd'), > TO_DATE('19991201','mmdd')) > at postgre 7.3.3, the result : > age > - > 4 years 11 mons 1 day With TimeZone set to 'Asia/

Re: [SQL] AGE function

2005-09-07 Thread Michael Fuhr
On Tue, Sep 06, 2005 at 10:05:06PM -0700, Louise Catherine wrote: > 1. How does postgre 7.3.3 calculate AGE function? > 2. Why the result produced by postgre 7.3.3 > is different from postgre 8.0.3 ? The change appears to have been committed in 7.4 and later in response to Bug #1332: http://arch

Re: [SQL] AGE function

2005-09-07 Thread A. Kretschmer
am 06.09.2005, um 22:05:06 -0700 mailte Louise Catherine folgendes: > When I execute this statement : > select AGE(TO_DATE('20041101','mmdd'), > TO_DATE('19991201','mmdd')) > ... > 4 years 11 mons 1 day > 4 years 11 mons > > My question : > 1. How does postgre 7.3.3 calculate AGE fu

Re: [SQL] AGE function

2005-09-07 Thread Louise Catherine
--- Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Tue, Sep 06, 2005 at 10:05:06PM -0700, Louise > Catherine wrote: > > When I execute this statement : > > select AGE(TO_DATE('20041101','mmdd'), > > TO_DATE('19991201','mmdd')) > > > > at postgre 7.3.3, the result : > > age