agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Sebastien FLAESCH <sf@4js.com>
To: pgsql-sql@lists.postgresql.org
Subject: Re: Serial sequence name when table/column name in uppercase
Date: Wed, 31 Mar 2021 17:13:06 +0200
Message-ID: <9a4f52ca-29be-34c6-08a7-0fbf7974e630@4js.com> (raw)
In-Reply-To: <3167888.1617198904@sss.pgh.pa.us>
References: <cc5742f1-7b3f-5051-e033-e99ff69245e7@4js.com>
	<CAB8KJ=hnuX0aKLj490Q2ryX0aFRg-z-aur=JtiW=7r4-prT+mQ@mail.gmail.com>
	<87d8f930-a87c-2d08-f362-d59655ca6c24@4js.com>
	<3167888.1617198904@sss.pgh.pa.us>

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





view thread (7+ messages)

Message-ID: <9a4f52ca-29be-34c6-08a7-0fbf7974e630@4js.com>
Permalink:  ../9a4f52ca-29be-34c6-08a7-0fbf7974e630@4js.com/
Also on:    postgresql.org/message-id/9a4f52ca-29be-34c6-08a7-0fbf7974e630@4js.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sf@4js.com, pgsql-sql@lists.postgresql.org
  Subject: Re: Serial sequence name when table/column name in uppercase
  In-Reply-To: <9a4f52ca-29be-34c6-08a7-0fbf7974e630@4js.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox