PostgreSQL
-
윈도우에서 postgresql 시작하기 - postgresql 설치 및 pgAdmin 사용방법프로그래밍/DB 2024. 8. 19. 14:48
postgreSQL 다운로드 https://www.postgresql.org/download/windows/ PostgreSQL: Windows installersWindows installers Interactive installer by EDB Download the installer certified by EDB for all supported PostgreSQL versions. Note! This installer is hosted by EDB and not on the PostgreSQL community servers. If you have issues with the website it's hostewww.postgresql.org 위 사이트에서 Download the insta..
-
postgres 데이터 파일로 저장하기프로그래밍/DB 2020. 10. 5. 13:22
https://www.postgresql.org/docs/10/static/sql-copy.html postgresql 테이블의 데이터를 csv로 저장하려면 copy to 문을 사용하면 된다. 아래 copy 문법과 예시 참조할 것. 문법 ) COPY table_name [ ( column_name [, ...] ) ] FROM { 'filename' | STDIN } [ [ WITH ] [ BINARY ] [ OIDS ] [ DELIMITER [ AS ] 'delimiter' ] [ NULL [ AS ] 'null string' ] [ CSV [ HEADER ] [ QUOTE [ AS ] 'quote' ] [ ESCAPE [ AS ] 'escape' ] [ FORCE NOT NULL column_name..
-
postgresql 테이블에 칼럼 추가 + 커멘트 달기프로그래밍/DB 2020. 8. 14. 14:34
postgresql 테이블에 칼럼 추가 + 커멘트 달기 칼럼 추가 방식 ALTER TABLE 테이블명 ADD COLUMN 컬럼명 데이터타입 제약조건 참고) postgresql numeric type 예시 - int 형의 칼럼 추가하고 코멘트 달기 ALTER TABLE 테이블이름 ADD 칼럼이름 integer;COMMENT ON COLUMN 테이블이름.칼럼이름 IS '코멘트'; - numeric 형의 칼럼 추가하기 ALTER TABLE 테이블이름 ADD COLUMN "ERROR" numeric(5,3); 칼럼 이름을 대문자로 할 경우 ""로 감싸줍니다. - varchar 칼럼 추가하면서 default 값 설정하기 ALTER TABLE test_tb ADD COLUMN name varchar(50) DEFA..