| От | Tom Lane |
|---|---|
| Тема | Re: Escape parentheses in aggregate function |
| Дата | |
| Msg-id | 26321.1567178286@sss.pgh.pa.us обсуждение |
| Ответ на | Escape parentheses in aggregate function (Rich Shepard <rshepard@appl-ecosys.com>) |
| Ответы |
Re: Escape parentheses in aggregate function
|
| Список | pgsql-general |
Rich Shepard <rshepard@appl-ecosys.com> writes:
> I want to copy query results to a text file and there's an aggregate
> function in the SELECT expression. One of the aggregate function's
> parentheses seems to end the \copy() function and I don't know how best to
> write the statement. A minimal example:
> \copy(select count_value, sum(count_value)
> from table_name) to 'output_file.txt';
I think your problem is the line break, not the parentheses.
psql knows how to count parens, but it has no concept of letting
backslash commands continue across lines.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера