본문 바로가기

[Database]/PostgreSQL

psql 테이블 백업파일 insert

psql -U [계정명] -d [데이터베이스명] -a -f [파일명]

-a
--echo-all

Print all nonempty input lines to standard output as they are read. (This does not apply to lines read interactively.) This is equivalent to setting the variable ECHO to all.

-f filename
--file=filename

Use the file filename as the source of commands instead of reading commands interactively. After the file is processed, psql terminates. This is in many ways equivalent to the meta-command \i.

If filename is - (hyphen), then standard input is read.

Using this option is subtly different from writing psql < filename. In general, both will do what you expect, but using -f enables some nice features such as error messages with line numbers. There is also a slight chance that using this option will reduce the start-up overhead. On the other hand, the variant using the shell's input redirection is (in theory) guaranteed to yield exactly the same output you would have received had you entered everything by hand.


'[Database] > PostgreSQL' 카테고리의 다른 글

NULL 체크 및 문자열 합치기  (0) 2015.06.08
CSV 백업파일 생성  (0) 2015.04.06
pg_dump insert 구문  (0) 2014.11.13
pg_dump schema (MySQL : show create table tablename)  (0) 2014.11.12
Start / 기본 명령어  (0) 2014.10.22