Skip site navigation (1) Skip section navigation (2)

Re: inserting/updating a field with the contents of a text file

From: "Lonni J Friedman" <netllama(at)gmail(dot)com>
To: "Richard Broersma Jr" <rabroersma(at)yahoo(dot)com>
Cc: "George Pavlov" <gpavlov(at)mynewplace(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: inserting/updating a field with the contents of a text file
Date: 2007-09-25 01:57:09
Message-ID: 7c1574a90709241857w2b91baf8yf1a3a1c7ca2e9aa0@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
On 9/24/07, Richard Broersma Jr <rabroersma(at)yahoo(dot)com> wrote:
>
> --- Lonni J Friedman <netllama(at)gmail(dot)com> wrote:
>
> > > (e.g. ...-c"insert into table (info) values('`sed "s/'/''/g"
> > > file.txt`')" )
> > >
>
> if single quotes were your problem, then maybe you could use Postgresql's dollar sign quoting.
>
> you could replace the ' with $myquote$.

Actually the issue here is that i'm inserting build log snippets, so
I'm never going to be 100% what will appear.  Single quotes were
definitely the issue the first time I hit this.  Are there any other
characters that are verboten, or just single quotes?


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman                                    netllama(at)gmail(dot)com
LlamaLand                       https://netllama.linux-sxs.org

In response to

Responses

pgsql-novice by date

Next:From: Phillip SmithDate: 2007-09-25 03:18:21
Subject: Re: inserting/updating a field with the contents of a text file
Previous:From: Richard Broersma JrDate: 2007-09-25 01:50:39
Subject: Re: inserting/updating a field with the contents of a text file

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group