On Wed, Oct 12, 2005 at 07:28:37PM -0400, Tom Lane wrote: > Oliver Elphick <olly@lfix.co.uk> writes: > > On Wed, 2005-10-12 at 17:45 -0400, Tom Lane wrote: > >> Hm. Could we see the actual pg_attribute data for both this table and > >> its parent? > > > Here you are: > > Thanks. Nothing particularly strange-looking there though. Do you want > to try tracing through COPY with a debugger to see where it's getting > the bogus column order from?
Do you get the same bogosity with the attached test case? It's based on the same table definition and data from your first message; about the only differences from what you're doing are that the table isn't inherited and it uses "COPY foo FROM stdin" instead of reading the data from an external file. If this test works correctly, what happens if you use "COPY FROM stdin" on the real table? -- Michael Fuhr
CREATE TABLE foo ( invno integer not null, customer character varying(10) not null, account character varying(8) not null, invdate date not null default ('now'::text)::date, taxpoint date not null default ('now'::text)::date, discount numeric(5,3) not null default 0.0, ordno integer not null, custref text not null default 'NONE'::text, currency character(3) not null, carriage numeric(10,2) not null default 0.00, printed boolean not null default false, assigned boolean not null default false, customer_ean character varying(13) , location_ean character varying(13) , exchange_rate numeric(10,4) , grpid character varying(2) , postcode character varying(10) , grn character varying(20) , orderdate date , packages integer not null default 1, packing numeric(12,2) , other numeric(12,2) , other_desc text , insurance numeric(12,2) , pack_desc text , kilos numeric(12,3) , nett numeric(12,3) , dimensions text , terms text , bank text , goods text , marks text , port text , transport text , destination character(2) , origin character(2) not null default 'GB'::bpchar, auth text , copies integer not null default 1 ); COPY foo FROM stdin; 67829 22058 X378 10 FEB 2004 10 FEB 2004 0.000 5411 15498-00 GBP 0.00 t t \N \N \N \N \N \N 10 FEB 2004 60 0.00 0.00 0 0.00 Carton 570.000 0.000 CIF-MONTREAL/ACT 30-DAYS Chemist\'s sundries AMG MEDICAL;5411;MONTREAL;1-60; THAMESPORT SEA/ALLIANCE CA GB MAIREAD BOYCE, DIRECTOR 1 \. SELECT * FROM foo;
---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster