Large object problem in 6.5.2 & 3

From: root <victor_moroz(at)public(dot)mtu(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Large object problem in 6.5.2 & 3
Date: 2000-02-18 08:20:48
Message-ID: 38AD00E0.910126CB@public.mtu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

RedHat 6.1, Postgresql 6.5.2 (tried on 6.5.3 - same result).

------------------------------- Code:

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

int main() {
PGconn *conn;
PGresult *res;
conn = PQsetdb(NULL, NULL, NULL, NULL, "ctlg");
if(PQstatus(conn) == CONNECTION_BAD) {
printf("Cannot connect\n");
exit(1);
}
Oid LOid;
LOid = lo_creat(conn, INV_READ | INV_WRITE);
if(LOid == 0) {
printf("Cannot create\n");
exit(1);
}
printf("Created with Oid=%d\n", LOid);
int LOfd;
LOfd = lo_open(conn, LOid, INV_READ | INV_WRITE);
printf("Opened with LOfd = %d, %s\n", LOfd, PQerrorMessage(conn));
}

----------------------------------- Result:

Created with Oid=31169
Opened with LOfd = -1, ERROR: lo_lseek: invalid large obj descriptor
(0)

----------------------------------- Debug:

FindExec: found "/usr/bin/postgres" using argv[0]
/usr/bin/postmaster: BackendStartup: pid 1012 user root db ctlg socket 4

FindExec: found "/usr/bin/postgres" using argv[0]
started: host=localhost user=root database=ctlg
InitPostgres
StartTransactionCommand
ProcessQuery
CommitTransactionCommand
StartTransactionCommand
CommitTransactionCommand
StartTransactionCommand
CommitTransactionCommand
StartTransactionCommand
ERROR: lo_lseek: invalid large obj descriptor (0)
AbortCurrentTransaction
pq_recvbuf: unexpected EOF on client connection
proc_exit(0) [#0]
shmem_exit(0) [#0]
exit(0)
/usr/bin/postmaster: reaping dead processes...
/usr/bin/postmaster: CleanupProc: pid 1012 exited with status 0
pmdie 2
proc_exit(0) [#0]
shmem_exit(0) [#0]
exit(0)

------------------------------------------

Browse pgsql-hackers by date

  From Date Subject
Next Message Karel Zak - Zakkr 2000-02-18 10:26:16 Re: [HACKERS] TODO: Cache most recent query plan
Previous Message Chris Bitmead 2000-02-18 06:06:48 Re: [HACKERS] psql and Control-C