X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 208843A3AC2 for ; Mon, 25 Oct 2004 21:08:45 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 60345-09 for ; Mon, 25 Oct 2004 20:08:42 +0000 (GMT) Received: from happy.onesystem.ca (happy.onesystem.ca [205.206.61.17]) by svr1.postgresql.org (Postfix) with ESMTP id 5EFD13A41F4 for ; Mon, 25 Oct 2004 21:08:42 +0100 (BST) Received: from elb_lx.onesystem.ca ([10.1.1.50]) by happy.onesystem.ca with asmtp (Exim 4.14) id 1CMB8z-0006CF-Es; Mon, 25 Oct 2004 14:08:41 -0600 Message-ID: <417D5D49.1090908@onesystem.com> Date: Mon, 25 Oct 2004 14:08:41 -0600 From: Edmund Bacon User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Marinos Yannikos Cc: pgsql-sql@postgresql.org Subject: Re: plpgsql: PERFORM vs. SELECT INTO (PERFORM not setting FOUND References: <417D57B1.8010507@geizhals.at> In-Reply-To: <417D57B1.8010507@geizhals.at> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/184 X-Sequence-Number: 19287 Marinos Yannikos wrote: > (btw.: I'm trying a few ways to ensure that all values in both t1 and t2 > are unique: > alter table blup add constraint check (blup_unique3(t1,t2)); > - perhaps there are more elegant ways, any suggestions?) > No doubt someone will tell me this is Very Wrong: create table blup_text(txt text primary key); create table blup (t1 text references blup_text(txt), t2 text references blup_text(txt)); You may want to add NOT NULL conditions to t1, t2. If your text values are long, this may be a good place to use synthetic keys - e.g. create table blup_text(id serial primary key, txt text unique); create table blup(t1 integer references blup_text(id), t2 integer references blub_text(id)); -- Edmund Bacon