# pgsql and MAXALIGN

## nordic bro

not really sure where this should go but I have a pgsql "data" dir from a mac I'm trying to get working on my amd64 linux.  I compiled the pgsql version that "data" came from and when I try to start it I get a fatal err:

The database cluster was initialized with MAXALIGN 0, but the server was compiled with MAXALIGN 8.

not being able to find much on that I tried recompiling w/CC="gcc -m32 --target=i386 ..." to see what would happen and got this next:

... but the server was compiled with MAXALIGN 4.

presumably a "MAXALIGN 0" means it was unset when the mac bins were built, maybe because mac arch doesn't support MAXALIGN or something?  is there a way around this such that I can build the linux pgsql bins to get a MAXALIGN 0 too?

when I check compile env I see these so could changing to something else be what I need to do?  if so what would I change them too?  or do they not matter?

HOSTTYPE=x86_64-linux

MACHTYPE=x86_64

thanks.

----------

## mike155

 *Quote:*   

> ... I have a pgsql "data" dir from a mac I'm trying to get working on my amd64 linux. ...

 

Unless you are an advanced PostgreSQL expert familiar with internal data structures, 

you shouldn't even think about transferring data between different systems by copying 

the "data" dir. It's dangerous, it won't work, you will run into all kind of troubles, 

and - most importantly - it's not a valid use case and not supported by the developers.

The proper way to transfer data from a Mac to a Linux system is to make a PostgreSQL 

dump on the Mac using pg_dump or pg_dumpall and to import that dump on the 

Linux server.

----------

## nordic bro

thanks but tbh all I'm interested in is what I posted about, whether or not I can do anything about MAXALIGN when compiling.  what is/is not supported isn't a concern although of course I'd be interested to know that one has first-hand knowledge going from mac to another platform is functionally impossible.

if I can get it running in order to dump text data from a table for a customer that's what I'm after.  I've never had probs I can't deal with when moving/recovering "data" between win machines, this is the first time I've tried to do so for a mac (intel mac if it matters).

----------

## titanofold

No, you can't adjust MAXALIGN. It's particular to the OS and system.

The best process is a dump and restore.

----------

