Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iiWvf-0004n0-91 for pgsql-general@arkaria.postgresql.org; Sat, 21 Dec 2019 05:03:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iiWuf-0004CA-V5 for pgsql-general@arkaria.postgresql.org; Sat, 21 Dec 2019 05:02:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iiWue-00048p-ML for pgsql-general@lists.postgresql.org; Sat, 21 Dec 2019 05:02:49 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iiWub-0005cp-KQ for pgsql-general@lists.postgresql.org; Sat, 21 Dec 2019 05:02:47 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 12D23623; Sat, 21 Dec 2019 00:02:44 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sat, 21 Dec 2019 00:02:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=S 90LpxEOsygdVdPLe+uZzcD0WqPjS0hXGQ+gJMH9O44=; b=qriXjSkRvOFPHXWzR PzXMAp9YSY84eOWjlLwWyHSbTdvDASsSexm9WQDj7Hq0aeHg060p0QYNxopMX2+s qJ4OtcIPQLBZm7zT9msw/sRRn0FUjIMzWL+f1GarDrowO//oDCfz6mV8Lvyge4rJ kd87Is5iWfJqlc4WELf1w+7h/FfmYyI/Fm4Xd+pfDD55VqWZf/mXU3LN2wr8S407 +e89VCeDQaWKBiB6B6ZikLZcyu80/LAylnZtTbeXl50qYYocAdbQjWE9+TKzpvXn VAfo2vUCCilPXvSMiRqaXpDBSZVJE5NoQ6KzxUA+RnZm3gr1ERRLDEIu+1/CPLfe pbu1Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=S90LpxEOsygdVdPLe+uZzcD0WqPjS0hXGQ+gJMH9O 44=; b=ZR2FsJL6mWHtlamR0Znlh14P3oKL+zF5RCXNvV3psUoQrF0n3NB2caodo /n130UuxW7D58Bl23w1CiK98ee/IoWYsIMPwAoBzHdV2j73w6l13wnpES2PYfWKy c7KZEjNjpcSa86rEI466vCEAkn+7kPS6f/9oijtd9kR8RKSiY02u2Tw/S/kHcMBH e+Mz28oheGQtbzEnQUlXuoudo4Lz0Uy5Kxy1bJYGJEzIvQX8zMYle5sik3csTWYM 6jHE+vB6u4zH3Tta8zpQkdLUC93wJU9mYBN2BBEqoh3Wf1SUqWTCTHpzgKSqVndg UCS9YD1MjCgWKUYWOabPRvg2AALQg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddugedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuffhomhgrihhnpehpghgrughmihhnrd horhhgnecukfhppeejuddrvdduvddruddvledrudelfeenucfrrghrrghmpehmrghilhhf rhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhush htvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.2] (unknown [71.212.129.193]) by mail.messagingengine.com (Postfix) with ESMTPA id 38DE33060C93; Sat, 21 Dec 2019 00:02:43 -0500 (EST) Subject: Re: Semi-unable to add new records to table--primary key needed? To: Ron , pgsql-general@lists.postgresql.org References: <9c113278-3593-92dc-fbe5-7e3e0018218a@gmail.com> From: Adrian Klaver Message-ID: Date: Fri, 20 Dec 2019 21:02:42 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <9c113278-3593-92dc-fbe5-7e3e0018218a@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/20/19 6:28 PM, Ron wrote: > The lack of PK should make insertions *more* forgiving.  (It really > should have a PK, but that's irrelevant to this problem.) Actually it is the problem: https://www.pgadmin.org/docs/pgadmin4/4.16/editgrid.html "If the table definition does not include an OID or a primary key, the displayed data is read only. " As I recall Access has the same restriction. > >> I had to abandon plans to rollout a conversion to Postgres because of this problem, and so I'd like to solve it so we can do the switch relatively soon. >> >> Here's the SQL on the table from pgAdmin: >> CREATE TABLE public.tblaliquot >> ( >> aliquotid integer NOT NULL DEFAULT nextval('tblaliquot_aliquotid_seq'::regclass), >> preparationid bigint, >> datealiquotted date, >> rnaaliquottype bigint, >> sequencer character varying(4) COLLATE pg_catalog."default", >> aliquotlabel character varying(40) COLLATE pg_catalog."default", >> aliquotbarcode character varying(255) COLLATE pg_catalog."default", >> rnaaliquotconcentration double precision, >> originalvolume double precision, >> numberdefrosts integer, >> storagetype bigint, >> locationfreezer bigint, >> locationrow character varying(10) COLLATE pg_catalog."default", >> locationrack character varying(10) COLLATE pg_catalog."default", >> locationbox character varying(10) COLLATE pg_catalog."default", >> locationplate character varying(255) COLLATE pg_catalog."default", >> locationspace character varying(10) COLLATE pg_catalog."default", >> locationother character varying(60) COLLATE pg_catalog."default", >> aliquottedby bigint, >> comments text COLLATE pg_catalog."default", >> creationdate date, >> createdby bigint >> ) >> >> The original code that created the table used AliquotID serial for the first field. >> >> The sequence mentioned in the first field of the definition shows Current Value of 1 in the properties tab in pgAdmin, despite the large number of records. But the sequences associated with other tables also are very low, like 3 or 4. 3 or 4 might be the number of records added after the initial creation. >> >> This worked from psql: >> INSERT INTO tblAliquot VALUES (55338, 6772, '2012-10-05 00:00:00', 6, E'A', NULL, NULL, 24.3, >> 33, 0, 1, NULL, NULL, E'1', E'A', NULL, >> E'A1', NULL, 23, NULL, '2012-10-18 00:00:00', 55 ); >> >> > > -- > Angular momentum makes the world go 'round. -- Adrian Klaver adrian.klaver@aklaver.com