pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_attribute file in PostgreSQL 9.0
9+ messages / 5 participants
[nested] [flat]

* pg_attribute file in PostgreSQL 9.0
@ 2012-03-07 13:14 Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2012-03-07 13:53 ` Re: pg_attribute file in PostgreSQL 9.0 Achilleas Mantzios <achill@smadev.internal.net>
  2012-03-07 14:35 ` Re: pg_attribute file in PostgreSQL 9.0 Steve Crawford <scrawford@pinpointresearch.com>
  0 siblings, 2 replies; 9+ messages in thread

From: Lukasz Brodziak @ 2012-03-07 13:14 UTC (permalink / raw)
  To: pgsql-admin

Hello,

I have a question regarding pg_attribute. In which file it is stored
because the relfilenode for it shows 0 and file 1249 isn't present in
the folder.

-- 
Łukasz Brodziak



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_attribute file in PostgreSQL 9.0
  2012-03-07 13:14 pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
@ 2012-03-07 13:53 ` Achilleas Mantzios <achill@smadev.internal.net>
  1 sibling, 0 replies; 9+ messages in thread

From: Achilleas Mantzios @ 2012-03-07 13:53 UTC (permalink / raw)
  To: pgsql-admin

On Τετ 07 Μαρ 2012 15:14:33 Lukasz Brodziak wrote:
> Hello,
> 
> I have a question regarding pg_attribute. In which file it is stored
> because the relfilenode for it shows 0 and file 1249 isn't present in
> the folder.

in my system:

dynacom=# SELECT pg_relation_filepath('public.vessels'::regclass);
 pg_relation_filepath 
----------------------
 base/539545/63242177
(1 row)

for system catalog tables you will have this relfilenode = 0

-- 
Achilleas Mantzios
IT DEPT



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_attribute file in PostgreSQL 9.0
  2012-03-07 13:14 pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
@ 2012-03-07 14:35 ` Steve Crawford <scrawford@pinpointresearch.com>
  2012-03-07 15:01   ` Re: pg_attribute file in PostgreSQL 9.0 Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 9+ messages in thread

From: Steve Crawford @ 2012-03-07 14:35 UTC (permalink / raw)
  To: Lukasz Brodziak <lukasz.brodziak@gmail.com>; +Cc: pgsql-admin

On 03/07/2012 05:14 AM, Lukasz Brodziak wrote:
> Hello,
>
> I have a question regarding pg_attribute. In which file it is stored
> because the relfilenode for it shows 0 and file 1249 isn't present in
> the folder.
>
select pg_relation_filepath('pg_attribute');

 From the docs, relfilenode is:
"Name of the on-disk file of this relation; zero means this is a 
"mapped" relation whose disk file name is determined by low-level state"

However the meaning "mapped relation" and "low-level state" are 
difficult to divine from the docs. Go with the function.

Cheers,
Steve




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_attribute file in PostgreSQL 9.0
  2012-03-07 13:14 pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2012-03-07 14:35 ` Re: pg_attribute file in PostgreSQL 9.0 Steve Crawford <scrawford@pinpointresearch.com>
@ 2012-03-07 15:01   ` Tom Lane <tgl@sss.pgh.pa.us>
  2012-03-07 17:03     ` Re: pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Tom Lane @ 2012-03-07 15:01 UTC (permalink / raw)
  To: Steve Crawford <scrawford@pinpointresearch.com>; +Cc: Lukasz Brodziak <lukasz.brodziak@gmail.com>; pgsql-admin

Steve Crawford <scrawford@pinpointresearch.com> writes:
> On 03/07/2012 05:14 AM, Lukasz Brodziak wrote:
>> I have a question regarding pg_attribute. In which file it is stored
>> because the relfilenode for it shows 0 and file 1249 isn't present in
>> the folder.

> select pg_relation_filepath('pg_attribute');

>  From the docs, relfilenode is:
> "Name of the on-disk file of this relation; zero means this is a 
> "mapped" relation whose disk file name is determined by low-level state"

> However the meaning "mapped relation" and "low-level state" are 
> difficult to divine from the docs. Go with the function.

Or use pg_relation_filenode() if you want the result of the mapping.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_attribute file in PostgreSQL 9.0
  2012-03-07 13:14 pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2012-03-07 14:35 ` Re: pg_attribute file in PostgreSQL 9.0 Steve Crawford <scrawford@pinpointresearch.com>
  2012-03-07 15:01   ` Re: pg_attribute file in PostgreSQL 9.0 Tom Lane <tgl@sss.pgh.pa.us>
@ 2012-03-07 17:03     ` Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2012-03-07 17:14       ` Re: pg_attribute file in PostgreSQL 9.0 Steve Crawford <scrawford@pinpointresearch.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Lukasz Brodziak @ 2012-03-07 17:03 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Steve Crawford <scrawford@pinpointresearch.com>; pgsql-admin

Thanks a lot I have found file I needed let's hope I will be able to
fix the problem now as I cannot connect to the database because I get
'catalog is missing 1 attribute for relation 2662' which I hope to be
able to repair by getting the pg_attribute file from another db.

