db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Eade <se...@backstagetech.com.au>
Subject Re: autoIncrement in PostgreSQL
Date Sun, 04 Jan 2004 23:50:03 GMT
Thomas Lohmueller wrote:

>I have a problem with autoIncrement in PostgreSQL. The following part from the 
>xml-file does not even generate valid SQL. 
>
>    <table name="addr_groups">
>        <column name="addr_group_id" type="BIGINT" autoIncrement="true" 
>required="true" primaryKey="true" />
>        <column name="name" type="VARCHAR" size="20" required="true" />
>        <column name="descr" type="VARCHAR" size="100" required="true" 
>default="" />
>    </table>
>
>Torque-gen-3.1 generates this sql-code. 
>CREATE TABLE addr_groups
>(
>                                    addr_group_id,
>                                    name varchar (20) NOT NULL,
>                                    descr varchar (100) default '' NOT NULL,
>    PRIMARY KEY (addr_group_id)
>);
>
>The database-tag contains defaultIdMethod?="native".
>
Do you also specify a name attribute on your database element?  Have you 
tried using an idMethod attribute on your table element?

For PostgreSQL I recommend that you specify include:

    <id-method-parameter name="seqName" 
value="addr_groups_addr_group_id_seq"/>

within your table element.

You should also be sure to check out:

http://nagoya.apache.org/wiki/apachewiki.cgi?TorqueProjectPages/PostgreSQLFAQ

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au




---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message