Thread: Pls help

Pls help

From
"Roseller A. Romanos"
Date:
 Hi,

I really have a serious problem with this.  I hope you could give me some insights on how to possibly solve this problem. I have installed a new copy of postgres in my PC using Windows XP OS and I have copy the data folder in my previous installation from the other PC, my problem is that I cannot access the records that I have copied from the other PC.

An error message pops up saying "Cache lookup failed for relation 16410".
What does this mean?

Please help. I will really appreciate if you could give me some ideas with this.
Thanks in advance and God bless.Pls


Roseller Romanos
STI-Pagadian
Gillamac Building, Pagadian City
Office Nos: (062) 2144-785
Home Nos: (062) 2144-695
Mobile Nos: 09205302636

Re: Pls help

From
Pavel Stehule
Date:
2009/7/4 Roseller A. Romanos <don2_907@yahoo.com>:
>  Hi,
>
> I really have a serious problem with this.  I hope you could give me some
> insights on how to possibly solve this problem. I have installed a new copy
> of postgres in my PC using Windows XP OS and I have copy the data folder in
> my previous installation from the other PC, my problem is that I cannot
> access the records that I have copied from the other PC.

you cannot copy postgres data files from one computer to second.
PostgreSQL is not MySQL. Use pg_dump instead or copy statement.

1. on PC1

pg_dump -t yourtable yourdatabase > yourtable.sql

2. copy yourtable.sql file from PC1 to PC2

3. on PC2

psql yourdatabase < yourtable.sql


>
> An error message pops up saying "Cache lookup failed for relation 16410".
> What does this mean?
>

your data file is not compatible with data dictionary.

http://www.postgresql.org/docs/8.3/static/backup.html

regards
Pavel Stehule



> Please help. I will really appreciate if you could give me some ideas with
> this.
> Thanks in advance and God bless.Pls
>
>
> Roseller Romanos
> STI-Pagadian
> Gillamac Building, Pagadian City
> Office Nos: (062) 2144-785
> Home Nos: (062) 2144-695
> Mobile Nos: 09205302636
>

Re: Pls help

From
Scott Marlowe
Date:
On Fri, Jul 3, 2009 at 10:40 PM, Pavel Stehule<pavel.stehule@gmail.com> wrote:
> 2009/7/4 Roseller A. Romanos <don2_907@yahoo.com>:
>>  Hi,
>>
>> I really have a serious problem with this.  I hope you could give me some
>> insights on how to possibly solve this problem. I have installed a new copy
>> of postgres in my PC using Windows XP OS and I have copy the data folder in
>> my previous installation from the other PC, my problem is that I cannot
>> access the records that I have copied from the other PC.
>
> you cannot copy postgres data files from one computer to second.
> PostgreSQL is not MySQL. Use pg_dump instead or copy statement.

Well, strictly speaking, if they're from the same architecture, with
the same compile time options and the same major version of pgsql*
then you can.  But you need to shut down the source and destination
servers while doing it.

* Note that in pgsql the first TWO numbers denote a major version, so
8.1 and 8.2 are NOT the same major version.

Re: Pls help

From
Pavel Stehule
Date:
2009/7/4 Scott Marlowe <scott.marlowe@gmail.com>:
> On Fri, Jul 3, 2009 at 10:40 PM, Pavel Stehule<pavel.stehule@gmail.com> wrote:
>> 2009/7/4 Roseller A. Romanos <don2_907@yahoo.com>:
>>>  Hi,
>>>
>>> I really have a serious problem with this.  I hope you could give me some
>>> insights on how to possibly solve this problem. I have installed a new copy
>>> of postgres in my PC using Windows XP OS and I have copy the data folder in
>>> my previous installation from the other PC, my problem is that I cannot
>>> access the records that I have copied from the other PC.
>>
>> you cannot copy postgres data files from one computer to second.
>> PostgreSQL is not MySQL. Use pg_dump instead or copy statement.
>
> Well, strictly speaking, if they're from the same architecture, with
> the same compile time options and the same major version of pgsql*
> then you can.  But you need to shut down the source and destination
> servers while doing it.

and all your DDL operation are same and executed in same order too


>
> * Note that in pgsql the first TWO numbers denote a major version, so
> 8.1 and 8.2 are NOT the same major version.
>

Re: Pls help

From
Scott Marlowe
Date:
On Sat, Jul 4, 2009 at 12:12 AM, Pavel Stehule<pavel.stehule@gmail.com> wrote:
> 2009/7/4 Scott Marlowe <scott.marlowe@gmail.com>:
>> On Fri, Jul 3, 2009 at 10:40 PM, Pavel Stehule<pavel.stehule@gmail.com> wrote:
>>> 2009/7/4 Roseller A. Romanos <don2_907@yahoo.com>:
>>>>  Hi,
>>>>
>>>> I really have a serious problem with this.  I hope you could give me some
>>>> insights on how to possibly solve this problem. I have installed a new copy
>>>> of postgres in my PC using Windows XP OS and I have copy the data folder in
>>>> my previous installation from the other PC, my problem is that I cannot
>>>> access the records that I have copied from the other PC.
>>>
>>> you cannot copy postgres data files from one computer to second.
>>> PostgreSQL is not MySQL. Use pg_dump instead or copy statement.
>>
>> Well, strictly speaking, if they're from the same architecture, with
>> the same compile time options and the same major version of pgsql*
>> then you can.  But you need to shut down the source and destination
>> servers while doing it.
>
> and all your DDL operation are same and executed in same order too

