On 27 Jul 2002, John McNally wrote:

> Are you saying torque created a sequence with name board_id_SEQ?  I
> don't see how it could given the table definition below.  But if you say
> yes, I guess I will take a look at the source.

Postgres creates the sequence... For example: [indentation added]

directory=# CREATE TABLE test ( id serial );
NOTICE:  CREATE TABLE will create implicit sequence 'test_id_seq' for 
          SERIAL column 'test.id'
NOTICE:  CREATE TABLE / UNIQUE will create implicit index 'test_id_key' 
          for table 'test'
CREATE
directory=# drop table test;
DROP
directory=# drop sequence test_id_seq;
DROP
directory=# CREATE TABLE test ( test_id serial );
NOTICE:  CREATE TABLE will create implicit sequence 'test_test_id_seq' for 
          SERIAL column 'test.test_id'
NOTICE:  CREATE TABLE / UNIQUE will create implicit index 
          'test_test_id_key' for table 'test'
CREATE

The sequences that postgres creates seem to be of the form 
${table}_${column}_seq and torque is referencing them as ${table}_seq. 

This happens in getSequenceName() in 
org/apache/torque/engine/database/model/Table.java

Is it the version of postgres that I am using, 7.2.1? It seems like it 
shouldn't be though; the method of just using the table name seems like it 
would fail if for some reason there were two serials in a table. I can't 
come up with a reason why someone would want to, but it isn't illegal and 
trying to do it should be allowed.

Will


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to