DB37 postgres의 문자열 컬럼을 json으로 파싱 후 이용하는 형태 update aiops_train_history set inst_type = ( cast(request as json)->>'inst_type' ) where "module" = 'exem_imxa_lngtrm_fcst'; 2020. 6. 17. PostgreSQL 테이블 용량 확인하기 1. 테이블별 사이즈 A. 테이블 스페이스 총량 => select spcname, pg_size_pretty(pg_tablespace_size(spcname)) from pg_tablespace; B. 각 테이블별 사이즈 => Index 미포함 : select pg_relation_size(‘TableName’); => Index 포함 : select pg_total_relation_size(‘TableName’); C. 인덱스 사이즈 => select pg_relation_size(‘IndexName’); D. 총 사이즈(데이터 + 인덱스) => select pg_total_relation_size(‘TableName’); -------------------------- 단위 적용 : pg_size_p.. 2020. 6. 15. 쉘스크립트로 sql파일들 여러개 실행하기 #!/bin/bash for f in *.sql; do psql -U postgres -d postgres -f "$f" done echo "sql runner complete"; https://stackoverflow.com/questions/13062168/how-to-execute-multiple-sql-files-in-postgresql-linux How to execute multiple sql files in postgreSQL linux? I have many .sql files in a folder (/home/myHSH/scripts) in linux debian. I want to know the command to execute or run all sql files inside the.. 2020. 4. 28. Mysql 도커설치 https://jmlim.github.io/docker/2019/07/30/docker-mysql-setup/ Docker를 통한 MySQL 설치하기. · 기억하기 위한 개발노트 Docker를 통한 MySQL 설치하기. 30 Jul 2019 | Docker docker MySQL 도커 Mysql Docker 한글문제 2020-02-26 에 한글깨짐 관련 내용 추가 함. 이 글에선 docker에서 MySQL을 설정하는 방법과 docker를 통해 설치한 MySQL에 접근 방법에 대해 알아본다. Docker가 무엇인지 알고, MySQL을 사용하는 방법을 이해하고 SQL 명령을 사용하여 사용자를 생성하고, 데이터베이스를 만들고, 권한을 jmlim.github.io 2020. 3. 9. 도커 컨테이너로 오라클 띄우기 https://stophyun.tistory.com/190 Mac(맥)에서 docker(도커)를 이용해 Oracle(오라클)11g 설치하기 Mac(맥)에서 docker(도커)를 이용해 Oracle(오라클) 11g를 설치해보겠습니다. 1. docker 설치 https://docs.docker.com/docker-for-mac/install/ 도커를 설치합니다. 2. 터미널을 이용해 도커 로그인 합니다. doc.. stophyun.tistory.com 2020. 3. 9. 시퀀스번호 로우 삭제시에도 순서대로 매겨지도록 만들기 https://www.dreampharos.com/2019/12/postgresql-insert-pk.html [메모] PostgreSQL에서 Insert 하는 경우 자동채번 PK가 중복에러 나는 경우 PostgreSQL에서 Entity Framework를 사용해서 DB조작할 때 에러에 대한 메모. id컬럼을 Serial형(Auto Increasing)으로 만든 테이블에 id 값을 생략한 형식으로 INSERT를 하려고 했더니 다음과 같은 에러가... www.dreampharos.com 2020. 2. 14. VO를 포함한 VO형태 사용방법 SELECT boardid, title, content FROM board WHERE boardid = #{boardid} SELECT commentid, boardid, writer, content FROM comment WHERE boardid = #{boardid https://krespo.net/162 2020. 2. 14. biggint칼럼으로 시퀀스를 쓸때 초기화하는 명령어? 어차피 이름있는 시퀀스이다. 테이블을 살펴보면 이름을 알 수 있다. select * from aiops_auth_info_auth_id_seq select currval('aiops_auth_info_auth_id_seq'::regclass) select setval('aiops_auth_info_auth_id_seq'::regclass,5) 이런 명령어들이 먹힌다. https://dbrang.tistory.com/784 [PGS9.2] Sequence 활용하기 /******************************************************************************************** -- Title : [PGS9.2] Sequence 활용하기 -- Refere.. 2020. 2. 13. postgres에서 select 사용시 바로 json으로 받아오기 https://blog.gaerae.com/2015/09/postgresql-multiple-rows-and-json-or-string.html PostgreSQL: 다중 행을 하나의 문자열 또는 JSON 타입으로 만들기 블로그와 SNS에서 주기적으로 기술 정보를 찾고 분류하여 가치를 더해 공유합니다. blog.gaerae.com 2020. 2. 13. 쿼리스트링 값을 if문(test)에서 사용하는 방법 _parameter를 사용하는 걸 설명하고 있는데 내가 아는 value를 쓰는 것이나 완전히 같은 방법이다.근데 쿼리스트링 값을 한개가 아니라 두개나 세개를 적용할 때는 어떻게 사용할 수 있을까? SELECT menu_name, use, menu_type FROM aiops_menu_info WHERE menu_type = #{menuType} ORDER BY menu_id https://thswave.github.io/spring/2015/06/18/mybatis-test-string-parameter.htmlmybatis string parameter를 if문(test)에서 사용하는 방법June 18th, 2015 mybatis로 개발하면서 알게 된 팁을 공유하고자 합니다. 주의: ibatis와 동작.. 2020. 2. 13. 이전 1 2 3 4 다음