[GENERAL] plperl: spi_query_prepared/spi_fetchrow versus spi_exec_prepared: memory?

2009-11-16 Thread Nathan Jahnke
hi all, having some memory leak issues with my app and spi_exec_prepared. checking the docs: "Normally, spi_fetchrow should be repeated until it returns undef, indicating that there are no more rows to read. The cursor is automatically freed when spi_fetchrow returns undef. If you do not wish to

Re: [GENERAL] bytea corruption?

2009-08-23 Thread Nathan Jahnke
th->bind_param(2,$md5sum); >        $sth->bind_param(3,$bin, { pg_type => PG_BYTEA }); >        $sth->execute(); >        } > > > I hope this helps if you haven't figured it out yet > > > On Saturday 22 August 2009 03:48:25 pm Daniel Verite wrote: >>       Nat

Re: [GENERAL] bytea corruption?

2009-08-22 Thread Nathan Jahnke
cute($id); my $newref = $getall_sth->fetchrow_hashref; my $newdata = $newref->{data}; print md5_hex($data).' '; print '!' if md5_hex($data) ne md5_hex($newdata); print '= '.md5_hex($newdata); print "\n"; -- nathan On Sat, Aug 22, 2009 at 9:17 AM, Dan

Re: [GENERAL] bytea corruption?

2009-08-21 Thread Nathan Jahnke
7ec965 nathan On Fri, Aug 21, 2009 at 6:11 PM, Tim Landscheidt wrote: > Nathan Jahnke wrote: > >> [...] >> my $encodeddata = $data; >> $encodeddata =~ s!(\\|[^ -~])!sprintf("\\%03o",ord($1))!ge; #prepare >> data for bytea column storage > >> [...] &

[GENERAL] bytea corruption?

2009-08-21 Thread Nathan Jahnke
got some binary data that changes when i insert and retrieve it later from bytea column: http://nate.quandra.org/data.bin.0.702601051229191 running 8.3 on debian 5.0. example: root=# create database testdb; CREATE DATABASE root=# \c testdb You are now connected to database "testdb". testdb=# cr

[GENERAL] Privilege problems: access denied on select for owner?

2009-08-03 Thread Nathan Jahnke
Hi all, Having some trouble today accessing tables in a database: sample=# \l+ List of databases Name| Owner | Encoding | Tablespace |Description ---+--+--++--- postgres | postgres | UTF8

[GENERAL] plperl spi_prepare and arrays

2009-07-22 Thread Nathan Jahnke
Hi all, Spent the last few hours searching but was unable to get a satisfactory answer. Basically, if I do this: my $arr = [1,2,3,4]; $_SHARED{test} = spi_prepare('update users set interest=$1 where uid=2', 'int[]'); spi_exec_prepared($_SHARED{test}, $arr); I get: DBD::Pg::st execute failed: ER