timescaledb/sql/common/ddl_utils.sql
Olof Rensfelt 13d3acbcfa Fix bug with alter table add/drop column if exists
Previously, an ALTER TABLE ADD COLUMN IF NOT EXISTS on a hypertable
caused an error if the column already did exist. The reversed problem
with DROP COLUMN is also fixed. Resolves issue #42.
2017-05-15 21:21:33 +02:00

10 lines
268 B
SQL

CREATE OR REPLACE FUNCTION ddl_is_add_column(pg_ddl_command)
RETURNS bool IMMUTABLE STRICT
AS '$libdir/timescaledb' LANGUAGE C;
CREATE OR REPLACE FUNCTION ddl_is_drop_column(pg_ddl_command)
RETURNS bool IMMUTABLE STRICT
AS '$libdir/timescaledb' LANGUAGE C;