Re: Not able to update some rows in a table
От | Tom Lane |
---|---|
Тема | Re: Not able to update some rows in a table |
Дата | |
Msg-id | 63928.1530547570@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Not able to update some rows in a table (Marco Fochesato <marcofoc@gmail.com>) |
Ответы |
Re: Not able to update some rows in a table
|
Список | pgsql-general |
Marco Fochesato <marcofoc@gmail.com> 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
В списке pgsql-general по дате отправления: