pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
18+ messages / 6 participants
[nested] [flat]

* DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
@ 2003-05-29 08:57 Rudy Lippan <rlippan@remotelinux.com>
  2003-05-29 09:00 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
  2003-05-29 15:34 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) David Wheeler <david@wheeler.net>
  0 siblings, 2 replies; 18+ messages in thread

From: Rudy Lippan @ 2003-05-29 08:57 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: Rudy Lippan <rlippan@remotelinux.com>; David Wheeler <david@wheeler.net>; Dominic Mitchell <dom@semantico.com>; pgsql-interfaces; 'DBI developers' <dbi-dev@perl.org>

On Mon, 26 May 2003, Bruce Momjian wrote:

> Rudy, where are we on the release of DBD:pg withs your patches?  Are
> they ready to go?


I spun an ALPHA copy of DBD::Pg. So much has changed in there that I am
sure something is broken for someone; therefore, I think we should let
people hammer on it for a few days before making an official release.

I put the alpha up here:  
http://www.remotelinux.com/rlippan/DBD-Pg-1.30_1.tar.gz


And for anyone who is interested here is the change log:

    - $dbh->prepare() rewrites the SQL statement into an internal for
      striping out comments and whitespace, and if PostgreSQL > 7.3 takes 
the
      stripped statement and passes that to postgress' PREPARE statement,
      then rewrites the statement as 'EXECUTE "DBD::PG::cached_query n"
      ($1, $2, ... $n, $n+1)' for DBD::Pg's execute.  -- Currently 
disabled
      until PREPARE works a little better
    - Allows the use of :n and :foo bind params. So: (SELECT * FROM foo 
where
      1 = :this and 2 = :that) will now work.
    - Complains on execute when unbound bind params are submitted (instead 
of
      defaulting to NULL)
    - Switched over to use driver.xst.
    - pg_error() only removes \n's don't truncate message on first \n
    - fixed statement scan problem where the preparse of
      "SELECT foo[3:33] from bar"  was scanning :33 as a placeholder
    - moved the quoting of bind values out of execute() and into
      bind -- as there is no need to requote the value every time execute
      is called.
    - :veryverylongplaceholdername ==  Long walk. Sort pier -- fixed.
    - quote() is now in C and uses same code as bind_param.
    - quoting and dequoting now use libpq quoting functions where 
available
      (I still need to take the libpq functions swiped out of quote.c and 
move
      it into libpqswip.c with license info &c., and switch ifndefs to 
ifdefs)
    - bind_param() will convert from 1,0 to TRUE/FALSE when pg_type is
      PGBOOLOID.
    - fixed many heap buffer overruns.





^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-05-29 08:57 DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
@ 2003-05-29 09:00 ` Dominic Mitchell <dom@semantico.com>
  2003-05-29 15:36   ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) David Wheeler <david@wheeler.net>
  2003-05-30 09:04   ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Tim Bunce <Tim.Bunce@pobox.com>
  2003-05-30 16:06   ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
  1 sibling, 3 replies; 18+ messages in thread

From: Dominic Mitchell @ 2003-05-29 09:00 UTC (permalink / raw)
  To: Rudy Lippan <rlippan@remotelinux.com>; +Cc: Bruce Momjian <pgman@candle.pha.pa.us>; David Wheeler <david@wheeler.net>; pgsql-interfaces@postgresql.org, 'DBI developers' <dbi-dev@perl.org>

Rudy Lippan wrote:
> On Mon, 26 May 2003, Bruce Momjian wrote:
> 
> 
>>Rudy, where are we on the release of DBD:pg withs your patches?  Are
>>they ready to go?
> 
> 
> 
> I spun an ALPHA copy of DBD::Pg. So much has changed in there that I am
> sure something is broken for someone; therefore, I think we should let
> people hammer on it for a few days before making an official release.
> 
> I put the alpha up here:  
> http://www.remotelinux.com/rlippan/DBD-Pg-1.30_1.tar.gz
> 
> 
> And for anyone who is interested here is the change log:

One more thing for the change log:  notice messages generated by the 
database now use the perl warning mechanism instead of going to stderr, 
so they can be trapped if needed.

-Dom




^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-05-29 08:57 DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
  2003-05-29 09:00 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
@ 2003-05-29 15:36   ` David Wheeler <david@wheeler.net>
  2003-05-29 15:44     ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
  2 siblings, 1 reply; 18+ messages in thread

From: David Wheeler @ 2003-05-29 15:36 UTC (permalink / raw)
  To: Dominic Mitchell <dom@semantico.com>; +Cc: Rudy Lippan <rlippan@remotelinux.com>; Bruce Momjian <pgman@candle.pha.pa.us>; pgsql-interfaces@postgresql.org, "'DBI developers'" <dbi-dev@perl.org>

On Thursday, May 29, 2003, at 02:00  AM, Dominic Mitchell wrote:

> One more thing for the change log:  notice messages generated by the 
> database now use the perl warning mechanism instead of going to 
> stderr, so they can be trapped if needed.

Oh, sweet! How did you do that? I've been doing this to catch them:

<hack caveat="ugly">

   open STDERR, "| perl -ne 'print unless /: NOTICE:  /'"
     or die "Cannot pipe STDERR: $!\n";

</hack>

Regards,

