pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim Nasby <decibel@decibel.org>
To: Carol Walter <walterc@indiana.edu>
Cc: Spiegelberg, Greg <gspiegelberg@isodxsolutions.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: duplicate key violates unique constraint
Date: Thu, 10 May 2007 16:17:41 -0500
Message-ID: <7D0DBA1F-6A76-4BEE-B2D5-193180F7B8C3@decibel.org> (raw)
In-Reply-To: <3368550B-3BE3-4754-8F72-BD36AE4EDF5F@indiana.edu>
References: <82E74D266CB9B44390D3CCE44A781ED90B6B15@POSTOFFICE.cranel.local>
	<3368550B-3BE3-4754-8F72-BD36AE4EDF5F@indiana.edu>

On May 10, 2007, at 9:01 AM, Carol Walter wrote:
> And this is more than a question than an answer, but I thought that  
> sequences had to designated as data type "serial."

Nope... sequences are actually completely un-related to tables. You  
can define a sequence that's not referenced by any table. The serial  
data type is essentially a 'macro' that:

Creates a sequence
Sets the default value for the field to be the nextval() of that  
sequence
Sets the field to be NOT NULL
--
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)





view thread (7+ messages)  latest in thread

Message-ID: <7D0DBA1F-6A76-4BEE-B2D5-193180F7B8C3@decibel.org>
Permalink:  ../7D0DBA1F-6A76-4BEE-B2D5-193180F7B8C3@decibel.org/
Also on:    postgresql.org/message-id/7D0DBA1F-6A76-4BEE-B2D5-193180F7B8C3@decibel.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: decibel@decibel.org, walterc@indiana.edu, gspiegelberg@isodxsolutions.com
  Subject: Re: duplicate key violates unique constraint
  In-Reply-To: <7D0DBA1F-6A76-4BEE-B2D5-193180F7B8C3@decibel.org>
  References: <82E74D266CB9B44390D3CCE44A781ED90B6B15@POSTOFFICE.cranel.local> <3368550B-3BE3-4754-8F72-BD36AE4EDF5F@indiana.edu> <7D0DBA1F-6A76-4BEE-B2D5-193180F7B8C3@decibel.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox