David Fetter wrote:
On Thu, Aug 24, 2006 at 11:31:02AM -0700, David Fetter wrote:
Folks,

I've found a little lacuna in the RETURNING feature, that being in
PL/Perl's spi_prepare()/spi_execute_prepared() as illustrated in the
attached file on CVS TIP.

I think that fixing this is a matter of post-RETURNING-patch cleanup.
What else might not know about RETURNING that needs to?

Cheers,
D


Oops.  This time, with the actual file attached :P

my $foo_id = spi_exec_prepared(
    $sth,
    $_[0],
)->{rows}->[0]->{foo_id};


I am not sure that the 'rows' member is the right place for it, even if it were returned. For one thing, it should always be an arrayref, but overloading the first row like this is ugly.

Maybe 'returned_value' or some such would be better, e.g. $foo_id = $result->{returned_value}->{foo_id}

(We can't just stash it in the result hash with the used name in case somebody overrides the preexisiting members)

cheers

andrew


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

Reply via email to