CDB_RegenerateTable: Work with sequences

This commit is contained in:
Raúl Marín 2020-11-16 17:15:13 +01:00
parent 59a47c863a
commit 3ad36e2a31
2 changed files with 5 additions and 6 deletions

View File

@ -64,8 +64,10 @@ BEGIN
ON c.relnamespace = ns.oid
WHERE c.oid = %L', tableoid) INTO table_name;
RAISE DEBUG '%', FORMAT('ALTER TABLE %s RENAME TO %s', table_name, temp_name);
EXECUTE FORMAT('ALTER TABLE %s RENAME TO %s', table_name, temp_name);
RAISE DEBUG '%', FORMAT('CREATE TEMPORARY TABLE %s ON COMMIT DROP AS SELECT * FROM %s', temp_name, table_name);
EXECUTE FORMAT('CREATE TEMPORARY TABLE %s ON COMMIT DROP AS SELECT * FROM %s', temp_name, table_name);
RAISE DEBUG '%', FORMAT('DROP TABLE %s', table_name);
EXECUTE FORMAT('DROP TABLE %s', table_name);
FOR i IN 1 .. array_upper(queries, 1)
LOOP
@ -75,8 +77,5 @@ BEGIN
RAISE DEBUG '%', FORMAT('INSERT INTO %s SELECT * FROM %I', table_name, temp_name);
EXECUTE FORMAT('INSERT INTO %s SELECT * FROM %I', table_name, temp_name);
RAISE DEBUG '%', FORMAT('DROP TABLE %I', temp_name);
EXECUTE FORMAT('DROP TABLE %I', temp_name);
END
$$ LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;

View File

@ -36,7 +36,7 @@ BEGIN
-- Don't bother clipping if the geometry boundary doesn't
-- go outside the valid extent.
IF latlon_input @ valid_extent THEN
IF @postgisschema@.geometry_within(latlon_input, valid_extent) THEN
BEGIN
RETURN @postgisschema@.ST_Transform(latlon_input, 3857);
EXCEPTION WHEN OTHERS THEN