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