Thread: Unrecognized node type

Unrecognized node type

From
Alvaro Sanchez-Mariscal
Date:
Hi:

I've to import a DB schema and data from one pgsql to another. The
source version is 7.3.4. The destination version is 7.4.2.

I've tried to import a dump from pg_dump. Everything goes ok, but at
certain point, in the following sentence:

CREATE TABLE ca_persona (
...
   lssi boolean DEFAULT NULL::boolean,   postal boolean DEFAULT NULL::boolean,   tele_marketing boolean DEFAULT
NULL::boolean,
...
)

I get the following error message:

"ERROR:  unrecognized node type: 656".

If I remove those fields, then nothing fails. But I cannot simply change
table definition, because then the (J2EE) application doesn't works. The
sql must be with NULL::boolean default values.

Both source and destination databases have the same encoding
(iso-8859-15, "LATIN_9"). Both servers are running on Linux.

The same dump have worked correctly in many other machines running
Postgres on Windows with Cygwin, with many different versions (7.3.x and
7.4.x).

I've tried all the ways of dumping with pg_dump, and using pg_restore in
those ways, or loading the sql script from psql, and always fails :-(.

Also I've tried with different versions of Postgres, from RPM packages
and building from source code, and again always fails :-(.

My question is simple: what the h... can I do? :-)

Please CC me your replies as I'm not suscribed to this list. Thanks in
advance.

PS: sorry about my english :-).

-- 
Álvaro Sánchez-Mariscal Arnaiz  | Departamento de Comunicación  mariscal@javahispano.org     |         javaHispano
     javaHispano. Una Comunidad al Servicio de Todos                  www.javaHispano.org



Re: Unrecognized node type

From
Tom Lane
Date:
Alvaro Sanchez-Mariscal <mariscal@javahispano.org> writes:
> I've tried to import a dump from pg_dump. Everything goes ok, but at
> certain point, in the following sentence:

> CREATE TABLE ca_persona (
> ...

>     lssi boolean DEFAULT NULL::boolean,
>     postal boolean DEFAULT NULL::boolean,
>     tele_marketing boolean DEFAULT NULL::boolean,
> ...
> )

> I get the following error message:
> "ERROR:  unrecognized node type: 656".

I couldn't duplicate this:

regression=# CREATE TABLE ca_persona (
regression(# lssi boolean DEFAULT NULL::boolean,
regression(# postal boolean DEFAULT NULL::boolean,
regression(# tele_marketing boolean DEFAULT NULL::boolean);
CREATE TABLE
regression=# \d ca_persona           Table "public.ca_persona"    Column     |  Type   |       Modifiers
----------------+---------+-----------------------lssi           | boolean | default NULL::booleanpostal         |
boolean| default NULL::booleantele_marketing | boolean | default NULL::boolean
 

regression=# insert into ca_persona default values;
INSERT 154658 1
regression=#

I suppose there's some other factor involved in the problem that
you didn't show us.

> My question is simple: what the h... can I do? :-)

As far as finding the bug, you need to provide a complete,
self-contained test case.

As far as loading the schema, how about just removing the DEFAULT
clauses?  "default null" is the default behavior anyway.
        regards, tom lane


Re: Unrecognized node type

From
Tom Lane
Date:
Alvaro Sanchez-Mariscal <mariscal@javahispano.org> writes:
>> I suppose there's some other factor involved in the problem that
>> you didn't show us.

> But... what? :-S

If I knew, I could've reproduced the problem ...

>> As far as finding the bug, you need to provide a complete,
>> self-contained test case.

> Can you be more explicit?

Preferably, send an SQL script that will trigger the failure starting
from an empty database.  You can probably make one by stripping down
your existing dump script.  (I don't care whether you try to minimize
the size of the example; but you'll want to take out your actual data
as well as anything else you deem private.)

>> As far as loading the schema, how about just removing the DEFAULT
>> clauses?  "default null" is the default behavior anyway.

> I tried this, but then EJB's doesn't work...

This is odd.  I suspect that it would be appropriate to ask the JDBC
people to see if they can fix it.  The driver itself ought to be aware
that "no default" is the same as "default null", but apparently it is
not.  (For that matter, whatever part of the EJB code is breaking ought
to know that, because for sure it is SQL-standard behavior.  But the
JDBC people might be more responsive to a bug report.)
        regards, tom lane


Re: Unrecognized node type

From
Alvaro Sanchez-Mariscal
Date:
> I suppose there's some other factor involved in the problem that
> you didn't show us.

But... what? :-S

> As far as finding the bug, you need to provide a complete,
> self-contained test case.

Can you be more explicit?

> As far as loading the schema, how about just removing the DEFAULT
> clauses?  "default null" is the default behavior anyway.

I tried this, but then EJB's doesn't work...

Thanks.

-- 
Álvaro Sánchez-Mariscal Arnaiz  | Departamento de Comunicación  mariscal@javahispano.org     |         javaHispano
     javaHispano. Una Comunidad al Servicio de Todos                  www.javaHispano.org