Perl DBI PostgreSQL

R

raminoacid

Hi,

I'm using Perl's DBI package to connect to a PostgreSQL database.
Everything works fine except the annoying DEBUG: output for each DB
operation. This is not the same as tracing since the later can be
disabled. For instance, the following output can be seen in my
terminal:

DEBUG: InitPostgres
DEBUG: StartTransaction
DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR,
xid/subid/cid: 2082592/1/0, nestlvl: 1, children: <>
DEBUG: CommitTransaction
DEBUG: name: unnamed; blockState: STARTED; state: INPROGR,
xid/subid/cid: 2082592/1/0, nestlvl: 1, children: <>


Is there anyway to disable this. I need to parse my output file and I'd
like to have a light-weight file rather a file with lots of garbage.

Thanks.
 
G

gf

raminoacid said:
Hi,

I'm using Perl's DBI package to connect to a PostgreSQL database.
Everything works fine except the annoying DEBUG: output for each DB
operation. This is not the same as tracing since the later can be
disabled. For instance, the following output can be seen in my
terminal: [...]
Is there anyway to disable this. I need to parse my output file and I'd
like to have a light-weight file rather a file with lots of garbage.

Please show a sample of your connect() call, along with all the
parameters used.
 
R

raminoacid

Hi and thanks for the follow up. Here is the connection code:

#
# connection and DB constants
use constant USERNAME => 'toto;
use constant PASSWORD => '123pwd321';
use constant DB_CONNECTION => "dbi:pg:dbname=dbTestpp/webroot/files/";

#...

# connect to the database and extract the records matching the query
my $dbh = DBI->connect(DB_CONNECTION, USERNAME, PASSWORD, {'RaiseError'
=> 1});

#...



raminoacid said:
Hi,

I'm using Perl's DBI package to connect to a PostgreSQL database.
Everything works fine except the annoying DEBUG: output for each DB
operation. This is not the same as tracing since the later can be
disabled. For instance, the following output can be seen in my
terminal: [...]
Is there anyway to disable this. I need to parse my output file and I'd
like to have a light-weight file rather a file with lots of garbage.

Please show a sample of your connect() call, along with all the
parameters used.
 
R

raminoacid

Sorry, the copy&paste was messed up, here is the corrected code:

# connection and DB constants
use constant USERNAME => 'toto;
use constant PASSWORD => '123pwd321';
use constant DB_CONNECTION =>
"dbi:pg:dbname=dbTest;host=localhost;port=8889";

#...

# connect to the database and extract the records matching the query
my $dbh = DBI->connect(DB_CONNECTION, USERNAME, PASSWORD, {'RaiseError'
=> 1});

Thanks.
 
C

Ch Lamprecht

raminoacid said:
Hi,

I'm using Perl's DBI package to connect to a PostgreSQL database.
Everything works fine except the annoying DEBUG: output for each DB
operation. This is not the same as tracing since the later can be
disabled. For instance, the following output can be seen in my
terminal:

DEBUG: InitPostgres
DEBUG: StartTransaction
DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR,
xid/subid/cid: 2082592/1/0, nestlvl: 1, children: <>
DEBUG: CommitTransaction
DEBUG: name: unnamed; blockState: STARTED; state: INPROGR,
xid/subid/cid: 2082592/1/0, nestlvl: 1, children: <>


Is there anyway to disable this. I need to parse my output file and I'd
like to have a light-weight file rather a file with lots of garbage.

Thanks.

Change your setting for the parameter 'client_min_messages' in postgresql.conf
to 'notice' or comment it out.

HTH, Christoph
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,662
Latest member
sxarexu

Latest Threads

Top