Re: Rewriting select statements

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Phil Cairns" <phil(at)pagaros(dot)com(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Rewriting select statements
Date: 2009-10-30 21:25:43
Message-ID: 22180.1256937943@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Phil Cairns" <phil(at)pagaros(dot)com(dot)au> writes:
> I want to have the server do this:
> If the query has no where clause, use a where clause of "where 1=0".

> Is this possible?

It's doubtless *possible*, but if you're asking for it to actually
happen in any supported version of Postgres, the answer is no way.
It's directly contrary to the SQL standard.

> Why would I want to do this? Because a third party library (ArcGIS) has a
> "feature" such that when a relation name is registered with it, it does a
> "select * from <relation>" and then does nothing with the results.

Tell the library authors to fix their broken code. This is blithering
stupidity in *any* SQL database, not only Postgres.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2009-10-30 21:37:05 Re: CREATE TABLE LIKE and SERIAL
Previous Message Tom Lane 2009-10-30 21:20:15 Re: CREATE TABLE LIKE and SERIAL