Re: [HACKERS] Problem with the constraints test and PRIMARY KEY on UnixWare 7. - Mailing list pgsql-hackers

From David Hartwig
Subject Re: [HACKERS] Problem with the constraints test and PRIMARY KEY on UnixWare 7.
Date
Msg-id 35F54232.23D773E7@insightdist.com
Whole thread Raw
In response to Problem with the constraints test and PRIMARY KEY on UnixWare 7.  ("Billy G. Allie" <Bill.Allie@mug.org>)
List pgsql-hackers
This is the same problem as that has been pestering me for two weeks.

Billy, please try this simple test:

CREATE TABLE foo (bar int);

\d foo

CREATE INDEX foo_idx ON foo USING btree (bar);

\d foo

Is foo gone?


Billy G. Allie wrote:

> 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    |




pgsql-hackers by date:

Previous
From: David Hartwig
Date:
Subject: Re: [HACKERS] Macro From Hell
Next
From: Bruce Momjian
Date:
Subject: Re: CIDR/IP types. Was: [GENERAL] big numbers