I want to get the sequence for the id column in the tags table as
SELECT pg_get_serial_sequence(‘tags’, ‘id’);
And then I want to use the result from the above Query (the sequence) as an input to the second query. Let s say the first query is called sequence I want to perform the second query as:
SELECT setval(**sequence**, SELECT max(id) FROM tags);
Any idea on how to do this ?