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@gmail.com>
Showing
- src/backend/commands/dbcommands.c 4 additions, 4 deletionssrc/backend/commands/dbcommands.c
- src/backend/commands/proclang.c 1 addition, 1 deletionsrc/backend/commands/proclang.c
- src/backend/commands/typecmds.c 1 addition, 1 deletionsrc/backend/commands/typecmds.c
- src/include/postgres.h 1 addition, 1 deletionsrc/include/postgres.h
Loading
Please register or sign in to comment