- Create the type on the master and all worker nodes:
CREATE TYPE new_composite_type as (project_key text, date text);
- Create a function for checking equality, and associate it with the equality operator for the new type
CREATE OR REPLACE FUNCTION citus_shard_name(table_name regclass, shard_id bigint) | |
RETURNS text | |
LANGUAGE sql | |
AS $function$ | |
SELECT table_name||'_'||shard_id; | |
$function$; | |
CREATE OR REPLACE FUNCTION citus_shard_name(shard_id bigint) | |
RETURNS text | |
LANGUAGE sql |