Re: Insert zero to auto increment serial column

From: Shaun Thomas <sthomas(at)optionshouse(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, Jayadevan M <maymala(dot)jayadevan(at)gmail(dot)com>
Cc: loc <c320sky(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Insert zero to auto increment serial column
Date: 2014-04-02 14:13:10
Message-ID: 533C1AF6.10502@optionshouse.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/02/2014 08:24 AM, Scott Marlowe wrote:

> Triggers are almost always better here and really aren't that hard to
> write.

Not only do I have to agree with this statement, I feel it's important
to add a clarification regarding your original question.

Translating serial values submitted as 0 to something else is will
likely never be a PostgreSQL feature, as it is probably a violation of
the SQL standard. Databases are meant to store exactly what you submit,
barring any modifications by stored procedure or trigger.

If a database engine takes it upon itself to modify your data, it is no
longer a database, but an application that mimics one.

--
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604
312-676-8870
sthomas(at)optionshouse(dot)com

______________________________________________

See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eliot Gable 2014-04-02 14:26:38 Table Vacuum Taking a Long Time
Previous Message David Johnston 2014-04-02 13:59:11 Re: Insert zero to auto increment serial column