Split out CreateCast into src/backend/catalog/pg_cast.c
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 10 Mar 2020 14:28:23 +0000 (11:28 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 10 Mar 2020 14:28:23 +0000 (11:28 -0300)
commit40b3e2c201af10c27a2c4c5bfcd029026b4cdff3
treec19e65a9b38c3ed42c26d58a25a349d0049a8606
parent0a42a2e9ce8481a024d085f2cc526a366db8df59
Split out CreateCast into src/backend/catalog/pg_cast.c

This catalog-handling code was previously together with the rest of
CastCreate() in src/backend/commands/functioncmds.c.  A future patch
will need a way to add casts internally, so this will be useful to have
separate.

Also, move the nearby get_cast_oid() function from functioncmds.c to
lsyscache.c, which seems a more natural place for it.

Author: Paul Jungwirth, minor edits by Álvaro
Discussion: https://postgr.es/m/20200309210003.GA19992@alvherre.pgsql
src/backend/catalog/Makefile
src/backend/catalog/pg_cast.c [new file with mode: 0644]
src/backend/commands/functioncmds.c
src/backend/commands/typecmds.c
src/backend/utils/cache/lsyscache.c
src/include/catalog/pg_cast.h
src/include/commands/defrem.h
src/include/utils/lsyscache.h