From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Be pickier about converting between Name and Datum. |
Date: | 2016-09-13 21:17:53 |
Message-ID: | E1bjv5V-0001s9-N8@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Be pickier about converting between Name and Datum.
We were misapplying NameGetDatum() to plain C strings in some places.
This worked, because it was just a pointer cast anyway, but it's a type
cheat in some sense. Use CStringGetDatum instead, and modify the
NameGetDatum macro so it won't compile if applied to something that's
not a pointer to NameData. This should result in no changes to
generated code, but it is logically cleaner.
Mark Dilger, tweaked a bit by me
Discussion: <EFD8AC94-4C1F-40C1-A5EA-304080089C1B(at)gmail(dot)com>
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/55c3391d1e6a201b5b891781d21fe682a8c64fe6
Modified Files
--------------
src/backend/commands/dbcommands.c | 8 ++++----
src/backend/commands/proclang.c | 2 +-
src/backend/commands/typecmds.c | 2 +-
src/include/postgres.h | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2016-09-14 18:30:55 | pgsql: Tweak targetlist-SRF tests. |
Previous Message | Tom Lane | 2016-09-13 18:26:25 | Re: pgsql: Improve parser's and planner's handling of set-returning functio |