skip to Main Content

Postgresql – De-duplicate part of a table on given condition

This is my message table. Now I am trying to write an query to group records by collection_id (only first instance) if type multi-store else by message.id . id | collection_id | type | affiliation_id | status | scheduled_for_date --------------------------------------+--------------------------------------+----------------+----------------+--------------+--------------------…

VIEW QUESTION

Postgresql – Raise exception from inside CTE (Postgres)

I have the following function that contains a CTE: CREATE OR REPLACE FUNCTION create_job( in_partition_id VARCHAR(40), in_job_id VARCHAR(48), in_name VARCHAR(255), in_description TEXT, in_data TEXT, in_job_hash INT, in_task_classifier VARCHAR(255), in_task_api_version INT, in_task_data BYTEA, in_task_pipe VARCHAR(255), in_target_pipe VARCHAR(255), in_prerequisite_job_ids VARCHAR(128)[], in_delay INT,…

VIEW QUESTION
Back To Top
Search