Re: DELETE FROM fails with error

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: chris Günther <guenther(at)uscreen(dot)de>, pgsql-sql(at)postgresql(dot)org
Subject: Re: DELETE FROM fails with error
Date: 2001-03-28 15:54:05
Message-ID: web-30884@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Chris,

> I have a reference between these two tables pointing from
> tblshop.ID_Country to
> tblcountry.ID_Country
>
> When I try to delete a row from tblshop I get the error that postgres
> can't find
> the attribute id_shop. My SQL-command looks like follows:
>
> DELETE FROM tblshop WHERE tblshop."ID_Shop" = 12
>
> the same happens when I try to do:
>
> DELETE FROM tblshop WHERE tblshop."ID_Country" = 3
>
> I also tried this query without quotes, with simple quotes (')
> without the leading
> tablename and so on, but I always get the error-message:

Two possibilities:

1. You're using a couple of different cases in the above example.
PostgreSQL is case-sensitive. What interface program are you using?
What OS? From the error messages, it looks like your commands are being
lower-cased by the interface or data transport, which would cause
Postgres not to recognize the field names.
a. Try you commands from PSQL on the Database server, making sure that
your case is the same as the table definition.
b. If you can down the DB for an hour, try re-naming one of the ID
fields in lower case (one that isn't foriegn keyed, of course).

2. It's possible that defining these rows as type OID requires some
special reference syntax. If so, hopefully someone on the list will
come forward.

-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Ansley 2001-03-28 15:58:13 RE: counting distinct rows on more than one column
Previous Message Tom Lane 2001-03-28 15:22:56 Re: pg_dump potential bug