David
-- 
David Wheeler                                     AIM: dwTheory
david@kineticode.com                              ICQ: 15726394
http://kineticode.com/                         Yahoo!: dew7e
                                                Jabber: Theory@jabber.org
Kineticode. Setting knowledge in motion.[sm]




^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-05-29 08:57 DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
  2003-05-29 09:00 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
  2003-05-29 15:36   ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) David Wheeler <david@wheeler.net>
@ 2003-05-29 15:44     ` Dominic Mitchell <dom@semantico.com>
  0 siblings, 0 replies; 18+ messages in thread

From: Dominic Mitchell @ 2003-05-29 15:44 UTC (permalink / raw)
  To: David Wheeler <david@wheeler.net>; +Cc: Rudy Lippan <rlippan@remotelinux.com>; Bruce Momjian <pgman@candle.pha.pa.us>; pgsql-interfaces@postgresql.org, 'DBI developers' <dbi-dev@perl.org>

David Wheeler wrote:
> On Thursday, May 29, 2003, at 02:00  AM, Dominic Mitchell wrote:
> 
>> One more thing for the change log:  notice messages generated by the 
>> database now use the perl warning mechanism instead of going to 
>> stderr, so they can be trapped if needed.
> 
> 
> Oh, sweet! How did you do that? I've been doing this to catch them:
> 
> <hack caveat="ugly">
> 
>   open STDERR, "| perl -ne 'print unless /: NOTICE:  /'"
>     or die "Cannot pipe STDERR: $!\n";
> 
> </hack>

Just hook up the existing libpq function PQsetNoticeProcessor() to a 
XS's warn in dbdimp.c.  It's about 5 lines of code.  I don't know 
whether it's 100% correct (I'm no XS guru), but it Works For Me[tm].

-Dom




^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-05-29 08:57 DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
  2003-05-29 09:00 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
@ 2003-05-30 09:04   ` Tim Bunce <Tim.Bunce@pobox.com>
  2003-05-30 09:20     ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
  2 siblings, 1 reply; 18+ messages in thread

From: Tim Bunce @ 2003-05-30 09:04 UTC (permalink / raw)
  To: Dominic Mitchell <dom@semantico.com>; +Cc: Rudy Lippan <rlippan@remotelinux.com>; Bruce Momjian <pgman@candle.pha.pa.us>; David Wheeler <david@wheeler.net>; pgsql-interfaces@postgresql.org, "'DBI developers'" <dbi-dev@perl.org>

On Thu, May 29, 2003 at 10:00:21AM +0100, Dominic Mitchell wrote:
> 
> One more thing for the change log:  notice messages generated by the 
> database now use the perl warning mechanism instead of going to stderr, 
> so they can be trapped if needed.

Hopefully implemented as

	if (DBIc_WARN(imp_xxh))
	    warn("...", ...)

The $h->{Warn} attribute defaults to true. Can be useful to silence
warnings for a handle without having to play games with $SIG{__WARN__}.

Tim.



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-05-29 08:57 DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
  2003-05-29 09:00 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
  2003-05-30 09:04   ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Tim Bunce <Tim.Bunce@pobox.com>
@ 2003-05-30 09:20     ` Dominic Mitchell <dom@semantico.com>
  2003-05-30 14:03       ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Tim Bunce <Tim.Bunce@pobox.com>
  0 siblings, 1 reply; 18+ messages in thread

From: Dominic Mitchell @ 2003-05-30 09:20 UTC (permalink / raw)
  To: Tim Bunce <Tim.Bunce@pobox.com>; +Cc: Rudy Lippan <rlippan@remotelinux.com>; Bruce Momjian <pgman@candle.pha.pa.us>; David Wheeler <david@wheeler.net>; pgsql-interfaces@postgresql.org, 'DBI developers' <dbi-dev@perl.org>

Tim Bunce wrote:
> On Thu, May 29, 2003 at 10:00:21AM +0100, Dominic Mitchell wrote:
> 
>>One more thing for the change log:  notice messages generated by the 
>>database now use the perl warning mechanism instead of going to stderr, 
>>so they can be trapped if needed.
> 
> 
> Hopefully implemented as
> 
> 	if (DBIc_WARN(imp_xxh))
> 	    warn("...", ...)
> 
> The $h->{Warn} attribute defaults to true. Can be useful to silence
> warnings for a handle without having to play games with $SIG{__WARN__}.

See, I told you I wasn't an XS guru.  :-)

Actually, I looked at this, but my limited C and DBI skills couldn't 
work out a) what the required handle was (probably dbh) and b) how to 
pass that into the PQsetNoticeProcessor function as data and get it out 
again.

I'll happily take another look though, now that it's been brought up as 
desirable.

-Dom (time to reread K&R, methinks)




^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-05-29 08:57 DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
  2003-05-29 09:00 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
  2003-05-30 09:04   ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Tim Bunce <Tim.Bunce@pobox.com>
  2003-05-30 09:20     ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
@ 2003-05-30 14:03       ` Tim Bunce <Tim.Bunce@pobox.com>
  2003-05-30 14:13         ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
  0 siblings, 1 reply; 18+ messages in thread

