Re: Wrong query result w/ propgraph single lateral col reference

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Wrong query result w/ propgraph single lateral col reference
Date: 2026-08-06 08:51:09
Message-ID: f2728e73-4252-4a07-8ec8-7f13042ccbe4@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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
> <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> wrote:
>>
>> On Wed, Jul 8, 2026 at 2:35 PM Peter Eisentraut <peter(at)eisentraut(dot)org> 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.
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message ZizhuanLiu X-MAN 2026-08-06 09:00:50 Re: Fix var_eq_const: sum selectivity of all matching MCV entries instead of stopping at first match
Previous Message Heikki Linnakangas 2026-08-06 08:37:46 Re: convert various variables to atomics