Re: Setting the Field Separator in PSQL
От | David G. Johnston |
---|---|
Тема | Re: Setting the Field Separator in PSQL |
Дата | |
Msg-id | CAKFQuwYwdd575J0zOPLvLYDtr1ZhYHuq-Hj19R3_nSzrbzs1YA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Setting the Field Separator in PSQL ("David G. Johnston" <david.g.johnston@gmail.com>) |
Список | pgsql-sql |
I need to change the field separator to a tab in an input SQL file.
I’ve tried every combination of tab, ‘\t’, “\t”, --field-separator=’\t’, etc, etc.
Should it be in the command line or in the SQL file?
Any help?
More context would helpful but keep in mind that within SQL the expression:'\t' is a literal back-slash and a literal "t"E'\t' is escaped to mean <tab>Dealing with the shell complicates the issue so if you can avoid it I suggest that do avoid it.I should probably have tried my own advice first, and I still haven't, but the documentation states:""""fieldsepSpecifies the field separator to be used in unaligned output format. That way one can create, for example, tab- or comma-separated output, which other programs might prefer. To set a tab as field separator, type \pset fieldsep '\t'. The default field separator is '|' (a vertical bar)."""So I'm not sure if this report is user-error or documentation error. A self-contained test case would help...David J.
sorry...
Two more random thoughts:
Do you maybe need to altering COPY behavior:
and, if you are indeed focused on "psql OUTPUT" are you making sure you are specifying the "unaligned" output format?
David J.
В списке pgsql-sql по дате отправления: