Обсуждение: ISBN: dump from 64bits and restore on 32 bits fail, Datum?

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

ISBN: dump from 64bits and restore on 32 bits fail, Datum?

От
Daniel Cristian Cruz
Дата:
Hi,

I'm in a project where there is one development server with 32bits
architecture and all the others are 64 bits.

The server where I generate the base models (in sense of version) is a 64
bit. Dump and restore from this machine to all others 64bits development
servers works well. When I try to restore it in the 32 bits server, it
returns the following errors:

[pg9@server ~]$ createdb isbn -T template0
[pg9@server ~]$ pg_restore -d isbn /tmp/isbn.backup
*ERROR:  internal size 8 is invalid for passed-by-value type*
STATEMENT:  CREATE TYPE ean13 (
            INTERNALLENGTH =3D 8,
            INPUT =3D ean13_in,
            OUTPUT =3D public.ean13_out,
            ALIGNMENT =3D double,
            STORAGE =3D plain,
            PASSEDBYVALUE
        );
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 550; 1247 1184851 TYPE
ean13 pg9
pg_restore: [archiver (db)] could not execute query: ERROR:  internal size 8
is invalid for passed-by-value type
    Command was: CREATE TYPE ean13 (
    INTERNALLENGTH =3D 8,
    INPUT =3D ean13_in,
    OUTPUT =3D public.ean13_out,
    ALIGNMENT =3D double,
   ...
ERROR:  type "ean13" is only a shell
STATEMENT:  COMMENT ON TYPE ean13 IS 'International European Article Number
(EAN13)';
pg_restore: [archiver (db)] Error from TOC entry 2254; 0 0 COMMENT TYPE
ean13 pg9
pg_restore: [archiver (db)] could not execute query: ERROR:  type "ean13" is
only a shell
    Command was: COMMENT ON TYPE ean13 IS 'International European Article
Number (EAN13)';
*ERROR:  internal size 8 is invalid for passed-by-value type*
STATEMENT:  CREATE TYPE isbn (
            INTERNALLENGTH =3D 8,
            INPUT =3D isbn_in,
            OUTPUT =3D public.isn_out,
            ALIGNMENT =3D double,
            STORAGE =3D plain,
            PASSEDBYVALUE
        );
pg_restore: [archiver (db)] Error from TOC entry 562; 1247 1184867 TYPE isbn
pg9
...

And many errors after these ones.

I guess it's a bug in isbn code since when not using isbn/issn contrib
modules the errors doesn't shows up.

Naive I was trying to force Datum size to 8 and recompile postgresql for the
32 bits server. It doesn't work this way. :)

Now I request some help from some PostgreSQL Olympian Gods... :)

Regards,
--=20
Daniel Cristian Cruz
=E3=82=AF=E3=83=AB=E3=82=BA =E3=82=AF=E3=83=AA=E3=82=B9=E3=83=81=E3=82=A2=
=E3=83=B3 =E3=83=80=E3=83=8B=E3=82=A8=E3=83=AB

Re: ISBN: dump from 64bits and restore on 32 bits fail, Datum?

От
Tom Lane
Дата:
Daniel Cristian Cruz <danielcristian@gmail.com> writes:
> I'm in a project where there is one development server with 32bits
> architecture and all the others are 64 bits.

> The server where I generate the base models (in sense of version) is a 64
> bit. Dump and restore from this machine to all others 64bits development
> servers works well. When I try to restore it in the 32 bits server, it
> returns the following errors:

> [pg9@server ~]$ createdb isbn -T template0
> [pg9@server ~]$ pg_restore -d isbn /tmp/isbn.backup
> *ERROR:  internal size 8 is invalid for passed-by-value type*

This isn't a bug ... you need to load the appropriate version of
contrib/isn for that server.  Admittedly, pg_dump doesn't make that
terribly easy (it will work a lot better in 9.1 with the extensions
infrastructure).  In existing releases the best advice is to load
the .sql file for the contrib module, then source the dump, ignoring
the object-already-exists errors you get for the module's objects.

            regards, tom lane