Re: [SQL] plpgsql: PERFORM vs. SELECT INTO (PERFORM not setting FOUND variable?)

2004-10-25 Thread Tom Lane
Marinos Yannikos <[EMAIL PROTECTED]> writes: > create function blup_unique2 (text,text) returns boolean as 'begin > perform (select 1 from blup where t1=$1 or t1=$2 or t2=$1 or t2=$2 or > $1=$2 limit 1); return NOT FOUND; end' LANGUAGE plpgsql; You've got a syntax problem. PERFORM is syntactica

Re: [SQL] plpgsql: PERFORM vs. SELECT INTO (PERFORM not setting FOUND

2004-10-25 Thread Edmund Bacon
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_t

[SQL] plpgsql: PERFORM vs. SELECT INTO (PERFORM not setting FOUND variable?)

2004-10-25 Thread Marinos Yannikos
Hi, I'm probably misintepreting the documented equivalence of PERFORM and SELECT INTO as far as the special variable FOUND is concerned, but the following 2 definitions do not seem to produce the same result. create table blup ( t1 text, t2 text ); create function blup_unique2 (text,text) return