Problem with the constraints test and PRIMARY KEY on UnixWare 7.

bill.allie@mug.org

From: "Billy G. Allie" <Bill.Allie@mug.org>
To: hackers@postgreSQL.org
Date: 1998-09-08T08:02:52Z
Lists: pgsql-hackers
In the constraints test, a table (primary_tbl) is defined with a primary key.  
The table is created, shows up in the list of table using the \dt command, but 
does not exist if you use the \d command, or any SQL statement referencing the 
table.  Here is the output from the \dt and \d command.

    regression=>\dt

    Database    = regression
     +------------------+----------------------------------+----------+
     |  Owner           |             Relation             |   Type   |
     +------------------+----------------------------------+----------+
				    [...]
     | postgres         | path_tbl                         | table    |
     | postgres         | person                           | table    |
     | postgres         | point_tbl                        | table    |
     | postgres         | polygon_tbl                      | table    |
     | postgres         | primary_tbl                      | table    |
     | postgres         | real_city                        | table    |
     | postgres         | reltime_tbl                      | table    |
     | postgres         | road                             | table    |
				    [...]
     +------------------+----------------------------------+----------+
    regression=> \d primary_tbl
    Couldn't find table primary_tbl!
    regression=> \di

    Database    = regression
     +------------------+----------------------------------+----------+
     |  Owner           |             Relation             |   Type   |
     +------------------+----------------------------------+----------+
     | postgres         | primary_tbl_pkey                 | index    |
     | postgres         | unique_tbl_i_key                 | index    |
     +------------------+----------------------------------+----------+
    regression=> \d primary_tbl_pkey

    Table    = primary_tbl_pkey
    +----------------------------------+----------------------------+-------+
    |              Field               |            Type            | Length|
    +----------------------------------+----------------------------+-------+
    | i                                | int4                       |     4 |
    +----------------------------------+----------------------------+-------+
    regression=> 

The problem seems to be restrict to the use of PRIMARY KEY, since unique_table 
works fine.

And here is the relavent portions from test output.

    QUERY: CREATE TABLE PRIMARY_TBL (i int PRIMARY KEY, t text);
    NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index
             primary_tbl_pkey for table primary_tbl
    QUERY: INSERT INTO PRIMARY_TBL VALUES (1, 'one');
    ERROR:  primary_tbl: Table does not exist.
    QUERY: INSERT INTO PRIMARY_TBL VALUES (2, 'two');
    ERROR:  primary_tbl: Table does not exist.
			    [...]
    QUERY: SELECT '' AS four, * FROM PRIMARY_TBL;
    ERROR:  primary_tbl: Table does not exist.
    QUERY: DROP TABLE PRIMARY_TBL;
    ERROR:  Relation primary_tbl Does Not Exist!
    QUERY: CREATE TABLE PRIMARY_TBL (i int, t text, PRIMARY KEY(i,t));
    NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index
             primary_tbl_pkey for table primary_tbl
    ERROR:  cannot create primary_tbl
    QUERY: INSERT INTO PRIMARY_TBL VALUES (1, 'one');
    ERROR:  primary_tbl: Table does not exist.
    QUERY: INSERT INTO PRIMARY_TBL VALUES (2, 'two');
    ERROR:  primary_tbl: Table does not exist.
			    [...]
    QUERY: SELECT '' AS three, * FROM PRIMARY_TBL;
    ERROR:  primary_tbl: Table does not exist.
    QUERY: DROP TABLE PRIMARY_TBL;
    ERROR:  Relation primary_tbl Does Not Exist!

Any help would be appreciated.
Thanks.
-- 
____       | Billy G. Allie    | Domain....: Bill.Allie@mug.org
|  /|      | 7436 Hartwell     | Compuserve: 76337,2061
|-/-|----- | Dearborn, MI 48126| MSN.......: B_G_Allie@email.msn.com
|/  |LLIE  | (313) 582-1540    |