Re: Thread-safe stringToNode() / pg_strtok()

From: 邱宇航 <iamqyh(at)gmail(dot)com>
To: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: Thread-safe stringToNode() / pg_strtok()
Date: 2026-08-18 03:38:17
Message-ID: E06FB3C8-55E9-408D-B063-30C20B12B31F@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Matthias,

Thanks for v2. I think the ExtensibleNode path still needs an update.
_readExtensibleNode() receives ReadNodeContext *ctx, but still calls:
methods->nodeRead(local_node);

Since pg_strtok(), readBitmapset(), and the other reader helpers now
require ctx, an extension's nodeRead callback has no way to read its
private fields. External extensions such as Apache AGE, DocumentDB and
AQO implement ExtensibleNode nodeRead callbacks using pg_strtok() and
related reader helpers.

Should ExtensibleNodeMethods.nodeRead also receive ReadNodeContext, for
example:
void (*nodeRead)(ReadNodeContext *ctx, ExtensibleNode *node);
and be called as:
methods->nodeRead(ctx, local_node);

Best Regards,
Yuhang Qiu.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2026-08-18 03:47:53 Re: MERGE/SPLIT PARTITIONS issues/questions
Previous Message Zhijie Hou (Fujitsu) 2026-08-18 03:27:43 RE: Logical replication row filter loses unchanged toasted columns