Re: Getting result set metadata without executing query?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: tansley(at)law(dot)du(dot)edu
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Getting result set metadata without executing query?
Date: 2002-07-11 14:37:45
Message-ID: 17760.1026398265@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Tom Ansley <tansley(at)law(dot)du(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Masaru Sugawara 2002-07-11 16:57:33 Re: views and rules
Previous Message Tom Ansley 2002-07-11 14:26:54 Re: Getting result set metadata without executing query?