Re: [BUGS] BUG #14645: Can't use psql from within program used by "copy ... from program" script?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] BUG #14645: Can't use psql from within program used by "copy ... from program" script?
Дата
Msg-id 19511.1494092702@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [BUGS] BUG #14645: Can't use psql from within program used by "copy ... fromprogram" script?  (john@7fff.com)
Ответы Re: [BUGS] BUG #14645: Can't use psql from within program used by"copy ... from program" script?  (John Norman <john@7fff.com>)
Список pgsql-bugs
john@7fff.com writes:
> copy bug(id) from program '$HOME/bug/data' csv header;

> It calls a script called data. I run it with psql -X -f
> $HOME/bug/setup.sql

> This works for the "data" script:

> #/bin/bash
> echo "id"
> echo "1"
> echo "2"

> This doesn't:

> #/bin/bash
> echo "id"
> echo "1"
> psql -X -t -q -c "select 2" | xargs

> I can't figure out if psql is disallowed from the program referenced by the
> copy program; or if somehow standard out is getting nuked.

I think you're getting messed up by the fact that the program will
be run by the server, ie, under the postgres user's login, not your
own login.  Try capturing psql's stderr to see if it's printing a
cant-login type of message.
        regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

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

Предыдущее
От: john@7fff.com
Дата:
Сообщение: [BUGS] BUG #14645: Can't use psql from within program used by "copy ... fromprogram" script?
Следующее
От: John Norman
Дата:
Сообщение: Re: [BUGS] BUG #14645: Can't use psql from within program used by"copy ... from program" script?