thanks to you both for your comments ... i've only been able to address this a little since my original post. krazken seems close to the mark, although single-quoting the value held in the scalar results in the same lack of recognition, other quoting schemes do result in strings getting passed to the statement, although the strings themselves don't quite correspond to the username and as a result authentication fails. i'll be playing with this more.

for zapawork, here's the beginning of of the script from which the problem arises...

#!/usr/bin/perl -w sub BEGIN { $ENV{DISPLAY}= "machine:0.0"; } use Carp () ; use CGI qw( ::standard );; use CGI::Carp qw( fatalsToBrowser ); use DBI; use DBD::Pg; our $counter = 0; our $full=new CGI; print $full->header; our $dbh; $path_info = $full->path_info; my ($param1,$param2); $param1='username'; $param2='password'; my $username; $username=$full->param($param1); my $password; $password=$full->param($param2); my $database='jrado'; my $driver='Pg'; my $host='raider-ralph'; my $dsn="DBI:$driver:dbname=$database;host=$host"; $username=~s/^\s+//; $password=~s/^\s+//; unlink '/home/www/dbitrace.log6a' if -e '/home/www/dbitrace.log6a'; DBI->trace(2,'/home/www/dbitrace.log6a'); $dbh=DBI->connect($dsn,$username,$password) or die print "error connec +ting to database ", $DBI::errstr, "\n";

the initial portion of the working script is as follows:

#! /usr/bin/perl -Tw ##use strict; use CGI qw(:all); ##list.cgi ##set up the postgresql interface use DBI; use DBD::Pg; my $match; my $begdate; my $enddate; our $username; our $password; $match=''; $begdate=''; $enddate=''; our $list=new CGI; $begdate=$list->param('begdate'); $enddate=$list->param('enddate'); $match=$list->param('match'); $username=$list->param('username'); $password=$list->param('password'); ##declare scalars ##dsn-related my $host; my $db; my $driver; my $dsn; my $database; our $key; $database='jrado'; $driver='Pg'; $user=''; $host='raider-ralph'; $dsn="DBI:$driver:dbname=$database;host=$host"; ##database handle my $dbh_list; unlink '/home/www/dbitrace.log4' if -e '/home/www/dbitrace.log4'; DBI->trace(2,'/home/www/dbitrace.log4'); $username=~s/^\s+//; $password=~s/^\s+//; $dbh_list=DBI->connect($dsn,$username,$password) or die print "ACCESS +DENIED";

as you can see, there's nothing fancy in either one. in about an hour, i'll be out of here for the next week and a half and i'll probably only intermittently be able to cloister, but i appreciate any input you have.

ralphie


In reply to Re: postgresql dbi connection problem by ralphie
in thread postgresql dbi connection problem by ralphie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.