pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
newline in text field
2+ messages / 2 participants
[nested] [flat]

* newline in text field
@ 1998-11-08 11:50  Sergei M. Suntsov <serge@uic.nsu.ru>
  0 siblings, 1 reply; 2+ messages in thread

From: Sergei M. Suntsov @ 1998-11-08 11:50 UTC (permalink / raw)
  To: pgsql-sql

  Hello
I would like to insert into text field strings separated by newline
character ('\n') using psql. How should I quote newline characters if it
is possible ?
   Thanx in advance.
Sergei




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [SQL] newline in text field
@ 1998-11-08 12:12  Herouth Maoz <herouth@oumail.openu.ac.il>
  parent: Sergei M. Suntsov <serge@uic.nsu.ru>
  0 siblings, 0 replies; 2+ messages in thread

From: Herouth Maoz @ 1998-11-08 12:12 UTC (permalink / raw)
  To: Sergei M. Suntsov <serge@uic.nsu.ru>; +Cc: pgsql-sql

At 13:50 +0200 on 8/11/98, Sergei M. Suntsov wrote:


>   Hello
> I would like to insert into text field strings separated by newline
> character ('\n') using psql. How should I quote newline characters if it
> is possible ?
>    Thanx in advance.
> Sergei

It depends on the context. If you want to put it in an insert string, you
don't have to quote it. You do something like:

INSERT INTO my_table ( text_field )
VALUES (
'...And yet by heaven I swear my love as rare
As any she belied with false compare!' );

If you are doing it within COPY, where newline has significance as a
delimiter, you should put a backslash before it:

COPY my_table FROM stdin;
...And yet by heaven I swear my love as rare\
As any she belied with false compare!
\.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1998-11-08 12:12 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-11-08 11:50 newline in text field Sergei M. Suntsov <serge@uic.nsu.ru>
1998-11-08 12:12 ` Herouth Maoz <herouth@oumail.openu.ac.il>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox