datatype.sgml misleading regclass example - Mailing list pgsql-bugs

From Michael Fuhr
Subject datatype.sgml misleading regclass example
Date
Msg-id 20041009162102.GA15474@winnie.fuhr.org
Whole thread Raw
Responses Re: datatype.sgml misleading regclass example  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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/

pgsql-bugs by date:

Previous
From: Michael Fuhr
Date:
Subject: 8.0.0beta3 plpython link troubles
Next
From: Tom Lane
Date:
Subject: Re: datatype.sgml misleading regclass example