plperl, cvs head w/spi patch, return rows on update returns nothing (resend)

From: elein <elein(at)varlena(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: andrew(at)dunslane(dot)net, elein <elein(at)varlena(dot)com>
Subject: plperl, cvs head w/spi patch, return rows on update returns nothing (resend)
Date: 2004-07-05 02:39:19
Message-ID: 20040704193919.S21709@cookie.varlena.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)somewhere(dot)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(at)home');

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Clift 2004-07-05 02:52:46 Re: Adding column comment to information_schema.columns
Previous Message Justin Clift 2004-07-05 02:29:20 Re: LinuxTag wrapup