Skip site navigation (1) Skip section navigation (2)

problem with unique entry

From: David Sauer <davids(at)penguin(dot)cz>
To: pgsql-bugs(at)postgresql(dot)org
Subject: problem with unique entry
Date: 1999-09-14 19:54:20
Message-ID: m2u2ox8e1f.fsf@penguin.cz (view raw or flat)
Thread:
Lists: pgsql-bugs
Hi, 

  I have a simple table:

create table users
(
	id serial primary key,                      
	login text unique not null,                 
	passwd text,                                
	last_access date,               	    
	tables_to_show int4[],			    
        passwds_for_tables text[]		    
);

This will produce output:

david=> create table users
david-> (
david-> id serial primary key,                      
david-> login text unique not null,                 
david-> passwd text,                                
david-> last_access date,                   
david-> tables_to_show int4[],    
david->         passwds_for_tables text[]    
david-> );
NOTICE:  CREATE TABLE will create implicit sequence 'users_id_seq' for SERIAL column 'users.id'
NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index 'users_pkey' for table 'users'
CREATE
david=> \d users
Table    = users
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                | Length|
+----------------------------------+----------------------------------+-------+
| id                               | int4 not null default nextval('" |     4 |
| login                            | text not null                    |   var |
| passwd                           | text                             |   var |
| last_access                      | date                             |     4 |
| tables_to_show                   | int4[]                           |   var |
| passwds_for_tables               | text[]                           |   var |
+----------------------------------+----------------------------------+-------+
Index:    users_pkey


My question (I think, that this is bug) is simple: why unique entry 'login' 
doesn't create implicit unique index ?
  This is true on my 6.5.1 on linux x86, compiled by gcc 2.95.

6.4.2 compiled by gcc 2.7.2 works fine.

-- 
* David Sauer, student of Czech Technical University
* electronic mail: davids(at)penguin(dot)cz (mime compatible)

pgsql-bugs by date

Next:From: George YoungDate: 1999-09-20 18:42:05
Subject: datetime bug in 6.6.0
Previous:From: Vadim MikheevDate: 1999-09-13 18:21:29
Subject: Re: [BUGS] Running queries on inherited tables

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group