Re: auto-increment with postgresql

Thomas Vandahl <[email protected]>
Newsgroups gmane.comp.jakarta.turbine.devel
Message-ID <[email protected]>
Hi Jeff,

On 20.03.20 17:40, Jeffery Painter wrote:
> The torque template generator is creating sequences for auto-increment
> primary keys, however, I think there is a flaw in the logic setup.

The management of sequences is done within the Torque Java code and not
in SQL. When Torque was designed, the features you describe probably
didn't exist. Please check if the code works without your manual changes
(it should). If it doesn't, please create an issue in the Torque project.

My guess is that in your setup nextval() is going to be called twice,
once by the default clause in your table column and once by the Java
code in Torque. That means that you ids will increment by two every
time. Could you please verify that?

Generally, my intention was to modernize the Torque code for 5.0. If the
ownership of a sequence is now a recommended best practice, we should
add that to the Torque templates.

Bye, Thomas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.