Search Postgresql Archives

Re: issue with SELECT settval(..);

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx

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 //



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux