grant select on sequence sequence_name to user_name; grant usage on sequence sequence_name to user_name; grant update on sequence sequence_name to user_name;
pg_dump 명령어
postgresql 설치폴더를 찾음
(기본값은 c:\porogrm files\C:\Program Files\PostgreSQL\10\bin )
cmd 실행후 해당 경로로 이동함
pg_dump -h "localhost" -U "postgres" -f "c:\\저장파일경로\\저장파일명" "저장할 데이터베이스명"
c:\postgresqlautobackup 폴더를 만들고
pg_dump -h "localhost" -U "postgres" -f "c:\\postgresqlautobackup\\postgres" "postgres"
암호를 물어보면 암호 입력후
해당 경로에 백업이 잘 됨.
비밀번호 자동 입력과 파일 이름 날짜 변환
set pgpassword=**********pg_dump -h "localhost" -U "postgres" -f "c:\\postgresqlautobackup\\postgres_%date%" "postgres"
실행할수있도록 등록 배치파일 생성
c:\porogrm files\C:\Program Files\PostgreSQL\10\bin\\job_pgbackup.bat
윈도우 스캐줄러로 기본 작업 만들어서
매일 오후 11시 59분에 작업 백업이 됨.
사용자 생성 :
CREATE USER clientview WITH ENCRYPTED PASSWORD '1234';
// id : clientview, pwd = 1234 생성
데이터베이스에 권한 부여 :
GRANT ALL PRIVILEGES ON database_name TO user;
// database_name 란 Database 에 user 란 사용자한테 권한을 줌
특정 테이블에 권한 부여 :
GRANT select ON comcode_iot_onday TO clientview;
//concode_oit_onday 테이블에 select 권한을 사용자 : clientview 부여함
// select { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER | ALL}