Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 26 Jan 2005 11:10:07 -0500, Frank D. Engel, Jr.
<fde101@xxxxxxxxxxx> 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.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux