Re: Implementing SQL ASSERTION

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: Implementing SQL ASSERTION
Дата
Msg-id 87pnwvewny.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на Re: Implementing SQL ASSERTION  (Joe Wildish <joe-postgresql.org@elusive.cx>)
Ответы Re: Implementing SQL ASSERTION  (Dmitry Dolgov <9erthalion6@gmail.com>)
Список pgsql-hackers
>>>>> "Joe" == Joe Wildish <joe-postgresql.org@elusive.cx> writes:

 >> I haven't looked at the background of this, but if what you want to
 >> know is whether the aggregate function has the semantics of min() or
 >> max() (and if so, which) then the place to look is
 >> pg_aggregate.aggsortop.

 Joe> Thanks for the pointer. I've had a quick look at pg_aggregate, and
 Joe> back at my code, but I think there is more to it than just the
 Joe> sorting property. Specifically we need to know about the aggregate
 Joe> function when combined with connectors <, <=, < ANY, <= ANY, < ALL
 Joe> and <= ALL (and their equivalents with ">" and ">=").

The presence of an aggsortop means "this aggregate function is
interchangeable with (select x from ... order by x using OP limit 1)",
with all of the semantic consequences that implies. Since OP must be the
"<" or ">" member of a btree index opclass, the semantics of its
relationships with other members of the same opfamily can be deduced
from that.

 Joe> Also, it looks like COUNT and SUM don't have a sortop

Right, because those currently have no semantics that PG needs to know
about or describe.

-- 
Andrew (irc:RhodiumToad)


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Cygwin linking rules
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: Odd 9.4, 9.3 buildfarm failure on s390x