Обсуждение: BUG #4222: ERROR: cache lookup failed for relation

Поиск
Список
Период
Сортировка

BUG #4222: ERROR: cache lookup failed for relation

От
"Parag Goyal"
Дата:
The following bug has been logged online:

Bug reference:      4222
Logged by:          Parag Goyal
Email address:      paragosho@gmail.com
PostgreSQL version: 8.3.1
Operating system:   Window XP
Description:        ERROR:  cache lookup failed for relation
Details:

ERROR: Cache lookup failed for relation incurred
and we are not able to fire any query for the particular relation any
more(table).

ERROR: Cache lookup failed for relation
even we are not able to delete the particular schema.


Thanks,
Parag Goyal

Re: BUG #4222: ERROR: cache lookup failed for relation

От
"Heikki Linnakangas"
Дата:
Parag Goyal wrote:
> ERROR: Cache lookup failed for relation incurred
> and we are not able to fire any query for the particular relation any
> more(table).
>
> ERROR: Cache lookup failed for relation
> even we are not able to delete the particular schema.

Please copy-paste and post the actual queries along with the error
message, so that we can get a better idea of what you're doing. What
happened when it stopped working?

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Re: BUG #4222: ERROR: cache lookup failed for relation

От
"Heikki Linnakangas"
Дата:
Please keep the list cc'd so that others can help you out.

Parag Goyal wrote:
> Actually my client-server application is using default database postgres and
> using 39 tables. Out of thase one table is 'eventregistration' created by
> hibernate automatically.
>
> Some how we got stuck and tried delete all the tables using 'drop-cascaded'
> option of pgAdminIII. It has deleted the tables except mentioned one. Now if
> we try to drop the table using query 'drop table eventregistration' -> it is
> giving error as mentioned eralier.

Well, if you really want to just drop everything, you could try dropping
and recreating the whole database. That doesn't explain why you got the
error, of course, so please back up by tarring or zipping up the data
directory before you do that. We don't want to lose the evidence if
someone wants to investigate this further.

Did you by chance run two DROP commands at the same time from different
pgAdmin sessions? There has been some race conditions in the dependency
traversal, though I don't recall anything that would leave the database
in such a state.

> It is giving same exception with any query.

Any query, even if not related to that table?


> Log ->
>
> 2008-06-05 14:28:19 IST DEBUG:  name: unnamed; blockState:       DEFAULT;
> state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: <>
> 2008-06-05 14:28:19 IST DEBUG:  CommitTransaction
> 2008-06-05 14:28:19 IST DEBUG:  name: unnamed; blockState:       STARTED;
> state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: <>
> 2008-06-05 14:28:19 IST DEBUG:  autovacuum: processing database "postgres"
> 2008-06-05 14:28:19 IST DEBUG:  StartTransaction
> 2008-06-05 14:28:19 IST DEBUG:  name: unnamed; blockState:       DEFAULT;
> state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: <>
> 2008-06-05 14:28:19 IST DEBUG:  pg_statistic: vac: 0 (threshold 120), anl:
> 348 (threshold 85)
> 2008-06-05 14:28:19 IST DEBUG:  pg_authid: vac: 0 (threshold 50), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_database: vac: 0 (threshold 50), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_tablespace: vac: 0 (threshold 50), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_shdepend: vac: 0 (threshold 50), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_shdescription: vac: 0 (threshold 50),
> anl: 0 (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_type: vac: 111 (threshold 127), anl: 0
> (threshold 88)
> 2008-06-05 14:28:19 IST DEBUG:  pg_attribute: vac: 0 (threshold 409), anl: 0
> (threshold 230)
> 2008-06-05 14:28:19 IST DEBUG:  pg_proc: vac: 0 (threshold 479), anl: 0
> (threshold 264)
> 2008-06-05 14:28:19 IST DEBUG:  pg_class: vac: 0 (threshold 96), anl: 0
> (threshold 73)
> 2008-06-05 14:28:19 IST DEBUG:  pg_attrdef: vac: 24 (threshold 55), anl: 0
> (threshold 52)
> 2008-06-05 14:28:19 IST DEBUG:  pg_constraint: vac: 0 (threshold 51), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_index: vac: 0 (threshold 68), anl: 0
> (threshold 59)
> 2008-06-05 14:28:19 IST DEBUG:  pg_operator: vac: 0 (threshold 190), anl: 0
> (threshold 120)
> 2008-06-05 14:28:19 IST DEBUG:  pg_opclass: vac: 0 (threshold 72), anl: 0
> (threshold 61)
> 2008-06-05 14:28:19 IST DEBUG:  pg_am: vac: 0 (threshold 51), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_amop: vac: 0 (threshold 119), anl: 0
> (threshold 85)
> 2008-06-05 14:28:19 IST DEBUG:  pg_amproc: vac: 0 (threshold 99), anl: 0
> (threshold 74)
> 2008-06-05 14:28:19 IST DEBUG:  pg_language: vac: 0 (threshold 51), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_aggregate: vac: 0 (threshold 73), anl: 0
> (threshold 62)
> 2008-06-05 14:28:19 IST DEBUG:  pg_rewrite: vac: 0 (threshold 65), anl: 0
> (threshold 58)
> 2008-06-05 14:28:19 IST DEBUG:  pg_trigger: vac: 0 (threshold 51), anl: 0
> (threshold 51)
> 2008-06-05 14:28:19 IST DEBUG:  pg_description: vac: 0 (threshold 451), anl:
> 0 (threshold 251)
> 2008-06-05 14:28:19 IST DEBUG:  pg_cast: vac: 0 (threshold 88), anl: 0
> (threshold 69)
> 2008-06-05 14:28:19 IST DEBUG:  pg_namespace: vac: 0 (threshold 51), anl: 0
> (threshold 51)
> 2008-06-05 14:28:19 IST DEBUG:  pg_depend: vac: 1199 (threshold 1236), anl:
> 0 (threshold 643)
> 2008-06-05 14:28:19 IST DEBUG:  eventregistration: vac: 4 (threshold 50),
> anl: 4 (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_toast_630151: vac: 0 (threshold 50), anl:
> 0 (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  CommitTransaction
> 2008-06-05 14:28:19 IST DEBUG:  name: unnamed; blockState:       STARTED;
> state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: <>
> 2008-06-05 14:28:19 IST DEBUG:  proc_exit(0)
> 2008-06-05 14:28:19 IST DEBUG:  shmem_exit(0)
> 2008-06-05 14:28:19 IST DEBUG:  exit(0)
> 2008-06-05 14:28:19 IST DEBUG:  reaping dead processes
> 2008-06-05 14:28:19 IST DEBUG:  server process (PID 3224) exited with exit
> code 0
> 2008-06-05 14:28:58 IST DEBUG:  StartTransactionCommand
> 2008-06-05 14:28:58 IST DEBUG:  StartTransaction
> 2008-06-05 14:28:58 IST DEBUG:  name: unnamed; blockState:       DEFAULT;
> state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: <>
> 2008-06-05 14:28:58 IST DEBUG:  ProcessUtility
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to toast table
> pg_toast.pg_toast_630151
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to type
> pg_toast.pg_toast_630151
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to index
> pg_toast.pg_toast_630151_index
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to type eventregistration
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to type
> eventregistration[]
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to constraint
> eventregistration_pkey on table eventregistration
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to index
> eventregistration_pkey
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to constraint
> fk490d8536643b1db on table eventregistration
> 2008-06-05 14:28:58 IST ERROR:  cache lookup failed for relation 630146
> 2008-06-05 14:28:58 IST STATEMENT:  drop table eventregistration;
>
>
>
> 2008-06-05 14:28:19 IST DEBUG:  name: unnamed; blockState:       DEFAULT;
> state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: <>
> 2008-06-05 14:28:19 IST DEBUG:  CommitTransaction
> 2008-06-05 14:28:19 IST DEBUG:  name: unnamed; blockState:       STARTED;
> state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: <>
> 2008-06-05 14:28:19 IST DEBUG:  autovacuum: processing database "postgres"
> 2008-06-05 14:28:19 IST DEBUG:  StartTransaction
> 2008-06-05 14:28:19 IST DEBUG:  name: unnamed; blockState:       DEFAULT;
> state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: <>
> 2008-06-05 14:28:19 IST DEBUG:  pg_statistic: vac: 0 (threshold 120), anl:
> 348 (threshold 85)
> 2008-06-05 14:28:19 IST DEBUG:  pg_authid: vac: 0 (threshold 50), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_database: vac: 0 (threshold 50), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_tablespace: vac: 0 (threshold 50), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_shdepend: vac: 0 (threshold 50), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_shdescription: vac: 0 (threshold 50),
> anl: 0 (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_type: vac: 111 (threshold 127), anl: 0
> (threshold 88)
> 2008-06-05 14:28:19 IST DEBUG:  pg_attribute: vac: 0 (threshold 409), anl: 0
> (threshold 230)
> 2008-06-05 14:28:19 IST DEBUG:  pg_proc: vac: 0 (threshold 479), anl: 0
> (threshold 264)
> 2008-06-05 14:28:19 IST DEBUG:  pg_class: vac: 0 (threshold 96), anl: 0
> (threshold 73)
> 2008-06-05 14:28:19 IST DEBUG:  pg_attrdef: vac: 24 (threshold 55), anl: 0
> (threshold 52)
> 2008-06-05 14:28:19 IST DEBUG:  pg_constraint: vac: 0 (threshold 51), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_index: vac: 0 (threshold 68), anl: 0
> (threshold 59)
> 2008-06-05 14:28:19 IST DEBUG:  pg_operator: vac: 0 (threshold 190), anl: 0
> (threshold 120)
> 2008-06-05 14:28:19 IST DEBUG:  pg_opclass: vac: 0 (threshold 72), anl: 0
> (threshold 61)
> 2008-06-05 14:28:19 IST DEBUG:  pg_am: vac: 0 (threshold 51), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_amop: vac: 0 (threshold 119), anl: 0
> (threshold 85)
> 2008-06-05 14:28:19 IST DEBUG:  pg_amproc: vac: 0 (threshold 99), anl: 0
> (threshold 74)
> 2008-06-05 14:28:19 IST DEBUG:  pg_language: vac: 0 (threshold 51), anl: 0
> (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_aggregate: vac: 0 (threshold 73), anl: 0
> (threshold 62)
> 2008-06-05 14:28:19 IST DEBUG:  pg_rewrite: vac: 0 (threshold 65), anl: 0
> (threshold 58)
> 2008-06-05 14:28:19 IST DEBUG:  pg_trigger: vac: 0 (threshold 51), anl: 0
> (threshold 51)
> 2008-06-05 14:28:19 IST DEBUG:  pg_description: vac: 0 (threshold 451), anl:
> 0 (threshold 251)
> 2008-06-05 14:28:19 IST DEBUG:  pg_cast: vac: 0 (threshold 88), anl: 0
> (threshold 69)
> 2008-06-05 14:28:19 IST DEBUG:  pg_namespace: vac: 0 (threshold 51), anl: 0
> (threshold 51)
> 2008-06-05 14:28:19 IST DEBUG:  pg_depend: vac: 1199 (threshold 1236), anl:
> 0 (threshold 643)
> 2008-06-05 14:28:19 IST DEBUG:  eventregistration: vac: 4 (threshold 50),
> anl: 4 (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  pg_toast_630151: vac: 0 (threshold 50), anl:
> 0 (threshold 50)
> 2008-06-05 14:28:19 IST DEBUG:  CommitTransaction
> 2008-06-05 14:28:19 IST DEBUG:  name: unnamed; blockState:       STARTED;
> state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: <>
> 2008-06-05 14:28:19 IST DEBUG:  proc_exit(0)
> 2008-06-05 14:28:19 IST DEBUG:  shmem_exit(0)
> 2008-06-05 14:28:19 IST DEBUG:  exit(0)
> 2008-06-05 14:28:19 IST DEBUG:  reaping dead processes
> 2008-06-05 14:28:19 IST DEBUG:  server process (PID 3224) exited with exit
> code 0
> 2008-06-05 14:28:58 IST DEBUG:  StartTransactionCommand
> 2008-06-05 14:28:58 IST DEBUG:  StartTransaction
> 2008-06-05 14:28:58 IST DEBUG:  name: unnamed; blockState:       DEFAULT;
> state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: <>
> 2008-06-05 14:28:58 IST DEBUG:  ProcessUtility
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to toast table
> pg_toast.pg_toast_630151
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to type
> pg_toast.pg_toast_630151
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to index
> pg_toast.pg_toast_630151_index
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to type eventregistration
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to type
> eventregistration[]
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to constraint
> eventregistration_pkey on table eventregistration
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to index
> eventregistration_pkey
> 2008-06-05 14:28:58 IST DEBUG:  drop auto-cascades to constraint
> fk490d8536643b1db on table eventregistration
> 2008-06-05 14:28:58 IST ERROR:  cache lookup failed for relation 630146
> 2008-06-05 14:28:58 IST STATEMENT:  drop table eventregistration;

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Re: BUG #4222: ERROR: cache lookup failed for relation

От
"Heikki Linnakangas"
Дата:
(please keep the mailing list CC'd)

Parag Goyal wrote:
> As i told earlier some how i got stuck ,so  i was dropping the
> database but "eventregistration" table was not deleted due to "ERROR: Cache
> lookup failed for relation " .
> but after ward i check with defferent queries (select,insert also) on same
> table "eventregistration" , but these queries also were giving same error
> "ERROR: Cache lookup failed for relation".
> moreover as per your suggestion i tried to drop database"postgres" (because
> my appliction using default database "postgres" only) using postgresAdmin
> tool  but this is also not possible and returning back the message
> "maintenance database can't be dropped". Now I think, i have only option
> left  with me reinstall the postgres again on my system.

Ah, I see, pgAdmin doesn't let you drop "postgres" database. You could
still recreate it from the command line with psql:

psql template1 -c "DROP DATABASE postgres"
psql template1 -c "CREATE DATABASE postgres"

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com