RDB/Postgresql 3

[postgreSQL] psql \copy

Psql (PostgreSQL의 Command Line Interface) psql은 pgAdmin로 DB 접속이 어려울 때 terminal로 접근하여 사용하는 명령어 개념이다. 다양한 기능이 존재하는데 매번 \d, \dt만 사용해서 무슨 명령어가 있는지 잘 모른다. (많은 기능을 제공한다는 것만 안다..) 테스트를 위해 DB에 대량 더미 데이터를 입력하기 위해서 psql의 \copy 명령어를 사용해 보았다. \copy psql 명령어 중 \copy를 통해 대량 데이터를 임포트 하여 입력했다. 파일과 테이블 간에 데이터를 전송하는 편리한 방법이지만 한 번에 몇 천 개가 넘는 행을 추가할 때도 INSERT 보다 훨씬 빠르다. customer 테이블에 id와 name 컬럼에 홈 디렉터리 하위의 temp 디렉..

RDB/Postgresql 2020.06.17

[PostgreSQL] Numeric Types

PostgreSQL에서의 숫자 자료형을 계속 검색하길래.. 포스팅을 올린다. ㅠㅠ 8.1. Numeric Types Numeric types consist of two-, four-, and eight-byte integers, four- and eight-byte floating-point numbers, and selectable-precision decimals. Table 8-2 lists the available types. Table 8-2. Numeric Types NameStorage SizeDescriptionRange smallint 2 bytes small-range integer -32768 to +32767 integer 4 bytes typical choice for intege..

RDB/Postgresql 2020.01.13
반응형