Re: blob

From: "Brett W(dot) McCoy" <bmccoy(at)chapelperilous(dot)net>
To: Luke <luke(at)chipcity(dot)com(dot)au>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: blob
Date: 2001-10-10 15:02:06
Message-ID: Pine.LNX.4.30.0110101051450.3684-100000@chapelperilous.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 8 Oct 2001, Luke wrote:

> Now my problem.
> I've been trying to get large objects "happening" through a perl script,
>
> which I want to run by httpd (user nobody) from the cgi-bin directory.
> In other words, I want to serve images to browsers from a database.
> This includes using the 'lo_export' function.
> But I've found that I can only run 'lo_export' as superuser.
>
> Is there any other way to get images served from the database?
> Or how do I get around the above in perl.

Are you using DBD::Pg in your Perl script? You can use the lo interface
via the func method of the DBI driver:

$lob_fd = $dbh->func($lobId, $mode, "lo_open");

See the perldoc on DBD::Pg for more information on how to do this. The
DBD::pg is built over libpq, so you should be able to export via this
facility.

-- Brett
http://www.chapelperilous.net/
------------------------------------------------------------------------
C'est magnifique, mais ce n'est pas l'Informatique.
-- Bosquet [on seeing the IBM 4341]

In response to

  • blob at 2001-10-07 22:47:28 from Luke

Browse pgsql-general by date

  From Date Subject
Next Message Brett W. McCoy 2001-10-10 15:19:45 Re: Session identifier
Previous Message Jim Caley 2001-10-10 14:56:42 Re: PG mailing list problems (was Re: Support issues)