Re: pg_dump and DEFAULT column values

From: "Eric Ridge" <ebr(at)tcdi(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_dump and DEFAULT column values
Date: 2001-11-06 22:20:12
Message-ID: D3ADE25911614840BC69C72E3171E4ED0FBE01@tcdiexch.tcdi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > Have you considered using a sequence, rather than generating
> > new values
> > as shown above? The approach you are using is extremely fragile:
> > consider what happens if two backends try to insert at the
> same time.
>
> a sequence it is! thanks.

well, but then again, I want the default value of that field to be 1
greater than the max value, not the next value in a sequence.

The client application has the ability to change the value of that
field, but new records need to be max+1.

So I guess to make pg_dump happy, and to solve potential concurrency
issues, I need a trigger for that field? Or will I have the same
circular reference problem with a trigger?

eric

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Masaru Sugawara 2001-11-06 22:25:07 Re: Probably simple answer
Previous Message Martín Marqués 2001-11-06 22:19:25 Re: Sourceforge moving from PostgreSQL to Oracle