[Postgresql] 데이터를 JSON 형태로 추출하는 방법
Postgresql의 json_build_object, json_object_agg 함수를 사용하면 데이터를 JSON 형태로 추출 할 수 있다. 해당 함수를 사용하여 Postgresql DB 정보를 추출하는 방법을 알아보자. PostgreSQL Database 정보를 JSON 형태로 추출하는 SQL 스크립트 SELECT json_build_object( 'database_name', current_database(), 'postgresql_version', version(), 'server_os', version(), 'server_uptime', pg_postmaster_start_time() AT TIME ZONE 'UTC', 'database_size', pg_size_pretty(pg_databa..
2023. 5. 13.