Re: Compare with default value?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Ulrich Goebel <ml(at)fam-goebel(dot)de>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Compare with default value?
Date: 2021-03-14 17:13:14
Message-ID: d71f24bf-02d8-1697-2dc7-9c976a23156f@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 3/14/21 6:30 AM, Ulrich Goebel wrote:
> Hi,
>
> Am 13.03.21 um 22:21 schrieb Tim Cross:
>>

>> I think you may need to re-think your design or at least come at it from
>> a different perspective. As shown by another post in the thread, at some
>> level, this is 'sort of' possible, but it will be ugly and fragile.
>
> Yes, I am re-thinking allredy...
>
>>

>
> o.k.: For a conference I have a tbl_person which holds all peoble which
> are involved: participants and people which provide private lodgins for
> other participants. (There are much more roles, but for illustration
> these two should be enough.) Of course each person can have one or more
> roles at the conference, a n-n-relation models that. Now our workflow
> allows that one person find it way in the tbl_person twice (ore even
> more often): for example the conference office generates a row for Tom,
> because he provides private lodgin. Later on Tom decides to participate
> an fills the online registration formular. These data generate the
> second row for Tom. Both rows hold significant information which the
> other doesn't hold. Let's say the online register gave the birthday, the
> other holds information about the lodgin (bed with or without
> breakfast). The next step then is that the conference office get notice
> of the doubled person an should make one row out of the existing two
> rows. The office decide which of the two rows should be completed with
> data from the other row. Therefore I would like to pick the columns in
> the first row where we have default values and replace it by the value
> from the second row.

This is just part of a bigger issue, which value to believe:

col_1 col_2 col_3 col_4
row 1 default some_val default some_val
row 2 other_val default default other_val

How do you arrive at assumption that row 2(or any other row) has
precedence over row 1?

>
> There are more ways to end with two or even more rows per person. May be
> it would have been much better to avoid these possibilities. But for the
> moment I have a given database structure running in productive mode, so
> it is not easy to re-structure the structure or even the workflows...
>
> Thanks for patience reading all that!
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ulrich Goebel 2021-03-14 17:38:15 Re: Compare with default value?
Previous Message Ulrich Goebel 2021-03-14 13:30:36 Re: Compare with default value?