Re: Export a column in a view without "announcing" it?

From: Dawid Kuroczko <qnex42(at)gmail(dot)com>
To: PgSQL General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Export a column in a view without "announcing" it?
Date: 2005-01-29 20:07:44
Message-ID: 758d5e7f050129120714c90931@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 26 Jan 2005 11:10:07 -0500, Frank D. Engel, Jr.
<fde101(at)fjrhome(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message PFC 2005-01-29 20:18:38 Re: Splitting queries across servers
Previous Message raptor 2005-01-29 19:55:23 dumping the schema ?