Re: Any way to insert rows with ID used in another column

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Francisco Olarte <folarte(at)peoplecall(dot)com>
Cc: Ben Hoyt <benhoyt(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Any way to insert rows with ID used in another column
Date: 2014-04-06 15:05:47
Message-ID: 53416D4B.4000007@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/06/2014 05:30 AM, Francisco Olarte wrote:
> Hi Adrian:
>
>
> On Sun, Apr 6, 2014 at 2:30 AM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
>> Still think this is something for a BEFORE INSERT TRIGGER:
>
> I think a trigger is overkill for just a simple data-combining
> procedure. JMO, but I prefere to reserve triggers for htings which
> need them.

Well the flip side to that argument is that a trigger is a single point
of reference for the data changing. You can hit the table from wherever
and whatever and have the same thing happen. No wrestling with ORMs to
get database specific code to run. No tracking down where the query is
that is munging the data. Not saying one approach is inherently better
than the other, just that there are options.

>
> Regards.
> Francisco Olarte.
>

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2014-04-06 18:31:56 Re: Any way to insert rows with ID used in another column
Previous Message Francisco Olarte 2014-04-06 12:30:09 Re: Any way to insert rows with ID used in another column