Unexpected ALTER TABLE behavior

Поиск
Список
Период
Сортировка
От Ed Loehr
Тема Unexpected ALTER TABLE behavior
Дата
Msg-id 3B56140A.80AD7814@austin.rr.com
обсуждение исходный текст
Список pgsql-general
This looks like a silent partial failure case in 7.1.2.  Maybe someone
can confirm or explain?  I would expect the following to succeed
completely or generate an error message with no side-effects.  Instead,
it appears to add the column but without the "not null" constraint.

    create table mytable (id integer);
    alter table mytable add column name varchar not null;

Here's what I saw:

% psql -V
psql (PostgreSQL) 7.1.2
...
% createdb testdb
CREATE DATABASE
% psql -d testdb -c "create table mytable (id integer);"
CREATE
% psql -d testdb -c "alter table mytable add column name varchar not
null;"
ALTER
% psql -d testdb -c "\d mytable"
             Table "mytable"
 Attribute |       Type        | Modifier
-----------+-------------------+----------
 id        | integer           |
 name      | character varying |


Regards,
Ed Loehr

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

Предыдущее
От: Ed Loehr
Дата:
Сообщение: Re: undeleteable records
Следующее
От: Adam Manock
Дата:
Сообщение: Re: replication?