Search Postgresql Archives

Re: Killing OIDs

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

 



I wrote:
> Sure it will.  I'd be a little worried about whether he shouldn't
> be using quote_identifier and/or schema-qualifying the names, but
> SET WITHOUT OIDS is the right command to be issuing.

BTW, the lazy man's way to deal with both of those issues is to cast
the OID to regclass, ie the best way to handle this is

SELECT
  'ALTER TABLE ' || oid::regclass || ' SET WITHOUT OIDS;'
FROM pg_class WHERE ...

Observe the following example:

regression=# create schema s1 create table "Foo"(f1 int);
CREATE SCHEMA
regression=# select max(oid)::regclass from pg_class;
   max    
----------
 s1."Foo"
(1 row)


You can similarly use regprocedure, regoperator, etc to get
safely qualified names for functions, operators etc.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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