Re: Variable constants ?

Поиск
Список
Период
Сортировка
От Luca Ferrari
Тема Re: Variable constants ?
Дата
Msg-id CAKoxK+7Y=4mOMGf6nefeZHUu8DUEAukL8h5YfJ3xZrOvk1OJ2g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Variable constants ?  (Rich Shepard <rshepard@appl-ecosys.com>)
Список pgsql-general
On Thu, Aug 15, 2019 at 11:27 PM Rich Shepard <rshepard@appl-ecosys.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



В списке pgsql-general по дате отправления:

Предыдущее
От: PegoraroF10
Дата:
Сообщение: Re: slow queries on system tables
Следующее
От: Peter Grman
Дата:
Сообщение: Re: Bad Estimate for complex query with JOINS on subselects and OR inwhere conditions