[OPEN-ILS-DEV] Error when trying to create a new patron record
Jason Etheridge
jason at esilibrary.com
Mon Oct 13 10:53:19 EDT 2008
On Sun, Oct 12, 2008 at 12:59 PM, Ben Ostrowsky <benostrowsky at gmail.com> wrote:
> I'm trying to create a new patron record, and I get the Postgres error
> 'duplicate key violates unique constraint "usr_address_pkey"'. The
> relevant entries from /var/log/messages (with postgres query logging
> turned on) are at http://paste.lisp.org/display/68371.
>
> Any thoughts? We recently discovered that there wasn't an index for
> tcn_value in biblio.record_entry, so I can't assume that my database
> is set up optimally in this case either.
Just for the benefit of the mail archives, Ben had to reset the
sequence for the actor.usr_address table.
For example: select setval('actor.usr_address_id_seq',max(id), true)
from actor.usr_address;
Any time you're inserting records directly into EG tables through the
database such that you're also specifying the id's (and not using the
id sequences for said tables), then you'll need to manually adjust the
sequences afterward so that they can't offer up id's that have already
been used.
--
Jason Etheridge
| VP, Community Support and Advocacy
| Equinox Software, Inc. / The Evergreen Experts
| phone: 1-877-OPEN-ILS (673-6457)
| email: jason at esilibrary.com
| web: http://www.esilibrary.com
More information about the Open-ils-dev
mailing list