Re: Insert zero to auto increment serial column - Mailing list pgsql-general

From Shaun Thomas
Subject Re: Insert zero to auto increment serial column
Date
Msg-id 533C1AF6.10502@optionshouse.com
Whole thread Raw
In response to Re: Insert zero to auto increment serial column  (Scott Marlowe <scott.marlowe@gmail.com>)
List 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@optionshouse.com

______________________________________________

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


pgsql-general by date:

Previous
From: David Johnston
Date:
Subject: Re: Insert zero to auto increment serial column
Next
From: Eliot Gable
Date:
Subject: Table Vacuum Taking a Long Time