Skip to content

Instantly share code, notes, and snippets.

View np-wauxhall's full-sized avatar

Dmitry Bykov np-wauxhall

  • napopravku.ru
  • Saint-Petersburg
View GitHub Profile
@pozs
pozs / json_equals.sql
Last active December 18, 2020 15:29
PostgreSQL function to test if two json values are equal
-- SQL function to test if two json values are equal
-- requires PostgreSQL 9.3+
CREATE OR REPLACE FUNCTION json_equals(json, json)
RETURNS BOOLEAN
LANGUAGE sql
IMMUTABLE
STRICT
AS $function$
SELECT CASE f1