Re: NAMEDATALEN increase because of non-latin languages

From: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, Денис Романенко <deromanenko(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: NAMEDATALEN increase because of non-latin languages
Date: 2022-08-01 12:38:05
Message-ID: CAFBsxsEj=zWQxbVrsmKCrCJZrV_NjuX7q0r2eg97_b15j2wYfg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Attached is v3, which is mostly putting Andres's suggestion above (use
heap_deform_tuple) into a code generation context. Everything interesting
is in 0002, and again only touches pg_cast as an experiment. Some design
points which could be debatable:

- I thought individual C files would be a pain for the build process, so I
just dumped the new functions into a single file, with the extern
declarations in the pg_*.h files.
- I used `#include "catalog/pg_cast.h"` just for Form_pg_cast, but maybe a
forward declaration would work.
- To get the struct member assignments, I resorted to a Perl hash to map
the attribute types to the DatumGet* macros. That may not be great, but I
don't have a better idea at the moment.
- I directly called this function for the table scan rather than hide it
behind a new variant of GETSTRUCT as I did before. That seems clearer to me
about the intent.

The syscache use of GETSTRUCT still uses a simple cast of the tuple (for
pg_cast those calls live in parse_coerce.c, which is unchanged from master
in v3). Next step I think is to see about the syscache piece -- teaching a
syscache miss to deform the entire tuple into a struct and store it in the
syscache.

--
John Naylor
EDB: http://www.enterprisedb.com

Attachment Content-Type Size
v3-0002-Generate-pg_cast-function-to-deform-tuples-into-s.patch text/x-patch 7.3 KB
v3-0001-Transform-GETSTRUCT-macro-to-pass-the-catalog-nam.patch text/x-patch 391.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2022-08-01 12:46:30 Re: Typo in pg_db_role_setting.h
Previous Message Euler Taveira 2022-08-01 12:07:47 Re: logical replication restrictions