I'm not sure what you mean.  If you shut down both db instances, and
copy the files over, there's no DDL involved really.

Re: Pls help

From
Pavel Stehule
Date:
2009/7/4 Scott Marlowe <scott.marlowe@gmail.com>:
> On Sat, Jul 4, 2009 at 12:12 AM, Pavel Stehule<pavel.stehule@gmail.com> wrote:
>> 2009/7/4 Scott Marlowe <scott.marlowe@gmail.com>:
>>> On Fri, Jul 3, 2009 at 10:40 PM, Pavel Stehule<pavel.stehule@gmail.com> wrote:
>>>> 2009/7/4 Roseller A. Romanos <don2_907@yahoo.com>:
>>>>>  Hi,
>>>>>
>>>>> I really have a serious problem with this.  I hope you could give me some
>>>>> insights on how to possibly solve this problem. I have installed a new copy
>>>>> of postgres in my PC using Windows XP OS and I have copy the data folder in
>>>>> my previous installation from the other PC, my problem is that I cannot
>>>>> access the records that I have copied from the other PC.
>>>>
>>>> you cannot copy postgres data files from one computer to second.
>>>> PostgreSQL is not MySQL. Use pg_dump instead or copy statement.
>>>
>>> Well, strictly speaking, if they're from the same architecture, with
>>> the same compile time options and the same major version of pgsql*
>>> then you can.  But you need to shut down the source and destination
>>> servers while doing it.
>>
>> and all your DDL operation are same and executed in same order too
>
> I'm not sure what you mean.  If you shut down both db instances, and
> copy the files over, there's no DDL involved really.
>

When you copy all files, then ok. But when you copy only one data
file, then you have a problem.

Problem should be different oid of pg_class table

Pavel

Re: Pls help

From
Scott Marlowe
Date:
On Sat, Jul 4, 2009 at 12:22 AM, Pavel Stehule<pavel.stehule@gmail.com> wrote:
> 2009/7/4 Scott Marlowe <scott.marlowe@gmail.com>:
>> On Sat, Jul 4, 2009 at 12:12 AM, Pavel Stehule<pavel.stehule@gmail.com> wrote:
>>> 2009/7/4 Scott Marlowe <scott.marlowe@gmail.com>:
>>>> On Fri, Jul 3, 2009 at 10:40 PM, Pavel Stehule<pavel.stehule@gmail.com> wrote:
>>>>> 2009/7/4 Roseller A. Romanos <don2_907@yahoo.com>:
>>>>>>  Hi,
>>>>>>
>>>>>> I really have a serious problem with this.  I hope you could give me some
>>>>>> insights on how to possibly solve this problem. I have installed a new copy
>>>>>> of postgres in my PC using Windows XP OS and I have copy the data folder in
>>>>>> my previous installation from the other PC, my problem is that I cannot
>>>>>> access the records that I have copied from the other PC.
>>>>>
>>>>> you cannot copy postgres data files from one computer to second.
>>>>> PostgreSQL is not MySQL. Use pg_dump instead or copy statement.
>>>>
>>>> Well, strictly speaking, if they're from the same architecture, with
>>>> the same compile time options and the same major version of pgsql*
>>>> then you can.  But you need to shut down the source and destination
>>>> servers while doing it.
>>>
>>> and all your DDL operation are same and executed in same order too
>>
>> I'm not sure what you mean.  If you shut down both db instances, and
>> copy the files over, there's no DDL involved really.
>>
>
> When you copy all files, then ok. But when you copy only one data
> file, then you have a problem.
>
> Problem should be different oid of pg_class table

Definitely, all files, and blow away the destination first.  The OP
had said he copied the data directory, which should be more than
enough, but if they left old files in place I'm not so sure.

Re: Pls help

From
Scott Marlowe
Date:
On Fri, Jul 3, 2009 at 10:02 PM, Roseller A. Romanos<don2_907@yahoo.com> wrote:
>  Hi,
>
> I really have a serious problem with this.  I hope you could give me some
> insights on how to possibly solve this problem. I have installed a new copy
> of postgres in my PC using Windows XP OS and I have copy the data folder in
> my previous installation from the other PC, my problem is that I cannot
> access the records that I have copied from the other PC.
>
> An error message pops up saying "Cache lookup failed for relation 16410".
> What does this mean?
>
> Please help. I will really appreciate if you could give me some ideas with
> this.

Note that this could be a permissions problem.  All the files need to
belong to whatever user postgres runs as.

Re: Pls help

From
justin
Date:
Scott Marlowe wrote:
> On Fri, Jul 3, 2009 at 10:02 PM, Roseller A. Romanos<don2_907@yahoo.com> wrote:
>
> Note that this could be a permissions problem.  All the files need to
> belong to whatever user postgres runs as.
>
>

If the destination PG install successfully started before there will be
no permission problems.  When copying files from one computer to another
security credentials do not follow in Windows, security will be
inherited from parent directory by default.

The only time security in windows has that kind of problem is when
moving the physical hard drive to another computer.  This creates
orphaned UUID describing security credentials in meta data of the NTFS
volume   To clean up that kind of security mess requires first taking
ownership of the files then reseting all the permissions with replace
option.