Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 16, 2012 at 4:53 PM,  <seiliki@xxxxxxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux