aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/postgres_fdw.h
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2021-06-04 22:42:17 +1200
committerDavid Rowley <drowley@postgresql.org>2021-06-04 22:42:17 +1200
commit8bdb36aab287f564eac534878bc0e1d873a4e3db (patch)
treef31a0682009d1f2362b9b6508d70e762624fae74 /contrib/postgres_fdw/postgres_fdw.h
parente4539386decae1c435767a69507cc7cbb11ac3ff (diff)
downloadpostgresql-8bdb36aab287f564eac534878bc0e1d873a4e3db.tar.gz
postgresql-8bdb36aab287f564eac534878bc0e1d873a4e3db.zip
Clean up some questionable usages of DatumGet* macros
This tidies up some questionable coding which made use of DatumGetPointer() for Datums being passed into functions where the parameter is expected to be a cstring. We saw no compiler warnings with the old code as the Pointer type used in DatumGetPointer() happens to be a char * rather than a void *. However, that's no excuse and we should be using the correct macro for the job. Here we also make use of OutputFunctionCall() rather than using FunctionCall1() directly to call the type's output function. OutputFunctionCall() is the standard way to do this. It casts the returned value to a cstring for us. In passing get rid of a duplicate call to strlen(). Most compilers will likely optimize away the 2nd call, but there may be some that won't. In any case, this just aligns the code to some other nearby code that already does this. Discussion: https://postgr.es/m/CAApHDvq1D=ehZ8hey8Hz67N+_Zth0GHO5wiVCfv1YcGPMXJq0A@mail.gmail.com
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.h')
0 files changed, 0 insertions, 0 deletions