datatype.sgml misleading regclass example

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: datatype.sgml misleading regclass example
Date: 2004-10-09 16:21:03
Message-ID: 20041009162102.GA15474@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PostgreSQL 7.4.5, 8.0.0beta3

The Object Identifier Types section of the PostgreSQL documentation
contains the following:

for example, one may write 'mytable'::regclass to get the OID
of table mytable, rather than SELECT oid FROM pg_class WHERE
relname = 'mytable'.

To get the OID, don't we then need to cast to the oid type?

test=> SELECT 'mytable'::regclass;
regclass
----------
mytable
(1 row)

test=> SELECT 'mytable'::regclass::oid;
oid
-------
26664
(1 row)

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-10-09 17:01:15 Re: datatype.sgml misleading regclass example
Previous Message Michael Boeni 2004-10-09 13:05:38 Not able to install 8.0-beta1-20040909