Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRcWv-0004mX-E7 for pgsql-sql@arkaria.postgresql.org; Wed, 31 Mar 2021 15:13:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lRcWu-0004hu-Ca for pgsql-sql@arkaria.postgresql.org; Wed, 31 Mar 2021 15:13:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRcWu-0004eN-6C for pgsql-sql@lists.postgresql.org; Wed, 31 Mar 2021 15:13:12 +0000 Received: from mail150.strasbourg.4js.com ([77.159.205.150]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRcWs-0003CL-1Z for pgsql-sql@lists.postgresql.org; Wed, 31 Mar 2021 15:13:11 +0000 Received: from [192.168.1.34] (lfbn-str-1-71-12.w92-140.abo.wanadoo.fr [92.140.198.12]) (authenticated bits=0) by mail150.strasbourg.4js.com (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id 12VFD6SQ022400 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 31 Mar 2021 17:13:08 +0200 Subject: Re: Serial sequence name when table/column name in uppercase To: pgsql-sql@lists.postgresql.org References: <87d8f930-a87c-2d08-f362-d59655ca6c24@4js.com> <3167888.1617198904@sss.pgh.pa.us> From: Sebastien FLAESCH Organization: Four Js Development Tools Message-ID: <9a4f52ca-29be-34c6-08a7-0fbf7974e630@4js.com> Date: Wed, 31 Mar 2021 17:13:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <3167888.1617198904@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.99.4 at mail150 X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail150.strasbourg.4js.com [10.10.0.1]); Wed, 31 Mar 2021 17:13:09 +0200 (CEST) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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