Re: DELETE FROM fails with error

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: DELETE FROM fails with error
Дата
Msg-id web-30884@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на DELETE FROM fails with error  (chris Günther <guenther@uscreen.de>)
Список 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 по дате отправления:

Предыдущее
От: Michael Ansley
Дата:
Сообщение: RE: counting distinct rows on more than one column
Следующее
От: Michael Fork
Дата:
Сообщение: Re: counting distinct rows on more than one column