Re: add column .. default

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rod Taylor <rbt(at)rbt(dot)ca>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: add column .. default
Date: 2003-06-19 03:22:13
Message-ID: 6065.1055992933@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rod Taylor <rbt(at)rbt(dot)ca> writes:
> For the update I intend to use double space, as if the user did those
> items as individual commands within the same transaction.

There is no alternative, unless you want the command to be
non-roll-back-able.

> Someone can
> make it more efficient in regards to constraint checks, etc. in the
> future if they want -- I don't intend to.

It'd be nice if you at least ensure that all the constraints are checked
in a single pass over the table (not one per constraint). Right offhand
I do not see why they couldn't be checked in the same pass that does the
UPDATE. For extra credit, detect that the default expression is
immutable or stable, and do the checks *once* not once per row.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2003-06-19 04:12:25 Re: Two weeks to feature freeze
Previous Message Tom Lane 2003-06-19 03:09:46 Re: allowed user/db variables