Обсуждение: Recent RI changes have broken something
Does anyone know what is happening here? There is no other user; the CREATE TABLE is part of a much larger script that was working OK last Thursday. The script drops and recreates an entire database. bray=# \d country Table "country"Attribute | Type | Modifier -----------+---------+----------id | char(2) | not nullname | text | not nullregion | text | telcode | text | Index: country_pkey Constraint: (id ~ '[A-Z]{2}'::text) bray=# create table country_ccy ( country char(2) references country (id) match full, ccy char(3) references currency (symbol) match full, primary key (country, ccy) ) ; NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'country_ccy_pkey' for table 'country_ccy' NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s) ERROR: RelationClearRelation: relation 21645 modified while in use bray=# select relname from pg_class where oid = 21645;relname ---------country (1 row) country was referenced in a previous table's foreign key. In view of the notes on RelationClearRelation, I am wondering if refcount wasn't decremented after that table was created. -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver PGP key from public servers; key ID32B8FAA1 ======================================== "My son, if sinners entice thee, consent thou not." Proverbs 1:10
"Oliver Elphick" <olly@lfix.co.uk> writes: > ERROR: RelationClearRelation: relation 21645 modified while in use This is probably my fault. Can you provide a simple test case? The two table declarations might be enough. regards, tom lane
Tom Lane wrote: >"Oliver Elphick" <olly@lfix.co.uk> writes: >> ERROR: RelationClearRelation: relation 21645 modified while in use > >This is probably my fault. Can you provide a simple test case? >The two table declarations might be enough. They seem to need to have the data loaded too. The attached gzipped tar is the minimum extract that will trigger the bug. It contains one example script (psql -d template1 -e <example) and 2 data files. You will have to amend the script to put in the correct path of the data files for your backend to find them. Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver PGP key from public servers; key ID 32B8FAA1 ======================================== "And be not conformed to this world; but be ye transformed by the renewing of your mind, that ye may prove what is that good, and acceptable, and perfect, will of God." Romans 12:2
Вложения
>> "Oliver Elphick" <olly@lfix.co.uk> writes: >>> ERROR: RelationClearRelation: relation 21645 modified while in use >> >> This is probably my fault. Can you provide a simple test case? >> The two table declarations might be enough. I think this is fixed now. Hopefully I didn't break SELECT FOR UPDATE while I was at it. regards, tom lane
Tom Lane wrote: >>> "Oliver Elphick" <olly@lfix.co.uk> writes: >>>> ERROR: RelationClearRelation: relation 21645 modifiedwhile in use >>> >>> This is probably my fault. Can you provide a simple test case? >>> The two table declarationsmight be enough. > >I think this is fixed now. Hopefully I didn't break SELECT FOR UPDATE >while I was at it. Yes, it is fixed from my point of view. I can't say about SELECT FOR UPDATE... -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver PGP key from public servers; key ID32B8FAA1 ======================================== "O come, let us worship and bow down; let us kneel before the LORD our maker." Psalms 95:6