Re: Add relcreated (timestamp) column to pg_class catalog to record the time an object was created

Поиск
Список
Период
Сортировка
От Melvin Davidson
Тема Re: Add relcreated (timestamp) column to pg_class catalog to record the time an object was created
Дата
Msg-id CANu8Fiw_h=QtDbwytGLE5MtYEroEE8T0rpJ2Cz1gB3yCvTjVow@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add relcreated (timestamp) column to pg_class catalog to record the time an object was created  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Ответы Re: Add relcreated (timestamp) column to pg_class catalog to record the time an object was created  (Melvin Davidson <melvin6925@gmail.com>)
Список pgsql-general


On Thu, Apr 21, 2016 at 3:11 AM, Karsten Hilbert <Karsten.Hilbert@gmx.net> wrote:
On Wed, Apr 20, 2016 at 07:09:24PM -0400, Melvin Davidson wrote:

> There is also the situation of tables with limitited use. EG:
> history_yyyymm, in which case it would facilitate dropping of tables that
> are no longer needed after x amount of time.

        select * from pg_class where to_timestamp(substring(relname from 9), 'YYYYMM') CONDITION;

Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


"select * from pg_class where to_timestamp(substring(relname from 9), 'YYYYMM') CONDITION;"
Yes, that might possibly work, but history_YYYYMM was just an example illustration. What if the table name did not have a date in it?
eg: persons_things_done,
Then you need the creation date of the table.

--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

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

Предыдущее
От: Sameer Kumar
Дата:
Сообщение: Re: Invalid data read from synchronously replicated hot standby
Следующее
От: Alex Ignatov
Дата:
Сообщение: Re: Initdb --data-checksums by default