Re: Insert zero to auto increment serial column

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: loc <c320sky(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Insert zero to auto increment serial column
Date: 2014-04-02 13:46:57
Message-ID: 533C14D1.9050802@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/02/2014 05:17 AM, loc wrote:
> I'm currently using an Informix Innovator-C database with Aubit4GL and I
> would like to migrate to PostgreSQL, it looks like the transition will
> not be too difficult, however there is one feature that I would like
> added to PostgreSQL. Where is the best place to request a feature add?
> With Informix inserting a 0 into a serial column will auto increment the
> serial value, MySQL also works this way. With PostgreSQL I will need to
> do a lot of code modification to my Aubit4GL programs, since I will need
> to either insert with the key word default or omit the serial column in
> the insert statement. A typical insert with Aubit4GL looks like this:
>
> create table table_name (link serial, col2 integer, col3 integer ....)
> define var_rec record like table_name.*
> let table_name.link = 0
> insert into table_name values(var_rec.*)
>
> As you can see, with Informix the serial column is set to 0 before the
> insert, with PostgreSQL I will need to list all the columns and will not
> be able to use the wildcard syntax, which supplies all the column names
> to the insert. Setting the serial column to null to auto increment
> would also work for me.

Looks like Aubit4GL has provisions for doing the conversions behind the
scenes:

http://aubit4gl.sourceforge.net/aubit4gldoc/manual/index.html

and for a more detailed example:

http://openssa.sourceforge.net/aubit4gl.html

Might be worth asking for more info on the Aubit4GL list:

https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss

>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2014-04-02 13:59:11 Re: Insert zero to auto increment serial column
Previous Message Scott Marlowe 2014-04-02 13:24:39 Re: Insert zero to auto increment serial column