alter column appears to work, but doesn't?

Поиск
Список
Период
Сортировка
От Ron Peterson
Тема alter column appears to work, but doesn't?
Дата
Msg-id 20110905183126.GA3061@mtholyoke.edu
обсуждение исходный текст
Ответы Re: alter column appears to work, but doesn't?
Список pgsql-general
I just updated a table to have a larger column size as follows.

alter table attributes_log alter column attribute_name type varchar(48);

The size was previously 24.

iddb=> \d attributes
                                               Table "iddb.attributes"
     Column     |         Type          |                                  Modifiers
----------------+-----------------------+-----------------------------------------------------------------------------
 attribute_id   | uuid                  | not null default (encode(pgcrypto.gen_random_bytes(16), 'hex'::text))::uuid
 attribute_name | character varying(48) | not null
 management     | character varying(24) | not null default 'by_value'::character varying

iddb=> insert into attributes ( attribute_name ) values ( 'abcdefghijklmnopqrstuvwxyz' );
ERROR:  value too long for type character varying(24)

I'm using PostgreSQL 9.0.4

I tried to replicate this with a new database and a simple table, but
could not.

I had to drop (and then recreate) three rules and a view on this table
before altering the column.

This is a production database, so I need to treat it gently.

--
Ron Peterson
Network & Systems Administrator
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso

В списке pgsql-general по дате отправления:

Предыдущее
От: MirrorX
Дата:
Сообщение: Re: warm standby - apply wal archives
Следующее
От: Tom Lane
Дата:
Сообщение: Re: alter column appears to work, but doesn't?