Re: Clustered table order is not preserved on insert

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Andrus <eetasoft(at)online(dot)ee>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Clustered table order is not preserved on insert
Date: 2006-04-27 00:15:23
Message-ID: 20060427001523.GR97354@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 26, 2006 at 11:05:09PM +0300, Andrus wrote:
> >> I want to duplicate report so that id order is preserved.
> >
> > Tables aren't ordered by definition.
>
> From CLUSTER docs:
>
> "When a table is clustered, it is physically reordered based on the index
> information. "

Keep reading... from the same paragraph:

Clustering is a one-time operation: when the table is subsequently
updated, the changes are not clustered. That is, no attempt is made to
store new or updated rows according to their index order. If one wishes,
one can periodically recluster by issuing the command again.

There is absolutely no way to enforce any kind of table ordering in
PostgreSQL as soon as you do *anything* that changes the table.

And like others said, I think you need to re-think how you're doing
this... :)
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2006-04-27 00:16:32 Re: Moving a data base between differnt OS
Previous Message Jim C. Nasby 2006-04-27 00:04:30 Re: Database Selection