Re: plpgsql and rowtypes

From: Dave Trombley <dtrom(at)bumba(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: plpgsql and rowtypes
Date: 2002-01-02 01:15:11
Message-ID: 3C325F1F.2000001@bumba.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)bumba(dot)net>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-01-02 04:10:59 Re: plpgsql and rowtypes
Previous Message Tom Lane 2002-01-02 00:35:50 Re: plpgsql and rowtypes