From: Tim Bunce @ 2003-05-30 14:03 UTC (permalink / raw)
  To: Dominic Mitchell <dom@semantico.com>; +Cc: Tim Bunce <Tim.Bunce@pobox.com>; Rudy Lippan <rlippan@remotelinux.com>; Bruce Momjian <pgman@candle.pha.pa.us>; David Wheeler <david@wheeler.net>; pgsql-interfaces@postgresql.org, "'DBI developers'" <dbi-dev@perl.org>

On Fri, May 30, 2003 at 10:20:11AM +0100, Dominic Mitchell wrote:
> Tim Bunce wrote:
> >On Thu, May 29, 2003 at 10:00:21AM +0100, Dominic Mitchell wrote:
> >
> >>One more thing for the change log:  notice messages generated by the 
> >>database now use the perl warning mechanism instead of going to stderr, 
> >>so they can be trapped if needed.
> >
> >
> >Hopefully implemented as
> >
> >	if (DBIc_WARN(imp_xxh))
> >	    warn("...", ...)
> >
> >The $h->{Warn} attribute defaults to true. Can be useful to silence
> >warnings for a handle without having to play games with $SIG{__WARN__}.
> 
> See, I told you I wasn't an XS guru.  :-)
> 
> Actually, I looked at this, but my limited C and DBI skills couldn't 
> work out a) what the required handle was (probably dbh)

Just whatever handle was used to call the method that's generating the warning.

> and b) how to pass that into the PQsetNoticeProcessor function as data
> and get it out again.

Ah, different issue. For that I'd say if DBIc_WARN(imp_xxh) isn't true
then disable the PQsetNoticeProcessor function.

> I'll happily take another look though, now that it's been brought up as 
> desirable.

Actually I'd misunderstood the circumstances of the warn (not reading
your message carefully enough). For notice messages generated by
the database server they'll soon(ish) be a $h->{HandleEvent} = sub { ... }
hook that should be used.

But that'll bring you back to needing some way for the PQsetNoticeProcessor
function to get at the handle data it'll need to pass to the HandleEvent
hook. The PQsetNoticeProcessor API ought to allow you to some way to do that.

Tim.



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-05-29 08:57 DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
  2003-05-29 09:00 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
  2003-05-30 09:04   ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Tim Bunce <Tim.Bunce@pobox.com>
  2003-05-30 09:20     ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
  2003-05-30 14:03       ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Tim Bunce <Tim.Bunce@pobox.com>
@ 2003-05-30 14:13         ` Dominic Mitchell <dom@semantico.com>
  2003-05-30 16:21           ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Tim Bunce <Tim.Bunce@pobox.com>
  0 siblings, 1 reply; 18+ messages in thread

From: Dominic Mitchell @ 2003-05-30 14:13 UTC (permalink / raw)
  To: Tim Bunce <Tim.Bunce@pobox.com>; +Cc: Rudy Lippan <rlippan@remotelinux.com>; Bruce Momjian <pgman@candle.pha.pa.us>; David Wheeler <david@wheeler.net>; pgsql-interfaces@postgresql.org, 'DBI developers' <dbi-dev@perl.org>

Tim Bunce wrote:
> On Fri, May 30, 2003 at 10:20:11AM +0100, Dominic Mitchell wrote:
>>See, I told you I wasn't an XS guru.  :-)
>>
>>Actually, I looked at this, but my limited C and DBI skills couldn't 
>>work out a) what the required handle was (probably dbh)
> 
> 
> Just whatever handle was used to call the method that's generating the warning.
> 
> 
>>and b) how to pass that into the PQsetNoticeProcessor function as data
>>and get it out again.
> 
> 
> Ah, different issue. For that I'd say if DBIc_WARN(imp_xxh) isn't true
> then disable the PQsetNoticeProcessor function.

Well, we're calling PQsetNoticeProcessor[1], from inside dbd_db_login, 
so I should be able to pass in imp_dbh as the "arg" argument.  The bit 
that I wasn't sure about before was what to cast it to in order to 
retrieve it from a void *.

>>I'll happily take another look though, now that it's been brought up as 
>>desirable.
> 
> 
> Actually I'd misunderstood the circumstances of the warn (not reading
> your message carefully enough). For notice messages generated by
> the database server they'll soon(ish) be a $h->{HandleEvent} = sub { ... }
> hook that should be used.

How will that work?  Is that for any sort of asynchronous message from 
the database?

> But that'll bring you back to needing some way for the PQsetNoticeProcessor
> function to get at the handle data it'll need to pass to the HandleEvent
> hook. The PQsetNoticeProcessor API ought to allow you to some way to do that.

It does, I just couldn't figure it out in the 30 minutes I spent looking 
at it.  I need to go back and spend more time with the docs and less 
being lazy.  :-)

-Dom

[1] Damn mozilla for not being emacs[2].  I want dynamic-abbrevs!
[2] Or vim.  That does it too.




^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-05-29 08:57 DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
  2003-05-29 09:00 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
  2003-05-30 09:04   ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Tim Bunce <Tim.Bunce@pobox.com>
  2003-05-30 09:20     ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
  2003-05-30 14:03       ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Tim Bunce <Tim.Bunce@pobox.com>
  2003-05-30 14:13         ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
@ 2003-05-30 16:21           ` Tim Bunce <Tim.Bunce@pobox.com>
  0 siblings, 0 replies; 18+ messages in thread

