I guess short term, I would like to see support for the nextval and curval functions.

With Postgres it is possible to also support an mysql style auto increment.  


Either one of these would work.  





What I am getting right now is a hibernate error, if I use the Teiid Dialect:
org.hibernate.MappingException: Dialect does not support identity key generation



Here is the SQL I am using to create the table in Postgres:

CREATE TABLE labbook.person
(
  person_id serial NOT NULL,
  first_name text NOT NULL,
  last_name text NOT NULL,
  last_modified_by text,
  last_modified timestamp without time zone,
  CONSTRAINT person_pkey PRIMARY KEY (person_id)
);

ALTER TABLE labbook.person ADD COLUMN person_id integer;
ALTER TABLE labbook.person ALTER COLUMN person_id SET NOT NULL;
ALTER TABLE labbook.person ALTER COLUMN person_id SET DEFAULT nextval('labbook.person_person_id_seq'::regclass);



--
James Schappet
james-schappet@uiowa.edu



On Jun 21, 2010, at 2:51 PM, Steven Hawkins wrote:

Hi Jimmy,

What type of sequence support are you looking for?  Full language support?   

For Oracle, in designer a sequence may be modeled as a table with a name in source of dual and columns with the name in source set to <sequence name>.[nextval|currentval].  You can use a sequence as the default value for insert columns by setting the column to autoincrement and the name in source to <element name>:SEQUENCE=<sequence name>.<sequence value>.  The latter is more of a workaround though, rather than a good solution.

It seems like we would need to extend that support for PostgreSQL and other databases supporting sequences.  We should also think about getting sequence information as part of dynamic vdb metadata so this isn't a manual exercise.

For documentation we're always looking for more wiki content, examples, etc.  The newer documents, like the admin guide, may be a little lite.  So if you see anything omitted, let us know.

Steve

----- Original Message -----
From: "James C Schappet" <james-schappet@uiowa.edu>
To: teiid-dev@lists.jboss.org
Sent: Monday, June 21, 2010 8:54:47 AM GMT -06:00 US/Canada Central
Subject: [teiid-dev] PostgreSQL Sequences

Quick question:  Will teiid ever support sequences in postgres or oracle?


BTW, Theres lots of good work going on here -- CR2 looks good.

Is there some documentation I could help writing?

--Jimmy
--
James Schappet
james-schappet@uiowa.edu




_______________________________________________
teiid-dev mailing list
teiid-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/teiid-dev