Re: viewing the original order of entered records - Mailing list pgsql-general

From scott.marlowe
Subject Re: viewing the original order of entered records
Date
Msg-id Pine.LNX.4.33.0306131439010.21088-100000@css120.ihs.com
Whole thread Raw
In response to viewing the original order of entered records  ("Sven Van Acker" <Sven.Van.Acker@vub.ac.be>)
List pgsql-general
On Tue, 10 Jun 2003, Sven Van Acker wrote:

> Hi
>
>
>
> I've the following problem:
>
>
>
> I have a 2-column table with columns "person_id"(int4) and "phase"(text).
>
>
>
> When I entered the following records in a chronological fashion: <1, "high
> school">; <1, "childhood"> and <2, "university">;
>
>
>
>
>
> I requested the following select-statement.
>
>
>
> SELECT person_id, phase FROM life ORDER BY person_id
>
>
>
> And found the tuple <1, "childhood"> before the tuple <1, "high school">.
>
>
>
> I want to view the chronological order of my entries, but ordered by
> person_id.
>
> Is this possible in postgresql?

Yes, just make sure and store a date/time stamp when you insert the
records.  You can use a before trigger to update a time stamp field on
every update of the row.

Note that without a field to "order by" neither postgresql nor any other
database guarantees any particular return order.


pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Index not being used in MAX function (7.2.3)
Next
From: weigelt@metux.de
Date:
Subject: Re: Pg_dumpall