partitioning question. need current month and archive partitions. - Mailing list pgsql-general

From Sergey Levchenko
Subject partitioning question. need current month and archive partitions.
Date
Msg-id e3ffbf240810240218u6c80b78cu629035946c57043e@mail.gmail.com
Whole thread Raw
List pgsql-general
Hi All!

I have a table - transaction pool - with a lot of rows, but I use only
data for the latest month, or current year in my computations.
How can I split data to partitions like that if I can't use CHECK
constraints with non constant objects like, extract('month' from
CURRENT_DATE), extract('year' from CURRENT_DATE):

  transaction_pool - master table

  transaction_currentmonth - table contains transactions commited
_only_ this (current) month
  transaction_currentyear - table contains all transaction for this
year except for transaction_currentmonth rows

  transaction_archive - table contains everything except for
transaction_currentmonth, transaction_currentyear rows

Will it be helpful to make such a kind of partitioning?

Thanks a lot!

pgsql-general by date:

Previous
From: "Thom Brown"
Date:
Subject: Re: Storing questionnaire data
Next
From: Ludwig Kniprath
Date:
Subject: Query m:n-Combination