본문 바로가기

내가 당면한 문제와 해결방안

(81)
postgresql trigger retrieve 이미 만들어진 postgresql event trigger 확인 \dS 트리거 조회 select pg_get_functiondef('functionname'::regproc); 이벤트시에 트리거로 실행되는 함수 상세 조회 참고 https://serverfault.com/questions/331024/how-can-i-show-the-content-of-a-trigger-with-psql
postgresql get column_name with data_type select column_name,data_type from information_schema.columns where table_name = 'table_name'; stackoverflow.com/a/32369441/10194999
logstash postgres to elasticsearch tl;dr pgsync를 써볼걸 그랬나? https://github.com/toluaina/pg-sync 상황 - postgres에서 elasticsearch로 데이터 동기화 하려고함 - geometry, json, geo_shape 타입 처리 - 언제나 그렇듯 개발서버에서는 문제없는데 운영에서는 제약이 있고, 내가 설치한 것도 아니라 디렉토리 권한 같은 것도 하나하나 확인하며 실행시켜야하죠 해결방법 디렉토리는 내기준 && 수정한 부분 - cd /usr/share/logstash 에다가 data2 폴더 만들어서했음. (필수적인 부분 아님) - vi /etc/logstash/jvm.options ## JVM configuration -Xms12g -Xmx12g (heap size 늘리기위해서) - vi /..
logstash postgres to elasticsearch stackoverflow.com/a/61672243/10194999 Missing Converter handling for full class name=org.postgresql.util.PGobject, simple name=PGobject There is a column of geometry type in my postgres table. I checked that the rest of the columns worked fine postgres-> logstash-> elasticsearch. However, I am not sure how to cast the geometry type... stackoverflow.com 결국 해결. geometry는 geojson으로 받아 json으로 한번 더 c..
python 환경 관리 virtualenv : 내가 원하는 모듈만 운용하는 바구니 (https://dgkim5360.tistory.com/entry/python-virtualenv-on-linux-ubuntu-and-windows) virtualenv만 있나? ㄴㄴ 뭐가있지? 검색. https://www.pluralsight.com/tech-blog/managing-python-environments/ Managing Python Environments If you're not careful, your Python environment can quickly become a disaster. We'll walk through the available tools to be more (code) environmentally frie..
postgres ilike 문제 - 너무 느림 The key word ILIKE can be used instead of LIKE to make the match case-insensitive according to the active locale. This is not in the SQL standard but is a PostgreSQL extension. The operator ~~ is equivalent to LIKE, and ~~* corresponds to ILIKE. There are also !~~ and !~~* operators that represent NOT LIKE and NOT ILIKE, respectively. All of these operators are PostgreSQL-specific. 해결..
elastiesearch doc upsert https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html#doc_as_upsert Update API | Elasticsearch Reference [7.6] | Elastic Updates a document using the specified script. POST / /_update/ Enables you to script document updates. The script can update, delete, or skip modifying the document. The update API also supports passing a partial document, which is merged into the e..
postgres 트리거 만들기 CREATE FUNCTION update_json_expedia_region_union() RETURNS TRIGGER AS $$ DECLARE BEGIN UPDATE expedia_region_union SET boundaries = ST_GeomFromGeoJSON(coordinates)::geometry, boundaries_nearby = ST_GeomFromGeoJSON(coordinates_nearby)::geometry WHERE region_id = NEW.region_id; UPDATE expedia_region_union SET add_continent = ( select json_agg(json_build_object('id', region_id, 'name', region_name_..