<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I guess short term, I would like to see support for the nextval and curval functions.<div><br></div><div>With Postgres it is possible to also support an mysql style auto increment. </div><div><br></div><div><br></div><div>Either one of these would work. </div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>What I am getting right now is a hibernate error, if I use the Teiid Dialect:</div><div><span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">org.hibernate.MappingException: Dialect does not support identity key generation</span></div><div><div><br></div></div><div><br></div><div><br></div><div>Here is the SQL I am using to create the table in Postgres:</div><div><br></div><div><div><div><font class="Apple-style-span" face="Courier">CREATE TABLE labbook.person</font></div><div><font class="Apple-style-span" face="Courier">(</font></div><div><font class="Apple-style-span" face="Courier"> person_id serial NOT NULL,</font></div><div><font class="Apple-style-span" face="Courier"> first_name text NOT NULL,</font></div><div><font class="Apple-style-span" face="Courier"> last_name text NOT NULL,</font></div><div><font class="Apple-style-span" face="Courier"> last_modified_by text,</font></div><div><font class="Apple-style-span" face="Courier"> last_modified timestamp without time zone,</font></div><div><font class="Apple-style-span" face="Courier"> CONSTRAINT person_pkey PRIMARY KEY (person_id)</font></div><div><font class="Apple-style-span" face="Courier">);</font></div></div><div><font class="Apple-style-span" face="Courier"><br></font></div><div><font class="Apple-style-span" face="Courier">ALTER TABLE labbook.person ADD COLUMN person_id integer;</font></div><div><font class="Apple-style-span" face="Courier">ALTER TABLE labbook.person ALTER COLUMN person_id SET NOT NULL;</font></div><div><font class="Apple-style-span" face="Courier">ALTER TABLE labbook.person ALTER COLUMN person_id SET DEFAULT nextval('labbook.person_person_id_seq'::regclass);</font></div></div><div><br></div><div><br></div><div><br></div><div><div>
<div>--</div><div>James Schappet</div><div><a href="mailto:james-schappet@uiowa.edu">james-schappet@uiowa.edu</a></div><div><br></div><br class="Apple-interchange-newline">
</div>
<br><div><div>On Jun 21, 2010, at 2:51 PM, Steven Hawkins wrote:</div><br class="Apple-interchange-newline"><div>Hi Jimmy,<br><br>What type of sequence support are you looking for? Full language support? <br><br>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.<br><br>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.<br><br>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.<br><br>Steve<br><br>----- Original Message -----<br>From: "James C Schappet" <<a href="mailto:james-schappet@uiowa.edu">james-schappet@uiowa.edu</a>><br>To: <a href="mailto:teiid-dev@lists.jboss.org">teiid-dev@lists.jboss.org</a><br>Sent: Monday, June 21, 2010 8:54:47 AM GMT -06:00 US/Canada Central<br>Subject: [teiid-dev] PostgreSQL Sequences<br><br>Quick question: Will teiid ever support sequences in postgres or oracle?<br><br><br>BTW, Theres lots of good work going on here -- CR2 looks good.<br><br>Is there some documentation I could help writing? <br><br>--Jimmy<br>--<br>James Schappet<br><a href="mailto:james-schappet@uiowa.edu">james-schappet@uiowa.edu</a><br><br><br><br><br>_______________________________________________<br>teiid-dev mailing list<br>teiid-dev@lists.jboss.org<br>https://lists.jboss.org/mailman/listinfo/teiid-dev<br></div></div><br></div></body></html>