Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id C1D9E960ABC for ; Mon, 26 Mar 2012 02:39:36 -0300 (ADT) Received: from blu0-omc1-s26.blu0.hotmail.com ([65.55.116.37]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SC2eS-0006k7-8W for pgsql-admin@postgresql.org; Mon, 26 Mar 2012 05:39:35 +0000 Received: from BLU0-SMTP195 ([65.55.116.7]) by blu0-omc1-s26.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 25 Mar 2012 22:39:17 -0700 X-Originating-IP: [61.170.255.199] X-Originating-Email: [liuhaifeng@live.com] Message-ID: Received: from [172.16.224.180] ([61.170.255.199]) by BLU0-SMTP195.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sun, 25 Mar 2012 22:39:16 -0700 From: Haifeng Liu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Daily Rotated Insertion Date: Mon, 26 Mar 2012 13:39:01 +0800 To: pgsql-admin@postgresql.org MIME-Version: 1.0 (Apple Message framework v1257) X-Mailer: Apple Mail (2.1257) X-OriginalArrivalTime: 26 Mar 2012 05:39:17.0009 (UTC) FILETIME=[C8D15010:01CD0B12] X-Pg-Spam-Score: 0.8 (/) X-Archive-Number: 201203/124 X-Sequence-Number: 39312 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=