diff --git a/expected/pgaudit.out b/expected/pgaudit.out
index 8570d03..4ba7260 100644
--- a/expected/pgaudit.out
+++ b/expected/pgaudit.out
@@ -1432,6 +1432,34 @@ NOTICE:  AUDIT: SESSION,98,1,DDL,DROP INDEX,,,DROP INDEX h_idx,<none>
 DROP TABLE h;
 NOTICE:  AUDIT: SESSION,99,1,DDL,DROP TABLE,,,DROP TABLE h,<none>
 --
+-- Test that foreign key validation is not logged against the ALTER TABLE.
+-- The tables must be populated so the constraint is validated by
+-- RI_Initial_Check(), which checks permissions outside the executor.  Both
+-- commands that validate reach it, i.e. adding a constraint and validating one
+-- that was added NOT VALID.
+CREATE TABLE fk_pk (id int PRIMARY KEY);
+NOTICE:  AUDIT: SESSION,100,1,DDL,CREATE TABLE,,,CREATE TABLE fk_pk (id int PRIMARY KEY),<none>
+INSERT INTO fk_pk VALUES (1);
+NOTICE:  AUDIT: SESSION,101,1,WRITE,INSERT,TABLE,public.fk_pk,INSERT INTO fk_pk VALUES (1),<none>
+CREATE TABLE fk_fk (id int);
+NOTICE:  AUDIT: SESSION,102,1,DDL,CREATE TABLE,,,CREATE TABLE fk_fk (id int),<none>
+INSERT INTO fk_fk VALUES (1);
+NOTICE:  AUDIT: SESSION,103,1,WRITE,INSERT,TABLE,public.fk_fk,INSERT INTO fk_fk VALUES (1),<none>
+ALTER TABLE fk_fk ADD CONSTRAINT fk_fk_id_fkey FOREIGN KEY (id) REFERENCES fk_pk(id);
+NOTICE:  AUDIT: SESSION,104,1,READ,SELECT,TABLE,public.fk_fk,"SELECT fk.""id"" FROM ONLY ""public"".""fk_fk"" fk LEFT OUTER JOIN ONLY ""public"".""fk_pk"" pk ON ( pk.""id"" OPERATOR(pg_catalog.=) fk.""id"") WHERE pk.""id"" IS NULL AND (fk.""id"" IS NOT NULL)",<none>
+NOTICE:  AUDIT: SESSION,104,1,READ,SELECT,TABLE,public.fk_pk,"SELECT fk.""id"" FROM ONLY ""public"".""fk_fk"" fk LEFT OUTER JOIN ONLY ""public"".""fk_pk"" pk ON ( pk.""id"" OPERATOR(pg_catalog.=) fk.""id"") WHERE pk.""id"" IS NULL AND (fk.""id"" IS NOT NULL)",<none>
+NOTICE:  AUDIT: SESSION,104,2,DDL,ALTER TABLE,,,ALTER TABLE fk_fk ADD CONSTRAINT fk_fk_id_fkey FOREIGN KEY (id) REFERENCES fk_pk(id),<none>
+ALTER TABLE fk_fk ADD CONSTRAINT fk_fk_id_fkey_nv FOREIGN KEY (id) REFERENCES fk_pk(id) NOT VALID;
+NOTICE:  AUDIT: SESSION,105,1,DDL,ALTER TABLE,,,ALTER TABLE fk_fk ADD CONSTRAINT fk_fk_id_fkey_nv FOREIGN KEY (id) REFERENCES fk_pk(id) NOT VALID,<none>
+ALTER TABLE fk_fk VALIDATE CONSTRAINT fk_fk_id_fkey_nv;
+NOTICE:  AUDIT: SESSION,106,1,READ,SELECT,TABLE,public.fk_fk,"SELECT fk.""id"" FROM ONLY ""public"".""fk_fk"" fk LEFT OUTER JOIN ONLY ""public"".""fk_pk"" pk ON ( pk.""id"" OPERATOR(pg_catalog.=) fk.""id"") WHERE pk.""id"" IS NULL AND (fk.""id"" IS NOT NULL)",<none>
+NOTICE:  AUDIT: SESSION,106,1,READ,SELECT,TABLE,public.fk_pk,"SELECT fk.""id"" FROM ONLY ""public"".""fk_fk"" fk LEFT OUTER JOIN ONLY ""public"".""fk_pk"" pk ON ( pk.""id"" OPERATOR(pg_catalog.=) fk.""id"") WHERE pk.""id"" IS NULL AND (fk.""id"" IS NOT NULL)",<none>
+NOTICE:  AUDIT: SESSION,106,2,DDL,ALTER TABLE,,,ALTER TABLE fk_fk VALIDATE CONSTRAINT fk_fk_id_fkey_nv,<none>
+DROP TABLE fk_fk;
+NOTICE:  AUDIT: SESSION,107,1,DDL,DROP TABLE,,,DROP TABLE fk_fk,<none>
+DROP TABLE fk_pk;
+NOTICE:  AUDIT: SESSION,108,1,DDL,DROP TABLE,,,DROP TABLE fk_pk,<none>
+--
 -- Test rows retrived or affected by statements
 \connect - :current_user
 SET pgaudit.log = 'all';
diff --git a/pgaudit.c b/pgaudit.c
index a7960f0..d598a62 100644
--- a/pgaudit.c
+++ b/pgaudit.c
@@ -1578,8 +1578,17 @@ pgaudit_ExecutorCheckPerms_hook(List *rangeTabls,
      * auditing via pgaudit.role might apply.  This short-circuits the role
      * lookup and per-statement DML processing for configurations such as
      * pgaudit.log = 'ddl, role'.
+     *
+     * Also skip checks that are not enforcing.  A caller passing
+     * ereport_on_violation false is asking whether it may proceed, not
+     * executing a statement against the relations, so there is nothing to
+     * audit.  RI_Initial_Check() does this to decide whether it can validate a
+     * foreign key with a single query, and it runs while the utility command's
+     * own stack item is on top of the stack, so auditing the check would
+     * attribute the referenced relations to that command.  The validation query
+     * it goes on to run is audited normally.
      */
-    if (audit_executor_enabled() &&
+    if (audit_executor_enabled() && ereport_on_violation &&
         !IsAbortedTransactionBlockState() && !IsParallelWorker())
     {
         /* Get the audit oid if the role exists */
diff --git a/sql/pgaudit.sql b/sql/pgaudit.sql
index 62d613c..673cf89 100644
--- a/sql/pgaudit.sql
+++ b/sql/pgaudit.sql
@@ -978,6 +978,22 @@ CREATE INDEX h_idx ON h (x);
 DROP INDEX h_idx;
 DROP TABLE h;
 
+--
+-- Test that foreign key validation is not logged against the ALTER TABLE.
+-- The tables must be populated so the constraint is validated by
+-- RI_Initial_Check(), which checks permissions outside the executor.  Both
+-- commands that validate reach it, i.e. adding a constraint and validating one
+-- that was added NOT VALID.
+CREATE TABLE fk_pk (id int PRIMARY KEY);
+INSERT INTO fk_pk VALUES (1);
+CREATE TABLE fk_fk (id int);
+INSERT INTO fk_fk VALUES (1);
+ALTER TABLE fk_fk ADD CONSTRAINT fk_fk_id_fkey FOREIGN KEY (id) REFERENCES fk_pk(id);
+ALTER TABLE fk_fk ADD CONSTRAINT fk_fk_id_fkey_nv FOREIGN KEY (id) REFERENCES fk_pk(id) NOT VALID;
+ALTER TABLE fk_fk VALIDATE CONSTRAINT fk_fk_id_fkey_nv;
+DROP TABLE fk_fk;
+DROP TABLE fk_pk;
+
 --
 -- Test rows retrived or affected by statements
 \connect - :current_user
