Re: [SQL] Why doesn't the SERIAL data type automatically have a

2005-10-04 Thread Jim C. Nasby
On Tue, Oct 04, 2005 at 07:50:28PM -0400, Ferindo Middleton Jr wrote: > Based on the feedback I received after I made that original post, it > seemed most people don't use SERIAL with a unique constraint or primary > key and I was blasted for making such a suggestion. I'm sorry... It I don't

Re: [SQL] Why doesn't the SERIAL data type automatically have a

2005-10-04 Thread Ferindo Middleton Jr
Richard Huxton wrote: Jim C. Nasby wrote: Is there some reason why the SERIAL data type doesn't automatically have a UNIQUE CONSTRAINT. It used to, and then we decoupled it. [snip] Arguably it would have been better to make the default case add either UNIQUE or PRIMARY KEY with a way to over

Re: [SQL] Why doesn't the SERIAL data type automatically have a

2005-10-04 Thread Ferindo Middleton Jr
Jim C. Nasby wrote: On Tue, Sep 27, 2005 at 10:33:14AM -0500, Scott Marlowe wrote: On Mon, 2005-09-26 at 20:03, Tom Lane wrote: Ferindo Middleton Jr <[EMAIL PROTECTED]> writes: Is there some reason why the SERIAL data type doesn't automatically have a UNIQUE CONSTRAINT.

Re: [SQL] Why doesn't the SERIAL data type automatically have a

2005-10-04 Thread Richard Huxton
Jim C. Nasby wrote: Is there some reason why the SERIAL data type doesn't automatically have a UNIQUE CONSTRAINT. It used to, and then we decoupled it. [snip] Arguably it would have been better to make the default case add either UNIQUE or PRIMARY KEY with a way to over-ride. Arguably SERIA

Re: [SQL] Why doesn't the SERIAL data type automatically have a

2005-10-04 Thread Jim C. Nasby
On Tue, Sep 27, 2005 at 10:33:14AM -0500, Scott Marlowe wrote: > On Mon, 2005-09-26 at 20:03, Tom Lane wrote: > > Ferindo Middleton Jr <[EMAIL PROTECTED]> writes: > > > Is there some reason why the SERIAL data type doesn't automatically have > > > a UNIQUE CONSTRAINT. > > > > It used to, and then

Re: [SQL] Why doesn't the SERIAL data type automatically have a UNIQUE CONSTRAINT

2005-09-28 Thread codeWarrior
"Ferindo Middleton Jr" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there some reason why the SERIAL data type doesn't automatically have a > UNIQUE CONSTRAINT. It seems that the main reason for using it is so that > the value for this field keeps changing automatically and

Re: [SQL] Why doesn't the SERIAL data type automatically have a

2005-09-27 Thread Scott Marlowe
On Mon, 2005-09-26 at 20:03, Tom Lane wrote: > Ferindo Middleton Jr <[EMAIL PROTECTED]> writes: > > Is there some reason why the SERIAL data type doesn't automatically have > > a UNIQUE CONSTRAINT. > > It used to, and then we decoupled it. I don't think "I have no use for > one without the other

Re: [SQL] Why doesn't the SERIAL data type automatically have a UNIQUE

2005-09-26 Thread Ferindo Middleton Jr
You're right, Tom. I'm sure someone has a use for a serial field that isn't unique. I just assumed that it was. I guess I didn't read the documentation closely enough. At any rate, I had a table using a serial field that I had to restore to a previous date when I noticed that I forgot to set th

Re: [SQL] Why doesn't the SERIAL data type automatically have a UNIQUE CONSTRAINT

2005-09-26 Thread Tom Lane
Ferindo Middleton Jr <[EMAIL PROTECTED]> writes: > Is there some reason why the SERIAL data type doesn't automatically have > a UNIQUE CONSTRAINT. It used to, and then we decoupled it. I don't think "I have no use for one without the other" translates to an argument that no one has a use for it

[SQL] Why doesn't the SERIAL data type automatically have a UNIQUE CONSTRAINT

2005-09-26 Thread Ferindo Middleton Jr
Is there some reason why the SERIAL data type doesn't automatically have a UNIQUE CONSTRAINT. It seems that the main reason for using it is so that the value for this field keeps changing automatically and is never null so any one record can be identified using it- So why not imply that it is a