pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Kostyrka <andreas@ag.or.at>
To: pygresql@vex.net
Cc: pgsql-sql@postgreSQL.org
Subject: Large Objects, anyone?
Date: Fri, 27 Nov 1998 20:51:56 +0100 (CET)
Message-ID: <Pine.LNX.3.96.981127204838.652A-100000@lifesaver> (raw)

Hi!

I'm having problems with postgresql 6.3.2 (RH 5.x vintage). The following
program should probably work, but it doesn't:
import pg,sys,string

c=pg.connect("test",None,-1,None,None)
if len(sys.argv)==1:
    c.query("BEGIN")
    lo=c.locreate(pg.INV_READ|pg.INV_WRITE)
    lo.open(pg.INV_WRITE)

    lo.write("TESTing")
    lo.close()
#    lo=c.loimport("/etc/sendmail.cf")
    print lo.oid
    c.query("END;")
else:
    c.query("BEGIN")
    lo=c.getlo(string.atoi(sys.argv[1]))
    lo.open(pg.INV_READ)
    print lo.read(102400)
    c.query("END;")


The funny thing is, that the object is created, but the lo.write() seems
to be ignored :(

BUT when using loimport, the contents get into the db.

Even more fun, the testlo.c example in the postgresql source core dumps on
the PQexec("end") line :(

Andreas
-- 
Win95: n., A huge annoying boot virus that causes random spontaneous system
     crashes, usually just before saving a massive project.  Easily cured by
     UNIX.  See also MS-DOS, IBM-DOS, DR-DOS, Win 3.x, Win98.





Message-ID: <Pine.LNX.3.96.981127204838.652A-100000@lifesaver>
Permalink:  ../Pine.LNX.3.96.981127204838.652A-100000@lifesaver/
Also on:    postgresql.org/message-id/Pine.LNX.3.96.981127204838.652A-100000@lifesaver

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: andreas@ag.or.at, pygresql@vex.net
  Subject: Re: Large Objects, anyone?
  In-Reply-To: <Pine.LNX.3.96.981127204838.652A-100000@lifesaver>
  References: <Pine.LNX.3.96.981127204838.652A-100000@lifesaver>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox