I get the following error when trying to use DBI:Pg
install_driver(Pg) failed: Can't load '/usr/lib/perl5/vendor_perl/5.8. +0/i386-linux-thread-multi/auto/DBD/Pg/Pg.so' for module DBD::Pg: libp +q.so.2: cannot open shared object file: No such file or directory at +/usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229. at (eval 7)[/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/ +DBI.pm:597] line 3 Compilation failed in require at (eval 7)[/usr/lib/perl5/vendor_perl/5 +.8.0/i386-linux-thread-multi/DBI.pm:597] line 3. Perhaps a required shared library or dll isn't installed where expecte +d at dbusers line 6 DBI::install_driver('DBI','Pg') called at /usr/lib/perl5/vendo +r_perl/5.8.0/i386-linux-thread-multi/DBI.pm line 497 DBI::connect('DBI','DBI:Pg:dbname=shop1','','') called at dbus +ers line 6
The code is:
#!/usr/bin/perl -w use strict; use DBI; # Connect to the database my $dbh = DBI->connect('DBI:Pg:dbname=shop1', '', '') or die "Couldn't open database: '$DBI::errstr'; <br>stopped"; $dbh->do("CREATE TABLE users (uid INT, login CHAR(8))"); $dbh->disconnect;
~ I am very new to this any help will be greatly appreciated. Lewie

Edited by Chady -- added code tags.


In reply to using DBI to connect to postgres by Anonymous Monk

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.