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 1iiYVO-0000aL-GG for pgsql-general@arkaria.postgresql.org; Sat, 21 Dec 2019 06:44:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iiYVN-0008BZ-0U for pgsql-general@arkaria.postgresql.org; Sat, 21 Dec 2019 06:44:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iiYVM-0008BR-Me for pgsql-general@lists.postgresql.org; Sat, 21 Dec 2019 06:44:48 +0000 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iiYVK-0000es-1l for pgsql-general@lists.postgresql.org; Sat, 21 Dec 2019 06:44:48 +0000 Received: by mail-ot1-x341.google.com with SMTP id d7so10434776otf.5 for ; Fri, 20 Dec 2019 22:44:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=mUioEtbMqrK8VentDSQ8FipkoJpSOPO6U4qaur+2S2Y=; b=IOFaQ4lPG8MpmiYw2XbY+0hFw2nE0e4dDWsulAqqx1LG4vkl+RuU+dPefPU4JWQUe3 gvAo0vzzUPAnR6CE4JSF5/5nTjutfUARj6PrihcgdciKLnYeAeUX4XrCKYEQ1CV6NWfi L2SrUQwGvwBIeXBYXoW8quXEgPniZHFS9Z1Lz0urc4VeAW2bm+a/k43DEtFJdNrjbYLV cb5fZb7di+RBoIvzux3Tj4Qa1hp0lAu/Ng2dNJcLXxnSWH85tm0i6wHO8rQnJ98UIgla 9uzNNAYsbX0lq7KeXz4aghRhcmNQkBwuzCST7l7S0mn5BucIvmhmpmQ30CpTf7sQhP47 f/1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=mUioEtbMqrK8VentDSQ8FipkoJpSOPO6U4qaur+2S2Y=; b=JLzg7kHFNsFli2HDhvWrqnVkYvWVDvnnVvG51/nNGba47rrwuY3de8wLGatxocRF/m vXSPhNpINnlbIEetlyn7iPUeZ5oFnuzRZysK0g1Zwj80z5qWZJxgZZNNEa/y/MjB/ffV Yqq9VGo6ZMjC6M1mYrWRTKWLPlP8XDlm4nSncpiNCQyaWZ6w70dFeN/AvI/Q2Duahtjd 55m4CaYvJqVSnMbFZJ3gHyP94onj9DjXDrb8OiIYAhhNXVYT3cL1XNrqi0OLxoFUfGcz qbGEyZMeiDetOfMRePRmt0grUQZ353p8qBYrgXFfV2NTkafMW+yWs8zbI0OZZMKQisOH KojQ== X-Gm-Message-State: APjAAAXS73srcVaUqk/USkJN8YLMHkrZ2j9D76R1rlJXSG/4husplL14 S+djqbuvZsUEeqLG7v/lFnuCEAWVb32ROg== X-Google-Smtp-Source: APXvYqziBqEEQxUs14M+sQifMKRCf41l3P0oukw5ENENRxP6mvOksnMRPGjti/vB+8RdnoRNUqJjGA== X-Received: by 2002:a05:6830:1d5b:: with SMTP id p27mr1990997oth.263.1576910683009; Fri, 20 Dec 2019 22:44:43 -0800 (PST) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id r63sm1192041oib.56.2019.12.20.22.44.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Dec 2019 22:44:42 -0800 (PST) Subject: Re: Semi-unable to add new records to table--primary key needed? To: pgsql-general@lists.postgresql.org References: <9c113278-3593-92dc-fbe5-7e3e0018218a@gmail.com> From: Ron Message-ID: <1fee2e64-03c5-60a2-f3e3-80891da97ca5@gmail.com> Date: Sat, 21 Dec 2019 00:44:41 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/20/19 11:02 PM, Adrian Klaver wrote: > 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. Shows how much I use pgAdmin and Access... >> >>> 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. > > -- Angular momentum makes the world go 'round.