CREATE TABLE test (
    id SERIAL PRIMARY KEY,
    geom GEOGRAPHY UNIQUE NOT NULL
);


-- insert first point
INSERT INTO test (geom) VALUES ('POINT(1 3)');

-- if I try to insert a second identical point, an duplicate key errors prevents me to do that
-- INSERT INTO test (geom) VALUES ('POINT(1 3)');

-- But if I insert a different point, and update it after, no error is triggered
INSERT INTO test (geom) VALUES ('POINT(1 2)');
UPDATE test SET geom = ('POINT(1 3)') WHERE id = 2;

-- Then, I end up with two rows with the same geography even if geography should be unique
SELECT COUNT(*) FROM test WHERE ST_AsText(geom) = 'POINT(1 3)';
