Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 494056326FA for ; Sun, 11 Oct 2009 05:32:18 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 43427-10 for ; Sun, 11 Oct 2009 08:32:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f218.google.com (mail-ew0-f218.google.com [209.85.219.218]) by mail.postgresql.org (Postfix) with ESMTP id 0440E632662 for ; Sun, 11 Oct 2009 05:32:06 -0300 (ADT) Received: by ewy18 with SMTP id 18so2582141ewy.19 for ; Sun, 11 Oct 2009 01:32:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=u/2hkZVGGR5My1U/pHEXBE4uneKf6NnPV5I5u3k5mY0=; b=Rl64Nw9b+Jp3gp7899O+gBWRhd+fScWExaXerBcXlZ8fSdw7qZrLZvEN419RmwRsAn jhCfxsaYsFWoe1X5xZhuSsIREQ8/cThK4Wlq8NEY3enaszaOCr2savX1O1xSAjjWevkL xrSN7u/6igm1Cb+Dq/+tIStXyFxkCn2P718kU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=mmjBrRPhRpvliyHE3Qdrhobmz1k/0CrEPOq1xQDkrL8HdmHhhsgABgvm9Ia3yzpz0k fijS8bXoAijdzrUDin00FNB1Up1zw9Z+QeqcD1nJWAGlwmePLVDzLBi9cEGpGVB6ZMJy NzN5rHAn6dSe3fpBeioGIqCEf49hWq5irHMZU= MIME-Version: 1.0 Received: by 10.211.147.10 with SMTP id z10mr2619295ebn.28.1255249925039; Sun, 11 Oct 2009 01:32:05 -0700 (PDT) In-Reply-To: <200910101736.46449.robert@paulsenonline.net> References: <200910101056.24051.robert@paulsenonline.net> <200910101529.15690.robert@paulsenonline.net> <22204.1255209151@sss.pgh.pa.us> <200910101736.46449.robert@paulsenonline.net> Date: Sun, 11 Oct 2009 12:32:05 +0400 Message-ID: Subject: Re: ERROR: null value in column "id" violates not-null constraint From: Dmitriy Igrishin To: Robert Paulsen Cc: pgsql-sql@postgresql.org, Tom Lane Content-Type: multipart/alternative; boundary=001636c5ba97e2e7c20475a4a5a3 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200910/49 X-Sequence-Number: 33248 --001636c5ba97e2e7c20475a4a5a3 Content-Type: text/plain; charset=ISO-8859-1 Hello. Note, that you may use SERIAL data type and PostgreSQL will implicitly create sequence for you column, for example, CREATE table test ( id SERIAL NOT NULL PRIMARY KEY, -- PostgreSQL will implicitly create 'test_id_seq' dat text ); Regards, Dmitiy Igrishin 2009/10/11 Robert Paulsen > On Saturday 10 October 2009 4:12 pm, Tom Lane wrote: > > Robert Paulsen writes: > > > I do have a question, though, I fixed things as indicated above: > > > id integer DEFAULT nextval('vault_id_seq') NOT NULL, > > > Dump gave back > > > id integer DEFAULT nextval('vault_id_seq'::text) NOT NULL, > > > That "text" seems odd. Should I change it? > > > > That's all there is in 8.0 ... > > > > regards, tom lane > > Thanks! > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > --001636c5ba97e2e7c20475a4a5a3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello.
Note, that you may use SERIAL data type and PostgreSQL will impli= citly create sequence for you column, for example,
=A0=A0=A0 CREATE tabl= e test (
=A0=A0=A0=A0=A0=A0=A0 id SERIAL NOT NULL PRIMARY KEY, -- Postgr= eSQL will implicitly create 'test_id_seq'
=A0=A0=A0=A0=A0=A0=A0 dat text
=A0=A0=A0 );

Regards,
Dmitiy Ig= rishin

2009/10/11 Robert Paulsen <robert@paulsenonl= ine.net>
On Saturday 10 October 2009 4:12 pm, Tom Lane wrote:
> Robert Paulsen <robert@= paulsenonline.net> writes:
> > I do have a question, though, I fixed things as indicated above:<= br> > > =A0 =A0 id integer DEFAULT nextval('vault_id_seq') NOT NU= LL,
> > Dump gave back
> > =A0 =A0 id integer DEFAULT nextval('vault_id_seq'::text) = NOT NULL,
> > That "text" seems odd. Should I change it?
>
> That's all there is in 8.0 ...
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 regards, tom lane

Thanks!

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
= http://www.postgresql.org/mailpref/pgsql-sql

--001636c5ba97e2e7c20475a4a5a3--