Compare commits
2 Commits
master
...
bug/sc-161
Author | SHA1 | Date | |
---|---|---|---|
|
5da3490aa3 | ||
|
592ef90abc |
3
Makefile
3
Makefile
@ -1,7 +1,7 @@
|
|||||||
# cartodb/Makefile
|
# cartodb/Makefile
|
||||||
|
|
||||||
EXTENSION = cartodb
|
EXTENSION = cartodb
|
||||||
EXTVERSION = 0.37.1
|
EXTVERSION = 0.37.2
|
||||||
|
|
||||||
SED = sed
|
SED = sed
|
||||||
AWK = awk
|
AWK = awk
|
||||||
@ -110,6 +110,7 @@ UPGRADABLE = \
|
|||||||
0.35.0 \
|
0.35.0 \
|
||||||
0.36.0 \
|
0.36.0 \
|
||||||
0.37.0 \
|
0.37.0 \
|
||||||
|
0.37.1 \
|
||||||
$(EXTVERSION)dev \
|
$(EXTVERSION)dev \
|
||||||
$(EXTVERSION)next \
|
$(EXTVERSION)next \
|
||||||
$(END)
|
$(END)
|
||||||
|
3
NEWS.md
3
NEWS.md
@ -1,3 +1,6 @@
|
|||||||
|
0.37.2 (2021-09-27)
|
||||||
|
* Change `CDB_TableMetadata_Trigger` to handle a race condition due to concurrent inserts.
|
||||||
|
|
||||||
0.37.1 (2020-12-02)
|
0.37.1 (2020-12-02)
|
||||||
* Change `__CDB_RegenerateTable_Get_Commands` to use the caller timeout or '1min' if not set.
|
* Change `__CDB_RegenerateTable_Get_Commands` to use the caller timeout or '1min' if not set.
|
||||||
|
|
||||||
|
@ -42,16 +42,26 @@ BEGIN
|
|||||||
SELECT oid FROM pg_class WHERE oid = tabname
|
SELECT oid FROM pg_class WHERE oid = tabname
|
||||||
);
|
);
|
||||||
|
|
||||||
WITH nv as (
|
BEGIN
|
||||||
SELECT TG_RELID as tabname, now() as t
|
WITH nv as (
|
||||||
), updated as (
|
SELECT TG_RELID as tabname, now() as t
|
||||||
UPDATE @extschema@.CDB_TableMetadata x SET updated_at = nv.t
|
), updated as (
|
||||||
FROM nv WHERE x.tabname = nv.tabname
|
UPDATE @extschema@.CDB_TableMetadata x SET updated_at = nv.t
|
||||||
RETURNING x.tabname
|
FROM nv WHERE x.tabname = nv.tabname
|
||||||
)
|
RETURNING x.tabname
|
||||||
INSERT INTO @extschema@.CDB_TableMetadata SELECT nv.*
|
)
|
||||||
FROM nv LEFT JOIN updated USING(tabname)
|
INSERT INTO @extschema@.CDB_TableMetadata SELECT nv.*
|
||||||
WHERE updated.tabname IS NULL;
|
FROM nv LEFT JOIN updated USING(tabname)
|
||||||
|
WHERE updated.tabname IS NULL;
|
||||||
|
EXCEPTION
|
||||||
|
-- Managing race condition due to concurrent inserts
|
||||||
|
WHEN UNIQUE_VIOLATION THEN
|
||||||
|
WITH nv as (
|
||||||
|
SELECT TG_RELID as tabname, now() as t
|
||||||
|
)
|
||||||
|
UPDATE @extschema@.CDB_TableMetadata x SET updated_at = nv.t
|
||||||
|
FROM nv WHERE x.tabname = nv.tabname;
|
||||||
|
END;
|
||||||
|
|
||||||
RETURN NULL;
|
RETURN NULL;
|
||||||
END;
|
END;
|
||||||
|
Loading…
Reference in New Issue
Block a user