2012/3/7 Tom Lane <tgl@sss.pgh.pa.us>:
> Steve Crawford <scrawford@pinpointresearch.com> writes:
>> On 03/07/2012 05:14 AM, Lukasz Brodziak wrote:
>>> I have a question regarding pg_attribute. In which file it is stored
>>> because the relfilenode for it shows 0 and file 1249 isn't present in
>>> the folder.
>
>> select pg_relation_filepath('pg_attribute');
>
>>  From the docs, relfilenode is:
>> "Name of the on-disk file of this relation; zero means this is a
>> "mapped" relation whose disk file name is determined by low-level state"
>
>> However the meaning "mapped relation" and "low-level state" are
>> difficult to divine from the docs. Go with the function.
>
> Or use pg_relation_filenode() if you want the result of the mapping.
>
>                        regards, tom lane



-- 
Łukasz Brodziak
"Do you bury me when I'm gone
Do you teach me while I'm here
Just as soon I belong
Then it's time I disappear"



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_attribute file in PostgreSQL 9.0
  2012-03-07 13:14 pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2012-03-07 14:35 ` Re: pg_attribute file in PostgreSQL 9.0 Steve Crawford <scrawford@pinpointresearch.com>
  2012-03-07 15:01   ` Re: pg_attribute file in PostgreSQL 9.0 Tom Lane <tgl@sss.pgh.pa.us>
  2012-03-07 17:03     ` Re: pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
@ 2012-03-07 17:14       ` Steve Crawford <scrawford@pinpointresearch.com>
  2012-03-07 17:24         ` Re: pg_attribute file in PostgreSQL 9.0 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 9+ messages in thread

From: Steve Crawford @ 2012-03-07 17:14 UTC (permalink / raw)
  To: Lukasz Brodziak <lukasz.brodziak@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin

On 03/07/2012 09:03 AM, Lukasz Brodziak wrote:
> Thanks a lot I have found file I needed let's hope I will be able to
> fix the problem now as I cannot connect to the database because I get
> 'catalog is missing 1 attribute for relation 2662' which I hope to be
> able to repair by getting the pg_attribute file from another db.
>
STOP! Don't touch anything just yet. Now we know the real reason for the 
question.

Do you have an idea what may have caused this? Are there any relevant 
errors in the log? What is the source of the file that you want to use 
as a replacement? What version of PG? OS? Is the database able to start? 
Are you attempting to connect as a superuser?

With this as a starting point you may get some valuable advice (though 
from those people far more capable of answering this question than I).

Cheers,
Steve




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_attribute file in PostgreSQL 9.0
  2012-03-07 13:14 pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2012-03-07 14:35 ` Re: pg_attribute file in PostgreSQL 9.0 Steve Crawford <scrawford@pinpointresearch.com>
  2012-03-07 15:01   ` Re: pg_attribute file in PostgreSQL 9.0 Tom Lane <tgl@sss.pgh.pa.us>
  2012-03-07 17:03     ` Re: pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2012-03-07 17:14       ` Re: pg_attribute file in PostgreSQL 9.0 Steve Crawford <scrawford@pinpointresearch.com>
@ 2012-03-07 17:24         ` Tom Lane <tgl@sss.pgh.pa.us>
  2012-03-07 17:49           ` Re: pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2012-03-07 17:57           ` Re: pg_attribute file in PostgreSQL 9.0 Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 2 replies; 9+ messages in thread

From: Tom Lane @ 2012-03-07 17:24 UTC (permalink / raw)
  To: Steve Crawford <scrawford@pinpointresearch.com>; +Cc: Lukasz Brodziak <lukasz.brodziak@gmail.com>; pgsql-admin

Steve Crawford <scrawford@pinpointresearch.com> writes:
> On 03/07/2012 09:03 AM, Lukasz Brodziak wrote:
>> Thanks a lot I have found file I needed let's hope I will be able to
>> fix the problem now as I cannot connect to the database because I get
>> 'catalog is missing 1 attribute for relation 2662' which I hope to be
>> able to repair by getting the pg_attribute file from another db.

> STOP! Don't touch anything just yet. Now we know the real reason for the 
> question.

... yeah, and this is the wrong answer.  It's *exceedingly* unlikely
that plopping in the pg_attribute file from a different database will
accomplish anything except to make matters far worse.  Even if the other
DB has exactly the same tables and exactly the same columns in those
tables, it likely doesn't have the same OID assignments.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_attribute file in PostgreSQL 9.0
  2012-03-07 13:14 pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2012-03-07 14:35 ` Re: pg_attribute file in PostgreSQL 9.0 Steve Crawford <scrawford@pinpointresearch.com>
  2012-03-07 15:01   ` Re: pg_attribute file in PostgreSQL 9.0 Tom Lane <tgl@sss.pgh.pa.us>
  2012-03-07 17:03     ` Re: pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2012-03-07 17:14       ` Re: pg_attribute file in PostgreSQL 9.0 Steve Crawford <scrawford@pinpointresearch.com>
  2012-03-07 17:24         ` Re: pg_attribute file in PostgreSQL 9.0 Tom Lane <tgl@sss.pgh.pa.us>
@ 2012-03-07 17:49           ` Lukasz Brodziak <lukasz.brodziak@gmail.com>
  1 sibling, 0 replies; 9+ messages in thread

