Re: plpgsql and rowtypes - Mailing list pgsql-general

From Dave Trombley
Subject Re: plpgsql and rowtypes
Date
Msg-id 3C325F1F.2000001@bumba.net
Whole thread Raw
In response to plpgsql and rowtypes  (Dave Trombley <dtrom@bumba.net>)
Responses Re: plpgsql and rowtypes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:

>
>Not sure why plpgsql insists on the explicit marker that a rowtype is
>meant, but it does.
>

    Oh, spiffy.  This works now, thanks.

    One other thing that seems odd to me follows, the relevant
documentation is section 23.6.2.4.  Again, I could be misunderstanding
the semantics, but it seems intuitively wrong that this construct should
behave as I'm seeing:

test=# CREATE FUNCTION ifelsetest(int) RETURNS bool AS '
test'#  BEGIN
test'#   IF $1 = 4 THEN RETURN true;
test'#   ELSIF $1 = 7 THEN RETURN true;
test'#   ELSE return false;
test'#   END IF;
test'#  END; ' language 'plpgsql';
CREATE
test=# select ifelsetest(2);
 ifelsetest
------------
 f
(1 row)

test=# select ifelsetest(4);
 ifelsetest
------------
 t
(1 row)

test=# select ifelsetest(7);
 ifelsetest
------------
 f
(1 row)

    Cheers,
        dj trombley
        <dtrom@bumba.net>


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpgsql and rowtypes
Next
From: Tom Lane
Date:
Subject: Re: plpgsql and rowtypes