pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedERROR: column "total_cost" is of type numeric but expression is of type character varying
6+ messages / 2 participants
[nested] [flat]
* ERROR: column "total_cost" is of type numeric but expression is of type character varying
@ 2005-02-11 10:41 Antony Paul <antonypaul24@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Antony Paul @ 2005-02-11 10:41 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
I am testing PostgreSQL 8.0.1. I compiled and installed it.
Downloaded JDBC driver postgresql-8.0-310.jdbc3.jar for JDK 1.4.(I was
unable to find it in source) Dumped my 7.3.3 database. Restored it in
new installation. Run the application and it gives this error.
The error is when I use setString() to insert into a numeric
field. I hope it is bug. Otherwise we have to rewrite our application.
The error message can be seen in server log also.
rgds
Antony Paul
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: ERROR: column "total_cost" is of type numeric but expression
@ 2005-02-11 11:02 Markus Schaber <schabios@logi-track.com>
parent: Antony Paul <antonypaul24@gmail.com>
0 siblings, 2 replies; 6+ messages in thread
From: Markus Schaber @ 2005-02-11 11:02 UTC (permalink / raw)
To: Antony Paul <antonypaul24@gmail.com>; +Cc: pgsql-jdbc
Hi, Antony,
Antony Paul schrieb:
> I am testing PostgreSQL 8.0.1. I compiled and installed it.
> Downloaded JDBC driver postgresql-8.0-310.jdbc3.jar for JDK 1.4.(I was
> unable to find it in source) Dumped my 7.3.3 database. Restored it in
> new installation. Run the application and it gives this error.
> The error is when I use setString() to insert into a numeric
> field. I hope it is bug. Otherwise we have to rewrite our application.
> The error message can be seen in server log also.
Using setString() to insert anything else from text types is not
possible any more using pgjdbc 8.0 jars, as the new driver makes
stricter use of type checking. One of our third-party apps also suffers
from this problems.
I can three solutions / workarounds for your problem:
- Use the pgjdbc 7.4 jar file, it should work fine against a postgresql
8.0 server. You can also stay with the 7.3 jar you used against your
7.3.3 server, as AFAIK pg8.0 still supports the V2 query protocol.
- Use a "?::numeric" cast in your prepared statement (not tested here).
- Update your application to use the proper numeric types.
Markus
--
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios@logi-track.com | www.logi-track.com
Attachments:
signature.asc (application/pgp-signature, 255B) download
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: ERROR: column "total_cost" is of type numeric but expression
@ 2005-02-11 11:27 Antony Paul <antonypaul24@gmail.com>
parent: Markus Schaber <schabios@logi-track.com>
1 sibling, 0 replies; 6+ messages in thread
From: Antony Paul @ 2005-02-11 11:27 UTC (permalink / raw)
To: Markus Schaber <schabios@logi-track.com>; +Cc: pgsql-jdbc
7.3.3 driver have problem in set autocommit.
I used setString() for number in Oracle 8i.
rgds
Antony Paul
On Fri, 11 Feb 2005 12:02:41 +0100, Markus Schaber
<schabios@logi-track.com> wrote:
> Hi, Antony,
>
> Antony Paul schrieb:
>
> > I am testing PostgreSQL 8.0.1. I compiled and installed it.
> > Downloaded JDBC driver postgresql-8.0-310.jdbc3.jar for JDK 1.4.(I was
> > unable to find it in source) Dumped my 7.3.3 database. Restored it in
> > new installation. Run the application and it gives this error.
> > The error is when I use setString() to insert into a numeric
> > field. I hope it is bug. Otherwise we have to rewrite our application.
> > The error message can be seen in server log also.
>
> Using setString() to insert anything else from text types is not
> possible any more using pgjdbc 8.0 jars, as the new driver makes
> stricter use of type checking. One of our third-party apps also suffers
> from this problems.
>
> I can three solutions / workarounds for your problem:
>
> - Use the pgjdbc 7.4 jar file, it should work fine against a postgresql
> 8.0 server. You can also stay with the 7.3 jar you used against your
> 7.3.3 server, as AFAIK pg8.0 still supports the V2 query protocol.
>
> - Use a "?::numeric" cast in your prepared statement (not tested here).
>
> - Update your application to use the proper numeric types.
>
> Markus
>
> --
> markus schaber | dipl. informatiker
> logi-track ag | rennweg 14-16 | ch 8001 zürich
> phone +41-43-888 62 52 | fax +41-43-888 62 53
> mailto:schabios@logi-track.com | www.logi-track.com
>
>
>
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: ERROR: column "total_cost" is of type numeric but expression is of type character varying
@ 2005-02-11 11:31 Antony Paul <antonypaul24@gmail.com>
parent: Markus Schaber <schabios@logi-track.com>
1 sibling, 1 reply; 6+ messages in thread
From: Antony Paul @ 2005-02-11 11:31 UTC (permalink / raw)
To: Markus Schaber <schabios@logi-track.com>; +Cc: pgsql-jdbc
Updating application is going to be a lot of work. If it breaks
existing applications why it is implemented. I dont think type
checking is a big thing. What is its use ?.
I will try 7.4 driver.
rgds
Antony Paul
On Fri, 11 Feb 2005 12:02:41 +0100, Markus Schaber
<schabios@logi-track.com> wrote:
> Hi, Antony,
>
> Antony Paul schrieb:
>
> > I am testing PostgreSQL 8.0.1. I compiled and installed it.
> > Downloaded JDBC driver postgresql-8.0-310.jdbc3.jar for JDK 1.4.(I was
> > unable to find it in source) Dumped my 7.3.3 database. Restored it in
> > new installation. Run the application and it gives this error.
> > The error is when I use setString() to insert into a numeric
> > field. I hope it is bug. Otherwise we have to rewrite our application.
> > The error message can be seen in server log also.
>
> Using setString() to insert anything else from text types is not
> possible any more using pgjdbc 8.0 jars, as the new driver makes
> stricter use of type checking. One of our third-party apps also suffers
> from this problems.
>
> I can three solutions / workarounds for your problem:
>
> - Use the pgjdbc 7.4 jar file, it should work fine against a postgresql
> 8.0 server. You can also stay with the 7.3 jar you used against your
> 7.3.3 server, as AFAIK pg8.0 still supports the V2 query protocol.
>
> - Use a "?::numeric" cast in your prepared statement (not tested here).
>
> - Update your application to use the proper numeric types.
>
> Markus
>
> --
> markus schaber | dipl. informatiker
> logi-track ag | rennweg 14-16 | ch 8001 zürich
> phone +41-43-888 62 52 | fax +41-43-888 62 53
> mailto:schabios@logi-track.com | www.logi-track.com
>
>
>
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: ERROR: column "total_cost" is of type numeric but expression
@ 2005-02-11 11:37 Markus Schaber <schabios@logi-track.com>
parent: Antony Paul <antonypaul24@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Markus Schaber @ 2005-02-11 11:37 UTC (permalink / raw)
To: Antony Paul <antonypaul24@gmail.com>; +Cc: pgsql-jdbc
Hi, Antony,
Antony Paul schrieb:
> Updating application is going to be a lot of work. If it breaks
> existing applications why it is implemented. I dont think type
> checking is a big thing. What is its use ?.
I'm not 100% shure, as I'm no jdbc developer, but I think the 8.0 driver
consequently uses server-side prepared statements from V3 protocol, for
speed benefits, and thus needs all typing information. (I do not know
whether it is possible to send untyped parameters via this approach.)
Markus
--
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios@logi-track.com | www.logi-track.com
Attachments:
signature.asc (application/pgp-signature, 255B) download
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: ERROR: column "total_cost" is of type numeric but expression
@ 2005-02-11 11:47 Antony Paul <antonypaul24@gmail.com>
parent: Markus Schaber <schabios@logi-track.com>
0 siblings, 0 replies; 6+ messages in thread
From: Antony Paul @ 2005-02-11 11:47 UTC (permalink / raw)
To: Markus Schaber <schabios@logi-track.com>; +Cc: pgsql-jdbc
Now I understand why 8.0 drive dont print query parameters in the
server log while 7.4 prints query parameters since 8.0 uses real
prepared statements.
rgds
Antony Paul
On Fri, 11 Feb 2005 12:37:25 +0100, Markus Schaber
<schabios@logi-track.com> wrote:
> Hi, Antony,
>
> Antony Paul schrieb:
> > Updating application is going to be a lot of work. If it breaks
> > existing applications why it is implemented. I dont think type
> > checking is a big thing. What is its use ?.
>
> I'm not 100% shure, as I'm no jdbc developer, but I think the 8.0 driver
> consequently uses server-side prepared statements from V3 protocol, for
> speed benefits, and thus needs all typing information. (I do not know
> whether it is possible to send untyped parameters via this approach.)
>
> Markus
> --
> markus schaber | dipl. informatiker
> logi-track ag | rennweg 14-16 | ch 8001 zürich
> phone +41-43-888 62 52 | fax +41-43-888 62 53
> mailto:schabios@logi-track.com | www.logi-track.com
>
>
>
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2005-02-11 11:47 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-11 10:41 ERROR: column "total_cost" is of type numeric but expression is of type character varying Antony Paul <antonypaul24@gmail.com>
2005-02-11 11:02 ` Re: ERROR: column "total_cost" is of type numeric but expression Markus Schaber <schabios@logi-track.com>
2005-02-11 11:27 ` Re: ERROR: column "total_cost" is of type numeric but expression Antony Paul <antonypaul24@gmail.com>
2005-02-11 11:31 ` Antony Paul <antonypaul24@gmail.com>
2005-02-11 11:37 ` Re: ERROR: column "total_cost" is of type numeric but expression Markus Schaber <schabios@logi-track.com>
2005-02-11 11:47 ` Re: ERROR: column "total_cost" is of type numeric but expression Antony Paul <antonypaul24@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox