Here's an odd problem installing DBD:Pg. Usual steps (have done this module a few times now) ...

The problem I got is "no such file" - it seems that somehow the driver is looking for the wrong named socket ... :


admin@li8-246:~/.cpanplus/5.8.8/build/DBD-Pg-1.49$ perl -Ilib t/01connect.t
1..8
Bail out! Could not connect: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

#
# Program               Version
# Perl                  5.8.8 (linux)
# DBD::Pg               1.49
# PostgreSQL (compiled) ?
# PostgreSQL (target)   ?
# PostgreSQL (reported) ?
# Default port          ?
# DBI                   1.59
# DBI_DSN               dbi:Pg:dbname=pgtest
# No tests run!
admin@li8-246:~/.cpanplus/5.8.8/build/DBD-Pg-1.49$
admin@li8-246:~/.cpanplus/5.8.8/build/DBD-Pg-1.49$
admin@li8-246:~/.cpanplus/5.8.8/build/DBD-Pg-1.49$ ls -al /var/run/postgresql/
total 4
drwxrwsr-x 2 postgres postgres 1024 Nov 30 12:26 .
drwxr-xr-x 7 root     root     1024 Nov 30 08:49 ..
srwxrwxrwx 1 postgres postgres    0 Nov 30 12:26 .s.PGSQL.5433
-rw------- 1 postgres postgres   34 Nov 30 12:26 .s.PGSQL.5433.lock
-rw------- 1 postgres postgres    5 Nov 30 12:26 8.1-main.pid
admin@li8-246:~/.cpanplus/5.8.8/build/DBD-Pg-1.49$

As you can see, the driver is looking for a socket with a different name to the one that actualy exists. What could cause this? I have tried make clean and a rebuild, also restarting postgresql itself. I can connect to the db just fine from the command line too.


In reply to odd DBD::Pg install problem by danmcb

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.