Questions tagged [dbd-pg]

PostgreSQL database driver module for perl DBI module.

This database driver module handles the specifics of PostgreSQL database management system for the Perl DBI module which provides a common API for database access.

See also: DBI and DBD::*

23 questions
21
votes
9 answers

Linux: How to install DBD::Pg module?

Postgres DB is already installed. I'm not using system perl I have installed another perl in "/srv/data203806/Migration/CPAN/localperl/bin". When I'm trying to install, It is asking for PATH TO pg_config: [root1@frmrszvwb023 bin]# ./cpan install…
Naghaveer R
  • 2,890
  • 4
  • 30
  • 52
8
votes
2 answers

Manual transaction management in DBD::Pg

I'm having a hard time getting manual transactions to work as documented in DBD::Pg, or I'm simply misunderstanding said documentation. My understanding is that if I want to manually manage transactions, I should turn off…
Michael Soulier
  • 803
  • 1
  • 9
  • 20
4
votes
3 answers

How to assure that DB (Postgres) connection is still alive between prepare and execute?

I have daemon script which runs forever in while loop. I have a prepared statement and this statement is executed on every loop. Example: my $dbh; sub get_dbh { return DBI->connect(...); } my $dbh = get_dbh(); my $sth =…
toktok
  • 279
  • 1
  • 5
  • 13
3
votes
0 answers

DBD::Pg double-encodes UTF8 characters when inserting data

I am trying to insert UTF8 strings into PostgreSQL, using DBD::Pg and always get double-encoded UTF8 in the database. I only get the correct characters in the DB if the strings I insert are Latin1. How can I tell DBD::Pg to not re-encode my strings…
mivk
  • 13,452
  • 5
  • 76
  • 69
3
votes
1 answer

Is it possible to make something like longjump in Perl inside EV callbacks?

I am trying to emulate synchronous control flow in an asynchronous environment. The purpose is to support DB requests without callbacks or blocking on request. I am trying to use the Coro module, but I think I don't understand it in full. Here are…
3
votes
1 answer

How to insert null values using pg_putcopydata in DBD::Pg?

I am populating a postgres table with millions of records. In order to speed up the process, I am making use of the pg_putcopydata in DBD:Pg. I am following this example : $dbh->do("COPY mytable(flavor, slices) FROM STDIN WITH DELIMITER…
FacePalm
  • 10,992
  • 5
  • 48
  • 50
3
votes
2 answers

Perl dies with: "Usage: DBD::Pg::db::DESTROY(dbh) during global destruction"

A stable, web-based, single-threaded/process, perl application running in production started throwing this error intermittently and only under heavy system load. We can't identify the root cause. Usage: DBD::Pg::db::DESTROY(dbh) during global…
Allen
  • 718
  • 8
  • 9
2
votes
1 answer

Get immediate notification of Postgres NOTIFY

Is there any way with DBD::Pg to do a blocking wait for a NOTIFY that will immediately return when a message is ready? I have a simple test script that can send messages using the Postgres 'NOTIFY' mechanism: #!/usr/bin/perl use 5.018; use…
Grant McLean
  • 6,898
  • 1
  • 21
  • 37
2
votes
0 answers

How do I connect to different versions of Postgres using DBD::Pg on one system

My production system uses Postgres 9.3 and Perl; I have a test Postgres 10.3 database that I'd like to run the same Perl scripts against to make sure that everything works. I'm using Perl DBI and DBD::Pg to connect to the databases. I'm logging…
Adina
  • 78
  • 6
2
votes
0 answers

Perl-Application and queries with accented characters using postgres

It's been a decade I have worked with Postgres and Perl. One of my oldest still-operated applications, an dictionary of government addresses and departmental responsibilities, has issues handling query terms containing accented characters, for…
Andreas W. Wylach
  • 723
  • 2
  • 10
  • 31
2
votes
2 answers

Installing perl DBD:Pg on Mac

I run: perl -MCPAN -e 'install Bundle::DBD::Pg' it asks: Path to pg_config? I say: /Library/PostgreSQL/9.3/bin/pg_config it runs... and the last lines are: Test Summary Report ------------------- t/02attribs.t (Wstat: 256 Tests: 249 Failed:…
jgp
  • 2,069
  • 1
  • 21
  • 40
1
vote
1 answer

DBD::Pg slow to connect to Postgresql on Mac OS

After some updates (system and brew - I don't know which was the cause), Perl's DBD:Pg is slow to establish a connection to a local Postgresql instance. It is not slow to execute queries once the connection has been established. No other utility…
Mike Bennett
  • 266
  • 3
  • 10
1
vote
2 answers

ld unknown option -platform_version while installing perl package

I am trying to install perl package DBD::Pg in my macOS Mojave Version 10.14.6. But I get error for unknown option -platform_version and does not allow make command to continue. How would I be able to solve this? Thank you! The following is the…
menten
  • 45
  • 9
1
vote
1 answer

Unable to connect to postgresQL with Ruby

I've searched in the archive but could not find an answer to my dilemma. I'm coding in Ruby and using watir webdriver framework on my local Mac Yosemite and want to connect to postgres database on a linux box. I have the required ruby gems…
1
vote
2 answers

Perl: Is there a DBI function similar to statistics_info, to retrieve FK references and constraints?

When performing a \d+ on a table within Postgres, it lists the table schema along with the indexes, as well as other tables that reference it as a FK. Example: Table "public.foo_table" Column | Type | Modifiers | Storage | Description…
vol7ron
  • 40,809
  • 21
  • 119
  • 172
1
2