lobj bug

From: Cob <cob(at)gnt(dot)kiev(dot)ua>
To: pgsql-bugs(at)postgresql(dot)org
Subject: lobj bug
Date: 1999-10-14 08:40:09
Message-ID: 87emey1gk6.fsf@rock.gnt.kiev.ua
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Alexey Kobozev
Your email address : cob(at)gnt(dot)kiev(dot)ua

System Configuration
---------------------
Architecture (example: Intel Pentium) : Intel Pentium

Operating System (example: Linux 2.0.26 ELF) : FreeBSD 2.2.1 & Solaris 2.6

PostgreSQL version (example: PostgreSQL-6.5.2): PostgreSQL-6.5 & 6.5.2

Compiler used (example: gcc 2.8.0) : gcc version 2.7.2.1 & 2.8.1

Please enter a FULL description of your problem:
------------------------------------------------
Bug in libpq (IMHO).

When I've got large object id (oid) from table any attempt to
open it with lo_open (lo_export) returns -1 (perrno = 2 - not found).

But using of built-in lo_import/lo_export
(insert into xxx values(lo_import('file')) or select lo_export(lobj_id))
successful.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

create table tmp (lobj oid);

insert into tmp values(lo_import('some_file'));

select lobj from tmp;
lobj
------
xxxxxx

//------------- problem.c ----------------

#include <stdio.h>
#include "libpq-fe.h"
#include "libpq/libpq-fs.h"

void main()
{
PGconn *dbConn = PQsetdb(NULL, NULL, NULL, NULL, "database");
if(PQstatus(dbConn) == CONNECTION_BAD)
{
fprintf(stderr, "%s\n", PQerrorMessage(dbConn));
exit(1);
}

if(lo_export(dbConn, xxxxxx, "/tmp/lobj") < 0)
fprintf(stderr, "Can't export lobj\n"); //we'll get here

if(lo_open(dbConn, xxxxxx, INV_READ) < 0)
fprintf(stderr, "Can't even open lobj\n"); //we'll get here

PQfinish(dbConn);
}

//--------------------------------------------

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Schaefer 1999-10-14 10:52:29 default operator (int8le?)
Previous Message Peter Schaefer 1999-10-14 07:39:25 Re: [BUGS] CREATE VIEW interp AS select DISTINCT itemkey from songs;