Re: Weirdness with OIDs and JOIN ON?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Weirdness with OIDs and JOIN ON?
Date: 2004-04-28 12:29:48
Message-ID: 27302.1083155388@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> writes:
> Why doesn't this work:
> test=# select oid, relname, indisclustered from pg_index join pg_class
> on indexrelid=oid where indexrelid > 17205;
> ERROR: column "oid" does not exist

The JOIN is a bit like a view --- it doesn't have any system columns.
For example consider

select alias.* from (a join b on ...) as alias;

This should certainly not show any system columns --- both because SQL92
says so, and because there'd be no way to choose which input table's
system columns to use.

In scenarios where only one input table has an OID column, we could
maybe kluge things to allow it to be accessed without qualification,
but I don't really see the value of adding a wart for that ...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-04-28 12:41:18 Re: tcl error
Previous Message 帅猛 2004-04-28 10:16:39 tcl error