This is a discussion on postgresql 8.1.5 psql -P recordsep='\n' not work within the pgsql Bugs forums, part of the PostgreSQL category; --> Hello All. I want to output result of query with double newline record separated. For example: psql -At -P ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello All. I want to output result of query with double newline record separated. For example: psql -At -P recordsep="\n\n" -U postgres -c "select generate_series(1,3)" 1 2 3 But my result is: psql -At -P recordsep="\n\n" -U postgres -d chronopay -c "select generate_series(1,3)" 1\n\n2\n\n3 Simple newline not work too: psql -At -P recordsep="\n" -U postgres -d chronopay -c "select generate_series(1,3)" 1\n2\n3 -------------- psql -At -P recordsep='\n\n' -U postgres -d chronopay -c "select generate_series(1,3)" psql -At -R '\n\n' -U postgres -d chronopay -c "select generate_series(1,3)" psql -At -R "\n\n" -U postgres -d chronopay -c "select generate_series(1,3)" no resultat Is it a bug? p.s. PostgreSQL 8.1.5 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3) Thanks. |
| |||
| Denis Lishtovny wrote: > Hello All. > > > > I want to output result of query with double newline record separated. > > For example: > > psql -At -P recordsep="\n\n" -U postgres -c "select generate_series(1,3)" What this says is that there's no interpolation of escapes in recordsep. Try putting them literally: $ psql -At -P recordsep=" > > " -c "select generate_series(1,3)" 1 2 3 -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| ||||
| Am Montag, 2. April 2007 16:48 schrieb Denis Lishtovny: > I want to output result of query with double newline record separated. > > For example: > > psql -At -P recordsep="\n\n" -U postgres -c "select generate_series(1,3)" "\n" is not a newline, it's a "\" followed by an "n". You need to actually enter two newlines psql -At -P recordsep=" " -U postgres -c "select generate_series(1,3)" or figure out how your shell makes escapes available. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| Thread Tools | |
| Display Modes | |
|
|