Re: Export a column in a view without "announcing" it? - Mailing list pgsql-general

From Dawid Kuroczko
Subject Re: Export a column in a view without "announcing" it?
Date
Msg-id 758d5e7f050129120714c90931@mail.gmail.com
Whole thread Raw
In response to Export a column in a view without "announcing" it?  ("Frank D. Engel, Jr." <fde101@fjrhome.net>)
List pgsql-general
On Wed, 26 Jan 2005 11:10:07 -0500, Frank D. Engel, Jr.
<fde101@fjrhome.net> wrote:
> I'm fairly certain there is currently no way to do this, but it would
So am I. :)

> Is there any way to expose a column in a view without "announcing" the
> fact that it is there?  Specifically, in order to support updatable
> cursors on views (faked ones, using the ODBC driver), it is necessary
> to include the underlying table's OID and CTID columns in the view; but
> the client software I am trying to use then chokes on there being a
> column named OID (which is present, but hidden, if I use a table).  So
> basically I would like to do:
>
> CREATE VIEW aView AS
>      SELECT x, y, OID, CTID, z, t, ... FROM aTable WHERE condition_met
> WITHOUT ANNOUNCING OID, CTID

Oh, I think it would be quite useful in non-ODBC world,
suppose I have:
CREATE VIEW av AS
   SELECT foo_id, foo_name, foo_bar, foo_baz FROM blah
WITHOUT ANNOUNCING foo_id;
...means that I can later do things like:
SELECT foo_name FROM av ORDER BY foo_id;
...but also (much more important) use this foo_id in joins!

This could be especially useful when doing view-on-a-view. :)

   Regards,
      Dawid

PS: Though I'm somewhat sceptical towards "WITHOUT ANNOUNCING" syntax.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Splitting queries across servers
Next
From: Tzahi Fadida
Date:
Subject: Pinning buffers for long times like outer joins might do.