Re: sendLong in custom communication doesn't work - Mailing list pgsql-hackers

From Robert Haas
Subject Re: sendLong in custom communication doesn't work
Date
Msg-id CA+TgmoZUpyMbz0BUG-NEXC9Q5Uu9D7A5v9T-Hro=ZQ6DXPd_Mg@mail.gmail.com
Whole thread Raw
In response to sendLong in custom communication doesn't work  (Krystian Piećko <krystian.piecko@gmail.com>)
List pgsql-hackers
On Fri, Jul 25, 2014 at 5:53 AM, Krystian Piećko
<krystian.piecko@gmail.com> wrote:
> I’m implementing the functionality that will pass all the queries native to
> postgresql (that asks about structures and versions) to the hidden
> postgresql and other queries I would like to parse myself. I have a big
> problem with outputing PG_TYPE_INT[248] value. I’m doing it because in my
> system I would like to provide the method to send by jdbc XML messages that
> would be resolved by my software and other queries would be answered by
> PostgreSQL. I don’t mind the speed and the double processing I just want to
> learn how to do it.
> Outputing texts works fine.
>
> So when I receive native query like (select * from pg_class) I have active
> JDBC connection to hidden postgresql (9.3) and this query is executed on
> that server. When I get ResultSet from the hidden postgresql I try to output
> the results in postgres form to the output. Example communication that
> returns current date in long (in my opinion) should look like this:
>
> //Example code that outputs current date in long format
> public void sendExampleResponse() {
>         server.trace("Query");
>         String query = readString();
>         System.out.println("query = " + query);
[ ...and there's more... ]

I don't think you're going to get much help writing Java code here; if
you want to discuss the pgsql-jdbc code, you should use that mailing
list rather than this one.  This mailing list would be the right place
for discussions about the wire protocol itself, though, so maybe
someone could give you some advice on that if you were more specific
about what problem you're having.  From the provided information it's
hard to be sure what's going wrong.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [RFC] Should smgrtruncate() avoid sending sinval message for temp relations
Next
From: Peter Geoghegan
Date:
Subject: Re: Making joins involving ctid work for the benefit of UPSERT