niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » PostgreSQL
Index size
Post new topic   Reply to topic Page 2 of 2 [19 Posts] View previous topic :: View next topic
Goto page:  Previous  1, 2
Author Message
Guest






PostPosted: Tue Mar 08, 2005 6:12 pm    Post subject: SRF, JDBC and result info Reply with quote

Hi everybody!

I have an SRF which is called from a JAVA app with JDBC. Everything works
fine
and I want now to be able to pass some result-related info to my app. It is
not about the format of the results (ResultSetMetaData) or something like
that.

Is it possible to return some string (or other type of)info together with
the result tuples (even if it requiers some hacking i.e. there is no
provision for something like that)? Any ideas?

Regards,
Ntinos Katsaros


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
Back to top
Kris Jurka
*nix forums beginner


Joined: 01 Mar 2005
Posts: 28

PostPosted: Fri Mar 11, 2005 4:49 am    Post subject: Re: SRF, JDBC and result info Reply with quote

On Tue, 8 Mar 2005 ntinos@aueb.gr wrote:

Quote:
Hi everybody!

I have an SRF which is called from a JAVA app with JDBC. Everything
works fine and I want now to be able to pass some result-related info to
my app. It is not about the format of the results (ResultSetMetaData) or
something like that.

Is it possible to return some string (or other type of)info together with
the result tuples (even if it requiers some hacking i.e. there is no
provision for something like that)? Any ideas?


The only idea that comes to mind is using RAISE NOTICE in your plpgsql
function and Statement or ResultSet .getWarnings() on the Java side to
retrieve that info. There really isn't any other out of band data path.

Kris Jurka


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Back to top
Guest






PostPosted: Fri Mar 11, 2005 6:52 am    Post subject: Re: SRF, JDBC and result info Reply with quote

Thank you very much for your reply. The thing is that my SRF is written in
C, not plpgsql, but I'll look into RAISE NOTICE anyway.(I think there is
something equevalent in libpq)

Thanks again,
Ntinos Katsaros

Kris Jurka writes:

Quote:


On Tue, 8 Mar 2005 ntinos@aueb.gr wrote:

Hi everybody!

I have an SRF which is called from a JAVA app with JDBC. Everything
works fine and I want now to be able to pass some result-related info to
my app. It is not about the format of the results (ResultSetMetaData) or
something like that.

Is it possible to return some string (or other type of)info together with
the result tuples (even if it requiers some hacking i.e. there is no
provision for something like that)? Any ideas?


The only idea that comes to mind is using RAISE NOTICE in your plpgsql
function and Statement or ResultSet .getWarnings() on the Java side to
retrieve that info. There really isn't any other out of band data path.

Kris Jurka


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq
Back to top
Guest






PostPosted: Fri Mar 11, 2005 11:17 am    Post subject: Re: SRF, JDBC and result info Reply with quote

Solution found! Thanks to Kris Jurka's advise I managed to pass this info
using: elog(INFO,... or elog(NOTICE,... . These messages together with
..getWarnings() do the job. :

e.g. message returned by the SQLWarning:

SNOTICEC00000M#SUCCESSFUL EXECUTION. NO TUPLES FROM PEER(S):
mobileb#Ftestmybuild.cL2558Ranswer

Getting the plain message is then trivial (e.g. using flag chars like '#'
above)

Of cource the appropriate logging must be set in postgresql.conf.

Just in case somenone wants to do the same thing.
I dont know if this is the best solution (or if any other exists) but it
surely works.

Regards,
Ntinos Katsaros

PS: libpq has nothing to do with the above Smile!

ntinos@aueb.gr writes:

Quote:
Thank you very much for your reply. The thing is that my SRF is written in
C, not plpgsql, but I'll look into RAISE NOTICE anyway.(I think there is
something equevalent in libpq)

Thanks again,
Ntinos Katsaros

Kris Jurka writes:



On Tue, 8 Mar 2005 ntinos@aueb.gr wrote:

Hi everybody!

I have an SRF which is called from a JAVA app with JDBC. Everything
works fine and I want now to be able to pass some result-related info to
my app. It is not about the format of the results (ResultSetMetaData) or
something like that.

Is it possible to return some string (or other type of)info together
with the result tuples (even if it requiers some hacking i.e. there is
no provision for something like that)? Any ideas?


The only idea that comes to mind is using RAISE NOTICE in your plpgsql
function and Statement or ResultSet .getWarnings() on the Java side to
retrieve that info. There really isn't any other out of band data path.

Kris Jurka


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 2 of 2 [19 Posts] Goto page:  Previous  1, 2
View previous topic :: View next topic
The time now is Thu Jan 08, 2009 9:49 am | All times are GMT
navigation Forum index » Databases » PostgreSQL
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts container for insert/delete + fast index Neal Becker C++ 1 Fri Jul 21, 2006 12:57 pm
No new posts (secondary) index-only scans Ryan Berkeley DB 1 Thu Jul 20, 2006 8:32 pm
No new posts Create index hanging Claire McLister PostgreSQL 7 Thu Jul 20, 2006 8:11 pm
No new posts ORA-31167: XML nodes over 64K in size cannot be inserted Lars Tetzlaff Server 0 Thu Jul 20, 2006 10:43 am
No new posts Cursor size Ron Maxey Mandrake 10 Thu Jul 20, 2006 5:50 am

Credit Cards | Work at Home Jobs | Credit Card | Literatura fantastica | Mortgage Calculator
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1593s ][ Queries: 16 (0.0689s) ][ GZIP on - Debug on ]