Re: pg_dump and DEFAULT column values - Mailing list pgsql-general

From Eric Ridge
Subject Re: pg_dump and DEFAULT column values
Date
Msg-id D3ADE25911614840BC69C72E3171E4ED0FBE01@tcdiexch.tcdi.com
Whole thread Raw
In response to pg_dump and DEFAULT column values  ("Eric Ridge" <ebr@tcdi.com>)
Responses Re: pg_dump and DEFAULT column values
List 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

pgsql-general by date:

Previous
From: "Eric Ridge"
Date:
Subject: Re: pg_dump and DEFAULT column values
Next
From: Masaru Sugawara
Date:
Subject: Re: Probably simple answer