From: Haifeng Liu <liuhaifeng@live.com>
To: pgsql-admin@postgresql.org
Subject: Daily Rotated Insertion
Date: Mon, 26 Mar 2012 13:39:01 +0800
Message-ID: <BLU0-SMTP195BAAB8B6E63CE73CF5849B9450@phx.gbl> (raw)
Hi all:
I want to do a daily rotated insertion according the data's date field. The data come from a real time analyzer, which means it's date field is nearly the current date but not exactly, even not exactly in the date order.
The real trouble is it will be a heavy insertion, I don't want to code a complex trigger function. I'd like to simply redirect the insertion to a "CURRENT" table, and rename it every mid-night. But it's difficult to make 'check', which is required by a better query performance.
Well, I can create a trigger to redirect insertion to 'yesterday', 'today' and 'tomorrow', but I am still expecting a more simple and more fast solution.
Any idea is appreciated. Thanks in advance.
Best regards.
liuhaifeng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: liuhaifeng@live.com
Subject: Re: Daily Rotated Insertion
In-Reply-To: <BLU0-SMTP195BAAB8B6E63CE73CF5849B9450@phx.gbl>
References: <BLU0-SMTP195BAAB8B6E63CE73CF5849B9450@phx.gbl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox