Re: broken join optimization? (8.0) - Mailing list pgsql-sql

From Richard Huxton
Subject Re: broken join optimization? (8.0)
Date
Msg-id 435F3EF4.7010808@archonet.com
Whole thread Raw
In response to broken join optimization? (8.0)  (chester c young <chestercyoung@yahoo.com>)
List pgsql-sql
chester c young wrote:
> in php (for example) it's frequently nice to get the structure of a
> table without any data, ie, pull a single row with each attribute's
> value is null.  I use the query (dual is a table of one row ala
> Oracle):
> 
> select m.* from dual
> left join mytable m on( false );

Out of curiosity, why do it this way? Does "rownum" not get set if there 
are no rows returned?

Actually, even if it doesn't why not use:  SELECT * FROM mytable WHERE true=false

Surely your client interface returns the types/column-names then? It 
should - that's a set of 0 rows.

--  Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: Patrick JACQUOT
Date:
Subject: Re: automatic update or insert
Next
From: Rajesh Kumar Mallah
Date:
Subject: converting epoch to timestamp