views:

1227

answers:

3

Can anyone suggest a good guide/tutorial for programming PostgreSQL? By this I mean creating triggers and procedures, domains, new types, using the various languages, and so on.

The manual is good, but I found it lacking as a learning aid (it is more of a reference, as manuals should be)? It is very good at describing the SQL syntax and administration tools, but was not very good at the more advanced features of PostgreSQL.

I have used the forums in the past

http://www.postgresqlforums.com/forums/

but I think a proper guide or tutorial would be better.

Edit: Rereading my question, I see I was not clear enough, I am asking about writing stored procedures/triggers, creating new domains and types and all the higher end stuff. I was not asking about basic SQL and database functions, I was thinking more along the power user lines.

Update (Dec 2008): I still have not had a whole lot of luck finding anything really. I am currently using the later chapters of the PostgreSQL manual. In the FLOSS Weekly episode on PostgreSQL, Josh Berkus spoke of various uses where people have found ways for their server to talk directly to other databases, and various other applications that really sound quite impressive.

Of course, it seems quite plausible that this kind of functionality just is not really documented anywhere.

A: 

What about this? PostgreSQL 8.0.17 tutorial

SQLMenace
+3  A: 

PostgreSQL follows the ANSI SQL standards more closely than just about any database out there, so a general SQL tutorial should work.

I think that the W3Schools SQL tutorial is pretty good. They even have a "try some SQL here" page that has some example tables and lets you see the results of select statements.

The official tutorial for the latest version is here. It's part of the official manual, but maybe you missed it (the manual a little hard to browse through - it's big).

The only non-standard thing you will probably want is auto-incrementing primary keys. Just make your primary key of the type "serial" or "bigserial" instead of "integer" or "bigint". As far as I know, every database does this differently.

The proper capitalization is "PostgreSQL" and the pronunciation is "post-gres-Q-L". The strange name comes from a long time ago when SQL support was first added to the Postgres database. (Postgres was made as a successor to Ingres) "Postgres" is an accepted shortening of the name.

Neall
+1  A: 

Get the Oreilly practical PostgreSQL book, well worth the money. the link will take you to a preveiw of the book, lots of info there as well.

WolfmanDragon