From: Kevin Grittner
Subject: Re: insert
Date: ,
Msg-id: 4E32CE5D020000250003F8FF@gw.wicourts.gov
(view: Whole thread, Raw)
In response to: insert  (alan)
Responses: Re: insert  (Gavin Flower)
List: pgsql-performance

alan <> wrote:

> Can I write a BEFORE ROW trigger for the products table  to runs
> on INSERT or UPDATE to
>  1. insert a new category & return the new category_id  OR
>  2.  return the existing category_id for the (to be inserted row)

What would you be using to match an existing category?  If this
accurately identifies a category, why not use it for the key to the
category table, rather than generating a synthetic key value?

-Kevin


pgsql-performance by date:

From: "Kevin Grittner"
Date:
Subject: Re: insert
From: Robert Klemme
Date:
Subject: Re: Performance penalty when using WITH