Re: Different results in a loop with RECORD vs ROWTYPE... - Mailing list pgsql-bugs

From Sean Chittenden
Subject Re: Different results in a loop with RECORD vs ROWTYPE...
Date
Msg-id 20030522105654.GI71079@perrin.int.nxad.com
Whole thread Raw
In response to Different results in a loop with RECORD vs ROWTYPE...  (Sean Chittenden <sean@chittenden.org>)
Responses Re: Different results in a loop with RECORD vs ROWTYPE...
List pgsql-bugs
> I'm looping through a single column from a set of results.  If I
> store the result in a ROWTYPE of the table, I get NULL values back.
> If I store them in a RECORD type, I get the proper values and life
> is happy.  I'm not sure why there'd be any difference, but it
> screams bug to me and I haven't been able to reproduce it outside of
> my production schema.

Hrm, sorry for replying to myself, but moving the rest of uses of
ROWTYPE to RECORD has solved what I originally thought was a logic
problem with recursive pl/pgsql calls, but was a problem stemming from
using ROWTYPE instead of RECORD.  Using ROWTYPE, I wasn't getting
results back that I was expecting, using RECORD, I was getting the
expected rows back so that I could operate on them in a loop.  ROWTYPE
seems to be broken somehow, somewhere, though I'm not sure in what way
or where.  Apologies in advance for the lack of more details... I'm
not sure where to look to get more details in this instance.

My best guess is there's a bug in exec_assign_value in that it doesn't
handle assigning to PLPGSQL_DTYPE_ROW... but I'm not seeing anything
in the error logs and there aren't any errors being thrown.  So,
failing that, maybe something in exec_move_row or exec_stmt_fors in
pl_exec.c, but I can't see anything that really jumps out other than
that.

Other ideas?  -sc

--=20
Sean Chittenden

pgsql-bugs by date:

Previous
From: Sean Chittenden
Date:
Subject: Different results in a loop with RECORD vs ROWTYPE...
Next
From: Tom Lane
Date:
Subject: Re: Different results in a loop with RECORD vs ROWTYPE...