PostgreSQL, oid, large object

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Daril
Posts: 27
Joined: Fri 07 Oct 2011 09:58

PostgreSQL, oid, large object

Post by Daril » Fri 07 Oct 2011 11:02

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.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Fri 07 Oct 2011 11:32

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';

Daril
Posts: 27
Joined: Fri 07 Oct 2011 09:58

PostgreSQL, oid, large object

Post by Daril » Mon 10 Oct 2011 10:14

Thank you Alex.
It is works good. :-)

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 10 Oct 2011 10:34

Hello,

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

Post Reply