pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Owen Jacobson <ojacobson@osl.com>
To: pgsql-sql@postgresql.org
Subject: Re: psql in the command line
Date: Wed, 25 Jan 2006 09:43:49 -0800
Message-ID: <144D12D7DD4EC04F99241498BB4EEDCC1DE489@nelson.osl.com> (raw)

Alvaro Herrera wrote:

> Aniko.Badzong@swisscom.com wrote:
> 
> > test:/opt/pgsql# echo "copy test from '/data/log/bla';" | psql logdb
> > COPY
> > 
> > But when I try to execute it as root user I get the following error:
> > 
> > [est/data/log] su - postgres -c "echo 'copy test from 
> /data/log/bla;'|
> > psql logdb"
> > ERROR:  syntax error at or near "/" at character 16
> > LINE 1: copy test from /data/log/bla;
> 
> This is clearly not the same line.  The quotes are not in the same
> position as in the line above.
> 
> su - postgres -c "psql logdb -c 'copy test from \'data/log/bla\''"

Or, preferably:

$ echo "copy test from '/data/log/bla';" | sudo -u postgres psql logdb

HTH,
Owen



view thread (3+ messages)

Message-ID: <144D12D7DD4EC04F99241498BB4EEDCC1DE489@nelson.osl.com>
Permalink:  ../144D12D7DD4EC04F99241498BB4EEDCC1DE489@nelson.osl.com/
Also on:    postgresql.org/message-id/144D12D7DD4EC04F99241498BB4EEDCC1DE489@nelson.osl.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ojacobson@osl.com
  Subject: Re: psql in the command line
  In-Reply-To: <144D12D7DD4EC04F99241498BB4EEDCC1DE489@nelson.osl.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox