Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 089FA632D39 for ; Thu, 31 Dec 2009 14:17:00 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67784-08 for ; Thu, 31 Dec 2009 18:16:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id 62C04632433 for ; Thu, 31 Dec 2009 14:16:47 -0400 (AST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1NQPZk-0002TL-Vc for pgsql-sql@postgresql.org; Thu, 31 Dec 2009 19:16:44 +0100 Received: from e177148036.adsl.alicedsl.de ([85.177.148.36]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 Dec 2009 19:16:44 +0100 Received: from tim by e177148036.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 Dec 2009 19:16:44 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: pgsql-sql@postgresql.org To: pgsql-sql@postgresql.org From: Tim Landscheidt Subject: Re: loading a file into a field Date: Thu, 31 Dec 2009 18:15:28 +0000 Organization: Lines: 26 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e177148036.adsl.alicedsl.de Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:u24N3pFmBvNylShsvNP8Djao1vU= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/95 X-Sequence-Number: 33533 Brian Sherwood wrote: > I am looking to play around with the postgres XML functions, but can't > seem to find a way to load my data. > I have a number of XML files: file1.xml, file2.xml, etc.... All files > follow the same xml format (DTD?) > I would like to create the following table: > CREATE TABLE configs ( > filename varchar(80) PRIMARY KEY, > config xml > ); > and load each file into the xml field, but can't seem to find a way. > (I think I need something similiar to lo_import, but have not found anything) There is no function to do that in the standard distribu- tion. You have to solve that in your client application. Theoretically, you could try to do it in a server-side user function, but permissions, local vs. remote file systems & Co. usually only create major headaches. Tim