serial datatype changes for v7.3?

Started by Chrisover 23 years ago5 messageshackers
Jump to latest
#1Chris
pghackers@designmagick.com

Hi,

I'm playing around with the CVS version and noticed a change from 7.2 in
regards to serial datatypes - they no longer automatically have an
index. Is this a deliberate thing? I did a search in the archives but
didn't come across mention of the change. A pointer to discussion on
this would be great.

CREATE TABLE author (
authorid SERIAL,
firstname VARCHAR(255),
surname VARCHAR(255),
dateofbirth DATE,
gender CHAR(1)
);

NOTICE: CREATE TABLE will create implicit sequence
'author_authorid_seq' for SERIAL column 'author.authorid'
CREATE TABLE

library=# \d author
Table "public.author"
Column | Type | Modifiers
-------------+------------------------+--------------------------------------------------------------
authorid | integer | not null default
nextval('public.author_authorid_seq'::text)
firstname | character varying(255) |
surname | character varying(255) |
dateofbirth | date |
gender | character(1) |

library=# \di
No relations found.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Chris (#1)
Re: serial datatype changes for v7.3?

Chris <pghackers@designmagick.com> writes:

I'm playing around with the CVS version and noticed a change from 7.2 in
regards to serial datatypes - they no longer automatically have an
index. Is this a deliberate thing?

Yes. The release notes mention:

SERIAL no longer implies UNIQUE; specify explicitly if index is wanted

regards, tom lane

#3Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#2)
Re: serial datatype changes for v7.3?

Tom Lane wrote:

Chris <pghackers@designmagick.com> writes:

I'm playing around with the CVS version and noticed a change from 7.2 in
regards to serial datatypes - they no longer automatically have an
index. Is this a deliberate thing?

Yes. The release notes mention:

SERIAL no longer implies UNIQUE; specify explicitly if index is wanted

What was the logic for this change?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#3)
Re: serial datatype changes for v7.3?

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Tom Lane wrote:

Yes. The release notes mention:
SERIAL no longer implies UNIQUE; specify explicitly if index is wanted

What was the logic for this change?

See the thread back around 17 Aug:
http://archives.postgresql.org/pgsql-hackers/2002-08/msg01336.php

regards, tom lane

#5Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#4)
Re: serial datatype changes for v7.3?

OK, we just need to make that clear in the release notes. I had
forgotten about the change.

---------------------------------------------------------------------------

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Tom Lane wrote:

Yes. The release notes mention:
SERIAL no longer implies UNIQUE; specify explicitly if index is wanted

What was the logic for this change?

See the thread back around 17 Aug:
http://archives.postgresql.org/pgsql-hackers/2002-08/msg01336.php

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073