I also recently had an opportunity to use postgres with perl on linux. I got "Begining Databases with PostgreSQL" isbn: 1-861005-15-5 from Amazon.

I'm pretty fluent with oracle and RDBMS's in general, and found this book covered lots of what I already knew. It covers from basic SQL to advanced things like correlated sub-queries, and also bits on Admin of Postgres

It also covers design aspects fo RDBMS's, as well as stored proc's, triggers, transactions, locking, DDL and DML. It sounds like it may be a good catch for you. There is also a nifty section on embeding perl, php, java and c in your database.

As for the install of Postgres, i did it myself (explicitly didnt install it from the Red-Hat CD's I have), and it worked fine 1st time. If you intend imbedding some perl in your database, make sure you compile perl into it when you build your Postgres DB.

One tip for DB design, the owner of the objects (tables, indexes et al) should not be the user that access the objects in production. For example you may have a Postgres user called Webmgr that you would use to create all the tables for a web application, then you would have another Postgres user called Apache, which would do the reading and writing from the tables. The distinct difference between the two users is your Webmgr user has the ability to drop tables, and alter the structure of your schema, while the Apache user only has the permissions to do what your application requires (usually only select, insert, update and delete, or a subset thereof)

As for perl hooks into it, I would strongly recommend using DBI with the Pg driver. Its really very simple to install, altho' you'll have to download the Pg driver seperately from the DBI module. Everyone knows DBI, there is tonnes of help available online, and O'Reilly have a really cool book on using it.

I'm using this combination (perl + postgres) for the infrastructure of a web application, and it couldnt be easier.

Not sure if this is the case with the PG.pm driver you're currently using, but you can also port your applications to different databases almost transparently if one day you suddenly find you must now use an Oracle database. all my oracle coding i've done in perl i've had to make almost zero changes to in order to port it across. the changes i've had to make are pretty much SQL ones that use Oracle "hints", that are not SQL-92 complient

Good luck on your adventure with perl and postgres, I've learnt heaps from it, I'm sure you will also.


In reply to Re: In need of Perl/PostgreSQL tutorials by Ryszard
in thread In need of Perl/PostgreSQL tutorials by dustbuster

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.