From: | Luca Ferrari <fluca1978(at)gmail(dot)com> |
---|---|
To: | Rich Shepard <rshepard(at)appl-ecosys(dot)com> |
Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Variable constants ? |
Date: | 2019-08-16 13:55:24 |
Message-ID: | CAKoxK+7Y=4mOMGf6nefeZHUu8DUEAukL8h5YfJ3xZrOvk1OJ2g@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, Aug 15, 2019 at 11:27 PM Rich Shepard <rshepard(at)appl-ecosys(dot)com> wrote:
> create table labor_rate_mult (
> rate real primary_key,
> start_date date not null,
> end_date date
> )
I think the rate should not be the primary key, since that would
prevent keeping the whole history when the value is resetted to a
previous one. Probably here a surrogate key will make the trick.
The range solution is probably a more elegant one.
I would also propose the over-complicated possibility of making an
extension wrapping functions that return each single constant value.
In this way, changing the value means upgrading the extension and is
another way to keep history of changes, but probably is because I
don't like one-raw tables so much.
Luca
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Grman | 2019-08-16 14:08:57 | Re: Bad Estimate for complex query with JOINS on subselects and OR in where conditions |
Previous Message | PegoraroF10 | 2019-08-16 13:52:16 | Re: slow queries on system tables |