Re: [HACKERS] float4 confused as int??

From: Ed Loehr <eloehr(at)austin(dot)rr(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pghackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] float4 confused as int??
Date: 2000-02-01 15:43:51
Message-ID: 3896FF37.457BC106@austin.rr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Tom Lane wrote:
>
> Ed Loehr <eloehr(at)austin(dot)rr(dot)com> writes:
> > The problem is occurring with a database that was restored with psql
> > from a pg_dump (6.5.2).
>
> > If I dump the problem table, then drop/recreate it with my original
> > table creation commands, and then reload with only the insert commands
> > from the pg_dump'ed file, it reloads and allows updating of the float
> > field without a problem.
>
> OK. Almost certainly, the data in the table is of no consequence;
> the table schema is what matters. What are your original table
> creation commands, and what does pg_dump emit?

I'd hoped to spot an erroneous integer type redefinition of the column
in the pg_dump output, but no such luck.

------------ Original table creation commands: ----------------------
CREATE TABLE contract_activity_type (
id SERIAL,
contract_id INTEGER NOT NULL, -- default frequency for
planning
activity_type_id INTEGER NOT NULL,-- Ex: "Interviews",
"Coaching", ...
travel_required INTEGER NOT NULL, -- bool: yes/no
billable INTEGER NOT NULL, -- bool: yes/no
duration FLOAT4 NOT NULL, -- how long is the activity
in days
participants INTEGER NOT NULL, -- # of expected
participants
frequency_id INTEGER NOT NULL, -- default frequency for
planning
cloned INTEGER NOT NULL DEFAULT 0, -- bool: yes/no
creator_id INTEGER NOT NULL DEFAULT 0, -- person id
creation_time DATETIME NOT NULL DEFAULT now(),
updater_id INTEGER NOT NULL DEFAULT 0, -- person id
last_update DATETIME NOT NULL DEFAULT now(),
record_status INTEGER NOT NULL DEFAULT 1,
PRIMARY KEY (contract_id,activity_type_id)
);
CREATE INDEX contract_activity_type_aid ON
contract_activity_type(activity_type_id);
CREATE INDEX contract_activity_type_cid ON
contract_activity_type(contract_id);

------------ pg_dump output: -----------------------------------------
CREATE SEQUENCE "contract_activity_type_id_seq" start 214 increment 1
maxvalue 2147483647 minvalue 1 cache 1 ;
SELECT nextval ('contract_activity_type_id_seq');
CREATE SEQUENCE "contract_activity_type_e_id_seq" start 1386 increment
1 maxvalue 2147483647 minvalue 1 cache 1 ;
SELECT nextval ('contract_activity_type_e_id_seq');
CREATE TABLE "contract_activity_type" (
"id" int4 DEFAULT nextval ( '"contract_activity_type_id_seq"'
) NOT NULL,
"contract_id" int4 NOT NULL,
"activity_type_id" int4 NOT NULL,
"travel_required" int4 NOT NULL,
"billable" int4 NOT NULL,
"duration" float4 NOT NULL,
"participants" int4 NOT NULL,
"frequency_id" int4 NOT NULL,
"cloned" int4 DEFAULT 0 NOT NULL,
"creator_id" int4 DEFAULT 0 NOT NULL,
"creation_time" datetime DEFAULT now ( ) NOT NULL,
"updater_id" int4 DEFAULT 0 NOT NULL,
"last_update" datetime DEFAULT now ( ) NOT NULL,
"record_status" int4 DEFAULT 1 NOT NULL);

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ed Loehr 2000-02-01 16:20:27 Re: [GENERAL] VACUUM ANALYSE
Previous Message Ed Loehr 2000-02-01 15:36:48 Re: [GENERAL] PL/pgSQL syntax/usage question

Browse pgsql-hackers by date

  From Date Subject
Next Message Mitch Vincent 2000-02-01 15:58:50 Re: [HACKERS] plpgsql problem..
Previous Message Mitch Vincent 2000-02-01 15:31:08 Re: [HACKERS] plpgsql problem..