Re: issue with SELECT settval(..);

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: issue with SELECT settval(..);
Дата
Msg-id 45FE7217.9000604@magproductions.nl
обсуждение исходный текст
Ответ на Re: issue with SELECT settval(..);  (Christian Schröder <cs@deriva.de>)
Список pgsql-general
Christian Schröder wrote:
> Alain Roger wrote:
>> insert into immense.statususer (statususer_id, statususer_type) values
>> (SELECT nextval( 'statususer_statususer_id_seq' ),'customer');
> The correct syntax would be:
>
> insert into immense.statususer (statususer_id, statususer_type) values
> ((SELECT nextval( 'statususer_statususer_id_seq' )),'customer');

Well, that original query was almost right, it just didn't need the
values statement and the parenthesis:

 insert into immense.statususer (statususer_id, statususer_type)
 SELECT nextval('statususer_statususer_id_seq'), 'customer';

But as mentioned; using nextval directly is better.
--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
   7500 AK Enschede

// Integrate Your World //


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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: planning issue
Следующее
От: "Ezequias R. da Rocha"
Дата:
Сообщение: Client/Server [max connections]