Re: BUG #14398: Order of Joins results in different results returned

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14398: Order of Joins results in different results returned
Дата
Msg-id 8758.1477518736@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #14398: Order of Joins results in different results returned  (vjchem@gmail.com)
Список pgsql-bugs
vjchem@gmail.com writes:
> This appears to ultimately be a casting issue, but it was surprising to us
> and thus I thought I'd file a bug report. I have a query that has two JOINs,
> where each JOIN uses parameters $1 and $2. The order of the JOIN changes the
> results returned. I can get the results I expect by explicitly casting $1
> and $2 or by changing the order of the JOINs. Is this expected behavior? It
> feels like I should get an error if the casting is ambiguous or that the
> order of the JOINs should not change the results.

I think the point is that you've got two separate uses of $1 and $2
in contexts that will lead to different conclusions about what their
types are (date or timestamptz, respectively).  Whichever one the
parser comes to first will determine its choice, and the other context
is not so incompatible as to result in an error; nor is the provided
input string.  But you'll get different results depending on that
choice.

Yes, it's ambiguous, but throwing an error would probably not make
more people happy than it makes unhappy.

            regards, tom lane

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

Предыдущее
От: vjchem@gmail.com
Дата:
Сообщение: BUG #14398: Order of Joins results in different results returned
Следующее
От: "Sengodan, Kesavan"
Дата:
Сообщение: Not able to uninstall PostgreSQL 8.4.5-1 in Windows 10 OS and Windows Server 2012 OS