Setting a default for nextval sequence

Поиск
Список
Период
Сортировка
От Robert Lakes
Тема Setting a default for nextval sequence
Дата
Msg-id CAHnqRj0_nsLQDitnF1_66ExfsKFCfNcDH0k_4nEeKFw_-O3Xzg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Setting a default for nextval sequence  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
I'm attempting to set the default value for a serial column. I created a generic function that I am passing a table name as the only parameter. I had it working correctly, however, it does not seem to like the sequence name being the same name for each audit table that is created through the function. So I changed the code to include the table name as part of the naming convention. Now, I need help on how to alter the serial column the new value EXECUTE 'CREATE SEQUENCE '|| t_name ||'tab_id_seq'|| ' OWNED BY '|| t_name || '_cdc'||'.table_id'; EXECUTE 'ALTER TABLE ' || quote_ident(t_name || '_cdc') || ' ALTER COLUMN table_id SET DEFAULT nextval(''tab_id_seq'');';

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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: ERROR: too many dynamic shared memory segments
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ERROR: too many dynamic shared memory segments