Re: Getting result set metadata without executing query? - Mailing list pgsql-novice

From Tom Lane
Subject Re: Getting result set metadata without executing query?
Date
Msg-id 17760.1026398265@sss.pgh.pa.us
Whole thread Raw
In response to Re: Getting result set metadata without executing query?  (Tom Ansley <tansley@law.du.edu>)
List pgsql-novice
Tom Ansley <tansley@law.du.edu> writes:
> I have.....
> SELECT * FROM foo where true = false;
> Is this as good as the answer below or does it do an entire table scan?

Yeah, that will work (actually you could simplify it to "WHERE false").

However the "LIMIT 0" variant might be a little easier to attach to a
prespecified query, which might already have some WHERE clauses.

            regards, tom lane

pgsql-novice by date:

Previous
From: Tom Ansley
Date:
Subject: Re: Getting result set metadata without executing query?
Next
From: Masaru Sugawara
Date:
Subject: Re: views and rules