Received: from Europa.go.com.mt (unknown [194.158.48.18]) by postgresql.org (Postfix) with ESMTP id 6DEB54759B1 for ; Mon, 11 Mar 2002 09:21:25 -0500 (EST) Subject: One sequence for different tables To: pgsql-admin@postgresql.org From: Robert.Farrugia@go.com.mt Date: Mon, 11 Mar 2002 15:20:35 +0100 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii Message-Id: <20020311142129.6DEB54759B1@postgresql.org> X-Archive-Number: 200203/129 X-Sequence-Number: 3663 Hi, Is it possible to create one sequence to be used for more than one table ? Let's say I create a pkey_seq sequence. Can I use it in table A (pkey default nextval('pkey_seq') PRIMARY KEY) and in table B as (pkey default nextval('pkey_seq') PRIMARY KEY) ? Is it safe in that each table will have unique values i.e. if I have a third table C which is used to link data both from A and B using the pkey field, will there be records having the same pkey but from different tables? Thanks alot Robert