e.ellenkamp@copernicus-it.nl (Egbert Ellenkamp) writes:
> select setval('mytable_myrowid_seq',select max(myrowid) from mytable);
That should work if you put in the required parentheses around the
sub-select:
select setval('mytable_myrowid_seq', (select max(myrowid) from mytable));
regards, tom lane