This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Several fixes and improvements by Itagaki Takahiro.
There are incompatibilites in built-in functions and global variables. * Support PGXS to build the codes. * Added regression tests. * Support additional type conversions: - timestamp [with time zone] - date - record (input only) - oid * Logging function is renamed to print(elevel, ...). Acceptable elevels are DEBUG[1-5], LOG, INFO, NOTICE, and WARNING. Use JavaScript exceptions (throw) to report errors; ERROR level are not allowed. * Query function is renamed to executeSql(sql). For SELECT statements, the returned value is an array of hashes. Each hash represents each record. Column names are mapped to hash keys. For non-SELECT commands, the returned value is an integer that represents number of affected rows. * Trigger functions receives trigger conditions as function arguments: NEW, OLD, TG_NAME, TG_WHEN, TG_LEVEL, TG_OP, TG_RELID, TG_TABLE_NAME, TG_TABLE_SCHEMA, and TG_ARGV. * Support VARIADIC arguments. * Support unnamed arguments. They can be referred with 'arguments' or $N. * Fix error handling and exception handling. Postgre's errors (siglongjmp) are packed into C++ exceptions to invoke destructors properly, and extracted at the end of function.
- Loading branch information
Showing
10 changed files
with
1,868 additions
and
1,027 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,30 @@ | ||
all: | ||
g++ -O2 -Wall -fPIC -I ../postgres/pgsql/src/include -I ../v8/include -o plv8.o -c plv8.cc | ||
g++ -lv8 -shared -o plv8.so plv8.o | ||
clean: | ||
rm plv8.so plv8.o | ||
distclean: clean | ||
realclean: clean | ||
|
||
.PHONY: all clean distclean realclean | ||
V8DIR = ../v8 | ||
|
||
SRCS = plv8.cc plv8_type.cc | ||
OBJS = $(SRCS:.cc=.o) | ||
DATA_built = plv8.sql | ||
DATA = uninstall_plv8.sql | ||
SHLIB_LINK += -lv8 | ||
MODULE_big = plv8 | ||
REGRESS = plv8 | ||
|
||
CCFLAGS := $(filter-out -Wmissing-prototypes, $(CFLAGS)) | ||
CCFLAGS := $(filter-out -Wdeclaration-after-statement, $(CCFLAGS)) | ||
|
||
%.o : %.cc | ||
g++ $(CCFLAGS) $(CPPFLAGS) -I $(V8DIR)/include -fPIC -c -o $@ $< | ||
|
||
ifdef USE_PGXS | ||
PGXS := $(shell pg_config --pgxs) | ||
include $(PGXS) | ||
else | ||
subdir = contrib/plv8 | ||
top_builddir = ../.. | ||
include $(top_builddir)/src/Makefile.global | ||
include $(top_srcdir)/contrib/contrib-global.mk | ||
endif | ||
|
||
# remove dependency to libxml2 and libxslt | ||
LIBS := $(filter-out -lxml2, $(LIBS)) | ||
LIBS := $(filter-out -lxslt, $(LIBS)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.