Skip to content

Commit 081c93c

Browse files
committed
Prune doc references to unsupported PG versions
17b7d7c (PR #450) dropped conditional code for PostgreSQL before 9.5, the oldest version to be supported by PL/Java 1.6.x. References to older PostgreSQL versions in the docs, however, were not pruned then. Remove those now. The docs also mentioned some paths and other details that changed with the new build system in 1.6; bring those up to date. Also, link to the page on pljava.policy from a couple more places that only touched on policy generally. These changes are not strictly about pre-9.5 PostgreSQL versions, but are details that were similarly overlooked in the PL/Java 1.5 to 1.6 transition.
1 parent 8992155 commit 081c93c

File tree

9 files changed

+51
-123
lines changed

9 files changed

+51
-123
lines changed

src/site/markdown/build/buildmsvc.md

-8
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ PostgreSQL and PL/Java. Using a *newer* version of Visual Studio (including
2121
the Community 2015 version) will generally work, while older versions are more
2222
likely to be problematic.
2323

24-
* PostgreSQL 9.1 to 9.3 were built using Visual Studio 2010.
25-
* PostgreSQL 9.4 was built using Visual Studio 2013.
26-
2724
## Software Prerequisites
2825

2926
0. You will need an appropriate version of [Microsoft Visual Studio][msvc]. When
@@ -50,11 +47,6 @@ likely to be problematic.
5047
an `INCLUDEDIR-SERVER` line, and list the directory it refers to. There
5148
should be a bunch of `*.h` files there.
5249

53-
0. OpenSSL headers: if using an EnterpriseDB PostgreSQL build older than 9.3,
54-
these will be missing. They can be obtained from a 9.3 or later
55-
EDB PostgreSQL build by copying the `include/openssl` directory and
56-
its contents.
57-
5850
0. You will need to install [Maven][mvn] and add it to your PATH so that
5951

6052
mvn --version

src/site/markdown/build/package.md

+17-7
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ shown in that link to disable the repacking of jars.
7878
The one part of PL/Java that could, if desired, be handled in the manner of
7979
Java libraries is `pljava-api`. This single jar file is needed on the classpath
8080
when compiling Java code that will be loaded into PL/Java in the database.
81-
It is _not_ needed at the time that code will _run_. That means it could be
82-
appropriate to treat `pljava-api` as a separate `-devel` package, if your
83-
packaging guidelines encourage such a distinction. In that case, you would
84-
exclude the `pljava-api` jar file from the main package, and produce a `-devel`
85-
package that provides it.
81+
That means it could be
82+
appropriate to provide `pljava-api` in a separate `-devel` package, if your
83+
packaging guidelines encourage such a distinction, where it would be installed
84+
in the expected place for a conventional Java library. (The API jar must still
85+
be included in the main package also, installed in the location where PostgreSQL
86+
expects it. There may be no need, therefore, for the main package to depend on
87+
the `-devel` package.)
8688

8789
A `-devel` package providing `pljava-api` might appropriately follow
8890
java library packaging guidelines to ensure it appears on a developer's
@@ -108,7 +110,7 @@ is the useful one to have in an installation target host's repository.)
108110

109111
The PL/Java build does not automatically build javadocs. Those that go with
110112
`pljava-api` can be easily generated by running
111-
`mvn --projects pljava-api javadoc:javadoc` to build them, then collecting
113+
`mvn --projects pljava-api site` to build them, then collecting
112114
the `apidocs` subtree from `target/site`. They can be included in the same
113115
package as `pljava-api` or in a separate javadoc package, as your guidelines
114116
may require.
@@ -126,7 +128,7 @@ been built first and installed into the build host's local Maven repository.
126128
Note that many of the examples do double duty as tests, as described in
127129
_confirming the build_ below.
128130

129-
When building for (and with) Java 8 or later and PostgreSQL 8.4 or later,
131+
Unless they are not wanted,
130132
the XML examples based on the Saxon library should also be built,
131133
by adding `-Psaxon-examples` to the `mvn` command line.
132134

@@ -170,6 +172,14 @@ Some tests involving Unicode are skipped if the `server_encoding` is not
170172
`utf-8`, so it is best to run them in a server instance created with that
171173
encoding.
172174

175+
To simplify automated testing, the jar file that is the end product of a full
176+
PL/Java source build contains a class that can serve as a PostgreSQL test
177+
harness from Java's `jshell` script engine. It is documented [here][node],
178+
and the continuous-integration scripts in PL/Java's own source-control
179+
repository can be consulted as examples of its use.
180+
181+
[node]: ../develop/node.html
182+
173183
## Packaging the built items
174184

175185
The end product of a full PL/Java source build is a jar file that functions as

src/site/markdown/examples/saxon.md

-12
Original file line numberDiff line numberDiff line change
@@ -451,18 +451,6 @@ string (`\A\z` in Java syntax):
451451
That workaround would also cause the replacement to happen if the input string
452452
is completely empty to start with, which might not be what's wanted.
453453

454-
#### Syntax in older PostgreSQL versions
455-
456-
The desugared syntax shown above can be used in PostgreSQL versions as old
457-
as 9.5. In 9.4 and 9.3, the same syntax, but with `=>` replaced by `:=` for
458-
the named parameters, can be used. The functions remain usable in still
459-
earlier PostgreSQL versions, but with increasingly convoluted SQL syntax
460-
needed to call them; before 9.3, for example, there was no `LATERAL` in a
461-
`SELECT`, and a function could not refer to earlier `FROM` items. Before 9.0,
462-
named-parameter notation can't be used in function calls. Before 8.4, the
463-
functions would have to be declared without their `DEFAULT` clauses and the
464-
`IntervalStyle` settings, and would not work with PostgreSQL interval values.
465-
466454
### Minimizing startup time
467455

468456
Saxon is a large library, and benefits greatly from precompilation into a

src/site/markdown/install/install.md.vm

+14-16
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ see the jar file there.
3939
__Upgrade installations__
4040
below*.
4141

42-
*Not running PostgreSQL 9.1 or higher? Use
42+
*Avoiding `CREATE EXTENSION` for some reason? Use
4343
`LOAD 'libpljava-so-${project.version}';` instead of the `CREATE EXTENSION`
44-
command. (It works in later versions too, if you prefer it to
45-
`CREATE EXTENSION`.) Using a Mac? Be sure to add `.bundle` at the end of the file name
44+
command. Using a Mac? Be sure to add `.bundle` at the end of the file name
4645
in the `LOAD` command. Windows? Remove `lib` from the front. Something else?
4746
Keep reading.*
4847

@@ -187,7 +186,7 @@ Another approach is to save them to the server's configuration file.
187186
If you wish PL/Java to be available for all databases in a cluster, it may
188187
be more convenient to put the settings in the file than to issue
189188
`ALTER DATABASE` for several databases, but `pg_ctl reload` will be needed
190-
to make changed settings effective. Starting with PostgreSQL 9.4,
189+
to make changed settings effective.
191190
`ALTER SYSTEM` may be used as an alternative to editing the file.
192191

193192
If you have several databases in the cluster and you favor the
@@ -197,9 +196,6 @@ sure that `CREATE EXTENSION` just works, in any database where PL/Java
197196
is wanted. Different per-database settings can still be made if one
198197
database needs them.
199198

200-
For PostgreSQL releases [earlier than 9.2][pre92], the configuration file is
201-
the _only_ way to make your settings persistent.
202-
203199
$h2 Upgrade installations
204200

205201
PL/Java performs an upgrade installation if there is already an `sqlj` schema
@@ -215,10 +211,12 @@ $h2 Usage permission
215211

216212
Installation of PL/Java creates two "languages", `java` and `javau`.
217213
Functions that specify `LANGUAGE javau` can be created only by superusers,
218-
and are subject to very few restrictions at runtime. Functions that specify
214+
and PL/Java's default policy grants them some filesystem access. Functions that
215+
specify
219216
`LANGUAGE java` can be created by any user or role that has been granted
220-
`USAGE` permission `ON LANGUAGE java`. They run under a security manager that
221-
denies access to the host filesystem.
217+
`USAGE` permission `ON LANGUAGE java`. The default policy grants them no extra
218+
permissions. The exact permissions granted in either case can be customized
219+
in [`pljava.policy`][policy].
222220

223221
__Note: For implications when running on Java 17 or later,
224222
please see [JEP 411][jep411]__.
@@ -237,12 +235,10 @@ $h2 Special topics
237235

238236
Be sure to read these additional sections if:
239237

240-
* You are installing to [a PostgreSQL release earlier than 9.2][pre92]
241238
* You are installing on [a system using SELinux][selinux]
242239
* You are installing on [Mac OS X][osx]
243240
* You are installing on [Ubuntu][ubu] and the self-extracting jar won't work
244241

245-
[pre92]: prepg92.html
246242
[selinux]: selinux.html
247243
[osx]: ../build/macosx.html
248244
[ubu]: ../build/ubuntu.html
@@ -254,9 +250,10 @@ $h3 Puzzling error message from `CREATE EXTENSION`
254250
ERROR: relation "see doc: do CREATE EXTENSION PLJAVA in new session"
255251
already exists
256252

257-
For PL/Java, `CREATE EXTENSION` (which works in PostgreSQL 9.1 and later) is a
258-
wrapper around installation via `LOAD` (which works in all versions PL/Java
259-
supports). A quirk of this arrangement is that PostgreSQL treats `LOAD` as a
253+
For PL/Java, `CREATE EXTENSION` is a wrapper around installation via `LOAD`
254+
(which was needed for PostgreSQL versions now of only historical interest,
255+
and remains supported for cases where `CREATE EXTENSION` is too inflexible).
256+
A quirk of this arrangement is that PostgreSQL treats `LOAD` as a
260257
no-op for the remainder of a session once the library has been loaded, so
261258
`CREATE EXTENSION pljava` works in a *fresh* session, but not in one where
262259
PL/Java's native code is already in place.
@@ -283,7 +280,7 @@ Because PL/Java, by design, runs entirely in the backend process created
283280
for each connection to PostgreSQL, to configure it does not require any
284281
cluster-wide actions such as stopping or restarting the server, or editing
285282
the configuration file; any necessary settings can be made in SQL over
286-
an ordinary connection (in PostgreSQL 9.2 and later, anyway).
283+
an ordinary connection.
287284

288285
_Caution: if you are installing a new, little-tested PL/Java build, be aware
289286
that in the unexpected case of a crash, the `postmaster` will kick other
@@ -399,3 +396,4 @@ readable by the user running `postgres`, and set the `pljava.*` variables
399396
accordingly.
400397

401398
[jep411]: https://github.com/tada/pljava/wiki/JEP-411
399+
[policy]: ../use/policy.html

src/site/markdown/install/locate.md.vm

+16-10
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ work with a `.jar` file no matter what.
3131

3232
Relative to the root of the build tree, the jar file is found at
3333

34-
`pljava-packaging/target/pljava-${pgversion}-${naraol}.jar`
34+
`pljava-packaging/target/pljava-${pgversion}.jar`
3535

36-
where `${pgversion}` resembles `pg9.4` and `${naraol}` is an
37-
*architecture-os-linker* triple, for example `amd64-Linux-gpp`
38-
or `amd64-Windows-msvc`. It contains these things:
36+
where `${pgversion}` resembles `pg16`. The jar contains these things:
3937

4038
`pljava/pkglibdir/libpljava-\${project.version}.so` (or `.dll`, etc.)
4139
: The architecture-dependent, native library portion of the PL/Java
@@ -62,13 +60,24 @@ or `amd64-Windows-msvc`. It contains these things:
6260
: Various files scripting what `CREATE EXTENSION` or
6361
`ALTER EXTENSION ... UPDATE` really do.
6462

63+
`pljava/sysconfdir/pljava.policy`
64+
: Policy file defining the Java permissions granted to the languages `java`
65+
and `javaU`, to any custom language aliases, or to specific jars, as
66+
described [here][policy].
67+
6568
It could happen that future versions add more files in the jar before
6669
updating this page. Also, every jar file has a `MANIFEST.MF`, and this
6770
file also contains a `JarX.class` to make it self-extracting; these are
6871
not otherwise important to PL/Java. See the [installation page][inst]
6972
for how to control the self-extraction.
7073

74+
Another file, `Node.class`, present in this jar is also unimportant for
75+
normal installation, but provides some facilities for automated testing,
76+
as described [here][node].
77+
7178
[examples]: ../examples/examples.html
79+
[node]: ../develop/node.html
80+
[policy]: ../use/policy.html
7281

7382
Extract the needed files from this archive and place them in appropriate
7483
locations, then complete the [installation][inst].
@@ -112,11 +121,8 @@ $h3 The architecture-dependent PL/Java native library
112121
This is built by the `pljava-so` subproject. Its filename extension can depend
113122
on the operating system: `.so` on many systems, `.dll` on Windows, `.bundle` on
114123
Mac OS X / Darwin. Relative to the source root where the build was performed, it
115-
is at the end of a long and redundant path that contains the project version
116-
(twice), an "architecture-OS-linker" string (twice), and a build type
117-
("plugin"), also twice.
124+
is found in the `pljava-so/pljava-pgxs` directory.
118125

119-
An example, for version `${project.version}` and arch-os-linker of
120-
`amd64-Linux-gpp` is (very deep breath):
126+
An example for version `${project.version}` is:
121127

122-
`pljava-so/target/nar/pljava-so-${project.version}-amd64-Linux-gpp-plugin/lib/amd64-Linux-gpp/plugin/libpljava-so-${project.version}.so`
128+
`pljava-so/pljava-pgxs/libpljava-so-${project.version}.so`

src/site/markdown/install/prepg92.md

-63
This file was deleted.

src/site/markdown/use/parallel.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# PL/Java in parallel query or background worker
22

33
With some restrictions, PL/Java can be used in [parallel queries][parq], from
4-
PostgreSQL 9.6, and in some [background worker processes][bgworker] (as
5-
introduced in PostgreSQL 9.3, though 9.5 or later is needed for support
6-
in PL/Java).
4+
PostgreSQL 9.6, and in some [background worker processes][bgworker].
75

86
[bgworker]: https://www.postgresql.org/docs/current/static/bgworker.html
97
[parq]: https://www.postgresql.org/docs/current/static/parallel-query.html

src/site/markdown/use/use.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ significant advantages to using the
9898

9999
### Parallel query
100100

101-
PostgreSQL 9.3 introduced [background worker processes][bgworker]
102-
(though at least PostgreSQL 9.5 is needed for support in PL/Java),
101+
PL/Java understands [background worker processes][bgworker]
102+
in PostgreSQL 9.5 and later,
103103
and PostgreSQL 9.6 introduced [parallel query][parq].
104104

105105
For details on PL/Java in a background worker or parallel query, see

src/site/markdown/use/variables.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ These PostgreSQL configuration variables can influence PL/Java's operation:
4040

4141
`pljava.enable`
4242
: Setting this variable `off` prevents PL/Java startup from completing, until
43-
the variable is later set `on`. It can be useful when
44-
[installing PL/Java on PostgreSQL versions before 9.2][pre92].
43+
the variable is later set `on`. It can be useful in some debugging settings.
4544

4645
`pljava.implementors`
4746
: A list of "implementor names" that PL/Java will recognize when processing

0 commit comments

Comments
 (0)