Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 45101477682 for ; Fri, 21 Jun 2002 18:30:34 -0400 (EDT) Received: from xyzzy.dhs.org (cvx-west-205-210-52-213.kingston.net [205.210.52.213]) by postgresql.org (Postfix) with ESMTP id 64FBC47741B for ; Fri, 21 Jun 2002 17:35:18 -0400 (EDT) Received: from xyzzy.dhs.org (quux.lan.internal [::ffff:192.168.1.6]) by xyzzy.dhs.org with esmtp; Fri, 21 Jun 2002 17:35:19 -0400 Message-ID: <3D139C03.4090503@xyzzy.dhs.org> Date: Fri, 21 Jun 2002 17:34:59 -0400 From: Andrew Hammond User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.1a) Gecko/20020611 X-Accept-Language: en-ca, en-us, en MIME-Version: 1.0 To: Kevin Brannen Cc: pgsql-sql@postgresql.org Subject: Re: is it easy to change the create sequence algorithm? References: <3D0FCD63.8030505@nurseamerica.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200206/308 X-Sequence-Number: 8273 Well, the quickest solution I can think of off hand is to not use SERIAL. Instead, do it manually, like this: DROP SEQUENCE my_seq; CREATE SEQUENCE my_seq; DROP TABLE my_table; CREATE TABLE my_table ( my_table_id INTEGER DEFAULT nextval('my_seq') PRIMARY KEY, ... ); Kevin Brannen wrote: > I see in the docs that when I create a column that is of type SERIAL, > the engine automatically creates the sequence for me, named > TABLE_COLUMN_seq. That's great until the table name + column name > lengths are > 27 chars, then it starts chopping, and you guessed it, I > have multiple table/column combinations that don't differ until after > that length. > > Is there a way to influence the "create sequence" generator with a > directive, hint, set value, whatever, to be something else? (e.g. > COLUMN_seq if I guarantee all the columns are unique) > > Yes I know that I could create the sequence myself, but the engine > does such a good job. :-) > > Thanks, > Kevin > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org