Re: Running Totals and other stuff.... - Mailing list pgsql-general

From Richard Huxton
Subject Re: Running Totals and other stuff....
Date
Msg-id 40BC8CDD.5090703@archonet.com
Whole thread Raw
In response to Running Totals and other stuff....  ("Levan, Jerry" <Jerry.Levan@EKU.EDU>)
List pgsql-general
Levan, Jerry wrote:
> Humpfff...Last night I tried posting this and found that
> dynamic IP's are now prevented from posting to the list...
>
> Did I miss the announcement?

Sounds odd - or do you mean your mailserver has a dynamic IP?

> I get the right results, but this relies on the fact the oids in the
> check table are currently *sorted* (when the table is sorted by thedate)
> at least it appears that way via
> a very brief inspection.... I suspect if I deleted a record and added
> a record the oids would get out of sequence.
>
> Is there a slick way to tell if a column (say the oids column) is in "sorted"
> order when the table is sorted by date?

No, and it isn't recommended that you use the oid column.

> Assuming the oids get out of wack with respect to the date, is it possible
> to easily construct a table of the checks sorted by date and then "glue on"
> a column of ascending integers so the running total sql statement will
> function properly?

What is your key?
Why not just sort by cheque_date, <key>?

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: after using pg_resetxlog, db lost
Next
From: Alvaro Herrera
Date:
Subject: Re: after using pg_resetxlog, db lost