Skip to content

Commit 147c248

Browse files
committed
Split plpython.c into smaller pieces
This moves the code around from one huge file into hopefully logical and more manageable modules. For the most part, the code itself was not touched, except: PLy_function_handler and PLy_trigger_handler were renamed to PLy_exec_function and PLy_exec_trigger, because they were not actually handlers in the PL handler sense, and it makes the naming more similar to the way PL/pgSQL is organized. The initialization of the procedure caches was separated into a new function init_procedure_caches to keep the hash tables private to plpy_procedures.c. Jan Urbański and Peter Eisentraut
1 parent 59e242a commit 147c248

28 files changed

+5842
-5442
lines changed

src/pl/plpython/Makefile

+14-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,19 @@ rpathdir = $(python_libdir)
3838

3939
NAME = plpython$(python_majorversion)
4040

41-
OBJS = plpython.o
41+
OBJS = \
42+
plpy_cursorobject.o \
43+
plpy_elog.o \
44+
plpy_exec.o \
45+
plpy_main.o \
46+
plpy_planobject.o \
47+
plpy_plpymodule.o \
48+
plpy_procedure.o \
49+
plpy_resultobject.o \
50+
plpy_spi.o \
51+
plpy_subxactobject.o \
52+
plpy_typeio.o \
53+
plpy_util.o
4254

4355
DATA = $(NAME)u.control $(NAME)u--1.0.sql $(NAME)u--unpackaged--1.0.sql
4456
ifeq ($(python_majorversion),2)
@@ -177,7 +189,7 @@ endif # can't build
177189
# distprep and maintainer-clean rules should be run even if we can't build.
178190

179191
# Force this dependency to be known even without dependency info built:
180-
plpython.o: spiexceptions.h
192+
plpython_plpy.o: spiexceptions.h
181193

182194
spiexceptions.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-spiexceptions.pl
183195
$(PERL) $(srcdir)/generate-spiexceptions.pl $< > $@

src/pl/plpython/nls.mk

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# src/pl/plpython/nls.mk
22
CATALOG_NAME = plpython
33
AVAIL_LANGUAGES = de es fr it ja pt_BR ro tr zh_CN zh_TW
4-
GETTEXT_FILES = plpython.c
4+
GETTEXT_FILES = plpy_cursorobject.c plpy_elog.c plpy_exec.c plpy_main.c plpy_planobject.c plpy_plpymodule.c \
5+
plpy_procedure.c plpy_resultobject.c plpy_spi.c plpy_subxactobject.c plpy_typeio.c plpy_util.c
56
GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS) PLy_elog:2 PLy_exception_set:2 PLy_exception_set_plural:2,3
67
GETTEXT_FLAGS = $(BACKEND_COMMON_GETTEXT_FLAGS) \
78
PLy_elog:2:c-format \

0 commit comments

Comments
 (0)