Re: [BUGS] BUG #1830: Non-super-user must be able to copy from a file - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: [BUGS] BUG #1830: Non-super-user must be able to copy from a file
Date
Msg-id 20050818223436.GC18804@svana.org
Whole thread Raw
In response to Re: [BUGS] BUG #1830: Non-super-user must be able to copy from a file  (Bernard <bht@actrix.gen.nz>)
List pgsql-general
On Fri, Aug 19, 2005 at 10:16:29AM +1200, Bernard wrote:
> Bruno and interested list members
>
> I want to follow what is suggested here. How are STDIN and STDOUT
> addressed when using the JDBC driver?
>
> Or in other words where can I write or receive megabytes of data?

I don't know how JDBC does it, but as an example the Perl Pg module has
these functions:

           $ret = $conn->putline($string)

       Sends a string to the backend. The application must explicitly
       send the two characters "\." to indicate to the backend that it
       has finished sending its data.

           $ret = $conn->putnbytes($buffer, $nbytes)

       Sends n bytes to the backend. Returns 0 if OK, EOF if not.

           $ret = $conn->endcopy

       This function waits  until the backend has finished the copy.
       It should either be issued when the last string has been sent to
       the backend using putline or when the last string has been
       received from the backend using getline. endcopy returns 0 on
       success, 1 on failure.

Looking at google I see the following:

http://archives.postgresql.org/pgsql-jdbc/2004-10/msg00166.php

saying it's not supported but there is a patch. That was a year ago
though. Some later emails suggest it is possible.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Bernard
Date:
Subject: Re: [BUGS] BUG #1830: Non-super-user must be able to copy from a file
Next
From: Steve Crawford
Date:
Subject: Re: Weird performance hit