On Wed, 2005-10-12 at 17:45 -0400, Tom Lane wrote: > Oliver Elphick <olly@lfix.co.uk> writes: > > ... in this particular case, the column > > order was wrong. I should add that the table inherits from another one, > > but the swapped columns are a long way into the extra columns specific > > to this table. > > Hm. Could we see the actual pg_attribute data for both this table and > its parent? I'm thinking of something like > > select * from pg_attribute where attrelid = 'foo'::regclass order by attnum; > > for each table. > > regards, tom lane
Here you are: bray=# select * from pg_attribute where attrelid = 'invoice'::regclass order by attnum; attrelid | attname | atttypid | attstattarget | attlen | attnum | attndims | attcacheoff | atttypmod | attbyval | attstorage | attalign | attnotnull | atthasdef | attisdropped | attislocal | attinhcount -----------+---------------+----------+---------------+--------+--------+----------+-------------+-----------+----------+------------+----------+------------+-----------+--------------+------------+------------- 358570253 | tableoid | 26 | 0 | 4 | -7 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0 358570253 | cmax | 29 | 0 | 4 | -6 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0 358570253 | xmax | 28 | 0 | 4 | -5 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0 358570253 | cmin | 29 | 0 | 4 | -4 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0 358570253 | xmin | 28 | 0 | 4 | -3 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0 358570253 | oid | 26 | 0 | 4 | -2 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0 358570253 | ctid | 27 | 0 | 6 | -1 | 0 | -1 | -1 | f | p | s | t | f | f | t | 0 358570253 | invno | 23 | -1 | 4 | 1 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0 358570253 | customer | 1043 | -1 | -1 | 2 | 0 | -1 | 14 | f | x | i | t | f | f | t | 0 358570253 | account | 1043 | -1 | -1 | 3 | 0 | -1 | 12 | f | x | i | t | f | f | t | 0 358570253 | invdate | 1082 | -1 | 4 | 4 | 0 | -1 | -1 | t | p | i | t | t | f | t | 0 358570253 | taxpoint | 1082 | -1 | 4 | 5 | 0 | -1 | -1 | t | p | i | t | t | f | t | 0 358570253 | discount | 1700 | -1 | -1 | 6 | 0 | -1 | 327687 | f | m | i | t | t | f | t | 0 358570253 | ordno | 23 | -1 | 4 | 7 | 0 | -1 | -1 | t | p | i | f | f | f | t | 0 358570253 | custref | 25 | -1 | -1 | 8 | 0 | -1 | -1 | f | x | i | t | t | f | t | 0 358570253 | currency | 1042 | -1 | -1 | 9 | 0 | -1 | 7 | f | x | i | t | f | f | t | 0 358570253 | carriage | 1700 | -1 | -1 | 10 | 0 | -1 | 655366 | f | m | i | t | t | f | t | 0 358570253 | printed | 16 | -1 | 1 | 11 | 0 | -1 | -1 | t | p | c | t | t | f | t | 0 358570253 | assigned | 16 | -1 | 1 | 12 | 0 | -1 | -1 | t | p | c | t | t | f | t | 0 358570253 | customer_ean | 1043 | -1 | -1 | 13 | 0 | -1 | 17 | f | x | i | f | f | f | t | 0 358570253 | location_ean | 1043 | -1 | -1 | 14 | 0 | -1 | 17 | f | x | i | f | f | f | t | 0 358570253 | exchange_rate | 1700 | -1 | -1 | 15 | 0 | -1 | 655368 | f | m | i | f | f | f | t | 0 358570253 | grpid | 1043 | -1 | -1 | 16 | 0 | -1 | 6 | f | x | i | f | f | f | t | 0 358570253 | postcode | 1043 | -1 | -1 | 17 | 0 | -1 | 14 | f | x | i | f | f | f | t | 0 358570253 | grn | 1043 | -1 | -1 | 18 | 0 | -1 | 24 | f | x | i | f | f | f | t | 0 358570253 | orderdate | 1082 | -1 | 4 | 19 | 0 | -1 | -1 | t | p | i | f | f | f | t | 0 (26 rows) bray=# select * from pg_attribute where attrelid = 'export_invoice'::regclass order by attnum; attrelid | attname | atttypid | attstattarget | attlen | attnum | attndims | attcacheoff | atttypmod | attbyval | attstorage | attalign | attnotnull | atthasdef | attisdropped | attislocal | attinhcount -----------+---------------+----------+---------------+--------+--------+----------+-------------+-----------+----------+------------+----------+------------+-----------+--------------+------------+------------- 358570504 | tableoid | 26 | 0 | 4 | -7 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0 358570504 | cmax | 29 | 0 | 4 | -6 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0 358570504 | xmax | 28 | 0 | 4 | -5 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0 358570504 | cmin | 29 | 0 | 4 | -4 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0 358570504 | xmin | 28 | 0 | 4 | -3 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0 358570504 | oid | 26 | 0 | 4 | -2 | 0 | -1 | -1 | t | p | i | t | f | f | t | 1 358570504 | ctid | 27 | 0 | 6 | -1 | 0 | -1 | -1 | f | p | s | t | f | f | t | 0 358570504 | invno | 23 | -1 | 4 | 1 | 0 | -1 | -1 | t | p | i | t | f | f | f | 1 358570504 | customer | 1043 | -1 | -1 | 2 | 0 | -1 | 14 | f | x | i | t | f | f | f | 1 358570504 | account | 1043 | -1 | -1 | 3 | 0 | -1 | 12 | f | x | i | t | f | f | f | 1 358570504 | invdate | 1082 | -1 | 4 | 4 | 0 | -1 | -1 | t | p | i | t | t | f | f | 1 358570504 | taxpoint | 1082 | -1 | 4 | 5 | 0 | -1 | -1 | t | p | i | t | t | f | f | 1 358570504 | discount | 1700 | -1 | -1 | 6 | 0 | -1 | 327687 | f | m | i | t | t | f | f | 1 358570504 | ordno | 23 | -1 | 4 | 7 | 0 | -1 | -1 | t | p | i | t | f | f | f | 1 358570504 | custref | 25 | -1 | -1 | 8 | 0 | -1 | -1 | f | x | i | t | t | f | f | 1 358570504 | currency | 1042 | -1 | -1 | 9 | 0 | -1 | 7 | f | x | i | t | f | f | f | 1 358570504 | carriage | 1700 | -1 | -1 | 10 | 0 | -1 | 655366 | f | m | i | t | t | f | f | 1 358570504 | printed | 16 | -1 | 1 | 11 | 0 | -1 | -1 | t | p | c | t | t | f | f | 1 358570504 | assigned | 16 | -1 | 1 | 12 | 0 | -1 | -1 | t | p | c | t | t | f | f | 1 358570504 | customer_ean | 1043 | -1 | -1 | 13 | 0 | -1 | 17 | f | x | i | f | f | f | f | 1 358570504 | location_ean | 1043 | -1 | -1 | 14 | 0 | -1 | 17 | f | x | i | f | f | f | f | 1 358570504 | exchange_rate | 1700 | -1 | -1 | 15 | 0 | -1 | 655368 | f | m | i | f | f | f | f | 1 358570504 | grpid | 1043 | -1 | -1 | 16 | 0 | -1 | 6 | f | x | i | f | f | f | f | 1 358570504 | postcode | 1043 | -1 | -1 | 17 | 0 | -1 | 14 | f | x | i | f | f | f | f | 1 358570504 | grn | 1043 | -1 | -1 | 18 | 0 | -1 | 24 | f | x | i | f | f | f | f | 1 358570504 | orderdate | 1082 | -1 | 4 | 19 | 0 | -1 | -1 | t | p | i | f | f | f | f | 1 358570504 | packages | 23 | -1 | 4 | 20 | 0 | -1 | -1 | t | p | i | t | t | f | t | 0 358570504 | packing | 1700 | -1 | -1 | 21 | 0 | -1 | 786438 | f | m | i | f | f | f | t | 0 358570504 | other | 1700 | -1 | -1 | 22 | 0 | -1 | 786438 | f | m | i | f | f | f | t | 0 358570504 | other_desc | 25 | -1 | -1 | 23 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 358570504 | insurance | 1700 | -1 | -1 | 24 | 0 | -1 | 786438 | f | m | i | f | f | f | t | 0 358570504 | pack_desc | 25 | -1 | -1 | 25 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 358570504 | kilos | 1700 | -1 | -1 | 26 | 0 | -1 | 786439 | f | m | i | f | f | f | t | 0 358570504 | nett | 1700 | -1 | -1 | 27 | 0 | -1 | 786439 | f | m | i | f | f | f | t | 0 358570504 | dimensions | 25 | -1 | -1 | 28 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 358570504 | terms | 25 | -1 | -1 | 29 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 358570504 | bank | 25 | -1 | -1 | 30 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 358570504 | goods | 25 | -1 | -1 | 31 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 358570504 | marks | 25 | -1 | -1 | 32 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 358570504 | port | 25 | -1 | -1 | 33 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 358570504 | transport | 25 | -1 | -1 | 34 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 358570504 | destination | 1042 | -1 | -1 | 35 | 0 | -1 | 6 | f | x | i | f | f | f | t | 0 358570504 | origin | 1042 | -1 | -1 | 36 | 0 | -1 | 6 | f | x | i | t | t | f | t | 0 358570504 | auth | 25 | -1 | -1 | 37 | 0 | -1 | -1 | f | x | i | f | f | f | t | 0 358570504 | copies | 23 | -1 | 4 | 38 | 0 | -1 | -1 | t | p | i | t | t | f | t | 0 (45 rows) -- Oliver Elphick olly@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA ======================================== Do you want to know God? http://www.lfix.co.uk/knowing_god.html ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly