serial datatype changes for v7.3?

Поиск
Список
Период
Сортировка
Искать

serial datatype changes for v7.3?

От:
Chris <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.


Re: serial datatype changes for v7.3?

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Chris  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

Re: serial datatype changes for v7.3?

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
Tom Lane wrote:
> Chris  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

Re: serial datatype changes for v7.3?

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Bruce Momjian  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

Re: serial datatype changes for v7.3?

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:

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

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

Tom Lane wrote:
> Bruce Momjian  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

FAQ