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

From Richard Huxton
Subject Re: Running Totals and other stuff....
Date
Msg-id 40BD9E3D.3050709@archonet.com
Whole thread Raw
In response to Re: Running Totals and other stuff....  (Mike Nolan <nolan@gw.tssi.com>)
Responses Re: Running Totals and other stuff....  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
Mike Nolan wrote:
>>Adding a cheque number primary key would work tho'
>
>
> Depending on the specifics of the application, check number may not
> be a  'unique' field.  Automatic bank checks come to mind, on my
> monthy statments they tend to always have the same check number or none
> at all.
>
> In this case I'd use a serial column.
>
> The best long term solution, IMHO, would be to change postgres so that
> it has a unique system column for each record, like Oracle does.

Eh? The expense of having a 64-bit column with index and unique
constraint on every table, whether I need it or not?

[soapbox = on]
The problem was a simple one. The original poster wanted to distinguish
between rows where there was no key. Without a key this is impossible.
The table should not have been created without a primary key defined,
and in the absence of adequate information to make a design decision the
best that can be offered is an auto-generated sequence.
[soapbox = off]

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: ORDER BY with plpgsql parameter
Next
From: Shridhar Daithankar
Date:
Subject: Re: Securing a db app - RFC