From: Tim Bunce @ 2003-05-30 16:21 UTC (permalink / raw)
  To: Dominic Mitchell <dom@semantico.com>; +Cc: Tim Bunce <Tim.Bunce@pobox.com>; Rudy Lippan <rlippan@remotelinux.com>; Bruce Momjian <pgman@candle.pha.pa.us>; David Wheeler <david@wheeler.net>; pgsql-interfaces@postgresql.org, "'DBI developers'" <dbi-dev@perl.org>

On Fri, May 30, 2003 at 03:13:04PM +0100, Dominic Mitchell wrote:
> Tim Bunce wrote:
> >On Fri, May 30, 2003 at 10:20:11AM +0100, Dominic Mitchell wrote:
> >>See, I told you I wasn't an XS guru.  :-)
> >>
> >>Actually, I looked at this, but my limited C and DBI skills couldn't 
> >>work out a) what the required handle was (probably dbh)
> >
> >Just whatever handle was used to call the method that's generating the 
> >warning.
> >
> >>and b) how to pass that into the PQsetNoticeProcessor function as data
> >>and get it out again.
> >
> >
> >Ah, different issue. For that I'd say if DBIc_WARN(imp_xxh) isn't true
> >then disable the PQsetNoticeProcessor function.
> 
> Well, we're calling PQsetNoticeProcessor[1], from inside dbd_db_login, 
> so I should be able to pass in imp_dbh as the "arg" argument.  The bit 
> that I wasn't sure about before was what to cast it to in order to 
> retrieve it from a void *.

You could always cast it to a void * :-)

> >Actually I'd misunderstood the circumstances of the warn (not reading
> >your message carefully enough). For notice messages generated by
> >the database server they'll soon(ish) be a $h->{HandleEvent} = sub { ... }
> >hook that should be used.
> 
> How will that work?  Is that for any sort of asynchronous message from 
> the database?

That kind of thing, yes, plus 'success with info' and anything else
a driver wants to comminucate back to an app 'out of band'. The
tricky part will be categorizing the types of events to make it
usefully portable. But I don't want to start that thread just yet,
so ignore me!

> >But that'll bring you back to needing some way for the PQsetNoticeProcessor
> >function to get at the handle data it'll need to pass to the HandleEvent
> >hook. The PQsetNoticeProcessor API ought to allow you to some way to do 
> >that.
> 
> It does, I just couldn't figure it out in the 30 minutes I spent looking 
> at it.  I need to go back and spend more time with the docs and less 
> being lazy.  :-)
> 
> -Dom
> 
> [1] Damn mozilla for not being emacs[2].  I want dynamic-abbrevs!
> [2] Or vim.  That does it too.

I use mutt and so edit messages in vim. Works well for me.

Tim.



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-05-29 08:57 DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
  2003-05-29 09:00 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Dominic Mitchell <dom@semantico.com>
@ 2003-05-30 16:06   ` Rudy Lippan <rlippan@remotelinux.com>
  2 siblings, 0 replies; 18+ messages in thread

From: Rudy Lippan @ 2003-05-30 16:06 UTC (permalink / raw)
  To: Dominic Mitchell <dom@semantico.com>; +Cc: Rudy Lippan <rlippan@remotelinux.com>; Bruce Momjian <pgman@candle.pha.pa.us>; David Wheeler <david@wheeler.net>; pgsql-interfaces; 'DBI developers' <dbi-dev@perl.org>

On Thu, 29 May 2003, Dominic Mitchell wrote:
> > 
> > And for anyone who is interested here is the change log:
> 
> One more thing for the change log:  notice messages generated by the 
> database now use the perl warning mechanism instead of going to stderr, 
> so they can be trapped if needed.
> 
Added on my system.. I will check it in on Mondy.

-r

> -Dom
> 
> 




^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-05-29 08:57 DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
@ 2003-05-29 15:34 ` David Wheeler <david@wheeler.net>
  2003-05-30 16:04   ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
  1 sibling, 1 reply; 18+ messages in thread

From: David Wheeler @ 2003-05-29 15:34 UTC (permalink / raw)
  To: Rudy Lippan <rlippan@remotelinux.com>; +Cc: Bruce Momjian <pgman@candle.pha.pa.us>; Dominic Mitchell <dom@semantico.com>; pgsql-interfaces; 'DBI developers' <dbi-dev@perl.org>

On Thursday, May 29, 2003, at 01:57  AM, Rudy Lippan wrote:

> On Mon, 26 May 2003, Bruce Momjian wrote:
>
>> Rudy, where are we on the release of DBD:pg withs your patches?  Are
>> they ready to go?
>
>
> I spun an ALPHA copy of DBD::Pg. So much has changed in there that I am
> sure something is broken for someone; therefore, I think we should let
> people hammer on it for a few days before making an official release.
>
> I put the alpha up here:
> http://www.remotelinux.com/rlippan/DBD-Pg-1.30_1.tar.gz

Nice, thanks for this, Rudy.

> And for anyone who is interested here is the change log:
>
>     - $dbh->prepare() rewrites the SQL statement into an internal for
>       striping out comments and whitespace, and if PostgreSQL > 7.3 
> takes
> the
>       stripped statement and passes that to postgress' PREPARE 
> statement,
>       then rewrites the statement as 'EXECUTE "DBD::PG::cached_query n"
>       ($1, $2, ... $n, $n+1)' for DBD::Pg's execute.  -- Currently
> disabled
>       until PREPARE works a little better

