Re: Weird results when using schemas

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Weird results when using schemas
Дата
Msg-id 20051120203449.I44533@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Weird results when using schemas  (Geert Jansen <geert@boskant.nl>)
Список pgsql-general
On Mon, 21 Nov 2005, Geert Jansen wrote:

> I'm experiencing some weird results with SELECT queries when I recently
> switched to using schemas. Basically, the same query works OK when I set
> my search_path to include the schema, but it doesn't when I qualify the
> tables in my query.
>
> One query that demonstrates the behaviour is (apologies for the long query).
>
> shs=> SELECT
> shs.city.id,shs.city.code,shs.city.name,shs.city.description,shs.city.mod_date,shs.city.mod_user
> FROM (shs.city AS city INNER JOIN shs.object_city_relationship ON
> shs.object_city_relationship.city_id = city.id INNER JOIN shs.object AS
> object ON shs.object_city_relationship.object_id = object.id)  WHERE
> object.id = 1;
> NOTICE:  adding missing FROM-clause entry for table "city"
>  id |  code  |  name  |      description       |
> mod_date          | mod_user
> ----+--------+--------+------------------------+----------------------------+----------
>   1 | alanya | Alanya | Alanya, the nice city. | 2005-11-21
> 00:00:40.502701 |        0
>   2 | bodrum | Bodrum | bodrum                 | 2005-11-21
> 00:03:53.786452 |        0
> (2 rows)
>
> Note the WARNING that "city" is missing in the FROM clause. I don't
> understand this as it seems to be there.

After using "shs.city as city", I don't believe it's correct to use
shs.city in the select list as I think that name is not exported from the
FROM clause due to the correlation name.


В списке pgsql-general по дате отправления:

Предыдущее
От: Geert Jansen
Дата:
Сообщение: Weird results when using schemas
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Weird results when using schemas