plperl, cvs head w/spi patch, return rows on update returns nothing (resend) - Mailing list pgsql-hackers

From elein
Subject plperl, cvs head w/spi patch, return rows on update returns nothing (resend)
Date
Msg-id 20040704193919.S21709@cookie.varlena.com
Whole thread Raw
List pgsql-hackers
The README.spi said that $rv->{rows} should return the number of
rows affected for INSERT, UPDATE & DELETE.  It seems to return NULL.
@{$rv->{rows}} also returns NULL.


-- drop table users ( email text, who text );
create table users ( email text, who text );
insert into users values ('someone@somewhere.com', USER);

create or replace function upd_user( text )
returns integer as
'
my $email = $_[0];
my $qry = "update users set email=''".$email."'' where who = USER ; ";
my $rv = spi_exec_query( $qry );
elog NOTICE, $qry;
elog NOTICE, $rv->{status};
elog NOTICE, $rv->{rows};
return $rv->{rows};
' language 'plperl';

select val_user('me@home');


pgsql-hackers by date:

Previous
From: Justin Clift
Date:
Subject: Re: LinuxTag wrapup
Next
From: Justin Clift
Date:
Subject: Re: Adding column comment to information_schema.columns