Pity. Do you know if it will work as well as you need in 7.4? Have you 
tested it with the latest from CVS? I think that it is close-ish to 
done, so now would be the time to get in any requests for fixes.

>     - Allows the use of :n and :foo bind params. So: (SELECT * FROM foo
> where
>       1 = :this and 2 = :that) will now work.
>     - Complains on execute when unbound bind params are submitted 
> (instead
> of
>       defaulting to NULL)

Ah, good!

>     - Switched over to use driver.xst.

About time we did this!

>     - pg_error() only removes \n's don't truncate message on first \n

Heh, funny. If we don't release 1.30 with all your changes soon, it 
might be worth it to backport this fix.

>     - fixed statement scan problem where the preparse of
>       "SELECT foo[3:33] from bar"  was scanning :33 as a placeholder
>     - moved the quoting of bind values out of execute() and into
>       bind -- as there is no need to requote the value every time 
> execute
>       is called.

rudy++

>     - :veryverylongplaceholdername ==  Long walk. Sort pier -- fixed.
>     - quote() is now in C and uses same code as bind_param.
>     - quoting and dequoting now use libpq quoting functions where
> available
>       (I still need to take the libpq functions swiped out of quote.c 
> and
> move
>       it into libpqswip.c with license info &c., and switch ifndefs to
> ifdefs)

Good, nice to have all this centralized.

>     - bind_param() will convert from 1,0 to TRUE/FALSE when pg_type is
>       PGBOOLOID.

Nice.

>     - fixed many heap buffer overruns.

Thanks Rudy, sounds great!

David

-- 
David Wheeler                                     AIM: dwTheory
david@kineticode.com                              ICQ: 15726394
http://kineticode.com/                         Yahoo!: dew7e
                                                Jabber: Theory@jabber.org
Kineticode. Setting knowledge in motion.[sm]




^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-05-29 08:57 DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
  2003-05-29 15:34 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) David Wheeler <david@wheeler.net>
