Thread: Duplicate Columns on Insert

Duplicate Columns on Insert

From
"Tom Innes"
Date:
Hi,

I am using Postgres V7.21 along with Jboss V3.01.. I have established a 1 to
many relationship between table A ( 1)  and Table B (n).  When I attempt to
insert into table B, I get a duplicate column exception.  The duplicated
column is the related column.

When I try this same project on hypersonic, it works fine.

Is this a known problem on the PostgreSQL JDBC driver?

Tom


Re: Duplicate Columns on Insert

From
Aaron Mulder
Date:
    Do you know what INSERT statement JBoss is constructing (sounds
like perhaps it is including the same column twice in the insert)?  Is the
column in question both a CMP field and a CMR field?  If so, and you
remove the CMP entries for it so it's just a CMR field, does it work?

Aaron

On Mon, 29 Jul 2002, Tom Innes wrote:
> Hi,
>
> I am using Postgres V7.21 along with Jboss V3.01.. I have established a 1 to
> many relationship between table A ( 1)  and Table B (n).  When I attempt to
> insert into table B, I get a duplicate column exception.  The duplicated
> column is the related column.
>
> When I try this same project on hypersonic, it works fine.
>
> Is this a known problem on the PostgreSQL JDBC driver?


Re: Duplicate Columns on Insert

From
"Tom Innes"
Date:
Reply Below..



 -----Original Message-----
From:     pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org]  On Behalf Of Aaron Mulder
Sent:    July 29, 2002 5:37 PM
To:    pgsql-jdbc@postgresql.org
Subject:    Re: [JDBC] Duplicate Columns on Insert

    Do you know what INSERT statement JBoss is constructing (sounds
like perhaps it is including the same column twice in the insert)?

    Exactly,
 Is the
column in question both a CMP field and a CMR field?

    Yes
  If so, and you
remove the CMP entries for it so it's just a CMR field, does it work?
    Yes it does,


But this has several negative implications.
    1,  A CMR field cannot particpate as the primary key in table B

What is perplexing here is that Hypersonic works fine?

Tom

Aaron

On Mon, 29 Jul 2002, Tom Innes wrote:
> Hi,
>
> I am using Postgres V7.21 along with Jboss V3.01.. I have established a 1
to
> many relationship between table A ( 1)  and Table B (n).  When I attempt
to
> insert into table B, I get a duplicate column exception.  The duplicated
> column is the related column.
>
> When I try this same project on hypersonic, it works fine.
>
> Is this a known problem on the PostgreSQL JDBC driver?


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


Re: Duplicate Columns on Insert

From
"SHEVLAND, Joe"
Date:

> But this has several negative implications.
>       1,  A CMR field cannot particpate as the primary key in table B
>
> What is perplexing here is that Hypersonic works fine?
>
> Tom

I think in the past Hypersonic has been fairly 'flexible' in allowing things like two columns of the same name in a table and other oddities (the above might be one)... I'd say upgrading to v1.7 of hsqldb might show this up to be a problem, but thats just a guess.

Regards,
Joe