[Dachs-support] [itteam] gavo import lock
carlosadean at linea.gov.br
carlosadean at linea.gov.br
Mon Nov 7 17:27:11 CET 2016
Markus,
----- Mensagem original -----
> De: "Markus Demleitner" <msdemlei at ari.uni-heidelberg.de>
> Para: dachs-support at g-vo.org
> Enviadas: Segunda-feira, 7 de novembro de 2016 13:00:50
> Assunto: Re: [Dachs-support] [itteam] gavo import lock
>
> Ok, so it's fine that the machine tries to add the column_index. I
> don't understand why it's already there, though. Postgres Manual
> 13.5 says "the table-rewriting forms of ALTER TABLE, are not
> MVCC-safe" but then goes on to say that concurrent transactions would
> only see an empty table, not that a rollback wouldn't take effect.
> And a quick:
>
> gavo=# begin;
> BEGIN
> gavo=# alter table tap_schema.columns add column junk smallint;
> ALTER TABLE
> gavo=# rollback;
> ROLLBACK
>
gavo=# \d tap_schema.columns
Table "tap_schema.columns"
Column | Type | Modifiers
--------------+----------+-----------
table_name | text | not null
column_name | text | not null
description | text |
unit | text |
ucd | text |
utype | text |
datatype | text |
size | integer |
principal | integer | not null
indexed | integer | not null
std | integer | not null
sourcerd | text |
column_index | smallint |
Indexes:
"columns_pkey" PRIMARY KEY, btree (table_name, column_name)
gavo=# begin;
BEGIN
gavo=# alter table tap_schema.columns add column junk smallint;
ALTER TABLE
gavo=# rollback;
ROLLBACK
gavo=# \d tap_schema.columns
Table "tap_schema.columns"
Column | Type | Modifiers
--------------+----------+-----------
table_name | text | not null
column_name | text | not null
description | text |
unit | text |
ucd | text |
utype | text |
datatype | text |
size | integer |
principal | integer | not null
indexed | integer | not null
std | integer | not null
sourcerd | text |
column_index | smallint |
Indexes:
"columns_pkey" PRIMARY KEY, btree (table_name, column_name)
> confirms that the column shouldn't be there. I'll take this as a
> data point and try to trigger an analogous problem next time gavo
> upgrade needs a schema change.
>
> Meanwhile: if you run
>
> alter table tap_schema.columns drop column column_index
>
> in psql gavo, the upgrade should run (when the faulty RDs are gone,
> that is).
>
gavo=# ALTER TABLE tap_schema.columns DROP COLUMN column_index;
ALTER TABLE
gavo=# \d tap_schema.columns
Table "tap_schema.columns"
Column | Type | Modifiers
-------------+---------+-----------
table_name | text | not null
column_name | text | not null
description | text |
unit | text |
ucd | text |
utype | text |
datatype | text |
size | integer |
principal | integer | not null
indexed | integer | not null
std | integer | not null
sourcerd | text |
Indexes:
"columns_pkey" PRIMARY KEY, btree (table_name, column_name)
[gavo at devel2 ~]$ gavo upgrade
> Adding column_index column to TAP_SCHEMA.columns... ok
> ingesting column_index for TAP-published tables....** WARNING: Column name 'size' conincides with a ADQL/SQL reserved name. This may lead to serious trouble later. Please consider changing the name, or prepend quoted/ to make it a delimited identifier.
** WARNING: Somwhere near /opt/dachs/inputs/cluster/mag_auto_10023232_i.rd, (16, 51): Column pixel may be null but has no explicit null value.
** WARNING: RD cluster/mag_auto_10023232_i couldn't be loaded (Element with id u'tilename' could not be located in parse context). Fix and run gavo imp -m on it to get column indices in TAP_SCHEMA
*X*X* Uncaught exception at toplevel
*** Error: Oops. Unhandled exception UnboundLocalError.
Exception payload: local variable 'rd' referenced before assignment
Now I can see another error message and the column_index wasn't re-created.
thanks,
--
Carlos Adean
IT Team
linea.gov.br
skype: carlosadean
More information about the Dachs-support
mailing list