Skip to content

Commit edcfc6e

Browse files
author
Denis Lussier
committed
initial commit from orafce
1 parent 85c98a3 commit edcfc6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+28820
-3
lines changed

COPYRIGHT.orafunc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Orafce, Oracle API support
2+
3+
Permission to use, copy, modify, and distribute this software and its
4+
documentation for any purpose, without fee, and without a written agreement
5+
is hereby granted, provided that the above copyright notice and this
6+
paragraph and the following two paragraphs appear in all copies.
7+
8+
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
9+
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
10+
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
11+
DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
12+
POSSIBILITY OF SUCH DAMAGE.
13+
14+
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
15+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
16+
AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
17+
ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
18+
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

INSTALL.orafunc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Installation
2+
============
3+
4+
This module is normally distributed as a PostgreSQL 'contrib' module. To
5+
install it from a pre-configured source tree run the following commands
6+
as a user with appropriate privileges from the orafce source directory:
7+
8+
make
9+
make install
10+
11+
Alternatively, if you have no source tree you can install using PGXS. Simply
12+
run the following commands the adminpack source directory:
13+
14+
make USE_PGXS=1
15+
make USE_PGXS=1 install
16+
17+
To install Orafce functions in the database, either run the orafce.sql script
18+
using the pgAdmin SQL tool (and then close and reopen the connection to the
19+
freshly instrumented server), or run the script using psql, eg:
20+
21+
psql -U postgres postgres < orafunc.sql
22+
23+
Other administration tools that use this module may have different requirements,
24+
please consult the tool's documentation for further details.
25+
26+
This package requires PostgreSQL 8.2 or later.

META.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "orafce",
3+
"abstract": "Oracle's compatibility functions and packages",
4+
"description": "This module allows use a well known Oracle's functions and packages inside PostgreSQL",
5+
"version": "3.0.7",
6+
"maintainer": [
7+
"Pavel Stehule <pavel.stehule@gmail.com>",
8+
"Takahiro Itagaki <itagaki.takahiro@gmail.com>"
9+
],
10+
"license": {
11+
"PostgreSQL": "http://www.postgresql.org/about/licence"
12+
},
13+
"prereqs": {
14+
"runtime": {
15+
"requires": {
16+
"plpgsql": 0,
17+
"PostgreSQL": "8.1.0"
18+
},
19+
"recommends": {
20+
"PostgreSQL": "9.2.0"
21+
}
22+
}
23+
},
24+
"provides": {
25+
"pgtap": {
26+
"file": "sql/orafce.sql",
27+
"docfile": "README.orafce",
28+
"version": "3.0.7",
29+
"abstract": "Oracle's compatibility functions and packages"
30+
},
31+
},
32+
"resources": {
33+
"homepage": "http://www.pgsql.cz/index.php/Oracle_functionality_%28en%29",
34+
"repository": {
35+
"url": "https://github.com/orafce/orafce",
36+
"web": "https://github.com/orafce/orafce",
37+
"type": "git"
38+
}
39+
},
40+
"generated_by": "Pavel Stehule",
41+
"meta-spec": {
42+
"version": "1.0.0",
43+
"url": "http://pgxn.org/meta/spec.txt"
44+
},
45+
"tags": [
46+
"oracle",
47+
"compatibility",
48+
"user function",
49+
"custom function",
50+
"intrerprocess communication",
51+
"read from file",
52+
"write to file",
53+
"bussiness calendar"
54+
]
55+
}

Makefile

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
MODULE_big = orafunc
2+
OBJS= convert.o file.o datefce.o magic.o others.o plvstr.o plvdate.o shmmc.o plvsubst.o utility.o plvlex.o alert.o pipe.o sqlparse.o putline.o assert.o plunit.o random.o aggregate.o oraguc.o
3+
4+
EXTENSION = orafce
5+
6+
DATA_built = orafunc.sql
7+
DATA = uninstall_orafunc.sql orafce--3.0.7.sql orafce--unpackaged--3.0.7.sql
8+
DOCS = README.asciidoc COPYRIGHT.orafunc INSTALL.orafunc
9+
10+
PG_CONFIG ?= pg_config
11+
12+
# version as a number, e.g. 9.1.4 -> 901
13+
VERSION := $(shell $(PG_CONFIG) --version | awk '{print $$2}')
14+
INTVERSION := $(shell echo $$(($$(echo $(VERSION) | sed 's/\([[:digit:]]\{1,\}\)\.\([[:digit:]]\{1,\}\).*/\1*100+\2/' ))))
15+
16+
# make "all" the default target
17+
all:
18+
19+
REGRESS = orafunc dbms_output dbms_utility files
20+
21+
ifeq ($(shell echo $$(($(INTVERSION) >= 804))),1)
22+
REGRESS += aggregates nlssort dbms_random
23+
endif
24+
25+
REGRESS_OPTS = --load-language=plpgsql --schedule=parallel_schedule
26+
REGRESSION_EXPECTED = expected/orafunc.out expected/dbms_pipe_session_B.out
27+
28+
ifeq ($(shell echo $$(($(INTVERSION) <= 802))),1)
29+
$(REGRESSION_EXPECTED): %.out: %1.out
30+
cp $< $@
31+
else
32+
$(REGRESSION_EXPECTED): %.out: %2.out
33+
cp $< $@
34+
endif
35+
36+
installcheck: $(REGRESSION_EXPECTED)
37+
38+
EXTRA_CLEAN = sqlparse.c sqlparse.h sqlscan.c y.tab.c y.tab.h orafunc.sql.in expected/orafunc.out expected/dbms_pipe_session_B.out
39+
40+
ifndef USE_PGXS
41+
top_builddir = ../..
42+
makefile_global = $(top_builddir)/src/Makefile.global
43+
ifeq "$(wildcard $(makefile_global))" ""
44+
USE_PGXS = 1 # use pgxs if not in contrib directory
45+
endif
46+
endif
47+
48+
ifdef USE_PGXS
49+
PG_CONFIG = pg_config
50+
PGXS := $(shell $(PG_CONFIG) --pgxs)
51+
include $(PGXS)
52+
else
53+
subdir = contrib/$(MODULE_big)
54+
include $(makefile_global)
55+
include $(top_srcdir)/contrib/contrib-global.mk
56+
endif
57+
58+
ifeq ($(enable_nls), yes)
59+
ifeq ($(PORTNAME),win32)
60+
SHLIB_LINK += -lintl
61+
else
62+
SHLIB_LINK += -L$(libdir)/gettextlib
63+
endif
64+
endif
65+
66+
# remove dependency to libxml2 and libxslt
67+
LIBS := $(filter-out -lxml2, $(LIBS))
68+
LIBS := $(filter-out -lxslt, $(LIBS))
69+
70+
plvlex.o: sqlparse.o
71+
72+
sqlparse.o: $(srcdir)/sqlscan.c
73+
74+
$(srcdir)/sqlparse.h: $(srcdir)/sqlparse.c ;
75+
76+
$(srcdir)/sqlparse.c: sqlparse.y
77+
ifdef BISON
78+
$(BISON) -d $(BISONFLAGS) -o $@ $<
79+
else
80+
ifdef YACC
81+
$(YACC) -d $(YFLAGS) -p cube_yy $<
82+
mv -f y.tab.c sqlparse.c
83+
mv -f y.tab.h sqlparse.h
84+
else
85+
bison -d $(BISONFLAGS) -o $@ $<
86+
endif
87+
endif
88+
89+
$(srcdir)/sqlscan.c: sqlscan.l
90+
ifdef FLEX
91+
$(FLEX) $(FLEXFLAGS) -o'$@' $<
92+
else
93+
flex $(FLEXFLAGS) -o'$@' $<
94+
endif
95+
96+
distprep: $(srcdir)/sqlparse.c $(srcdir)/sqlscan.c
97+
98+
maintainer-clean:
99+
rm -f $(srcdir)/sqlparse.c $(srcdir)/sqlscan.c
100+
101+
ifndef MAJORVERSION
102+
MAJORVERSION := $(basename $(VERSION))
103+
endif
104+
105+
orafunc.sql.in:
106+
if [ -f orafunc-$(MAJORVERSION).sql ] ; \
107+
then \
108+
cat orafunc-common.sql orafunc-$(MAJORVERSION).sql > orafunc.sql.in; \
109+
else \
110+
cat orafunc-common.sql orafunc-common-2.sql > orafunc.sql.in; \
111+
fi

NEWS

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Orafce News - History of user-visible changes
2+
Copyright (C) 2008-2012 Orafce Global Development Group
3+
4+
Version 3.0.7 - 27. Jul 2014
5+
* PostgreSQL 9.4 compilation
6+
* new datatype and related functions: oracle.date
7+
8+
Version 3.0.6 - 8. Sep 2013
9+
10+
* PostgreSQL 9.3 compilation
11+
* some cleaning, fixes, much more regress tests
12+
13+
Version 3.0.5 - X Dec 2012
14+
15+
* PostgreSQL 9.1/9.2 compilation
16+
* ... TODO ...

0 commit comments

Comments
 (0)