Re: creating a view that shows relation name -> OID

From: Bill Huff <bhuff(at)colltech(dot)com>
To: "Kevin T(dot) Manley" <kmanley(at)qwest(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: creating a view that shows relation name -> OID
Date: 2001-03-13 18:07:28
Message-ID: 20010313120727.A3514@colltech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


The view is trying to make a column called oid which will already exist.

Change your create to:

CREATE VIEW VW_FOO AS select pg_class.oid as v_oid, relname from pg_class
where relowner=27;

--
Bill

On Tue, Mar 13, 2001 at 09:39:23AM -0800, Kevin T. Manley wrote:
> This works:
>
> select pg_class.oid, relname from pg_class where relowner=27;
>
> but this:
>
> CREATE VIEW VW_FOO AS select pg_class.oid, relname from pg_class where
> relowner=27;
>
> fails with:
>
> Attribute 'oid' has a name conflict
> Name matches an existing system attribute
>
> How come?
>
> TIA
> Kevin
>
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

--
_____
/ ___/___ | Bill Huff / bhuff(at)colltech(dot)com
/ /__ __/ | Voice: (512) 263-0770 x 262
/ /__/ / | Fax: (512) 263-8921
\___/ /ollective | Pager: 1-800-946-4646 # 1406217
\/echnologies |------[ http://www.colltech.com ] ------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-03-13 18:13:39 Re: creating a view that shows relation name -> OID
Previous Message Kevin T. Manley 2001-03-13 17:39:23 creating a view that shows relation name -> OID