@ 2003-05-30 16:04   ` Rudy Lippan <rlippan@remotelinux.com>
  2003-05-30 17:37     ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 18+ messages in thread

From: Rudy Lippan @ 2003-05-30 16:04 UTC (permalink / raw)
  To: David Wheeler <david@wheeler.net>; +Cc: Rudy Lippan <rlippan@remotelinux.com>; Bruce Momjian <pgman@candle.pha.pa.us>; Dominic Mitchell <dom@semantico.com>; pgsql-interfaces; 'DBI developers' <dbi-dev@perl.org>

On Thu, 29 May 2003, David Wheeler wrote:
> > statement,
> >       then rewrites the statement as 'EXECUTE "DBD::PG::cached_query n"
> >       ($1, $2, ... $n, $n+1)' for DBD::Pg's execute.  -- Currently
> > disabled
> >       until PREPARE works a little better
> 
> Pity. Do you know if it will work as well as you need in 7.4? Have you 
> tested it with the latest from CVS? I think that it is close-ish to 
> done, so now would be the time to get in any requests for fixes.
> 

I need to test this, I'll play with it next week.

-r




^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-05-29 08:57 DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
  2003-05-29 15:34 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) David Wheeler <david@wheeler.net>
  2003-05-30 16:04   ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
@ 2003-05-30 17:37     ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 18+ messages in thread

From: Tom Lane @ 2003-05-30 17:37 UTC (permalink / raw)
  To: Rudy Lippan <rlippan@remotelinux.com>; +Cc: David Wheeler <david@wheeler.net>; Bruce Momjian <pgman@candle.pha.pa.us>; Dominic Mitchell <dom@semantico.com>; pgsql-interfaces@postgresql.org, "'DBI developers'" <dbi-dev@perl.org>

Rudy Lippan <rlippan@remotelinux.com> writes:
> On Thu, 29 May 2003, David Wheeler wrote:
>>>> disabled until PREPARE works a little better
>> 
>> Pity. Do you know if it will work as well as you need in 7.4? Have you 
>> tested it with the latest from CVS? I think that it is close-ish to 
>> done, so now would be the time to get in any requests for fixes.

> I need to test this, I'll play with it next week.

It *is* done.  The window for offering any feedback is shrinking fast,
so I'd definitely encourage you to look at it ASAP.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
@ 2003-06-06 05:03 Bruce Momjian <pgman@candle.pha.pa.us>
  2003-06-06 18:44 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
  0 siblings, 1 reply; 18+ messages in thread

From: Bruce Momjian @ 2003-06-06 05:03 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Rudy Lippan <rlippan@remotelinux.com>; David Wheeler <david@wheeler.net>; Dominic Mitchell <dom@semantico.com>; pgsql-interfaces@postgresql.org, "'DBI developers'" <dbi-dev@perl.org>


It is back up now --- Marc installed a new kernel.

Also, with our current CVS of DBD:pg, perl 5.005_03 can no longer do
'gmake test'.  I get:
	
	PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/libdata/perl5/5.00503/i386-bsdos -I/usr/libdata/perl5/5.00503 -e
	 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
	t/00basic...........Can't locate 5.61 in @INC (@INC contains: blib/arch blib/lib /usr/libdata/perl5/5.00503/i386-bsdos /usr/li
	bdata/perl5/5.00503/i386-bsdos /usr/libdata/perl5/5.00503/i386-bsdos /usr/libdata/perl5/5.00503 /usr/libdata/perl5/5.00503/i38
	6-bsdos /usr/libdata/perl5/5.00503/i386-bsdos /usr/libdata/perl5/5.00503 /usr/libdata/perl5/site_perl/i386-bsdos /usr/libdata/
	perl5/site_perl/i386-bsdos /usr/libdata/perl5/site_perl /usr/libdata/perl5/site_perl/i386-bsdos/include . /usr/libdata/perl5/5
	.00503/i386-bsdos /usr/libdata/perl5/5.00503 /usr/libdata/perl5/site_perl/i386-bsdos /usr/libdata/perl5/site_perl /usr/libdata
	/perl5/site_perl/i386-bsdos/include .) at blib/lib/DBD/Pg.pm line 12.
	BEGIN failed--compilation aborted at t/00basic.t line 4.
	dubious
	        Test returned status 2 (wstat 512, 0x200)
	t/01connect.........skipping test on this platform
	t/01constants.......Can't locate 5.61 in @INC (@INC contains: blib/arch blib/lib /usr/libdata/perl5/5.00503/i386-bsdos /usr/li
	bdata/perl5/5.00503/i386-bsdos /usr/libdata/perl5/5.00503/i386-bsdos /usr/libdata/perl5/5.00503 /usr/libdata/perl5/5.00503/i38
	6-bsdos /usr/libdata/perl5/5.00503/i386-bsdos /usr/libdata/perl5/5.00503 /usr/libdata/perl5/site_perl/i386-bsdos /usr/libdata/
	perl5/site_perl/i386-bsdos /usr/libdata/perl5/site_perl /usr/libdata/perl5/site_perl/i386-bsdos/include . /usr/libdata/perl5/5
	.00503/i386-bsdos /usr/libdata/perl5/5.00503 /usr/libdata/perl5/site_perl/i386-bsdos /usr/libdata/perl5/site_perl /usr/libdata
	/perl5/site_perl/i386-bsdos/include .) at blib/lib/DBD/Pg.pm line 12.
	BEGIN failed--compilation aborted at t/01constants.t line 4.
	# Looks like your test died before it could output anything.
	dubious
	        Test returned status 2 (wstat 512, 0x200)
	DIED. FAILED tests 1-20
	        Failed 20/20 tests, 0.00% okay
	t/01setup...........skipping test on this platform
	t/02prepare.........skipping test on this platform
	t/03bind............skipping test on this platform
	t/04execute.........skipping test on this platform
	t/04rows............skipping test on this platform
	t/05fetch...........skipping test on this platform
	t/06disconnect......skipping test on this platform
	t/07reuse...........skipping test on this platform
	t/08txn.............skipping test on this platform
	t/09autocommit......skipping test on this platform
	t/11quoting.........skipping test on this platform
	t/12placeholders....skipping test on this platform
	t/13pgtype..........skipping test on this platform
	t/15funct...........skipping test on this platform
	t/16pgbooltf........skipping test on this platform
	t/17arrays..........skipping test on this platform
	t/99cleanup.........skipping test on this platform
	Failed Test  Status Wstat Total Fail  Failed  List of failed
	-------------------------------------------------------------------------------
	t/00basic.t       2   512    ??   ??       %  ??
	t/01constants.t   2   512    20   20 100.00%  1-20
	
Any ideas?

---------------------------------------------------------------------------

Tom Lane wrote:
> Rudy Lippan <rlippan@remotelinux.com> writes:
> > developer.postgresql.org seems to be down?  Grrr.
> 
> Tell me about it :-(.  But you can read the 7.4 protocol document at
> Bruce's machine,
> http://candle.pha.pa.us/main/writings/pgsql/sgml/protocol.html
> The extended-query stuff is what you want.
> 
> 			regards, tom lane
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-06-06 05:03 Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Bruce Momjian <pgman@candle.pha.pa.us>
@ 2003-06-06 18:44 ` Rudy Lippan <rlippan@remotelinux.com>
  2003-06-06 19:02   ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 18+ messages in thread

From: Rudy Lippan @ 2003-06-06 18:44 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; David Wheeler <david@wheeler.net>; Dominic Mitchell <dom@semantico.com>; pgsql-interfaces; 'DBI developers' <dbi-dev@perl.org>

On Fri, 6 Jun 2003, Bruce Momjian wrote:

> Date: Fri, 6 Jun 2003 01:03:49 -0400 (EDT)
> From: Bruce Momjian <pgman@candle.pha.pa.us>
> To: Tom Lane <tgl@sss.pgh.pa.us>
> Cc: Rudy Lippan <rlippan@remotelinux.com>, David Wheeler <david@wheeler.net>,
>      Dominic Mitchell <dom@semantico.com>, pgsql-interfaces@postgresql.org,
>      'DBI developers' <dbi-dev@perl.org>
> Subject: Re: DBD::Pg 1.30_1 WAS (Re: [INTERFACES] Prepare and prepare ?)
> 
> 
> It is back up now --- Marc installed a new kernel.
> 
> Also, with our current CVS of DBD:pg, perl 5.005_03 can no longer do
> 'gmake test'.  I get:
> 	
> 	PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/libdata/perl5/5.00503/i386-bsdos -I/usr/libdata/perl5/5.00503 -e
> 	 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
> 	t/00basic...........Can't locate 5.61 in @INC (@INC contains: blib/arch blib/lib /usr/libdata/perl5/5.00503/i386-bsdos /usr/li

Looks like it is set to require perl 5.6.1 now.

I modified Makefile.PL so that it also requires 5.6.1 -- This should cause
the error to be thown much earlier.  The DBI version also needs to be
bumped (I have to go back and look to find out what version of DBI was
decided upon).


Rudy




^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
  2003-06-06 05:03 Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Bruce Momjian <pgman@candle.pha.pa.us>
  2003-06-06 18:44 ` Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
@ 2003-06-06 19:02   ` Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 0 replies; 18+ messages in thread

From: Bruce Momjian @ 2003-06-06 19:02 UTC (permalink / raw)
  To: Rudy Lippan <rlippan@remotelinux.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; David Wheeler <david@wheeler.net>; Dominic Mitchell <dom@semantico.com>; pgsql-interfaces@postgresql.org, "'DBI developers'" <dbi-dev@perl.org>

Rudy Lippan wrote:
> > Also, with our current CVS of DBD:pg, perl 5.005_03 can no longer do
> > 'gmake test'.  I get:
> > 	
> > 	PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/libdata/perl5/5.00503/i386-bsdos -I/usr/libdata/perl5/5.00503 -e
> > 	 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
> > 	t/00basic...........Can't locate 5.61 in @INC (@INC contains: blib/arch blib/lib /usr/libdata/perl5/5.00503/i386-bsdos /usr/li
> 
> Looks like it is set to require perl 5.6.1 now.
> 
> I modified Makefile.PL so that it also requires 5.6.1 -- This should cause
> the error to be thown much earlier.  The DBI version also needs to be
> bumped (I have to go back and look to find out what version of DBI was
> decided upon).

Good idea.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
@ 2003-07-08 22:38 ` Bruce Momjian <pgman@candle.pha.pa.us>
  1 sibling, 0 replies; 18+ messages in thread

From: Bruce Momjian @ 2003-07-08 22:38 UTC (permalink / raw)
  To: Dominic Mitchell <dom@semantico.com>; +Cc: Tim Bunce <Tim.Bunce@pobox.com>; Rudy Lippan <rlippan@remotelinux.com>; David Wheeler <david@wheeler.net>; pgsql-interfaces@postgresql.org, "'DBI developers'" <dbi-dev@perl.org>


Thanks.  Patch applied.

---------------------------------------------------------------------------

Dominic Mitchell wrote:
> Tim Bunce wrote:
> > Ah, you're passing it the address of (probably temporary) reference.
> > It's the underlying object (which the ref points to) that you need.
> > 
> > Try something like:
> > 
> >   PQsetNoticeProcessor(imp_dbh->conn, pg_warn, (void *)SvRV(dbh));
> > 
> > the D_imp_dbh( (SV *)arg ) will do-the-right-thing *if* the
> > handle is the 'last handle used' ($DBI::lasth) whenever it's called.
> > 
> > That's probably not a safe assumption so you could try something
> > more like this:
> > 
> >     D_imp_dbh( sv_2mortal(newRV((SV*)arg)) );
> 
> Thank you!  This worked a treat.  It turned out that sv_2mortal() was 
> necessary after all.  I'm going to go away and read up on XS before I 
> try this sort of thing again, I think.
> 
> Could somebody with a commit bit for dbdpg please apply the attached 
> patch?  It passes all tests here on perl 5.8.0 / postgres 7.3.2.  I 
> don't think that it will cause any problems for other perl versions...
> 
> -Dom
> 
> -- 
> | Semantico: creators of major online resources          |
> |       URL: http://www.semantico.com/                   |
> |       Tel: +44 (1273) 722222                           |
> |   Address: 33 Bond St., Brighton, Sussex, BN1 1RD, UK. |

> ? Pg.xsi
> Index: dbdimp.c
> ===================================================================
> RCS file: /usr/local/cvsroot/dbdpg/dbdpg/dbdimp.c,v
> retrieving revision 1.23
> diff -u -r1.23 dbdimp.c
> --- dbdimp.c	29 May 2003 08:37:46 -0000	1.23
> +++ dbdimp.c	2 Jun 2003 16:33:51 -0000
> @@ -76,7 +76,10 @@
>      void *arg;
>      const char *message;
>  {
> -    warn( message );
> +    D_imp_dbh( sv_2mortal(newRV((SV*)arg)) );
> +
> +    if (DBIc_WARN(imp_dbh))
> +	warn( message );
>  }
>  
>  /* Database specific error handling. */
> @@ -178,7 +181,7 @@
>      }
>  
>      /* Enable warnings to go through perl */
> -    PQsetNoticeProcessor(imp_dbh->conn, pg_warn, NULL);
> +    PQsetNoticeProcessor(imp_dbh->conn, pg_warn, (void *)SvRV(dbh));
>  
>      /* Quick basic version check -- not robust a'tall TODO: rewrite */
>      pgres_ret = PQexec(imp_dbh->conn, "SELECT version()");
> Index: t/01setup.t
> ===================================================================
> RCS file: /usr/local/cvsroot/dbdpg/dbdpg/t/01setup.t,v
> retrieving revision 1.5
> diff -u -r1.5 01setup.t
> --- t/01setup.t	6 May 2003 21:46:52 -0000	1.5
> +++ t/01setup.t	2 Jun 2003 16:33:51 -0000
> @@ -3,7 +3,7 @@
>  use Test::More;
>  
>  if (defined $ENV{DBI_DSN}) {
> -  plan tests => 4;
> +  plan tests => 5;
>  } else {
>    plan skip_all => 'cannot test without DB info';
>  }
> @@ -32,6 +32,7 @@
>     'create table'
>    );
>  
> +# First, test that we can trap warnings.
>  eval { local $dbh->{PrintError} = 0; $dbh->do( "drop table test2" ) };
>  {
>      my $warning;
> @@ -43,6 +44,19 @@
>  	 'PQsetNoticeProcessor working' );
>  }
>  eval { local $dbh->{PrintError} = 0; $dbh->do( "drop table test2" ) };
> +
> +# Next, test that we can disable warnings using $dbh.
> +eval { local $dbh->{PrintError} = 0; $dbh->do( "drop table test3" ) };
> +{
> +    my $warning;
> +    local $SIG{__WARN__} = sub { $warning = "@_" };
> +    local $dbh->{Warn} = 0;
> +    $dbh->do( "create table test3 (id integer primary key)" );
> +    # XXX This will have to be updated if PostgreSQL ever changes its
> +    # warnings...
> +    is( $warning, undef, 'PQsetNoticeProcessor respects dbh->{Warn}' );
> +}
> +eval { local $dbh->{PrintError} = 0; $dbh->do( "drop table test3" ) };
>  
>  ok($dbh->disconnect(),
>     'disconnect'

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 18+ messages in thread

* Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
@ 2003-07-08 22:40 ` Bruce Momjian <pgman@candle.pha.pa.us>
  1 sibling, 0 replies; 18+ messages in thread

From: Bruce Momjian @ 2003-07-08 22:40 UTC (permalink / raw)
  To: Dominic Mitchell <dom@semantico.com>; +Cc: Tim Bunce <Tim.Bunce@pobox.com>; Rudy Lippan <rlippan@remotelinux.com>; David Wheeler <david@wheeler.net>; pgsql-interfaces@postgresql.org, "'DBI developers'" <dbi-dev@perl.org>


I meant to say "Already applied by someone else --- not me".

---------------------------------------------------------------------------

Dominic Mitchell wrote:
> Tim Bunce wrote:
> > Ah, you're passing it the address of (probably temporary) reference.
> > It's the underlying object (which the ref points to) that you need.
> > 
> > Try something like:
> > 
> >   PQsetNoticeProcessor(imp_dbh->conn, pg_warn, (void *)SvRV(dbh));
> > 
> > the D_imp_dbh( (SV *)arg ) will do-the-right-thing *if* the
> > handle is the 'last handle used' ($DBI::lasth) whenever it's called.
> > 
> > That's probably not a safe assumption so you could try something
> > more like this:
> > 
> >     D_imp_dbh( sv_2mortal(newRV((SV*)arg)) );
> 
> Thank you!  This worked a treat.  It turned out that sv_2mortal() was 
> necessary after all.  I'm going to go away and read up on XS before I 
> try this sort of thing again, I think.
> 
> Could somebody with a commit bit for dbdpg please apply the attached 
> patch?  It passes all tests here on perl 5.8.0 / postgres 7.3.2.  I 
> don't think that it will cause any problems for other perl versions...

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 18+ messages in thread


end of thread, other threads:[~2003-07-08 22:40 UTC | newest]

Thread overview: 18+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-05-29 08:57 DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Rudy Lippan <rlippan@remotelinux.com>
2003-05-29 09:00 ` Dominic Mitchell <dom@semantico.com>
2003-05-29 15:36   ` David Wheeler <david@wheeler.net>
2003-05-29 15:44     ` Dominic Mitchell <dom@semantico.com>
2003-05-30 09:04   ` Tim Bunce <Tim.Bunce@pobox.com>
2003-05-30 09:20     ` Dominic Mitchell <dom@semantico.com>
2003-05-30 14:03       ` Tim Bunce <Tim.Bunce@pobox.com>
2003-05-30 14:13         ` Dominic Mitchell <dom@semantico.com>
2003-05-30 16:21           ` Tim Bunce <Tim.Bunce@pobox.com>
2003-05-30 16:06   ` Rudy Lippan <rlippan@remotelinux.com>
2003-05-29 15:34 ` David Wheeler <david@wheeler.net>
2003-05-30 16:04   ` Rudy Lippan <rlippan@remotelinux.com>
2003-05-30 17:37     ` Tom Lane <tgl@sss.pgh.pa.us>
2003-06-06 05:03 Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) Bruce Momjian <pgman@candle.pha.pa.us>
2003-06-06 18:44 ` Rudy Lippan <rlippan@remotelinux.com>
2003-06-06 19:02   ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-07-08 22:38 ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-07-08 22:40 ` Bruce Momjian <pgman@candle.pha.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox