| From: | Mark Dilger <hornschnorter(at)gmail(dot)com> |
|---|---|
| To: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | inappropriate use of NameGetDatum macro |
| Date: | 2016-09-12 19:39:56 |
| Message-ID: | EFD8AC94-4C1F-40C1-A5EA-304080089C1B@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Friends,
there are several places in the code where variables defined as
(char *) or as (const char *) are passed to the NameGetDatum()
macro. I believe it would be better form to use CStringGetDatum()
in these locations. I am aware that these two macros are internally
the same.
src/backend/commands/proclang.c, line 466.
src/backend/commands/dbcommands.c, lines 1263, 1489, 1606, 1746.
Am I overlooking some reason why the code is correct as is? If not,
I am attaching a patch that applies cleanly for me against master,
compiles, and passes the regression tests.
Thanks,
Mark Dilger
| Attachment | Content-Type | Size |
|---|---|---|
| NameGetDatum.patch.1 | application/octet-stream | 2.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Petr Jelinek | 2016-09-12 19:47:08 | Re: Logical Replication WIP |
| Previous Message | Tom Lane | 2016-09-12 19:31:37 | Re: pg_basebackup wish list |