Re: one more word about rules - Mailing list pgsql-general

From Adam Haberlach
Subject Re: one more word about rules
Date
Msg-id 20000922105157.B9319@ricochet.net
Whole thread Raw
In response to Re: one more word about rules  ("Abe Asghar" <abe@fish.tm>)
List pgsql-general
On Fri, Sep 22, 2000 at 03:33:46PM +0100, Abe Asghar wrote:
> Hi everyone,
>
> I have built a database that uses int4 as the unique identifier for a news
> database.
>
> Therefore an article has a identifier 1, the next one has 2 etc.
>
> Then I order them when they are displayed on the web reversely so that the
> last article added is at the top of the list.
>
> I now face a major problem.  If we need to back dackdate an article - I
> can't.  This is because the all the indexes are taken up ie 1, 2, 3......75
> odd records.  If I want to add one between 50 and 51 ie 50.5, I cannot
> because the field is an int4.

    Perhaps you should store the date of the article in the database, and
then sort by that.  You can even set the default for the field to be now() so
that it automatically gets set on insert, and you can override it during
backdate inserts or with later updates...


--
Adam Haberlach            | A billion hours ago, human life appeared on
adam@newsnipple.com       | earth.  A billion minutes ago, Christianity
http://www.newsnipple.com | emerged.  A billion Coca-Colas ago was
'88 EX500                 | yesterday morning. -1996 Coca-Cola Ann. Rpt.

pgsql-general by date:

Previous
From: "Aggarwal , Ajay"
Date:
Subject: what if PQexec() result is toooooo big?
Next
From: Stephan Szabo
Date:
Subject: Re: Triggers