Re: plpgsql and rowtypes - Mailing list pgsql-general

From Dave Trombley
Subject Re: plpgsql and rowtypes
Date
Msg-id 3C329FE8.40301@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>)
Re: plpgsql and rowtypes  (Jan Wieck <janwieck@yahoo.com>)
List pgsql-general
Dave Trombley wrote:

>    I'm using the current release version (7.1.3), downloaded and
> compiled it today after having this problem.  I'm going to try it
> again on a fresh box, in case something funcky is going on with
> library versions, etc.
>
    Ok, yeah, now I'm pretty sure I'm not insane.  Well, maybe not /so/
sure.  =)  But, I've messed up pl_exec.c to dump some information about
the branches it's taking in an IF statement.  It seems that the false
body part in the PLpgSQL_stmt_if structure is not being set correctly in
a IF-THEN-ELSIF-ELSE (same example as before):

test=# select itet(7);
Evaluating condition (SELECT   $1  = 4)...
Exec'ing false part...
False part statements: 64 allocated, 1 actually used.
False part statement 0: cmdtype 9, line 4
 itet
------
 f
(1 row)

    The command type is correct for that line, but the line number
itself is incorrect, line 4 is the ELSE part, not the ELSIF.  Looking at
the version of the source I have, the grammar seems to be old, version
1.17 of gram.y.  The CVS log tells me that this is exactly one version
before ELSIF support was added, but it seems oddball that I wouldn't be
griped at for putting some random words into my function (namely ELSIF).
 I'd persue it further, but frankly yacc/bison tends to give me
migraines, and I'm still reeling somewhat from the new year's party... =)

    Any idea why I have this older version?  I don't know when the
releases were made, but the same file is in 7.1.2 and 7.1.1.  7.1 has a
single minor revision earlier.  (Or is the documentation just ahead of
the releases?)   I guess I'll just go grab the CVS sources and mess
around with those for now.

    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