Greatest of a list of columns?

Поиск
Список
Период
Сортировка
От Ron
Тема Greatest of a list of columns?
Дата
Msg-id 76af441a-c989-55d7-5e42-ed029ae256c8@gmail.com
обсуждение исходный текст
Ответы Re: Greatest of a list of columns?  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-general
Postgresql 12.5


What's the canonical Postgresql method for doing, for example, this?
SELECT relname, MAXOF(last_vacuum, last_autovacuum)
FROM pg_stat_user_tables;

Seeing both last_vacuum and last_autovacuum is useful, of course, but 
sometimes I only want to see the "really" last time it was vacuumed.

I can hard code a case statement, but a generic multi-column solution is 
preferred.

Thanks

-- 
Angular momentum makes the world go 'round.



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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Insert/Dump/Restore table with generated columns
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Greatest of a list of columns?