X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 972849DCA5E for ; Tue, 27 Dec 2005 16:56:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 85977-05 for ; Tue, 27 Dec 2005 16:56:40 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from flake.decibel.org (unknown [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id AB35F9DC993 for ; Tue, 27 Dec 2005 16:56:37 -0400 (AST) Received: by flake.decibel.org (Postfix, from userid 1001) id C02C63983A; Tue, 27 Dec 2005 14:56:38 -0600 (CST) Date: Tue, 27 Dec 2005 14:56:38 -0600 From: "Jim C. Nasby" To: Alain Rodriguez Arias Cc: pgsql-admin@postgresql.org Subject: Re: file in posgres Message-ID: <20051227205638.GM72143@pervasive.com> References: <526cb99d0512211810m61c3ee07l8e9e2f887d11bd35@mail.gmail.com> <526cb99d0512220730i8a62b99l2122f371d3eaf08a@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <526cb99d0512220730i8a62b99l2122f371d3eaf08a@mail.gmail.com> X-Operating-System: FreeBSD 6.0-RELEASE amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.06 required=5 tests=[AWL=0.060] X-Spam-Score: 0.06 X-Spam-Level: X-Archive-Number: 200512/324 X-Sequence-Number: 20044 On Thu, Dec 22, 2005 at 07:30:56AM -0800, Alain Rodriguez Arias wrote: > Ok I'm using the EMS PostgreSQL Manager Pro utility to export my data into a > XML, the thing is that when I got a bytea field, which i use to save files, > when i tried to import the XML I have just create the file is corrupt. > I believe it has something to do with the XML encoding I'using or something > like that??? > Any help please. > The bytea field I'm using it to save PDF file!!!!! Can you post the first portion of the suspected bad XML? > > What do you mean with this??????? > > *binary data in XML needs to be uuencoded afaik,* XML only allows data within a certain range of values. I'm pretty sure that you can't just stick raw binary data into XML without ensuring that it won't contain certain invalid characters, and the most common way to do that is to base-64 (or uuencode) it. man uuencode on a unix/linux/OS X box should provide more info. > > On 12/19/05, Jim Nasby wrote: > > > > > > Including -admin back in the discussion... > > > > > > Well, binary data in XML needs to be uuencoded afaik, and of course > > > you'll want to put it in a CDATA block. > > > > > > PostgreSQL doesn't have any XML support built-in, but there's at least > > > one project that has stuff to help deal with XML. I think it's in pgFoundry, > > > though there may be some stuff in contrib as well. > > > > > > -----Original Message----- > > > From: Alain Rodriguez Arias [mailto:alainrod@gmail.com] > > > Sent: Monday, December 19, 2005 3:10 PM > > > To: Jim Nasby > > > Subject: Re: [ADMIN] file in posgres > > > > > > > > > Naybe you missunderstood me, i need to export all the data of a table > > > into an XML format, and I'm afraid to have any trouble with the bytea data > > > type that I use to store files. Can't you tell if there is any problem with > > > that and if not how do I do the export to XML??? > > > > > > > > > On 12/19/05, Jim C. Nasby wrote: > > > On Sat, Dec 17, 2005 at 02:45:08PM -0800, Alain Rodriguez Arias wrote: > > > > Hi everybody: > > > > I need that somebody tell me if there is any way to save a file of any > > > kind > > > > in a field of a database in posgres?? > > > > > > http://www.postgresql.org/docs/8.1/static/datatype-binary.html > > > > > > > I also need to convert the data of a tble into XML??? > > > > > > No reason to do that in the database... though if you end up storing XML > > > you should just stick it in a text field. > > > -- > > > Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com > > > Pervasive Software http://pervasive.com work: 512-231-6117 > > > vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 > > > > > > ---------------------------(end of broadcast)--------------------------- > > > TIP 4: Have you searched our list archives? > > > > > > http://archives.postgresql.org > > > > > > > -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461