Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tFOk0-00Cmw5-6j for pgsql-general@arkaria.postgresql.org; Mon, 25 Nov 2024 02:22:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tFOjy-00BDQV-TF for pgsql-general@arkaria.postgresql.org; Mon, 25 Nov 2024 02:22:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tFOjy-00BDPz-IF for pgsql-general@lists.postgresql.org; Mon, 25 Nov 2024 02:22:18 +0000 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tFOjv-003cb6-Sd for pgsql-general@lists.postgresql.org; Mon, 25 Nov 2024 02:22:17 +0000 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-29737adb604so959462fac.1 for ; Sun, 24 Nov 2024 18:22:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732501335; x=1733106135; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zZ0B/eFt4BrjLgrznAjmojJcUBigUYnTsxiAfhH+Qtw=; b=ZNE0HS8gXg+BT2DPDcQh9Jzf9H2IgrPLaprPTV9cgddbXehsQo+zmDQzUNIToPtVmp B8WUl4UhKgvrd/JQv/aSS5BYYzA3sEY0JAEJpgOuVuwUKoN0nGLB/8L7+sI7CIoW5i4q mMY/6Yw8860mZ6mVY2hq7g1G9xzbydXZbs6z7b0wjQuCA63tS94WJHbVRJBS+Sv4Q/Ls H736yYgcQzidto/ILrDKaG7DNHqB8JaIEg10cj/3VqwK1V0p9PvfzsrQKFOaeFhzn+Fv SS7A2KngO72o5iPGAYKmxio6x8G7by4v2JBW0okXd1tp6psxQorPncstGOVaVH8vNg7L dMXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732501335; x=1733106135; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zZ0B/eFt4BrjLgrznAjmojJcUBigUYnTsxiAfhH+Qtw=; b=fV514qfgim+i4JI8hEr7MAaBxogQ6CzQHDBOVsMH7InJEyTa93Zhkkta3DTW3Vs4XO 1qNTFxL0PHjDibwmnhou+ikoZRNfbcpwxn3t8yZ7MlUOc0316U2gH62pArrL8fEBOqpX uduuZahFpJGExoX44VT/tcmkFs8oX3bALdXAAdUpPhhGRxuALB6JgOFCGIbGLjKmZVJE EjOIMULrXN2FiqDv0Tb1NhXJPCs1YTzOKNaa8V1nl+8Fh+cH5rryUX5OTfP3uT3jh2ao L6YXYjDZiuqFFEvDoohRKYakvhvDv7QJF/GqrNdSD1iHpXk/JGC5LyNCEwTNghClT7DZ 6flQ== X-Gm-Message-State: AOJu0YzhPARYcdsd5pI7TgZEeGt23D9CRojmf1LEWyXdrTv0saaKRRYq Q6tV1m9Wai9FVD94Oqt5a/bHgBeQn+DGaJ+ALP3tYtRBljiQ3oRhDgOqGy7Js2Bdd7NZqkMAZ0f 4MDPN7YarfV5yKdNECnjPY4BkgN78I1x5 X-Gm-Gg: ASbGncuIxfkt4aBLujgIOxNsYqWyotXVCt5bDMAZJLs7Ucbfm0mPoHXXNDKGdv0NhXl 2suWOrtGQC5oG2tj9f5z/lO298OoIX4M= X-Google-Smtp-Source: AGHT+IEe2c0zUZq+0OJSaZZF2buiwx2MbebdFye1ZdoIR59RqGV3boTHujBeJE0hyFam0PjW1qMGk5VOay08DjrEfIY= X-Received: by 2002:a05:6870:80c6:b0:296:e660:5d7c with SMTP id 586e51a60fabf-29720e7af97mr8429991fac.36.1732501333893; Sun, 24 Nov 2024 18:22:13 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac9:5d14:0:b0:56c:c9af:3ee6 with HTTP; Sun, 24 Nov 2024 18:22:13 -0800 (PST) In-Reply-To: References: From: "David G. Johnston" Date: Sun, 24 Nov 2024 19:22:13 -0700 Message-ID: Subject: Re: JDBC using REFERENCES To: Arbol One Cc: "pgsql-general@lists.postgresql.org" , PostGreSQL MailingList Content-Type: multipart/alternative; boundary="0000000000009466e40627b3667e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009466e40627b3667e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, November 24, 2024, Arbol One wrote: > > > > > * sql.append("index SERIAL NOT NULL, "); > sql.append("id TEXT PRIMARY KEY, "); sql.append("CONSTRAI= N > id PRIMARY KEY (id)"); **<=3D=3D Error* > > > This is quite confusing, having the index column be serial but not PK (or even unique=E2=80=A6) while the id column is the PK, which you=E2=80=99ve r= edundantly specified. David J. --0000000000009466e40627b3667e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, November 24, 2024, Arbol One <ArbolOne@hotmail.ca> wrote:


=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 sql.append("index SERIAL NOT NULL, ")= ;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 sql.append("id TEXT PRIMARY KEY, ");<= br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 sql.append("CONSTRAIN id PRIMARY KEY (id)&= quot;);
<=3D=3D Error
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0


This is quite confusi= ng, having the index column be serial but not PK (or even unique=E2=80=A6) = while the id column is the PK, which you=E2=80=99ve redundantly specified.<= /div>

David J.
--0000000000009466e40627b3667e--