Re: Case bug in SQL Constraint

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: "Warren W(dot) Gay VE3WWG" <ve3wwg(at)cogeco(dot)ca>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Case bug in SQL Constraint
Date: 2002-08-02 18:26:37
Message-ID: 20020802112525.R41371-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


On Thu, 1 Aug 2002, Warren W. Gay VE3WWG wrote:

> The SQL query below reports an error if the value "uid" is
> provided in uppercase ("UID"). The error reported is:
>
> ERROR: CREATE TABLE: column "UID" named in key does not exist
>
> The problem is eliminated if "UID" is made "uid".
> Here is the full text of the query:
>
> CREATE TABLE PASSWD (
> NAME VARCHAR(32) NOT NULL,
> PASSWD VARCHAR(32),
> UID INTEGER NOT NULL,

Here you're giving an unquoted name so it gets casefolded
(currently to lowercase).

> GID INTEGER NOT NULL,
> GECOS VARCHAR(80) NOT NULL,
> DIR VARCHAR(256) NOT NULL,
> SHELL VARCHAR(256) NOT NULL,
> CONSTRAINT "PASSWD_PKEY" PRIMARY KEY ("UID")
Here you're giving a quoted name so no casefolding occurs.

In general you shoul be consistant about either quoting
or not quoting table and column names, mixing them is
dangerous.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephan Szabo 2002-08-02 18:30:43 Re: BUG: RI not enforced on inherited foreign keys (v.7.2.1)
Previous Message Ernest E Vogelsinger 2002-08-02 16:09:37 BUG: RI not enforced on inherited foreign keys (v.7.2.1)