pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Poul L. Christiansen <plc@faroenet.fo>
To: Joerg Hessdoerfer <Joerg.Hessdoerfer@sea-gmbh.com>
Cc: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Continuous inserts...
Date: Fri, 18 Aug 2000 11:57:55 +0100
Message-ID: <399D16B3.1E74DB8B@faroenet.fo> (raw)
References: <4.3.2.7.0.20000817162006.00af3db0@192.168.0.1>
	<4.3.2.7.0.20000818095440.00af6770@192.168.0.1>

I'm not familiar with rules. Could you please post the SQL for creating the rule
that you've created?

I going to make such a setup in the near future and this seems to .

Joerg Hessdoerfer wrote:

> Hi!
>
> Thanks all for your input...
>
> At 09:15 17.08.00 -0700, you wrote:
> [...]
> > > Question: would it work to use a transaction to perform the rename?
> > >
> > > i.e.: continuous insert into table 'main' from client.
> > >
> > >  From somewhere else, execute:
> > >
> > > begin;
> > > alter table main rename to vac_main;
> > > create table main (...);
> > > end;
> > >
> > > would the inserter notice this? Read: would ALL inserts AT ANY TIME
> > succeed?
> >
> >Unfortunately -- no.  Also, bad things can happen if the transaction
> >errors since the rename happens immediately.  There's been talk on
> >-hackers about this subject in the past.
> >
> >However, you might be able to do something like this, but
> >I'm not sure it'll work and it's rather wierd:
> >
> >Have three tables you work with, a and b and c
> >
> >Set up rule on a to change insert to insert on b.
> >Insert into a.
> >When you want to vacuum, change the rule to insert to c.
> >Vacuum b
> >Change rule back
> >move rows from a and c into b
> >vacuum c
> [...]
>
> Good idea - I immediately tested it - rules rule! That seems to work perfectly,
> and the client doesn't even see it happen (except for 'selects', one would
> have to setup
> a rule to return something meaningful then...).
>
> I did:
> Two tables, a and b.
> Normally, insert into a.
> When Vacuuming starts, create rule on a to insert into b
> Vacuum a
> drop rule
> copy records from b to a
> vacuum b
>
> Why did you suppose three tables? Did I overlook something?
>
> Greetings,
>          Joerg
> +------****  Science & Engineering Applications GmbH  ****------+
> |                                                               |
> | Joerg Hessdoerfer                                             |
> | Leading SW developer Phone:    +49 (0)2203-962211             |
> | S.E.A GmbH           Fax:                 -962212             |
> | D-51147 Koeln        Internet: joerg.hessdoerfer@sea-gmbh.com |
> |                                http://www.sea-gmbh.com        |
> +---------------------------------------------------------------+




view thread (15+ messages)  latest in thread

Message-ID: <399D16B3.1E74DB8B@faroenet.fo>
Permalink:  ../399D16B3.1E74DB8B@faroenet.fo/
Also on:    postgresql.org/message-id/399D16B3.1E74DB8B@faroenet.fo

 · 

reply

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-sql@postgresql.org
  Cc: plc@faroenet.fo, Joerg.Hessdoerfer@sea-gmbh.com, sszabo@megazone23.bigpanda.com
  Subject: Re: Continuous inserts...
  In-Reply-To: <399D16B3.1E74DB8B@faroenet.fo>
  References: <4.3.2.7.0.20000817162006.00af3db0@192.168.0.1> <4.3.2.7.0.20000818095440.00af6770@192.168.0.1> <399D16B3.1E74DB8B@faroenet.fo>

* 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