Re: greatest/least semantics different between oracle and postgres

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: greatest/least semantics different between oracle and postgres
Дата
Msg-id 874pkpfpp0.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: greatest/least semantics different between oracle and postgres  (Bruno Wolff III <bruno@wolff.to>)
Ответы Re: greatest/least semantics different between oracle and postgres  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
"Bruno Wolff III" <bruno@wolff.to> writes:

> Also what value should I have used in a coalesce to guaranty still getting
> the maximum?

I would expect coalesce(coalesce(greatest(a,b),a),b) to do what you want. It's
not terribly legible though and if a and b are subselects I would worry a
little about the optimizer rerunning them unnecessarily.

Perhaps coalesce(greatest(a,b), coalesce(a,b)) is more legible?

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com


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

Предыдущее
От: Masaru Sugawara
Дата:
Сообщение: Re: Possible bug (or I don't understand how foreign keys should work with partitions)
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: greatest/least semantics different between oracle and postgres