Обсуждение: PostgreSQL file system based restore from Linux to Windows

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

PostgreSQL file system based restore from Linux to Windows

От
girish R G peetle
Дата:
Hi all,
PostgreSQL file system based restore, ( copy database files from linux to windows) from Linux to Windows is supported ?  
I couldn't find any reference to this information in PostgreSQL documentation.

Thanks
Girish

Re: PostgreSQL file system based restore from Linux to Windows

От
Tom Lane
Дата:
girish R G peetle <giri.anamika0@gmail.com> writes:
> PostgreSQL file system based restore, ( copy database files from linux to
> windows) from Linux to Windows is supported ?
> I couldn't find any reference to this information in PostgreSQL
> documentation.

No.  The general project policy is that data files are only compatible
across one platform, ie, one OS and machine architecture.  (I'm pretty
sure this is stated somewhere in the docs, but am too tired to go
looking for chapter and verse.)

It might happen to work, if you're talking the same Intel-ish CPU type
on both ends ... but if it fails, don't call us.

            regards, tom lane


Re: PostgreSQL file system based restore from Linux to Windows

От
girish R G peetle
Дата:
Thanks a lot for the information Tom.

Thanks
Girish

On Wed, Dec 31, 2014 at 11:58 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
girish R G peetle <giri.anamika0@gmail.com> writes:
> PostgreSQL file system based restore, ( copy database files from linux to
> windows) from Linux to Windows is supported ?
> I couldn't find any reference to this information in PostgreSQL
> documentation.

No.  The general project policy is that data files are only compatible
across one platform, ie, one OS and machine architecture.  (I'm pretty
sure this is stated somewhere in the docs, but am too tired to go
looking for chapter and verse.)

It might happen to work, if you're talking the same Intel-ish CPU type
on both ends ... but if it fails, don't call us.

                        regards, tom lane

Re: PostgreSQL file system based restore from Linux to Windows

От
Craig Ringer
Дата:
On 12/31/2014 02:28 PM, Tom Lane wrote:
> It might happen to work, if you're talking the same Intel-ish CPU type
> on both ends ... but if it fails, don't call us.

It might for 32-bit, but I'm pretty sure it's not going to for 64-bit
because Windows is LLP64 and Linux is LP64, so sizeof(long) differs. See
http://en.wikipedia.org/wiki/64-bit_computing .

(Yet another area where Windows is annoyingly and pointlessly different,
like use of UTF16 instead of UTF-8, though at least there they have the
excuse of doing it first.)

Just use a Linux box or a virtual machine to start a copy of the
database, then pg_dump -Fc it and pg_restore to a new instance on the
Windows box.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Re: PostgreSQL file system based restore from Linux to Windows

От
Bruce Momjian
Дата:
On Fri, Jan  2, 2015 at 06:56:47PM +0800, Craig Ringer wrote:
> On 12/31/2014 02:28 PM, Tom Lane wrote:
> > It might happen to work, if you're talking the same Intel-ish CPU type
> > on both ends ... but if it fails, don't call us.
>
> It might for 32-bit, but I'm pretty sure it's not going to for 64-bit
> because Windows is LLP64 and Linux is LP64, so sizeof(long) differs. See
> http://en.wikipedia.org/wiki/64-bit_computing .
>
> (Yet another area where Windows is annoyingly and pointlessly different,
> like use of UTF16 instead of UTF-8, though at least there they have the
> excuse of doing it first.)
>
> Just use a Linux box or a virtual machine to start a copy of the
> database, then pg_dump -Fc it and pg_restore to a new instance on the
> Windows box.

I would also worry about collation differences between Linux and
Windows.  We have seen index problems with OS upgrades causing
mismatches, so I assume Windows and Linux might have even larger
mismatches.   We have discussed a way to test for mismatches but have
no solution yet.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +