reproducable command sequence to get "mdopen: Couldn't open..."

From: Palle Girgensohn <girgen(at)partitur(dot)se>
To: pgsql-bugs(at)postgresql(dot)org
Subject: reproducable command sequence to get "mdopen: Couldn't open..."
Date: 2000-10-15 16:25:26
Message-ID: 87d7h2m5qh.fsf@palle.girgensohn.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi!

I have seen this problem on several occasions, using 7.02:

# vacuum;
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: RelationIdBuildRelation: smgropen(at_provider_user_info): No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
ERROR: cannot open relation at_provider_user_info

To get it back to functional, I have to touch the file
data/base/dbname/at_provider_user_info, drop the table and restore it
from a backup (if it wasn't empty, which was luckily mostly the
case). This works, but there's a bug letting this happen...

Here's how I get it happening:

Script started on Sun Oct 15 18:06:12 2000
$ psql -e < src/core/db/elever-to-person.sql
You are now connected as new user nobody.
BEGIN;
BEGIN
CREATE TABLE person (userid text, giver text, first_name text, last_name text, email text, default_language text DEFAULT 'sv');
CREATE
CREATE UNIQUE INDEX person_index on person using btree (userid text_ops);
CREATE
CREATE INDEX person_giver_idx on person (giver);
CREATE
INSERT INTO person (userid,giver,first_name,last_name,email,default_language)
SELECT userid,giver,fnamn,enamn,datorpost,defaultlanguage FROM elever;
INSERT 1189717 1
COMMIT;
COMMIT
BEGIN;
BEGIN
ALTER TABLE at_provider_user_info RENAME TO tmp;
NOTICE: Caution: RENAME TABLE cannot be rolled back, so don't abort now
ALTER
CREATE TABLE at_provider_user_info (id int4, giver text, name text, order_nr int4, type text, az_only bool DEFAULT false, hideable bool DEFAULT false, is_unique bool DEFAULT false );
CREATE
INSERT INTO at_provider_user_info (id,giver,name,order_nr,type,az_only,hideable,is_unique)
SELECT *,false,false,false FROM tmp;
ERROR: INSERT has more expressions than target columns
DROP TABLE tmp;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
ALTER TABLE at_user_info RENAME TO tmp;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
CREATE TABLE at_user_info (userid text, info_id int4, content text, visible bool DEFAULT true );
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_user_info (userid,info_id,content,visible)
SELECT *,true FROM tmp;
ERROR: Attribute 'visible' is of type 'bool' but expression is of type 'int4'
You will need to rewrite or cast the expression
DROP TABLE tmp;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_provider_user_info (id,giver,name,order_nr,type)
SELECT nextval('at_provider_user_info_seq'),giver,'Gatuadress',10,'text' FROM providers;
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: RelationIdBuildRelation: smgropen(at_provider_user_info): No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_user_info (userid,info_id,content)
SELECT userid,currval('at_provider_user_info_seq'),gatuadress FROM elever;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_provider_user_info (id,giver,name,order_nr,type)
SELECT nextval('at_provider_user_info_seq'),giver,'Postnummer',11,'text' FROM providers;
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_user_info (userid,info_id,content)
SELECT userid,currval('at_provider_user_info_seq'),postnummer FROM elever;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_provider_user_info (id,giver,name,order_nr,type)
SELECT nextval('at_provider_user_info_seq'),giver,'Postadress',12,'text' FROM providers;
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_user_info (userid,info_id,content)
SELECT userid,currval('at_provider_user_info_seq'),postadress FROM elever;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_provider_user_info (id,giver,name,order_nr,type)
SELECT nextval('at_provider_user_info_seq'),giver,'Telefon',13,'text' FROM providers;
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_user_info (userid,info_id,content)
SELECT userid,currval('at_provider_user_info_seq'),telefon FROM elever;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_provider_user_info (id,giver,name,order_nr,type)
SELECT nextval('at_provider_user_info_seq'),giver,'Fax',14,'text' FROM providers;
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_user_info (userid,info_id,content)
SELECT userid,currval('at_provider_user_info_seq'),telefax FROM elever;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_provider_user_info (id,giver,name,order_nr,type)
SELECT nextval('at_provider_user_info_seq'),giver,'Företag',15,'text' FROM providers;
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_user_info (userid,info_id,content)
SELECT userid,currval('at_provider_user_info_seq'),foretag FROM elever;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_provider_user_info (id,giver,name,order_nr,type)
SELECT nextval('at_provider_user_info_seq'),giver,'Beskrivning',16,'textarea' FROM providers;
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_user_info (userid,info_id,content)
SELECT userid,currval('at_provider_user_info_seq'),beskrivning FROM elever;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_provider_user_info (id,giver,name,order_nr,type)
SELECT nextval('at_provider_user_info_seq'),giver,'Titel',17,'text' FROM providers;
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: mdopen: couldn't open at_provider_user_info: No such file or directory
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_user_info (userid,info_id,content)
SELECT userid,currval('at_provider_user_info_seq'),titel FROM elever;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
ALTER TABLE at_provider_course_info RENAME TO tmp;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
CREATE TABLE at_provider_course_info (id int4, giver text, name text, order_nr int4, type text, is_unique bool DEFAULT false);
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_provider_course_info (id,giver,name,order_nr,type,is_unique)
SELECT *,false FROM tmp;
ERROR: INSERT has more expressions than target columns
DROP TABLE tmp;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
ALTER TABLE at_course_info RENAME TO tmp;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
CREATE TABLE at_course_info (course_id int4, info_id int4, content text, visible bool DEFAULT true);
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
INSERT INTO at_course_info (course_id,info_id,content,visible)
SELECT *,false FROM tmp;
ERROR: Attribute 'visible' is of type 'bool' but expression is of type 'int4'
You will need to rewrite or cast the expression
DROP TABLE tmp;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
COMMIT;
COMMIT
VACUUM;
NOTICE: Skipping "pg_type" --- only table owner can VACUUM it
NOTICE: Skipping "pg_attribute" --- only table owner can VACUUM it
NOTICE: Skipping "pg_proc" --- only table owner can VACUUM it
NOTICE: Skipping "pg_class" --- only table owner can VACUUM it
NOTICE: Skipping "pg_indexes" --- only table owner can VACUUM it
NOTICE: Skipping "pg_group" --- only table owner can VACUUM it
NOTICE: Skipping "pg_database" --- only table owner can VACUUM it
NOTICE: Skipping "pg_attrdef" --- only table owner can VACUUM it
NOTICE: Skipping "pg_relcheck" --- only table owner can VACUUM it
NOTICE: Skipping "pg_trigger" --- only table owner can VACUUM it
NOTICE: Skipping "pg_inherits" --- only table owner can VACUUM it
NOTICE: Skipping "pg_index" --- only table owner can VACUUM it
NOTICE: Skipping "pg_statistic" --- only table owner can VACUUM it
NOTICE: Skipping "pg_operator" --- only table owner can VACUUM it
NOTICE: Skipping "pg_opclass" --- only table owner can VACUUM it
NOTICE: Skipping "pg_am" --- only table owner can VACUUM it
NOTICE: Skipping "pg_amop" --- only table owner can VACUUM it
NOTICE: Skipping "pg_amproc" --- only table owner can VACUUM it
NOTICE: Skipping "pg_language" --- only table owner can VACUUM it
NOTICE: Skipping "pg_aggregate" --- only table owner can VACUUM it
NOTICE: Skipping "pg_ipl" --- only table owner can VACUUM it
NOTICE: Skipping "pg_inheritproc" --- only table owner can VACUUM it
NOTICE: Skipping "pg_rewrite" --- only table owner can VACUUM it
NOTICE: Skipping "pg_listener" --- only table owner can VACUUM it
NOTICE: Skipping "pg_description" --- only table owner can VACUUM it
NOTICE: Skipping "pg_shadow" --- only table owner can VACUUM it
NOTICE: Skipping "pg_user" --- only table owner can VACUUM it
NOTICE: Skipping "pg_rules" --- only table owner can VACUUM it
NOTICE: Skipping "pg_views" --- only table owner can VACUUM it
NOTICE: Skipping "pg_tables" --- only table owner can VACUUM it
ERROR: pg_ownercheck: class "tmp" not found
VACUUM ANALYZE;
NOTICE: Skipping "pg_type" --- only table owner can VACUUM it
NOTICE: Skipping "pg_attribute" --- only table owner can VACUUM it
NOTICE: Skipping "pg_proc" --- only table owner can VACUUM it
NOTICE: Skipping "pg_class" --- only table owner can VACUUM it
NOTICE: Skipping "pg_indexes" --- only table owner can VACUUM it
NOTICE: Skipping "pg_group" --- only table owner can VACUUM it
NOTICE: Skipping "pg_database" --- only table owner can VACUUM it
NOTICE: Skipping "pg_attrdef" --- only table owner can VACUUM it
NOTICE: Skipping "pg_relcheck" --- only table owner can VACUUM it
NOTICE: Skipping "pg_trigger" --- only table owner can VACUUM it
NOTICE: Skipping "pg_inherits" --- only table owner can VACUUM it
NOTICE: Skipping "pg_index" --- only table owner can VACUUM it
NOTICE: Skipping "pg_statistic" --- only table owner can VACUUM it
NOTICE: Skipping "pg_operator" --- only table owner can VACUUM it
NOTICE: Skipping "pg_opclass" --- only table owner can VACUUM it
NOTICE: Skipping "pg_am" --- only table owner can VACUUM it
NOTICE: Skipping "pg_amop" --- only table owner can VACUUM it
NOTICE: Skipping "pg_amproc" --- only table owner can VACUUM it
NOTICE: Skipping "pg_language" --- only table owner can VACUUM it
NOTICE: Skipping "pg_aggregate" --- only table owner can VACUUM it
NOTICE: Skipping "pg_ipl" --- only table owner can VACUUM it
NOTICE: Skipping "pg_inheritproc" --- only table owner can VACUUM it
NOTICE: Skipping "pg_rewrite" --- only table owner can VACUUM it
NOTICE: Skipping "pg_listener" --- only table owner can VACUUM it
NOTICE: Skipping "pg_description" --- only table owner can VACUUM it
NOTICE: Skipping "pg_shadow" --- only table owner can VACUUM it
NOTICE: Skipping "pg_user" --- only table owner can VACUUM it
NOTICE: Skipping "pg_rules" --- only table owner can VACUUM it
NOTICE: Skipping "pg_views" --- only table owner can VACUUM it
NOTICE: Skipping "pg_tables" --- only table owner can VACUUM it
ERROR: pg_ownercheck: class "tmp" not found
$ exit

Script done on Sun Oct 15 18:06:22 2000

Cheers,
Palle

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2000-10-15 16:30:19 Re: Selects on tables with cidr type primary keys are broken
Previous Message Lennert Buytenhek 2000-10-15 14:56:34 Selects on tables with cidr type primary keys are broken