Hi,
Problem: A PostGreSQL function returns an ID when specifying return type as 'RETURNS SET OF <tablename>'. How does one use this ID to get access to the actual object containing data. I have tried the following using PostGresql and Java but am getting the error as given below.
Thanks in advance.
CREATE FUNCTION foo()
RETURNS SETOF dept
AS '
SELECT * FROM dept;
' LANGUAGE 'sql';
This function is returning an Objectid for each row in the emp table.
(the function is returning same Objectid for each row)
I tried reading the object using LargeObject class in package postgresql.largeobject passing the above objectid.
it's giving me following error
FastPath call returned ERROR: inv_open: large object 136440936 not found
at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:141)
at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:191)
at org.postgresql.fastpath.Fastpath.getInteger(Fastpath.java:203)
at org.postgresql.largeobject.LargeObject.<init>(LargeObject.java:89)
at org.postgresql.largeobject.LargeObjectManager.open(LargeObjectManager.java:147)
Problem: A PostGreSQL function returns an ID when specifying return type as 'RETURNS SET OF <tablename>'. How does one use this ID to get access to the actual object containing data. I have tried the following using PostGresql and Java but am getting the error as given below.
Thanks in advance.
CREATE FUNCTION foo()
RETURNS SETOF dept
AS '
SELECT * FROM dept;
' LANGUAGE 'sql';
This function is returning an Objectid for each row in the emp table.
(the function is returning same Objectid for each row)
I tried reading the object using LargeObject class in package postgresql.largeobject passing the above objectid.
it's giving me following error
FastPath call returned ERROR: inv_open: large object 136440936 not found
at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:141)
at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:191)
at org.postgresql.fastpath.Fastpath.getInteger(Fastpath.java:203)
at org.postgresql.largeobject.LargeObject.<init>(LargeObject.java:89)
at org.postgresql.largeobject.LargeObjectManager.open(LargeObjectManager.java:147)