[GENERAL] "alter table...if exists... add bigserial "still adds extra sequence

Поиск
Список
Период
Сортировка
От hvjunk
Тема [GENERAL] "alter table...if exists... add bigserial "still adds extra sequence
Дата
Msg-id BCD0C88B-C3DF-4FE2-9AAF-D6439680B897@gmail.com
обсуждение исходный текст
Ответы [GENERAL] Re: "alter table...if exists... add bigserial "still adds extrasequence  (hvjunk <hvjunk@gmail.com>)
Список pgsql-general
Good day,
 See the sequence below, Postgresql 9.6.5 on Debian using the postgresql repository.

Question: Is this expected behaviour?



postgres@tracsdbhvt01:~$ cat test-serial.sql
create database test;
\c test
create table test_serial ( teststring varchar(5));
alter table test_serial add column if not exists uid BIGSERIAL;
alter table test_serial add column if not exists uid BIGSERIAL;
\d

postgres@tracsdbhvt01:~$ psql -p 5433 < test-serial.sql
CREATE DATABASE
You are now connected to database "test" as user "postgres".
CREATE TABLE
ALTER TABLE
NOTICE:  column "uid" of relation "test_serial" already exists, skipping
ALTER TABLE                 List of relationsSchema |         Name         |   Type   |  Owner
--------+----------------------+----------+----------public | test_serial          | table    | postgrespublic |
test_serial_uid_seq | sequence | postgrespublic | test_serial_uid_seq1 | sequence | postgres 
(3 rows)




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

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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: [GENERAL] shared_buffers smaller than max_wal_size
Следующее
От: hvjunk
Дата:
Сообщение: [GENERAL] Re: "alter table...if exists... add bigserial "still adds extrasequence