Re: auto-increment with postgresql

Jeffery Painter <[email protected]>
Newsgroups gmane.comp.jakarta.turbine.devel
Message-ID <[email protected]>
I will try that.... for this project, I actually have a second Java 
program that is injesting code from xml archives and pushing it into the 
db (outside of Turbine)... Turbine was just the front end for allowing 
the team to query the data.

I was relying on the database to auto-gen the primary keys for me in 
this case. I can test this though based on your recommendation and see 
if it works without having to define the sequence stuff in nextval().

Cheers,

Jeff


On 3/21/20 8:20 AM, Thomas Vandahl wrote:
> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
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.