Improve comment for OAT_POST_CREATE.
authorJeff Davis <jdavis@postgresql.org>
Tue, 20 Sep 2022 17:41:34 +0000 (10:41 -0700)
committerJeff Davis <jdavis@postgresql.org>
Tue, 20 Sep 2022 17:52:01 +0000 (10:52 -0700)
Clarify that the command counter may or may not have been incremented.

We may want to change the behavior to be more consistent, but until
that time, at least improve the comment.

Discussion: https://postgr.es/m/CAHoZxqvN2eoic_CvjsAvpryyLyA2xG8JmsyMtKFFJz_1oFhfOg%40mail.gmail.com
Reported-by: Mary Xu
src/include/catalog/objectaccess.h

index d754f41202fe216d0a6193df447e2617a1ad60a3..fcb8562757fcce08d1f3bdc68358b5b75edb5965 100644 (file)
@@ -17,7 +17,9 @@
  *
  * OAT_POST_CREATE should be invoked just after the object is created.
  * Typically, this is done after inserting the primary catalog records and
- * associated dependencies.
+ * associated dependencies. The command counter may or may not be incremented
+ * at the time the hook is invoked; if not, the extension can use SnapshotSelf
+ * to get the new version of the tuple.
  *
  * OAT_DROP should be invoked just before deletion of objects; typically
  * deleteOneObject(). Its arguments are packed within ObjectAccessDrop.