Greg Sabino Mullane | 12 Mar 00:00
Favicon

DBD::Pg version 2.19.1 released


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Version 2.19.1 of DBD::Pg, the Perl interface to PostgreSQL, 
has just been released. This (and 2.19.0) fixes some serious 
bugs, so upgrading is recommended for all users. You can 
find it at your local CPAN mirror, or at:

http://search.cpan.org/~turnstep/DBD-Pg-2.19.1/

Checksums, MD5 and SHA1:

3a86ac826f5285003b87c6a8b225e0c4  DBD-Pg-2.19.1.tar.gz
0d0bd7daf2c24758716fbbde686e4d66cf81a206  DBD-Pg-2.19.1.tar.gz

Complete list of changes for 2.19.0 and 2.19.1:

  - Fix crash when passing in an array with undefined elements. [GSM]

  - Use proper formatting for warn() and croak() (CPAN bug #75642)
    [Niko Tyni]

  - Fix localized regex in test (CPAN bug #70759)

  - Fix for named placeholders (CPAN bug #70953) [Jan Pazdziora]

  - Various fixes to the array-marshalling code [Noah Misch, Mark 
    Stosberg, and David Christensen] (CPAN bug #58552)

(Continue reading)

Picon

feature request

Hi,
I need to get the type for a column from query result, but for
Postgres user defined types (composite types) I cannot find DBD::Pg
field  that contains such a  info.
For example for the query:
select A as class_record from pg_class A;

in the resulting DBI statement I have:
$$sth{TYPE}[0]: 0
$$sth{pg_type}[0]: 'unknown'

when the pqlib call PQftype() returns actual OID of the pg_class type.

Currently all calls to  PQftype() are wrapped around pg_type_data()
(for example  pg_type_data((int)PQftype(imp_sth->result, fields)), and
 pg_type_data() always returns NULL if the type is not standard.

I think if the result of PQftype() can be stored in a new pg specific
field (for example pg_type_oid) this will give a way of using composit
types without changing current behavior of the driver ?

Best regards!
Manol

mhoram | 7 Jan 15:49
Picon
Picon

Inconsistent behaviour with Dollar-quoted String Constants

Hello,

I am using UTF-8 characters within Dollar-quoted tags.
Following code is the problem-setting.

--- CODE BEGIN ---
#!/usr/bin/perl
use strict; use DBI;
my $db = DBI->connect(
     "dbi:Pg:dbname=$PgDbName;host=$PgHost;port=$PgPort",
     $PgSqlUser, $PgSqlPass);

my $txt = '2';
my $delim = "\$\x{5317}\$";

my $sql = "SELECT $delim$txt$delim";
print "SQL = '$sql'\n";
$db->do($sql);
print "after do\n";
$db->selectrow_hashref($sql);
print "after_selectrow_hashref\n";
--- CODE END ---

The script dies during selectrow_hashref and the output of the script is

--- OUTPUT BEGIN ---
SQL = 'SELECT $北$2$北$'
after do
Invalid placeholders: must start at $1 and increment one at a time 
(expected: $1)
(Continue reading)

veronica.santos | 20 Dec 19:03
Picon
Favicon

Re: make: *** [Pg.o] Error 1 while installing DBD-Pg module.

I'm having the same issue. PostgreSQL 8.4, DBI 2.0 e DBD 2.18

export POSTGRES_HOME=/usr/local/pgsql
export POSTGRES_LIB=/usr/local/pgsql/lib
export POSTGRES_INCLUDE=/usr/local/pgsql/include
export PATH=$PATH:$PGHOME/bin

xposhom1:~/dbi-link-2.0.0 # perl Makefile.PL
Writing Makefile for dbi-link
xposhom1:~/dbi-link-2.0.0 # make
xposhom1:~/dbi-link-2.0.0 # make install
Writing 
/usr/lib/perl5/site_perl/5.8.8/s390x-linux-thread-multi/auto/dbi-link/.packlist
Appending installation info to 
/usr/lib/perl5/5.8.8/s390x-linux-thread-multi/perllocal.pod

xposhom1:~ # tar -xzvf DBD-Pg-2.18.1.tar.gz
xposhom1:~ # cd DBD-Pg-2.18.1/

xposhom1:~/DBD-Pg-2.18.1 # perl Makefile.PL
Configuring DBD::Pg 2.18.1
PostgreSQL version: 80404 (default port: 5432)
POSTGRES_HOME: /usr/local/pgsql
POSTGRES_INCLUDE: /usr/local/pgsql/include
POSTGRES_LIB: /usr/local/pgsql/lib
OS: linux
Checking if your kit is complete...
Looks good
Warning: prerequisite DBI 1.52 not found. We have 1.50.
Warning: prerequisite version 0 not found.
(Continue reading)

David E. Wheeler | 22 Nov 04:06
Gravatar

DBD::Pg::hstore

Hi Galimov,

Thanks for DBD::Pg::hstore, it looks interesting. However, I think the name isn’t great. There is
nothing DBD::Pg specific about it, is there? You just have the decode() and encode() functions that take
strings, yes?

If so, I think a better name might be Pg::Hstore (or Pg::hstore if you prefer). I also suggest giveing the
exported functions longer names, like encode_hstore() and decode_hstore(), to prevent conflicts
with, e.g., the Encode module.

Looking forward to giving your module a try. Thank you!

Best,

David

John Arnold | 10 Nov 18:33
Picon

DBI::Pg

Gentlemen

I am having a little connectivity issue, that I think might be PostgreSQL related  and not DBI::Pg per se (but
I have to start somewhere :) )

The error: seems to indicate a local issue rather than a remote issue. Why is the script looking for a local
pg_hba.conf file?

DBI connect('dbname=taskman;host=xx.xxx.xx.xx;port=5432','postgres',...) failed: FATAL:  could
not load pg_hba.conf at C:/Documents and Settings/xxxxxxx/workspace/Forms/pg_connect.pl

seems to indicate a local issue rather than a remote issue. Why is the script looking for a local pg_hba.conf
file, since this conf file controls client connections on the SERVER side?

Thoughts?


----------------------------------------- This electronic mail
message, and any of the accompanying documents, may contain
confidential or privileged information. Any unauthorized disclosure
or distribution of such information is strictly prohibited. If you
are not the intended recipient of this message, please notify the
sender immediately and destroy the message. Messages sent through
electronic media may be subject to delays or unauthorized
alterations. Neither The Bank of Tokyo-Mitsubishi UFJ, Ltd. nor any
of its affiliates is responsible for any such delay or alteration.
This message may contain a commercial advertisement or promotion of
a commercial product or service. If you do not wish to receive
messages of this kind from the sender in the future, please reply
to this message and type "REMOVE MY EMAIL ADDRESS" in the subject
(Continue reading)

Chris Travers | 8 Nov 01:20
Picon

A couple complex type and array questions

Hi all;

1) I remember reading previously about complex type support in
DBD::Pg, but reading through the perl module code, I can't find how
hashrefs are mapped to string representations of tuples.  Is this in
fact supported at present?  Is there a private method  I can call for
the parsing (for reasons, see below)?

2) Reading through the DBD::Pg code, I am guessing it is not possible
to pass arrays of complex types to DBD::Pg is it?

3) If I want to use table definitions as complex types, this won't
work with the current discovery, correct?

Would the DBD::Pg team be interested in patches at some point on these
areas?  My plan is to copy relevant portions of DBD::Pg into my app
(in my app's namespaces) and tweak them, and then once they are
working I could use them from there pending generally available
versions with the same functionality.

Best Wishes,
Chris Travers

Mark Stosberg | 7 Oct 21:44
Picon
Favicon
Gravatar

Quoting of values in arrays in broken in DBD::Pg, can you help fix it? ( CPAN RT#58552 ) [SumsaultRT #9386]

Hello,

If you use DBD::Pg and also use PostgreSQL arrays, you should be aware
there is an open bug with quoting PostgreSQL array values. A bug report
about the issue is here, including some related test cases and work on
some patches:

https://rt.cpan.org/Public/Bug/Display.html?id=58552

However, the proposed fix is not passing all the test cases. The
solution will need someone with XS skills, who also has confidence about
exactly what the correct quoting behavior should be.

I'm affected by the issue and would personally appreciate the help.

Thanks!

    Mark

Florian Weimer | 24 Aug 09:29
Picon

Transaction wrapper

Is there are ready-to-use transaction wrapper for DBD:Pg?  I'm looking
for somehting which can be used like this:

    my $connect_args = [$data_source, $username, $auth, \%attr];
    transact $connect_args, sub {
      my ($dbh) = @_;
      $dbh->begin_work;
      ...
      $dbh->commit;
    };

The transact subroutine should abort the transaction if the passed sub
dies.  For certain exceptions, the sub should be called again to retry
the transaction.  The database handle should be cached.

This is somewhat PostgreSQL-specific because there are three cases:
permanent errors (such as SQL syntax errors, or non-SQL exceptions),
transient errors which will go away when the transaction is retried
within the same connection (such as serialization failures and certain
types of UNIQUE constraint violations), and errors which will likely go
away when the transaction is retried with a fresh connection (due to
server restart, for example).

This is not very difficult to write as such, but getting the error code
list right is a bit delicate.

--

-- 
Florian Weimer                <fweimer@...>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
(Continue reading)

David Rogers | 13 Jul 22:50
Picon

Installing DBD::Pg on Windows Vista

I am attempting to install DBD::Pg on a Windows Vista Ultimate machine for
my own personal use.  I am retired now, but did work with database systems
and expert systems.  I am developing a database for some linguistic
research.  Because others are using Perl (but not with a database) I really
need to include Perl routines in my work.  I have version 8.4 of PostgreSQL
and version 1.10.5 of PostgreSQL Tools.  They appear to be working, except
for the Perl interface.

I have downloaded DBD-Pg-2.18.1.tar.gz and have unzipped it, the result now
in C:\tmp\ DBD-Pg-2.18.1.  In step 1 of your instructions in “How to get
working DBD::Pg on Windows” you state to use MS Visual C++.  I do not have
this package, but do have C and Java.  Could I use C, and, if so, how would
that change your instructions?

Thanks for any help.
Avriette, Alex [USA] | 10 Jul 14:00

segfault in dbdimp.c:319

Hi Greg. My code was tickling a segfault in dbd::pg (which caused perl to
segfault, or the other way around, or whichever). This may be Tim's code
originally, so I don't know if it's your "hack," but it seems the hack is
no longer working. Here's a backtrace.

(gdb) bt
#0  0x0000000100677720 in pg_warn (arg=<value temporarily unavailable, due
to optimizations>, message=0x1011e9810 "LOG:  statement: DEALLOCATE
dbdpg_p62640_1\n") at dbdimp.c:319
#1  0x00000001006b4f90 in pqGetErrorNotice3 ()
#2  0x00000001006b65ca in pqParseInput3 ()
#3  0x00000001006ae5a4 in PQgetResult ()
#4  0x00000001006ae7c8 in PQexecFinish ()
#5  0x000000010067f59e in _result (my_perl=0x100800000,
imp_dbh=0x1014929c0, sql=0x1002027f0 "DEALLOCATE dbdpg_p62640_1") at
dbdimp.c:353
#6  0x0000000100682940 in pg_st_deallocate_statement (my_perl=0x100800000,
sth=0x10082fb48, imp_sth=0x101494910) at dbdimp.c:3631
#7  0x0000000100682e74 in pg_st_destroy (sth=0x10082fb48,
imp_sth=0x101494910) at dbdimp.c:3684
#8  0x000000010067041d in XS_DBD__Pg__st_DESTROY (my_perl=0x100800000,
cv=<value temporarily unavailable, due to optimizations>) at Pg.xsi:769
#9  0x00000001001ca61b in XS_DBI_dispatch ()
#10 0x0000000100075708 in Perl_pp_entersub ()
#11 0x0000000100069550 in Perl_call_sv ()
#12 0x000000010007bef1 in Perl_sv_clear ()
#13 0x000000010007c49b in Perl_sv_free2 ()
#14 0x000000010007c389 in Perl_sv_clear ()
#15 0x000000010007c49b in Perl_sv_free2 ()
#16 0x00000001000585c0 in Perl_mg_free ()
(Continue reading)


Gmane