Skip site navigation (1) Skip section navigation (2)

Bug in libpq large-object interface

From: Ian Grant <Ian(dot)Grant(at)cl(dot)cam(dot)ac(dot)uk>
To: pgsql-bugs(at)postgresql(dot)org
Cc: t-ishii(at)sra(dot)co(dot)jp, Ian(dot)Grant(at)cl(dot)cam(dot)ac(dot)uk
Subject: Bug in libpq large-object interface
Date: 2000-05-29 15:48:40
Message-ID: E12wRmU-0000vI-00@wisbech.cl.cam.ac.uk (view raw or flat)
Thread:
Lists: pgsql-bugs
Hi PostgreSQL people in general and Tatsuo in particular,

I'm using V 7.0 on a Linux machine and I believe I have found a bug in the 
large object interface provided by libpq.  The code below will reproduce it, I 
hope.  Basically it creates a large object, writes six 'a' characters to it, 
then closes it.  Then, in another transaction, it opens the object, seeks to 
position 1 from the start, writes a 'b', then seeks to position 3 from the 
start and writes another 'b'. Then it closes the object and COMMITs the 
transaction.  Finally, in a further separate transaction, it calls lo_export 
to write out the resulting object to a file testloseek.c.lobj  I find this 
file, instead of containing the string 'ababaa' as expected, contains 
'^(at)b^@baa' where ^@ is ASCII NUL.

Compile with something like

       gcc -o testloseek testloseek.c -lpq

The program sets the PQtrace to STDOUT and writes messages to STDERR, so run 
it with STDOUT redirected to a log file.

This is a C version of a basic regression test of guile-pg, my Guile language 
bindings for libpq.  You may recall I reported a similar bug a year or so ago, 
and I believed it was then fixed by Tatsuo, after a couple of iterations.  I'm 
sorry to be the bearer of bad news ...

Please reply to me directly since I'm not on the list.

Thanks
Ian
-- 
Ian Grant, Computer Lab., New Museums Site, Pembroke Street, Cambridge
Phone: +44 1223 334420          Personal e-mail: iang at pobox dot com 



pgsql-bugs by date

Next:From: Ian GrantDate: 2000-05-29 16:01:53
Subject: Bug in libpq large-object interface
Previous:From: Zacharie AmbroiseDate: 2000-05-29 14:02:14
Subject:

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group