On 10/19/07, Gregory Stark <[EMAIL PROTECTED]> wrote:
> "Kynn Jones" <[EMAIL PROTECTED]> writes:
>
> > CREATE OR REPLACE FUNCTION canonicalize( anyelement, anyelement )
> > RETURNS anyarray AS
> > $$
> > BEGIN
> > IF $1 < $2 THEN RETURN ARRAY[ $1, $2 ];
> > ELSERETURN ARRAY[ $2, $
"Kynn Jones" <[EMAIL PROTECTED]> writes:
> CREATE OR REPLACE FUNCTION canonicalize( anyelement, anyelement )
> RETURNS anyarray AS
> $$
> BEGIN
> IF $1 < $2 THEN RETURN ARRAY[ $1, $2 ];
> ELSERETURN ARRAY[ $2, $1 ];
> END IF;
> END;
> $$ LANGUAGE plpgsql;
You need to add IMMUT
Kynn Jones wrote:
I have a table used to store information about pairs of items. This
information is independent of the order of the two items in the pair,
so having two records
X Y
Y X
in the table would be redundant. But as far as I can tell, this
situation would n
I have a table used to store information about pairs of items. This
information is independent of the order of the two items in the pair,
so having two records
X Y
Y X
in the table would be redundant. But as far as I can tell, this
situation would not violate a uniquen