Re: Row pattern recognition

jian he <jian.universality@gmail.com>

From: jian he <jian.universality@gmail.com>
To: assam258@gmail.com
Cc: Tatsuo Ishii <ishii@postgresql.org>, pgsql-hackers@postgresql.org, zsolt.parragi@percona.com, sjjang112233@gmail.com, vik@postgresfriends.org, er@xs4all.nl, jacob.champion@enterprisedb.com, david.g.johnston@gmail.com, peter@eisentraut.org, li.evan.chao@gmail.com
Date: 2026-06-24T05:12:30Z
Lists: pgsql-hackers

Attachments

On Wed, Jun 24, 2026 at 10:33 AM jian he <jian.universality@gmail.com> wrote:
>
> Hi.
>
> It's still based on https://github.com/assam258-5892/postgres/commits/RPR
>

    /*
     * Once the name matches we never fall back to function resolution, so any
     * decoration that does not make sense for a navigation operation is a
     * hard error.  The aggregate/window decorations (agg_star, DISTINCT,
     * WITHIN GROUP, ORDER BY, FILTER, OVER, RESPECT/IGNORE NULLS) are already
     * rejected by the common path in ParseFuncOrColumn, which treated the
     * recognized name as an ordinary function; what remains are the
     * decorations that path accepts for a plain function but a navigation
     * operation must still reject.
     */

The above comments can be deleted, ParseRPRNavCall, ParseFuncOrColumn
already have lots of comments.
Also the error check and its message are quite intuitive in ParseRPRNavCall.

coerce_to_common_type have comments:
```
 * This is used following select_common_type() to coerce the individual
 * expressions to the desired type
 ```

coerce_to_target_type comments says
```
* This is the general-purpose entry point for arbitrary type coercion
* operations.
```
So, I tended to use coerce_to_target_type.

ParseRPRNavCall ending can be simplified because coerce_to_target_type
can handle the same data type.
Therefore, `if (offtype != INT8OID)` is not necessary.

Drop the extra parentheses around ereport() argument lists, fewer
parentheses are always better for new code.



--
jian
https://www.enterprisedb.com/

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Adjust cross-version upgrade tests for seg_out() fix

  2. Rationalize error comments in partition split/merge tests

  3. Add fast path for foreign key constraint checks

  4. Fix assorted pretty-trivial memory leaks in the backend.

  5. Add temporal FOREIGN KEY contraints

  6. Add trailing commas to enum definitions

  7. Remove obsolete executor cleanup code