Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: Rewriting select statements


  • From: "Phil Cairns" <phil(at)pagaros(dot)com(dot)au>
  • To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • Cc: <pgsql-general(at)postgresql(dot)org>
  • Subject: Re: Rewriting select statements
  • Date: Sat, 31 Oct 2009 08:57:03 +1100
  • Message-id: <01ea01ca59ab$eb819c20$c284d460$@com.au> <text/plain>

Tom Lane wrote:
> "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.

Yeah. Not asking for a feature to be added, just asking if something already
existed, some sort of rule that could be created that would rewrite the
query.

> > 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.

Tried that, and got no response. I fully agree that it's broken, but my
users just see the delay. I might have to try some sort of proxy
arrangement.

Thanks for your response,
Phil.




Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group