Page 1 of 1

PostgreSQL, oid, large object

Posted: Fri 07 Oct 2011 11:02
by Daril
Hi,
I connect to PostgreSQL(8.1,8.3,9.0) during unidac connection and I have problem.
When I try execute slq query

Code: Select all

SELECT tr.typnamespace 
  FROM pg_catalog.pg_proc p 
    LEFT JOIN pg_catalog.pg_type tr ON tr.oid = p.prorettype
then I get error "large object 11 does not exist".

I little experimented. Problem is in column typenamespace which has data type oid. When I execute

Code: Select all

SELECT CAST(tr.typnamespace as bigint) as "typnamespace" FROM pg_catalog.pg_proc p 
 LEFT JOIN pg_catalog.pg_type tr ON tr.oid = p.prorettype
all is ok.

Do you know anybody why? What is wrong on first form query.
I use Delphi 7.
Thank you very much.

Posted: Fri 07 Oct 2011 11:32
by AlexP
Hello,

This error is connected with the fact that the "typnamespace" field contains a link to an object that does not exist.
To resolve the problem, you should set the OIDAsInt specific option to True like:

Code: Select all

  UniQuery1.SpecificOptions.Values['OIDAsInt']:='true';

PostgreSQL, oid, large object

Posted: Mon 10 Oct 2011 10:14
by Daril
Thank you Alex.
It is works good. :-)

Posted: Mon 10 Oct 2011 10:34
by AlexP
Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.