Re: Wie kann man newlines i n die Ausgabe einfügen

Andreas Kretschmer <[email protected]>
Newsgroups gmane.comp.db.postgresql.german
Message-ID <20120505072209.GA11236@tux>
Andreas Tille <[email protected]> wrote:

> On Fri, May 04, 2012 at 10:26:43PM +0200, Andreas Kretschmer wrote:
> > Andreas Tille <[email protected]> wrote:
> > > versucht, um zwischen die beiden Werte ein Newline einzufügen was
> > > offensichtlich nicht funktioniert.  Wie macht man das richtig?
> > 
> > test=*# SELECT 'a' || E'\n' || 'b' AS test;
> >  test
> > ------
> >  a   +
> >  b
> > (1 row)
> 
> Danke - sieht gut aus.  Kann man das überflüssige ' *+' noch irgendwie
> wegbekommen.  Sicher könnte ich ein sed-Script drumherum schreiben -
> aber ich sehe keinen Grund, warum psql da etwas einfügt, was ich im
> String nicht vorgesehen habe.
> 
> Darüber hinaus finde ich das führende Leerzeichen an jeder Zeile lästig.

kretschmer@tux:~$ psql test -t -A -c "SELECT 'a' || E'\n' || 'b' AS
test"
a
b


So besser? Schau mal die Hilfe zu psql.


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

-- 
Sent via pgsql-de-allgemein mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-de-allgemein
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.