From: Lukasz Brodziak @ 2012-03-07 17:49 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Steve Crawford <scrawford@pinpointresearch.com>; pgsql-admin

Ok, so the case is that I don't have the exact cause of the problem as
it occured on one of our clients dbs. The PG version is 9.0.0 and the
OS is windows XP. The DB is able to start (I have the data folder) but
when I connect to the db from our application (or pgAdmin) I come
across the above mentioned error. I have managed to get into the
database after replacing the pg_attribute from another DB (clean db
created with our installer) but then I read Your mail so I stopped at
this point. Pg_log has only this one information on the error.

2012/3/7 Tom Lane <tgl@sss.pgh.pa.us>:
> Steve Crawford <scrawford@pinpointresearch.com> writes:
>> On 03/07/2012 09:03 AM, Lukasz Brodziak wrote:
>>> Thanks a lot I have found file I needed let's hope I will be able to
>>> fix the problem now as I cannot connect to the database because I get
>>> 'catalog is missing 1 attribute for relation 2662' which I hope to be
>>> able to repair by getting the pg_attribute file from another db.
>
>> STOP! Don't touch anything just yet. Now we know the real reason for the
>> question.
>
> ... yeah, and this is the wrong answer.  It's *exceedingly* unlikely
> that plopping in the pg_attribute file from a different database will
> accomplish anything except to make matters far worse.  Even if the other
> DB has exactly the same tables and exactly the same columns in those
> tables, it likely doesn't have the same OID assignments.
>
>                        regards, tom lane



-- 
Łukasz Brodziak
"Do you bury me when I'm gone
Do you teach me while I'm here
Just as soon I belong
Then it's time I disappear"



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_attribute file in PostgreSQL 9.0
  2012-03-07 13:14 pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2012-03-07 14:35 ` Re: pg_attribute file in PostgreSQL 9.0 Steve Crawford <scrawford@pinpointresearch.com>
  2012-03-07 15:01   ` Re: pg_attribute file in PostgreSQL 9.0 Tom Lane <tgl@sss.pgh.pa.us>
  2012-03-07 17:03     ` Re: pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
  2012-03-07 17:14       ` Re: pg_attribute file in PostgreSQL 9.0 Steve Crawford <scrawford@pinpointresearch.com>
  2012-03-07 17:24         ` Re: pg_attribute file in PostgreSQL 9.0 Tom Lane <tgl@sss.pgh.pa.us>
@ 2012-03-07 17:57           ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
  1 sibling, 0 replies; 9+ messages in thread

From: Kevin Grittner @ 2012-03-07 17:57 UTC (permalink / raw)
  To: Lukasz Brodziak <lukasz.brodziak@gmail.com>; +Cc: Steve Crawford <scrawford@pinpointresearch.com>; pgsql-admin; Tom Lane <tgl@sss.pgh.pa.us>

Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Steve Crawford <scrawford@pinpointresearch.com> writes:
>> On 03/07/2012 09:03 AM, Lukasz Brodziak wrote:
>>> Thanks a lot I have found file I needed let's hope I will be
>>> able to fix the problem now as I cannot connect to the database
>>> because I get 'catalog is missing 1 attribute for relation 2662'
>>> which I hope to be able to repair by getting the pg_attribute
>>> file from another db.
> 
>> STOP! Don't touch anything just yet. Now we know the real reason
>> for the question.
> 
> ... yeah, and this is the wrong answer.  It's *exceedingly*
> unlikely that plopping in the pg_attribute file from a different
> database will accomplish anything except to make matters far
> worse.  Even if the other DB has exactly the same tables and
> exactly the same columns in those tables, it likely doesn't have
> the same OID assignments.
 
http://wiki.postgresql.org/wiki/Corruption
 
-Kevin



^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2012-03-07 17:57 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-03-07 13:14 pg_attribute file in PostgreSQL 9.0 Lukasz Brodziak <lukasz.brodziak@gmail.com>
2012-03-07 13:53 ` Achilleas Mantzios <achill@smadev.internal.net>
2012-03-07 14:35 ` Steve Crawford <scrawford@pinpointresearch.com>
2012-03-07 15:01   ` Tom Lane <tgl@sss.pgh.pa.us>
2012-03-07 17:03     ` Lukasz Brodziak <lukasz.brodziak@gmail.com>
2012-03-07 17:14       ` Steve Crawford <scrawford@pinpointresearch.com>
2012-03-07 17:24         ` Tom Lane <tgl@sss.pgh.pa.us>
2012-03-07 17:49           ` Lukasz Brodziak <lukasz.brodziak@gmail.com>
2012-03-07 17:57           ` Kevin Grittner <Kevin.Grittner@wicourts.gov>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox