Re: [ODBC] BLOB handling compatibility with PostgreSQL > 7.4 - Mailing list pgsql-interfaces

From Ludek Finstrle
Subject Re: [ODBC] BLOB handling compatibility with PostgreSQL > 7.4
Date
Msg-id 20051206215022.GB24711@soptik.pzkagis.cz
Whole thread Raw
In response to Re: [ODBC] BLOB handling compatibility with PostgreSQL > 7.4  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-interfaces
> > Does it cover lo_export which need oid as second parameter?
>
> You could make an implicit cast from lo to oid ... perhaps not the other
> direction, though.

Thank you. This way helps. I have to create implicit cast in oid->lo too
becouse there is lo_import function.
Is any reason to don't do it? I don't see this reasen as lo is same
type as oid.

CREATE FUNCTION loin (cstring) RETURNS lo AS 'oidin' LANGUAGE internal IMMUTABLE STRICT;
CREATE FUNCTION loout (lo) RETURNS cstring AS 'oidout' LANGUAGE internal IMMUTABLE STRICT;
CREATE FUNCTION lorecv (internal) RETURNS lo AS 'oidrecv' LANGUAGE internal IMMUTABLE STRICT;
CREATE FUNCTION losend (lo) RETURNS bytea AS 'oidrecv' LANGUAGE internal IMMUTABLE STRICT;

CREATE TYPE lo ( INPUT = loin, OUTPUT = loout, RECEIVE = lorecv, SEND = losend, INTERNALLENGTH = 4, PASSEDBYVALUE );
CREATE CAST (lo AS oid) WITHOUT FUNCTION AS IMPLICIT;
CREATE CAST (oid AS lo) WITHOUT FUNCTION AS IMPLICIT;

Thank you very much

Luf

pgsql-interfaces by date:

Previous
From: Steve Howe
Date:
Subject: Re: [ODBC] BLOB handling compatibility with PostgreSQL
Next
From: Joost Kraaijeveld
Date:
Subject: PL/Java for Debian Etch AMD64 / PostgreSQL 8.1?