Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [GENERAL] Pls help

0 views
Skip to first unread message

Pavel Stehule

unread,
Jul 4, 2009, 12:40:52 AM7/4/09
to
2009/7/4 Roseller A. Romanos <don2...@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
>

--
Sent via pgsql-general mailing list (pgsql-...@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Scott Marlowe

unread,
Jul 4, 2009, 2:03:43 AM7/4/09
to
On Fri, Jul 3, 2009 at 10:40 PM, Pavel Stehule<pavel....@gmail.com> wrote:
> 2009/7/4 Roseller A. Romanos <don2...@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.

Pavel Stehule

unread,
Jul 4, 2009, 2:12:11 AM7/4/09
to
2009/7/4 Scott Marlowe <scott....@gmail.com>:

> On Fri, Jul 3, 2009 at 10:40 PM, Pavel Stehule<pavel....@gmail.com> wrote:
>> 2009/7/4 Roseller A. Romanos <don2...@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

Scott Marlowe

unread,
Jul 4, 2009, 2:13:47 AM7/4/09
to
On Sat, Jul 4, 2009 at 12:12 AM, Pavel Stehule<pavel....@gmail.com> wrote:
> 2009/7/4 Scott Marlowe <scott....@gmail.com>:
>> On Fri, Jul 3, 2009 at 10:40 PM, Pavel Stehule<pavel....@gmail.com> wrote:
>>> 2009/7/4 Roseller A. Romanos <don2...@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.

Pavel Stehule

unread,
Jul 4, 2009, 2:22:49 AM7/4/09
to
2009/7/4 Scott Marlowe <scott....@gmail.com>:
> On Sat, Jul 4, 2009 at 12:12 AM, Pavel Stehule<pavel....@gmail.com> wrote:
>> 2009/7/4 Scott Marlowe <scott....@gmail.com>:
>>> On Fri, Jul 3, 2009 at 10:40 PM, Pavel Stehule<pavel....@gmail.com> wrote:
>>>> 2009/7/4 Roseller A. Romanos <don2...@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

Scott Marlowe

unread,
Jul 4, 2009, 2:27:04 AM7/4/09
to
On Sat, Jul 4, 2009 at 12:22 AM, Pavel Stehule<pavel....@gmail.com> wrote:
> 2009/7/4 Scott Marlowe <scott....@gmail.com>:
>> On Sat, Jul 4, 2009 at 12:12 AM, Pavel Stehule<pavel....@gmail.com> wrote:
>>> 2009/7/4 Scott Marlowe <scott....@gmail.com>:
>>>> On Fri, Jul 3, 2009 at 10:40 PM, Pavel Stehule<pavel....@gmail.com> wrote:
>>>>> 2009/7/4 Roseller A. Romanos <don2...@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.

Scott Marlowe

unread,
Jul 4, 2009, 2:27:53 AM7/4/09
to
On Fri, Jul 3, 2009 at 10:02 PM, Roseller A. Romanos<don2...@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.

justin

unread,
Jul 4, 2009, 6:49:34 PM7/4/09
to
Scott Marlowe wrote:
> On Fri, Jul 3, 2009 at 10:02 PM, Roseller A. Romanos<don2...@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.

0 new messages