In Postgres at least, serial columns are typically defined as:

CREATE TABLE FOO (
  id_piano  serial primary key,
  ...
)

This automatically creates a sequence foo_id_piano_seq.  Of course,
you can also create a sequence separate from a table with CREATE
SEQUENCE, but this is (IMHO) wordy.

You can select from it to find the current value with CURRVAL(), or
get the value and increment it in one operation as:

SELECT NEXTVAL ( <sequencename> );

-- Kevin

___________________________________
Kevin J. Rice
Senior Software Engineer, Textura LLC
51-K Sherwood Terrace, Lake Bluff IL
___________________________________


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to