Re: Running Totals and other stuff....

From: Richard Huxton <dev(at)archonet(dot)com>
To: Mike Nolan <nolan(at)gw(dot)tssi(dot)com>
Cc: Alan Graham <alan(dot)graham(at)infonetsystems(dot)com(dot)au>, Levan Jerry <Jerry(dot)Levan(at)EKU(dot)EDU>, pgsql-general(at)postgresql(dot)org
Subject: Re: Running Totals and other stuff....
Date: 2004-06-02 09:30:37
Message-ID: 40BD9E3D.3050709@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shridhar Daithankar 2004-06-02 09:55:30 Re: Securing a db app - RFC
Previous Message Richard Huxton 2004-06-02 09:17:52 Re: ORDER BY with plpgsql parameter