Re: Reserve one row for every distinct value in a column

Поиск
Список
Период
Сортировка
От Chris Angelico
Тема Re: Reserve one row for every distinct value in a column
Дата
Msg-id CAPTjJmpANO1PJtemGpmBQW_QOVHKGPR=5QV-nMn6gMgH=U-L4w@mail.gmail.com
обсуждение исходный текст
Ответ на Reserve one row for every distinct value in a column  (seiliki@so-net.net.tw)
Список pgsql-general
On Wed, May 16, 2012 at 4:53 PM,  <seiliki@so-net.net.tw> wrote:
> Hi! I am trying to implement a mechanism to reserve the last row for every distinct value in column "c1".

Take a step back. Why are you needing to preserve these rows? This
smells like a likely target for normalization. Put your unique values
for c1 into a separate table, along with all data that depends only on
that, and reference it in your main table with a foreign key. Even if
you remove all the entries from your main that reference a row, the
other table will retain its data.

Chris Angelico

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

Предыдущее
От: seiliki@so-net.net.tw
Дата:
Сообщение: Reserve one row for every distinct value in a column
Следующее
От: Horaci Macias
Дата:
Сообщение: Re: vacuum, vacuum full and problems releasing disk space