Re: DELETE FROM fails with error - Mailing list pgsql-sql

From Josh Berkus
Subject Re: DELETE FROM fails with error
Date
Msg-id web-30884@davinci.ethosmedia.com
Whole thread Raw
In response to DELETE FROM fails with error  (chris Günther <guenther@uscreen.de>)
List 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
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


pgsql-sql by date:

Previous
From: Michael Ansley
Date:
Subject: RE: counting distinct rows on more than one column
Next
From: Michael Fork
Date:
Subject: Re: counting distinct rows on more than one column