On Mon, May 18, 2009 at 4:03 PM, Stefan Keller <sfkel...@gmail.com> wrote:
> How to insert a text file into a field in PostgreSQL?
> I'd like to insert a row with fields from a local or remote text file.
> I'd expect functions like get_text() or get_url() in order to do the
> following:
> INSERT INTO collection(id, path, content) VALUES(1, '/tmp/mytext,
> get_text('/tmp/mytext));
> AFAIK there was a get_url in libcurl but I neither find it any more. But
> anyway: This should be part of the core... :->

Putting this into core would have security implications.  The file or
URL would be downloaded by the PostgreSQL server process, not the
client process - therefore I think it would have to be super-user
only, which would make it much less useful.  You'd also need a pretty
rich API to mimic all the crazy thinks a URL-fetching library like
libcurl knows how to do.

Except for very large objects where double-copying must be avoided, it
seems like having the client retrieve and pass the data is a simpler
solution.  That having been said, nobody can stop you from writing
(and submitting) a patch.

...Robert

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to