skip to Main Content

Postgresql – How to aggregate for first values in group

I have troubles creating certain aggregations. I'm using this table in Postgres: CREATE TABLE public.customer_courier_chat_messages ( sender_app_type character varying(255), customer_id integer, from_id integer, to_id integer, chat_started_by_message boolean, order_id integer, order_stage character varying(255), courier_id integer, message_sent_time timestamp with time zone );…

VIEW QUESTION

Postgresql – Postgres `anyelement` function variable gives error: could not determine polymorphic type because input has type unknown

I have the following function which I want to pass anyelement and it should return whether it is a valid URL by matching the regex: CREATE OR REPLACE FUNCTION isURL(data anyelement) RETURNS BOOLEAN AS $$ BEGIN RETURN data::text ~ '^https?://[-a-zA-Z0-9@:%._+~#=]{2,255}.[a-z]{2,6}(/[-a-zA-Z0-9@:%._+~#=]*)*(?[-a-zA-Z0-9@:%_+.~#()?&//=]*)?$';…

VIEW QUESTION
Back To Top
Search