Re: Automate copy - Postgres 9.2

Поиск
Список
Период
Сортировка
От rob stone
Тема Re: Automate copy - Postgres 9.2
Дата
Msg-id 1465499725.7425.3.camel@gmail.com
обсуждение исходный текст
Ответ на Re: Automate copy - Postgres 9.2  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: Automate copy - Postgres 9.2  (Patrick B <patrickbakerbr@gmail.com>)
Список pgsql-general
On Wed, 2016-06-08 at 23:50 -0400, David G. Johnston wrote:
>
> POn Wednesday, June 8, 2016, Patrick B <patrickbakerbr@gmail.com>
> wrote:
> > > ERROR:  syntax error at or near "||"
> > > LINE 12:     TO '/var/lib/pgsql/' || crtrow.account_id |...
> >
>
> Which tells me you cannot use an expression as a file name.  The docs
> support this conclusion.
>
> You probably need to use EXECUTE after constricting a string.
>
> You could also try psql in a shell script.
>
> David J. 


If this is something that you'll never ever have to do again in the
future, you could download ExecuteQuery which has a function to export
a result set as either XML or CSV delimited file output.

OTOH, if this is going to be something run on a regular basis, I think
you'd be better off writing a little program, or as David suggested
embedding this into a shell script.

HTH,
Rob


В списке pgsql-general по дате отправления:

Предыдущее
От: Bryan Henderson
Дата:
Сообщение: Re: Why threads every 30 seconds?
Следующее
От: Alex Magnum
Дата:
Сообщение: Retrieving comment of rules and triggers