Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fa1LG-0003B1-VY for pgsql-general@arkaria.postgresql.org; Mon, 02 Jul 2018 16:06:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1LF-0002PL-GS for pgsql-general@arkaria.postgresql.org; Mon, 02 Jul 2018 16:06:17 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fa1LE-0002FS-NC for pgsql-general@lists.postgresql.org; Mon, 02 Jul 2018 16:06:16 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fa1LB-0005PV-BV for pgsql-general@lists.postgresql.org; Mon, 02 Jul 2018 16:06:14 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w62G6Aon008580; Mon, 2 Jul 2018 12:06:10 -0400 From: Tom Lane To: Marco Fochesato cc: pgsql-general@lists.postgresql.org Subject: Re: Not able to update some rows in a table In-reply-to: References: Comments: In-reply-to Marco Fochesato message dated "Mon, 02 Jul 2018 17:38:10 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <63927.1530547570.1@sss.pgh.pa.us> Date: Mon, 02 Jul 2018 12:06:10 -0400 Message-ID: <63928.1530547570@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Marco Fochesato writes: > CREATE TABLE public.forniture_ee > ( > id_cliente integer NOT NULL, > pod character varying(14) NOT NULL, > id_fornitore integer NOT NULL, > mese integer NOT NULL, > anno integer NOT NULL, > imponibile_fornitura double precision NOT NULL, > lettura character varying NOT NULL, > f1 double precision NOT NULL, > f2 double precision NOT NULL, > f3 double precision NOT NULL, > picco double precision NOT NULL, > fuori_picco double precision NOT NULL, > mono double precision NOT NULL, > perdite_di_rete double precision NOT NULL, > potenza_max double precision NOT NULL, > potenza_disponibile double precision NOT NULL, > costo_potenza_max double precision NOT NULL, > energia_reattiva double precision NOT NULL, > imponibile_energia double precision NOT NULL, > report_inviato boolean, > energia_e_perdite double precision NOT NULL, > CONSTRAINT forniture_ee_pkey PRIMARY KEY (id_cliente, pod, id_fornitore, > mese, anno, imponibile_fornitura, lettura, f1, f2, f3, picco, fuori_picco, > mono, perdite_di_rete, potenza_max, potenza_disponibile, costo_potenza_max, > energia_reattiva, imponibile_energia, energia_e_perdite), That seems like a remarkably strange definition of a primary key. Are all of those columns really identification of an object, and not properties of the object? In any case, I'll bet a lot of money that your can't-update problem is related to the fuzzy behavior of floating-point columns. Just because a float8 value prints out as "1.2345" doesn't mean that it'll be considered equal to a value you write as "1.2345". If this fact astonishes you, you should likely switch to type numeric. regards, tom lane