Search Postgresql Archives

Re: Alter definition of a column

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

 



On 1/22/07, Jim C. Nasby <jim@xxxxxxxxx> wrote:
> kelly=# update pg_attribute set atttypid=25, atttypmod=-1
> kelly-# where attname = 'c1' and attrelid =
> kelly-#     (select oid from pg_class where relname = 'foo');
> UPDATE 1 

<snip>

Also, you could replace that pg_class sub-select with "'foo'::regclass".
 
Interesting....!!!

$ edb-psql.exe edb -c "select  'pg_class'::regclass;"
 regclass
----------
 pg_class
(1 row)

$ edb-psql.exe edb -c "select  'pg_class'::regclass::int;"
 int4
------
 1259
(1 row)

Really interesting....!!


--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | yahoo }.com

[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