From dc6b7c49b428b1dac371598939e8fc23fc1fa1c0 Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Thu, 30 Jul 2026 14:18:25 -0500 Subject: [PATCH] Remove stale, unused sql/omit_column.sql MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It duplicates the real omit_column() in sql/cat_tools.sql.in (and the test-only copy in test/setup.sql), both of which already use the correct `!= ALL`. This standalone copy was never \i'd or built into the extension — its only reference was the linter target — and still has the `!= ANY` bug fixed elsewhere: attname != ANY(omit) is true as soon as attname differs from any single array element, so for a multi-element omit list it excludes almost nothing. Dead code with a live bug in it is worse than no code — drop it rather than fix a copy nothing uses. --- Makefile | 2 +- sql/omit_column.sql | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 sql/omit_column.sql diff --git a/Makefile b/Makefile index b293fc1..4c200bc 100644 --- a/Makefile +++ b/Makefile @@ -103,5 +103,5 @@ clean_old_version: # source instead; a version file still under active development can be # linted directly, e.g. # `.vendor/linter/sql/bin/sql-lint sql/cat_tools--0.3.0.sql.in`. -LINT_TARGETS = sql/cat_tools.sql.in sql/omit_column.sql test/ +LINT_TARGETS = sql/cat_tools.sql.in test/ include lint.mk diff --git a/sql/omit_column.sql b/sql/omit_column.sql deleted file mode 100644 index 1d95832..0000000 --- a/sql/omit_column.sql +++ /dev/null @@ -1,16 +0,0 @@ -CREATE FUNCTION :s.omit_column( - rel text - , omit name[] DEFAULT array['oid'] -) RETURNS text LANGUAGE sql IMMUTABLE AS $body$ -SELECT array_to_string(array( - SELECT attname - FROM pg_attribute a - WHERE attrelid = rel::regclass - AND NOT attisdropped - AND attnum >= 0 - AND attname != ANY( omit ) - ORDER BY attnum - ) - , ', ' -) -$body$;