Re: Serial sequence name when table/column name in uppercase

From: Sebastien FLAESCH <sf(at)4js(dot)com>
To: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: Serial sequence name when table/column name in uppercase
Date: 2021-03-31 15:13:06
Message-ID: 9a4f52ca-29be-34c6-08a7-0fbf7974e630@4js.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Side notes:

1) Seems ALTER SEQUENCE xxx START WITH 100 does not have any
impact on serial/bigserial sequences... expected?

2) I know there is a setval() function. But I was looking for
ALTER SEQUENCE to not produce a result set.

Any way to execute setval() without a preceding SELECT?

test1=> setval('public.tab1_pkey_seq',100,false);
ERROR: syntax error at or near "setval"
LINE 1: setval('public.tab1_pkey_seq',100,false)
^

test1=> select setval('public.tab1_pkey_seq',100,false);
setval
--------
100
(1 row)

I am using the C interface libpq.so ... I assume it's not a
problem to use SELECT setval() but was wondering if there is
a smarter solution.

Seb

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message JORGE MALDONADO 2021-04-06 04:34:19 URL Decode function
Previous Message Sebastien FLAESCH 2021-03-31 14:57:57 Re: Serial sequence name when table/column name in uppercase