Auto create partition with declarative partitioning

Поиск
Список
Период
Сортировка
От Jorge Torralba
Тема Auto create partition with declarative partitioning
Дата
Msg-id CACut7uSQhKPusp8Cvx-dK3huwZrRQw=aER23xs9U4fxS8-wvDA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Auto create partition with declarative partitioning
Re: Auto create partition with declarative partitioning
Список pgsql-admin
Trying to make this work but am having difficulties.

I have created a table with a timestamp column that i wish to partition by range using the timestamp column.

My objective is to test if a partition exists for the date range and create it if it does not.

In the past I have had a before insert trigger which I would send to a create partition function. Extract the info from NEW.createdate, and use some logic to create the partition if it did not exists for the create date.

However, now, with the partition by range, I get the error : 

Partitioned tables cannot have BEFORE / FOR EACH ROW triggers.

Therefore I cannot call the function to check if the partition exists.

Other than creating a bunch of partitions in advance, what are my options?

--
Thanks,

Jorge Torralba
----------------------------

Note: This communication may contain privileged or other confidential information. If you are not the intended recipient, please do not print, copy, retransmit, disseminate or otherwise use the information. Please indicate to the sender that you have received this email in error and delete the copy you received. Thank You.

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

Предыдущее
От: prasanna rk
Дата:
Сообщение: Re: minimal network speed for replication
Следующее
От: Scott Ribe
Дата:
Сообщение: Re: Auto create partition with declarative partitioning