I do most of my DB work in PostgreSQL. I like it. It’s object oriented, has loads of functionality, high level of SQL compliance, is Open Source, etc. Unfortunately I have to work in Oracle for my JDBC course. I didn’t think that would be a big problem, I kind of thought that Pgsql is just like Oracle (except Open Source). I have just learned a very important difference between Pgsql and Oracle. When creating a table in Pgsql you can set the default value for column to be the next value coming out of a sequence. Very useful as then you just ignore the column when doing any inserts and voila an automatic primary key whose current value can be queried, can be restarted, {insert your favorite feature of sequences here}, etc. However you can’t do that in Oracle. In Oracle you must specify everything in your insert statement (to be fair you can let the current date (time?) be a default value). I find the PGSQL way much easier and seemingly safer. The pgsql way looks like the table maintains the PK by default (though the user can over ride the default value) where as in Oracle it seems like the user is responsible for maintaining the pk.

 
By Tom Aratyn, 4. March 2006, 17:43 o'clock

You may add your comment at any time with the help of the form at the page bottom.

Currently no comments

  1. No comment yet

Add your own comment



Follow comments according to this article through a RSS 2.0 feed

Syndication

Categories

March 2006
M T W T F S S
« Feb   May »
 12345
6789101112
13141516171819
20212223242526
2728293031