From: | Tom Ansley <tansley(at)law(dot)du(dot)edu> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Getting result set metadata without executing query? |
Date: | 2002-07-11 14:26:54 |
Message-ID: | 200207110826.54438.tansley@law.du.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
I have.....
SELECT * FROM foo where true = false;
Is this as good as the answer below or does it do an entire table scan?
Cheers
Tom Ansley
On Wednesday 10 July 2002 07:45 am, Tom Lane wrote:
> Marc Ramirez <mrami(at)mrami(dot)homeunix(dot)org> writes:
> > Is this possible with PostgreSQL?
>
> SELECT * FROM foo LIMIT 0
>
> works in recent releases, though I think not before 7.1 or so.
>
> You'd want to avoid anything that involves a SORT step, though,
> since it's not truly "not executing the query", just abandoning
> it as soon as the first output row has been generated internally.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-07-11 14:37:45 | Re: Getting result set metadata without executing query? |
Previous Message | Simopoulos | 2002-07-11 14:02:16 | Newbie Stupid Question |