Re: Import SVG file - Mailing list pgsql-general

From Richard Huxton
Subject Re: Import SVG file
Date
Msg-id 41FA4615.1080709@archonet.com
Whole thread Raw
In response to Re: Import SVG file  (Miguel Angel Tribaldos Hervas <mitriher@teleco.upv.es>)
List pgsql-general
Miguel Angel Tribaldos Hervas wrote:
> I want to do the import from the psql client. I try to find something like that:
>
>
> INSERT INTO "controller" (notes, enabled, diagram, ...)
>      VALUES ('Example controller', TRUE, load_svg('controller.svg'), ...)
>
>
> with diagram of type TEXT, and diagram field correctly escaped.

Hmm - I don't know of anything which can do this for you. It'd be
difficult since by the time load_svg() is parsed and executed the
statement is server-side not client-side.

Ten lines of Perl/Python should do it just fine though. IIRC svg is just
xml, so the only thing you should need to escape is the single-quote

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: PFC
Date:
Subject: Re: How to get back the current count of a auto incrementing number.
Next
From: Alex Turner
Date:
Subject: Shared Memory/Shared Buffers