copy FROM stdin使用方法

最近更新时间: 2024-10-17 17:10:00


postgres=# COPY tbase (id, mc) FROM stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
>> 1  tbase
>> 2  \N
>> 3  pgxc
>> \.
postgres=# select * from tbase;
 id |  mc   
----+-------
  1 | tbase
  2 | 
  3 | pgxc
(3 rows)

注:1 和tbase 之间不是空格,而是tab符