Re: Multiple psql -c / -f options
От | Andrew Dunstan |
---|---|
Тема | Re: Multiple psql -c / -f options |
Дата | |
Msg-id | 52613A1C.8070809@dunslane.net обсуждение исходный текст |
Ответ на | Re: Multiple psql -c / -f options (Fabien COELHO <coelho@cri.ensmp.fr>) |
Ответы |
Re: Multiple psql -c / -f options
|
Список | pgsql-hackers |
On 10/18/2013 02:19 AM, Fabien COELHO wrote: > >> IMHO the current behavior is broken: >> >> decibel@decina:[17:46]~/pgsql/HEAD/i$bin/psql -c 'select 1' -c >> 'select 2' >> ?column? >> ---------- >> 2 >> (1 row) > > Another try with one -c but with similar results: > > sh> psql -c "SELECT 1; SELECT 'hello';" > ?column? > ---------- > hello > (1 row) > > sh> psql -V > psql (PostgreSQL) 9.3.1 > It's not broken. All this behaviour is documented fairly explicitly. See <http://www.postgresql.org/docs/current/static/app-psql.html> For example, regarding Fabio's example, which is actually very different from Jim's, the docs say: "only the result of the last SQL command is returned." If you want to argue that it should be enhanced, then do. But it's acting as designed and as documented. I suspect changing this might actually have more wrinkles that you imagine, but I could be wrong. Incidentally, both of you could probably achieve what you apparently want with: echo 'some sql here' | psql cheers andrew
В списке pgsql-hackers по дате отправления: