Re: AS OF queries

Поиск
Список
Период
Сортировка
От legrand legrand
Тема Re: AS OF queries
Дата
Msg-id 1515012543406-0.post@n3.nabble.com
обсуждение исходный текст
Ответ на Re: AS OF queries  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: AS OF queries
Список pgsql-hackers
Maybe that a simple check of the asof_timestamp value like:

asof_timestamp >= now() - time_travel_period
AND 
asof_timestamp >= latest_table_ddl

would permit to raise a warning or an error message saying that query result
can not be garanteed with this asof_timestamp value.


latest_table_ddl being found with

SELECT greatest( max(pg_xact_commit_timestamp( rel.xmin )),
max(pg_xact_commit_timestamp( att.xmin ))) as latest_table_ddl 
FROM      pg_catalog.pg_attribute att     
INNER JOIN pg_catalog.pg_class rel     
ON att.attrelid = rel.oid WHERE    rel.relname = '<asof_tablename>' and
rel.relowner= ...

(tested with add/alter/drop column and drop/create/truncate table)

Regards
PAscal



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html


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

Предыдущее
От: Remi Colinet
Дата:
Сообщение: Re: [Patch] Make block and file size for WAL and relations defined atcluster creation
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] Proposal: Local indexes for partitioned table