Re: Some newbie question

From: Shane Ambler <pgsql(at)007Marketing(dot)com>
To: Ritesh Nadhani <riteshn(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Some newbie question
Date: 2006-10-20 05:35:14
Message-ID: 45386012.9050501@007Marketing.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ritesh Nadhani wrote:
> Hello
>
> Just trying to play around with PostgreSQL. Some commands and their
> result are:
>
> test=# create table ncbi ( id serial, title varchar(50), abstract text,
> primary key(id));
> NOTICE: CREATE TABLE will create implicit sequence "ncbi_id_seq" for
> serial column "ncbi.id"
> NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
> "ncbi_pkey" for table "ncbi"
> CREATE TABLE
> test=# drop table ncbi;
> DROP TABLE
> test=# create table ncbi ( id serial, title varchar(50), abstract text);
> NOTICE: CREATE TABLE will create implicit sequence "ncbi_id_seq" for
> serial column "ncbi.id"
> CREATE TABLE
>
> ======
>
> q1) Does 'implicit index' means that they have given a default name to
> the PK which I defined in the first query since I didnt give a name or
> does it mean one another index is created apart from the PRIMARY KEY?
>
> Ritesh
>

Precisely - 'create implicit index' means you didn't give a CREATE INDEX
command - but the index was created to satisfy the primary key
constraint you entered in your first create table command.
Just as the sequence is implicitly created to satisfy the serial datatype.

--

Shane Ambler
Postgres(at)007Marketing(dot)com

Get Sheeky @ http://Sheeky.Biz

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2006-10-20 06:03:56 Re: The HP MSA20 SATA-SCSI enclosure
Previous Message A. Kretschmer 2006-10-20 04:55:23 Re: trigger postgresql 7.4