aonestar
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
sp_get_draft
Parameters
Name
Type
Mode
i_draft_type
integer
IN
i_ref_id
integer
IN (DEFAULT NULL)
Definition
--select row_to_json(dataset) select coalesce( (array_agg(row_to_json(dataset)))[1], '{}'::json) --ref: https://stackoverflow.com/questions/60817814/postgresql-11-coalesce-on-row-to-json-still-returns-null from ( SELECT create_time, modify_time, draft_data FROM draft WHERE username = fn_current_user() AND draft_type = i_draft_type and (i_ref_id is not distinct from ref_id) ) as dataset