Re: Rewriting select statements - Mailing list pgsql-general

From Tom Lane
Subject Re: Rewriting select statements
Date
Msg-id 22180.1256937943@sss.pgh.pa.us
Whole thread Raw
In response to Rewriting select statements  ("Phil Cairns" <phil@pagaros.com.au>)
Responses Re: Rewriting select statements
List pgsql-general
"Phil Cairns" <phil@pagaros.com.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: CREATE TABLE LIKE and SERIAL
Next
From: Thom Brown
Date:
Subject: Re: CREATE TABLE LIKE and SERIAL