Re: [HACKERS] Problem with the constraints test and PRIMARY KEY on UnixWare 7.

From: David Hartwig <daveh(at)insightdist(dot)com>
To: "Billy G(dot) Allie" <Bill(dot)Allie(at)mug(dot)org>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Problem with the constraints test and PRIMARY KEY on UnixWare 7.
Date: 1998-09-08 14:41:54
Message-ID: 35F54232.23D773E7@insightdist.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)Allie(at)mug(dot)org
> | /| | 7436 Hartwell | Compuserve: 76337,2061
> |-/-|----- | Dearborn, MI 48126| MSN.......: B_G_Allie(at)email(dot)msn(dot)com
> |/ |LLIE | (313) 582-1540 |

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Hartwig 1998-09-08 14:49:58 Re: [HACKERS] Macro From Hell
Previous Message Thomas G. Lockhart 1998-09-08 14:30:13 Re: [HACKERS] Problem with the constraints test and PRIMARY KEY on UnixWare 7.