Обсуждение: question regarding upgrade from pg74.215.jdbc3.jar to postgresql-8.1-407.jdbc3.jar. function does not exist appeared ??? Please help :-/

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

  I just upgraded my jdbc driver and fixing stuff to make it work with
the new driver.  I cannot find the  answer to the following one.  I
tried with the old driver and everything works.  With the new one that
doesn't work.

Here is the function declaration:
CREATE OR REPLACE FUNCTION usp_Comptabilite_AgeDeCompteClient(VARCHAR,
VARCHAR, DATE, BOOLEAN, BOOLEAN, INT, VARCHAR) RETURNS refcursor  AS $$


Here is the error that I grabbed from the postgresql log file:

          select * from usp_Comptabilite_AgeDeCompteClient(M, NULL,
2006-08-22 -0400, 1,         1, 0, NULL)

2006-08-22 18:04:27 LOG:  statement: PREPARE <unnamed> AS
select * from usp_Comptabilite_AgeDeCompteClient($1, $2, $3, $4,
$5, $6, $7)
2006-08-22 18:04:27 ERROR:  function
usp_comptabilite_agedecompteclient(character varying, character varying,
"unknown", boolean, boolean, character varying, "unknown") does not exist
2006-08-22 18:04:27 HINT:  No function matches the given name and
argument types. You may need to add explicit type casts.
2006-08-22 18:04:27 STATEMENT:            select * from
usp_Comptabilite_AgeDeCompteClient($1, $2, $3, $4,         $5, $6, $7)


If I execute the statement on pgAdminIII it works: select * from
usp_Comptabilite_AgeDeCompteClient('M', NULL, '2006-08-22',
true,         true, '0', NULL)      ;

Any idea what is the difference between drivers that can explain this.
And of course how I can fix the problem!

Thanks for your help!  It's really appreciated!
Best Regards
/David

P.S.: I traced with the debugger and I do call setDate for arg $3.  I
don't understand why it's still unknow ?







Re: question regarding upgrade from pg74.215.jdbc3.jar to

От
Oliver Jowett
Дата:
David Gagnon wrote:

> CREATE OR REPLACE FUNCTION usp_Comptabilite_AgeDeCompteClient(VARCHAR,
> VARCHAR, DATE, BOOLEAN, BOOLEAN, INT, VARCHAR) RETURNS refcursor  AS $$

> 2006-08-22 18:04:27 ERROR:  function
> usp_comptabilite_agedecompteclient(character varying, character varying,
> "unknown", boolean, boolean, character varying, "unknown") does not exist
> 2006-08-22 18:04:27 HINT:  No function matches the given name and
> argument types. You may need to add explicit type casts.

The problem is with parameter 7. This is expecting an INT, but you are
giving it a VARCHAR. You are probably calling setString(7, "0").

If you use setInt(7,0) or setObject(7,"0",Types.INTEGER) it should work.

> If I execute the statement on pgAdminIII it works: select * from
> usp_Comptabilite_AgeDeCompteClient('M', NULL, '2006-08-22',
> true,         true, '0', NULL)      ;

Try it in pgAdmin using PREPARE and you should see the same error.

> P.S.: I traced with the debugger and I do call setDate for arg $3.  I
> don't understand why it's still unknow ?

It's because the driver doesn't know whether it is a timestamp or a
timestamptz, and if we explicitly specify a type that doesn't match the
actual type then the server will mangle the value while casting.
However, it's not that parameter which is causing your problem.

-O

Re: question regarding upgrade from pg74.215.jdbc3.jar to

От
Oliver Jowett
Дата:
Oliver Jowett wrote:

> The problem is with parameter 7.

Aaaand.. I can't count. It's parameter 6 :)

-O

org.postgresql.util.PSQLException: An I/O error occured while sending to the backend

От
"surabhi.ahuja"
Дата:
hi,
I am using Postgres 8.0.0,
i am getting the following exception in my code, can you please suggest at to what may be going wrong?
The postgres logs do not tell anything.
 
thanks,
regards
Surabhi
 
 

org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.

at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:201)

at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:388)

at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:313)

at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:305)

at com.ge.hc.nuevo.sessions.dbexpress.DBSession.dbxTransaction(DBSession.java:1496)

at com.ge.hc.nuevo.sessions.dbexpress.DBSession.installImage(DBSession.java:1254)

at com.ge.hc.nuevo.sessions.dbexpress.DBSession.installFiles(DBSession.java:737)

at com.ge.med.terra.tap.dm.DMSession.installFiles(DMSession.java:414)

at com.ge.hc.nuevo.services.jmservice.WorkerThread.arRestore(WorkerThread.java:666)

at com.ge.hc.nuevo.services.jmservice.WorkerThread.run(WorkerThread.java:979)

at java.lang.Thread.run(Thread.java:595)

Caused by: java.net.SocketException: Broken pipe

at java.net.SocketOutputStream.socketWrite0(Native Method)

at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)

at java.net.SocketOutputStream.write(SocketOutputStream.java:136)

at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)

at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)

at org.postgresql.core.PGStream.flush(PGStream.java:494)

at org.postgresql.core.v3.QueryExecutorImpl.sendSync(QueryExecutorImpl.java:631)

at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:174)

... 10 more

Re: org.postgresql.util.PSQLException: An I/O error occured

От
Oliver Jowett
Дата:
surabhi.ahuja wrote:

> org.postgresql.util.PSQLException: An I/O error occured while sending to
> the backend.

> Caused by: java.net.SocketException: Broken pipe

This is a network error that the driver can't do anything about. If you
have a stateful firewall between the client and the server, perhaps it
is dropping the connection because it has been idle.

-O

Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend

От
"surabhi.ahuja"
Дата:
hi,
dont such messages get logged to postgreslog.
Also, is it possible to check wht firewall is dropping the connection between the client and the server.
 
thanks,
regards
Surabhi
 


From: Oliver Jowett [mailto:oliver@opencloud.com]
Sent: Wed 8/23/2006 12:03 PM
To: surabhi.ahuja
Cc: pgsql-general@postgresql.org; pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend

***********************
Your mail has been scanned by InterScan VirusWall.
***********-***********


surabhi.ahuja wrote:

> org.postgresql.util.PSQLException: An I/O error occured while sending to
> the backend.

> Caused by: java.net.SocketException: Broken pipe

This is a network error that the driver can't do anything about. If you
have a stateful firewall between the client and the server, perhaps it
is dropping the connection because it has been idle.

-O

Re: org.postgresql.util.PSQLException: An I/O error occured

От
Oliver Jowett
Дата:
surabhi.ahuja wrote:
> hi,
> dont such messages get logged to postgreslog.

You might see something in the backend logs -- "unexpected client EOF"
perhaps? Or just idle backend processes. It depends on exactly what is
going wrong, and the timing of it.

> Also, is it possible to check wht firewall is dropping the connection
> between the client and the server.

That is something you will have to diagnose yourself, it is specific to
your network.

-O