pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedlo_import problems
3+ messages / 3 participants
[nested] [flat]
* lo_import problems
@ 2000-04-18 22:33 Igor Gavriloff <igor@nupes.cefetpr.br>
0 siblings, 2 replies; 3+ messages in thread
From: Igor Gavriloff @ 2000-04-18 22:33 UTC (permalink / raw)
To: pgsql-interfaces
Hi,
I'm trying to write an script in Perl5 that do an lo_import, but
using the one that the perl interface offers returns an oid equal to
zero:
...
$conn = Pg::connectdb("dbname=test");
$lobjId = $conn->lo_import($file);
...
Where $file is the file to be imported into the database. If I try to do as in Chapter 45:
INSERT INTO image (name, raster) VALUES ('beautiful image', lo_import('/etc/motd'));
I get the following error:
ERROR: You must have Postgres superuser privilege to use server-side lo_import().
Anyone can use the client-side lo_import() provided by libpq.
And, indeed, this only works when logged on as superuser on the database, but not with the others.
Thanks in advance.
--
Is your job running? You'd better go catch it!
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: lo_import problems
@ 2000-04-19 04:21 Tom Lane <tgl@sss.pgh.pa.us>
parent: Igor Gavriloff <igor@nupes.cefetpr.br>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2000-04-19 04:21 UTC (permalink / raw)
To: Igor Gavriloff <igor@nupes.cefetpr.br>; +Cc: pgsql-interfaces
Igor Gavriloff <igor@nupes.cefetpr.br> writes:
> I'm trying to write an script in Perl5 that do an lo_import, but
> using the one that the perl interface offers returns an oid equal to
> zero:
> ...
> $conn = Pg::connectdb("dbname=test");
> $lobjId = $conn->lo_import($file);
lo_import, like all LO operations, has to be executed inside a
transaction block (BEGIN/END SQL commands). This is, um, poorly
documented in the Perl interface's docs, though you can read about
it in the docs for the underlying C library libpq.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: lo_import problems
@ 2000-04-19 08:49 Karel Zak <zakkr@zf.jcu.cz>
parent: Igor Gavriloff <igor@nupes.cefetpr.br>
1 sibling, 0 replies; 3+ messages in thread
From: Karel Zak @ 2000-04-19 08:49 UTC (permalink / raw)
To: Igor Gavriloff <igor@nupes.cefetpr.br>; +Cc: pgsql-interfaces
On Tue, 18 Apr 2000, Igor Gavriloff wrote:
> Hi,
>
> I'm trying to write an script in Perl5 that do an lo_import, but
> using the one that the perl interface offers returns an oid equal to
> zero:
>
> ...
> $conn = Pg::connectdb("dbname=test");
BEGIN;
> $lobjId = $conn->lo_import($file);
COMMIT;
Karel
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2000-04-19 08:49 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-04-18 22:33 lo_import problems Igor Gavriloff <igor@nupes.cefetpr.br>
2000-04-19 04:21 ` Tom Lane <tgl@sss.pgh.pa.us>
2000-04-19 08:49 ` Karel Zak <zakkr@zf.jcu.cz>
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