I committed the previous patch, which was of course much simpler.
I appreciate the effort to restructure the code, but I felt this was too
much surgery during beta. Maybe we can consider this again later (or
not). Thanks.
On 16.07.26 13:29, Ashutosh Bapat wrote:
On Wed, Jul 8, 2026 at 6:59 PM Ashutosh Bapat
<[email protected]> wrote:
On Wed, Jul 8, 2026 at 2:35 PM Peter Eisentraut <[email protected]> wrote:
I would like this code to be organized differently. Note that the
existing insert_*_record functions don't do any error checking; they are
just there to make catalog modifications. There are various check_*
functions that pretty much correspond to syntax rule checks, but these
are run after the catalog changes, hence the present issue. Maybe we
should have a set of "pre-check" functions in addition?
If we consolidate all the pre-checks together similar to post checks,
we duplicate the catalog lookups. But a future code may miss calling
pre-checks before calling insert_*_record(). I tried to write one
precheck function for insert_label_record and insert_property_record
respectively and ended up calling it close to the insert_*_record
itself. The effort is attached as
v20260716-0001-pre-check-Report-duplicate-property-and-label-names-.patch.nocibot
I don't like the result.
Do you expect insert_element_record() to perform sanity checks of
labels or insert_label_record() to perform sanity checks on
properties? Or do you expect a hierarchy of pre_check_ functions
cascading from elements to labels to properties?
If I understand your intention to keep functions inserting records
into catalogs simple, Attached
v20260716-0001-simple-insert-Report-duplicate-property-and-label-names.patch.nocibot
is what I could come up with. It adds one insert_*_record() function
for every property graph catalog, and then an add_* functions which
call the insert_*_record functions after necessary pre-checks. I like
this version better. It doesn't collect all the checks like check_*
functions but create a hierarchy of checks and catalog inserts keeping
the latter simple. I have also rearranged the code so that all the
catalog insert functions are together and their wrappers are together
respectively.