Re: Oid problem

From: Sky <sky(at)sylvio(dot)hu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Oid problem
Date: 2004-04-08 17:28:02
Message-ID: 40758BA2.5050609@sylvio.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Huxton írta:

>On Thursday 08 April 2004 15:21, Sky wrote:
>
>
>>Problem:
>>pg_loopen() unable to open PostgreSQL large object in...
>>
>>Solution from another mailing list:
>>My blob oid was very big.
>>I had to cast to (float) the oid parameter of pg_loopen.
>>
>>
>
>Sorry, bigger than what? Why float?
>
>
Watch these links:
http://archives.postgresql.org/pgsql-php/2003-09/msg00077.php
http://archives.postgresql.org/pgsql-php/2003-09/msg00079.php
I found it by google.

This error message is my problem:
pg_loopen() unable to open large object
/ PHP4 /

>>I tried to use the oid in a function:
>>
>>CREATE FUNCTION addfoto(character varying, oid)
>>RETURNS INTEGER
>>AS
>> '
>> BEGIN;
>> INSERT INTO foto(filename, image) VALUES ( $1, $2 );
>> COMMIT;
>> SELECT 1 AS RESULT;
>> '
>>LANGUAGE 'sql';
>>
>>
>
>Assuming the definition of "foto" is OK, looks fine from here.
>
>
>
>>So, What can I do, and how, how can I "CAST" ??
>>
>>
>
>Sorry - dont understand, but you can cast by:
>
Watch the links above.

>
>SELECT foo::int8 ...
>SELECT CAST(foo as int8) ...
>
>
>Is the problem that you want to handle oid's (0 .. 4 billion) and you are
>using int4 (-2 billion .. +2 billion). In which case int8 might be a better
>choice than int4.
>
Sorry but I don't understand, where do I use int4 ??
Here is my table definition too:

CREATE TABLE foto(
filename CHARACTER VARYING,
image OID
);

>
>HTH
>
>

Many thanks!

--
Sky
sky AT sylvio .hu
Debian Group - Association of Hungarian Linux Users
Accessibility Project leader
gpg --keyserver hkp://pgp.mit.edu --recv-keys 314D1B0C
fingerprint = B211 E8C7 C6C2 18B2 9F30 ADF6 EDD9 A7FA 314D 1B0C

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mark Lubratt 2004-04-08 17:59:38 Orphaned trigger -- bug?
Previous Message Alexander Cohen 2004-04-08 16:41:27 pg_ctl problem