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 1tHu8H-00AhIU-Pu for pgsql-general@arkaria.postgresql.org; Mon, 02 Dec 2024 00:17:46 +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 1tHu8F-00CDWq-AF for pgsql-general@arkaria.postgresql.org; Mon, 02 Dec 2024 00:17:44 +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 1tHu8D-00CDVz-Va for pgsql-general@lists.postgresql.org; Mon, 02 Dec 2024 00:17:44 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tHu8C-000Ymk-B3 for pgsql-general@postgresql.org; Mon, 02 Dec 2024 00:17:42 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id D6C581140110; Sun, 1 Dec 2024 19:17:38 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Sun, 01 Dec 2024 19:17:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1733098658; x=1733185058; bh=blTXwzDqUyjTaYXPRe6uEvGh8p93AtEW4ZwJhpngNWk=; b= XIbswWH2l9gMH7vV41K7a14lREjY+vcWPLx/lPftwWvbs7RTbWis2cIfKdt6aZuN QqPmBHUMqGoeVpRzZDJmKSTRc85jbkxmf2SGjr687CqTxjVRaLndPVTKUvu8159v Dl4m8IoPJuwUQ9nAATTfXX5i7/xBf/Eor4IRE12R97lJPZwjQmcw7Aj+77r5haTx sc4AHHwxddcMfnaKu6FTD1hmUPBbIStv/Ed696FJ/fJqy9rt2hUgWII3Stq6liOv KohrcuNpyUa6gP1/D8r1PI+k5FnHE+06YroIkBq77aRO+BPEnBdPpmGcCRYulPkk 5VlXXcmPCq9s6K4e+/b+oA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1733098658; x=1733185058; bh=b lTXwzDqUyjTaYXPRe6uEvGh8p93AtEW4ZwJhpngNWk=; b=zE7dlnWHmfvGMryQc Ts+R2C5Tg1obwDbummi30mc2GScsZHGdq6Km0XLXrqeLIzQzoiK8j68bjOiHPVGf Vi3Gw51xGRvn/Ok+sCgYTWFKIYk8rcRB4Ks1waevIJn5mYVt/HhePCDRHTArmDqy fbcjmMX8Q+KU1ksm4SF8HfQlZaLJBZXnukpiq8ZRqqWZMtWcAwMudz3dgDze+Q2I Ic9eQl90WDi2F9l6xpXpe+veAzRy570kGV9oB2E8VNSkt+JPncT32axARXirQjoe PAHWn8ZIcyGFXsLSAJ8Zt/7YH2sYdzamlsv2MT1S4237nRo9IVWAv4WHqlZMRo7a nLJ/Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrheekgddvtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtvdejnecu hfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrg hklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepleegveekkeekueeigfdtveei leeuhfefudefteekjeffkeejueejheegheegkedtnecuffhomhgrihhnpehpohhsthhgrh gvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsggprh gtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrrhgsohhlohhn vgeshhhothhmrghilhdrtggrpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlhesph hoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 1 Dec 2024 19:17:38 -0500 (EST) Message-ID: Date: Sun, 1 Dec 2024 16:17:37 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Help with syntax error To: Arbol One , PostGreSQL MailingList References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/1/24 16:14, Arbol One wrote: > I have these tables: > > *CREATE TABLE IF NOT EXISTS registrar ( > index SERIAL, > registrar_id TEXT, > day TEXT NOT NULL, > month TEXT NOT NULL, > year TEXT NOT NULL, > hour TEXT NOT NULL, > minute TEXT NOT NULL, > second TEXT NOT NULL, > millisecond TEXT NOT NULL, > am_pm TEXT NOT NULL, > admin BOOLEAN NOT NULL DEFAULT false, > CONSTRAINT key PRIMARY KEY (registrar_id) ); > > CREATE TABLE IF NOT EXISTS user_name ( > user_name_id TEXT PRIMARY KEY REFERENCES registrar(registrar_id), > first_name TEXT NOT NULL, > middle_name TEXT NOT NULL, > last_name TEXT NOT NULL);* > > When I enter the following pg commands : > > *INSERT INTO registrar VALUES (DEFAULT, '18551420601012L23', '1', '12', > '2024', '18', '55', '14', '207', 'PM'); > INSERT INTO user_name '18551420601012L23', 'John', 'Fitzgerald', > 'Kennedy'); <= **/UserNameTable.write()/* > You don't see the difference between the first and second statements. Hint, it starts with V. > I get this message : > > */Exception in thread "main" java.sql.SQLException: In > company.contact.Company$UserNameTable.write() > ERROR: syntax error at or near "'18551420601012L23'" >   Position: 23/ > * > > The error is in the user_name_id, which is a primary that references the > table "*registrar*" 's "*registrar_id" *primary key. > According to the documentation > , the > insertion should be OK, no? > > What am I doing wrong? > > > -- > */ArbolOne ™/* > Using Fire Fox and Thunderbird. > ArbolOne is composed of students and volunteers dedicated to providing > free services to charitable organizations. > ArbolOne's development on Java, PostgreSQL, HTML and Jakarta EE is in > progress [ í ] -- Adrian Klaver adrian.klaver@aklaver.com