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

Re: [GENERAL] BUG #1830: Non-super-user must be able to copy from a file

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Bernard <bht(at)actrix(dot)gen(dot)nz>
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, pgsql-bugs(at)postgresql(dot)org,pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] BUG #1830: Non-super-user must be able to copy from a file
Date: 2005-08-18 22:34:40
Message-ID: 20050818223436.GC18804@svana.org (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-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(at)svana(dot)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.

In response to

pgsql-bugs by date

Next:From: BernardDate: 2005-08-18 22:55:00
Subject: BUG #1834: Non-super-user must be able to copy from a file through JDBC
Previous:From: BernardDate: 2005-08-18 22:16:29
Subject: Re: BUG #1830: Non-super-user must be able to copy from a file

pgsql-general by date

Next:From: Steve CrawfordDate: 2005-08-18 22:44:36
Subject: Re: Weird performance hit
Previous:From: BernardDate: 2005-08-18 22:16:29
Subject: Re: BUG #1830: Non-super-user must be able to copy from a file

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