Skip to content

WIP for a PL/Java API that models PostgreSQL concepts rather than abstracting them away #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 397 commits into
base: REL1_7_STABLE
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
397 commits
Select commit Hold shift + click to select a range
e25b7c4
Clean up a bogus javadoc comment
jcflack Aug 24, 2023
8a88cbf
Beat down unchecked warnings from Datum migration
jcflack Aug 25, 2023
0391e18
Some more missing Adapters
jcflack Aug 26, 2023
45f965c
A reference NUMERIC -> BigDecimal implementation
jcflack Aug 26, 2023
8353f6f
Ax ancient Java version in PL/Java 1.6.x docs
jcflack Aug 26, 2023
83f5f5a
Merge trackjdk/REL1_6_STABLE/xmlpropnames into REL1_6_STABLE
jcflack Aug 26, 2023
c4b123f
Comment typos caught after pushing upstream
jcflack Aug 27, 2023
606caf0
Don't mistake SQL for Java
jcflack Aug 29, 2023
df912da
Fix unchecked warning introduced in 5559ba1
jcflack Sep 1, 2023
7de3b99
Merge doc/REL1_6_STABLE/docrot into REL1_6_STABLE
jcflack Sep 5, 2023
bff1d88
Skip handleFirstOptions for javadoc >= 19
jcflack Sep 5, 2023
6a64e91
Improve NEWLINE pattern
jcflack Sep 5, 2023
c9b3473
Javadoc >= 17 rejects non-HTML5 attributes
jcflack Sep 5, 2023
a3ee259
Quiet warnings about casts of function types
jcflack Sep 7, 2023
f2d3d29
Merge into REL1_6_STABLE these pull requests:
jcflack Sep 7, 2023
5e8fa13
Banish recent unchecked warning
jcflack Sep 8, 2023
e511a12
Allow IDX_... gaps in ModelConstants
jcflack Sep 8, 2023
dc62b4e
Regroup and renumber ModelConstants
jcflack Sep 8, 2023
d1e1db3
Pick up SIZEOF_INT via ModelConstants
jcflack Sep 8, 2023
cb71f38
Rename AttNames.andIf to alsoIf
jcflack Sep 9, 2023
0ad93fe
Merge chore/REL1_6_STABLE/funccast into REL1_6_STABLE
jcflack Sep 11, 2023
188b418
Two straggling schema qualifications
jcflack Sep 10, 2023
a0debcd
Merge trackpg/REL1_6_STABLE/pg16 into REL1_6_STABLE
jcflack Sep 16, 2023
4ee2a9d
Allow use of Node with either PGJDBC or pgjdbc-ng
jcflack Sep 17, 2023
2191191
Let stateMachine states make relative moves
jcflack Sep 17, 2023
ffb678f
Close a Node's Connections when stopping it
jcflack Sep 17, 2023
f7d2d5b
Update the documentation for the Node test harness
jcflack Sep 17, 2023
74a8622
Merge feature/REL1_6_STABLE/driverchoice into REL1_6_STABLE
jcflack Sep 19, 2023
117f8e2
Fix message typo in an example
jcflack Sep 19, 2023
2d02ff8
Bump DDRProcessor latest_tested to 21
jcflack Sep 19, 2023
ae29d81
Update releasenotes.md and versions.md
jcflack Sep 19, 2023
2d75992
Poke migration-management versions for 1.6.6
jcflack Sep 19, 2023
5cc90c1
Add control file in preparation for next release
jcflack Sep 19, 2023
c7eea1e
Fix a silly copy/pasto in the release notes
jcflack Sep 19, 2023
070f827
Merge REL1_6_STABLE into master
jcflack Sep 19, 2023
5ba9121
Merge master into REL1_7_STABLE
jcflack Sep 19, 2023
3131af9
Merge branch 'REL1_7_STABLE' into feature/REL1_7_STABLE/model
jcflack Sep 19, 2023
5a21027
Change: update maven plugin versions to work with versions that
fmbiete Sep 21, 2023
f9acf5e
Quit using paired entry points to pass 'trusted'
jcflack Oct 9, 2023
e5dd9f8
Tidy some uses of currentInvocation->function
jcflack Oct 9, 2023
15997b5
check_function_bodies readable from Java
jcflack Oct 9, 2023
19b3c1a
Sundry fixes to CatalogObject implmementations
jcflack Oct 9, 2023
afec77d
Introduce AbstractNoSplitList
jcflack Oct 9, 2023
7faf6c9
Add Identifier.Simple.None
jcflack Oct 9, 2023
57ed135
Distinguish the polymorphic pseudotypes
jcflack Oct 9, 2023
0d65d2b
Add TupleDescImpl.synthesizeDescriptor
jcflack Oct 9, 2023
a061b4e
Interlude: BitSet <-> PostgreSQL bitmapset
jcflack Oct 9, 2023
95fcf8f
TupleTableSlotImpl.NullableDatum
jcflack Oct 9, 2023
08e2079
More invalidation: two more classes, and TupleDesc
jcflack Oct 9, 2023
1ea5bfa
Flesh out the RegProcedure.Memo idea
jcflack Oct 9, 2023
4567117
Give RegType a 'notional' TupleDescriptor
jcflack Oct 9, 2023
93b250c
Add API methods on RegProcedure and memo
jcflack Oct 9, 2023
7af5e94
Interfaces a PL/Java-based language implements
jcflack Oct 9, 2023
95d4133
Add DualState.SingleDeleteGlobalRefP
jcflack Oct 9, 2023
bcd6185
Now put the implementation under it
jcflack Oct 9, 2023
afaeb88
Add example
jcflack Oct 9, 2023
f6f9c61
Merge polyglot into feature/REL1_7_STABLE/model
jcflack Oct 9, 2023
cbfcd09
Restore pre-PG16 buildability (back to PG 13)
jcflack Oct 9, 2023
c327868
Fix added example for library-name diversity
jcflack Oct 9, 2023
fde934c
No doInPG around releaseFromJava
jcflack Oct 17, 2023
f0c81cc
Simplify; the plan reference only keeps it live
jcflack Oct 17, 2023
9a1f669
Copyright year
jcflack Oct 17, 2023
167ff4b
Fix: missing last digit on version
fmbiete Dec 27, 2023
459af26
Update pom.xml for FreeBSD suppost
achix Nov 29, 2023
99a1daa
PR #475 from Achilleas Mantzios rebased
jcflack Mar 25, 2024
02b2421
Merge bug/REL1_6_STABLE/issue471 and port/REL1_6_STABLE/FreeBSD2023
jcflack Mar 25, 2024
e4f91ab
Merge chore/REL1_6_STABLE/mvnplugins2023 into REL1_6_STABLE
jcflack Mar 26, 2024
b32be73
Back to nashorn instead of graaljs for jdk22
jcflack Mar 25, 2024
6da39e1
Use Nashorn external module for all Java >= 15
jcflack Mar 26, 2024
4606b0f
Bump DDRProcessor latest_tested to 22
jcflack Mar 25, 2024
ed38044
Bring the JEP 411 warnings up to date
jcflack Mar 26, 2024
3816e9f
Update copyright
jcflack Mar 26, 2024
9b7d010
Merge trackjdk/REL1_6_STABLE/jdk22bld into REL1_6_STABLE
jcflack Mar 27, 2024
4ac9e8d
Fix Adjusting.XML.setFirstSupported javadoc
jcflack Mar 26, 2024
4986296
Use ALLOW, DENY modes of new jdk.xml.dtd.support
jcflack Mar 27, 2024
4e9d086
Use the IGNORE mode of new jdk.xml.dtd.support
jcflack Mar 27, 2024
746ac5e
Document the jdk.xml.jdkcatalog.resolve property
jcflack Mar 30, 2024
38e46db
Merge trackjdk/REL1_6_STABLE/jdk22usr into REL1_6_STABLE
jcflack Mar 31, 2024
e77d11a
Consistent (SAX/DOM) wrapping of XML parse errors
jcflack Mar 31, 2024
edc958b
Merge bug/REL1_6_STABLE/issue481 into REL1_6_STABLE
jcflack Apr 1, 2024
c3dbb04
Let docs reflect upstream rename of PostgresNode
jcflack Apr 1, 2024
bbb6510
Restore doc buildability after site plugin bump
jcflack Apr 2, 2024
ae0b64e
Add assigned bug ID for Java 22 XML parsing bug
jcflack Apr 2, 2024
5a4e796
Update versions tested in CI scripts
jcflack Apr 3, 2024
6a7495b
Update releasenotes.md and versions.md
jcflack Apr 3, 2024
d8240e0
Poke migration-management versions for 1.6.7
jcflack Apr 3, 2024
8992155
Add control file in preparation for next release
jcflack Apr 3, 2024
5df3520
Merge REL1_6_STABLE into master
jcflack Apr 3, 2024
fb5bf6f
Merge master into REL1_7_STABLE
jcflack Apr 3, 2024
75d93b2
Correct spelling of glot64
jcflack Apr 4, 2024
f072a64
Merge REL1_7_STABLE into feature/REL1_7_STABLE/model
jcflack Apr 4, 2024
dd81b16
Document how to confirm Maven uses the right Java
jcflack Apr 11, 2024
081c93c
Prune doc references to unsupported PG versions
jcflack Apr 11, 2024
02bd1fe
Update hello-world example POM plugin versions
jcflack Apr 12, 2024
66c0b80
Merge doc/REL1_6_STABLE/mvnplugins2023 into REL1_6_STABLE
jcflack Apr 25, 2024
46835bb
Fix build output when no platform rules matched
jcflack Apr 25, 2024
1c0a3ce
Merge bug/REL1_6_STABLE/issue485 into REL1_6_STABLE
jcflack May 5, 2024
5fefcce
macos-latest: now without PostgreSQL
jcflack May 21, 2024
61699f3
Merge chore/REL1_6_STABLE/macos12runner into REL1_6_STABLE
jcflack May 22, 2024
b25fc7c
Report PostgreSQL version found to build against
jcflack Jun 12, 2024
00639c6
Include command/arguments in Maven debug output
jcflack Jun 12, 2024
96a1690
Javadoc/whitespace cleanup and slight refactoring
jcflack Jun 12, 2024
10beea3
Merge feature/REL1_6_STABLE/sodiags into REL1_6_STABLE
jcflack Jun 13, 2024
a3a3927
Hush recent javac annotation-processor warnings
jcflack Jun 14, 2024
3a617a9
Merge chore/REL1_6_STABLE/annprocwarns into REL1_6_STABLE
jcflack Jun 16, 2024
f9e962f
Move javadoc paragraph attached to wrong method
jcflack Jun 16, 2024
278e8c1
Symbols renamed in PostgreSQL v17
jcflack Oct 3, 2024
603197d
Use SPI_restore_connection only in PG < 10
jcflack Oct 3, 2024
95b5962
Bump DDRProcessor latest_tested to 23
jcflack Oct 4, 2024
7ed4918
Bring the JEP 411 warnings up to date
jcflack Oct 4, 2024
3118cf2
Merge trackpg/REL1_6_STABLE/pg17 and trackjdk/REL1_6_STABLE/jdk23bld …
jcflack Oct 5, 2024
2df56f1
Remove more pre-PL/Java-1.6 remnants from docs
jcflack Oct 6, 2024
2fd5391
Merge doc/REL1_6_STABLE/issue385 and doc/REL1_6_STABLE/pg_ge_95 into …
jcflack Oct 19, 2024
471d749
Update releasenotes.md and versions.md
jcflack Oct 19, 2024
ec09b58
Poke migration-management versions for 1.6.8
jcflack Oct 19, 2024
9de9217
Add control file in preparation for next release
jcflack Oct 19, 2024
ac4bc41
Merge REL1_6_STABLE into master
jcflack Oct 21, 2024
d22f3bc
Merge master into REL1_7_STABLE
jcflack Oct 21, 2024
8d48e97
Use pgjdbc rather than pgjdbc-ng in CI
jcflack Feb 18, 2025
0ff417f
Factor out and unify the CI jshell script
jcflack Feb 18, 2025
5ca0ad3
Use new JVM options from JEPs 471 and 472
jcflack Feb 19, 2025
6c8f272
More, necessary, GitHub Actions workflow polishing
jcflack Feb 20, 2025
f2894cd
There's a version of bash that can't ${foo,, ?
jcflack Feb 20, 2025
c5f9ae4
Merge chore/JEP472/gha into trackjdk/REL1_6_STABLE/JEP472
jcflack Feb 20, 2025
39504d2
Merge trackjdk/REL1_6_STABLE/JEP472 into REL1_6_STABLE
jcflack Feb 21, 2025
6527185
java.security.manager=disallow to run unenforced
jcflack Feb 21, 2025
a4ce7fc
Restrict trusted CREATE FUNCTION when unenforced
jcflack Feb 21, 2025
94dbf3c
Add pljava.allow_unenforced configuration setting
jcflack Feb 21, 2025
acdb9d7
Hook JVM abort and exit
jcflack Feb 21, 2025
752ba01
Add pljava.allow_unenforced_udt config setting
jcflack Feb 23, 2025
fa82ade
Document unenforced operation
jcflack Feb 24, 2025
a780da7
Defensively copy system properties
jcflack Feb 24, 2025
192e910
Use defensive system-property copies in examples
jcflack Feb 24, 2025
c4e55d5
Handle defaulted properties in FrozenProperties
jcflack Feb 24, 2025
43ab7c3
Add example code to see Java's boot module layer
jcflack Feb 27, 2025
621505f
Java version vs. java.security.manager settings
jcflack Feb 27, 2025
d28e9fa
Mention how to see Java's module resolution log
jcflack Mar 3, 2025
ea0977f
Merge trackjdk/REL1_6_STABLE/JEP486 into REL1_6_STABLE
jcflack Mar 5, 2025
5096830
Assume javadoc-21 form of URLs into Javadoc
jcflack Mar 5, 2025
e8121ee
Likewise update releasenotes-pre1_6
jcflack Mar 5, 2025
f47a840
Reformat some code
jcflack Mar 7, 2025
194a0f8
Merge chore/REL1_6_STABLE/javadoc21 into REL1_6_STABLE
jcflack Mar 8, 2025
4f5d9d8
Enable CI for Windows MSVC in GitHub Actions
jcflack Mar 8, 2025
4752abf
Also enable MinGW-w64 test with PG from pacman
jcflack Mar 8, 2025
00507e2
Re-enable the whole CI matrix
jcflack Mar 8, 2025
9561c13
Merge chore/REL1_6_STABLE/windowsgha into REL1_6_STABLE
jcflack Mar 9, 2025
49ad1b0
Late JEP486 doc and diagnostic message tweaks
jcflack Mar 10, 2025
c889f65
Check public schema path too in withJarInPath
jcflack Mar 10, 2025
6653a22
Merge bug/REL1_6_STABLE/issue516 into REL1_6_STABLE
jcflack Mar 11, 2025
7d93594
Match implementor non-case-folded form to provider
jcflack Mar 10, 2025
fc16b49
Improve documentation of conditional execution
jcflack Mar 13, 2025
37c9da0
Merge bug/REL1_6_STABLE/issue515 into REL1_6_STABLE
jcflack Mar 14, 2025
594c5fb
Declare S9 example functions only if s9api found
jcflack Mar 14, 2025
237b205
Merge feature/REL1_6_STABLE/classtest into REL1_6_STABLE
jcflack Mar 15, 2025
a067862
Suppress warnings from recent javac versions
jcflack Mar 20, 2025
78f4c25
Bump DDRProcessor latest_tested to 24
jcflack Mar 20, 2025
8f53080
Document Java stack traces and debugger control
jcflack Mar 21, 2025
4670e02
Merge trackjdk/REL1_6_STABLE/jdk24bld into REL1_6_STABLE
jcflack Mar 21, 2025
0d86cb9
Merge doc/REL1_6_STABLE/userdebug into REL1_6_STABLE
jcflack Mar 23, 2025
937489e
Update releasenotes.md and versions.md
jcflack Mar 23, 2025
4d199df
Poke migration-management versions for 1.6.9
jcflack Mar 23, 2025
116fd50
Add control file in preparation for next release
jcflack Mar 23, 2025
02f41ff
Merge REL1_6_STABLE into master
jcflack Mar 24, 2025
7071f03
Merge branch 'master' into REL1_7_STABLE
jcflack Mar 24, 2025
e88bb7b
In Node, construct proper URI from Path
jcflack Mar 24, 2025
b68b84f
Merge master into REL1_7_STABLE
jcflack Mar 24, 2025
c19d049
Merge REL1_7_STABLE into feature/REL1_7_STABLE/model
jcflack Mar 24, 2025
5b4fdf9
Abstract permission checking from Java API
jcflack Mar 24, 2025
18eb26c
PG17: infinitely negative or positive INTERVALs
jcflack Mar 24, 2025
5d2de68
PG17: a new MAINTAIN privilege has been added
jcflack Mar 24, 2025
37fa4e7
JDK23: JDK-8318966: use more direct ByteBuffers
jcflack Mar 26, 2025
bf585ed
Slight polishing of dispatcher
jcflack Mar 26, 2025
5338683
Make better use of memo created during validation
jcflack Mar 26, 2025
0f2d815
Handle atomic / nonatomic indications
jcflack Mar 27, 2025
5e5d532
Windows build issues found in CI
jcflack Mar 27, 2025
473d473
That explains what Windows MSVC complained about
jcflack Mar 27, 2025
56b125a
Update javadoc on essentialChecks and checkBody
jcflack Mar 27, 2025
2cba755
Use Identifier.None and TupleDescImpl.OfType more
jcflack Apr 1, 2025
2539298
Big ol' rework of TargetList / Projection
jcflack Apr 5, 2025
f2899be
Expose CatalogObject to legacy PL/Java type system
jcflack Apr 5, 2025
e1a827b
API for a CatalogObject model of pg_constraint
jcflack Apr 5, 2025
1b733bb
Implementation of Constraint model
jcflack Apr 5, 2025
74f0b51
API for a CatalogObject model of pg_trigger
jcflack Apr 5, 2025
41a7983
Implementation of Trigger model
jcflack Apr 5, 2025
d7d8fdd
API for model of TriggerData call context
jcflack Apr 5, 2025
f03c568
Implementation of TriggerData model
jcflack Apr 5, 2025
cb19333
API for PLJavaBasedLanguage supporting triggers
jcflack Apr 5, 2025
f61d02b
Implementation of dispatching for triggers
jcflack Apr 6, 2025
51f4592
Make Glot64 language example implement triggers
jcflack Apr 5, 2025
62c5132
PG >= 15 works anyway but < 15 needs rel.h
jcflack Apr 6, 2025
d7b1ac6
Builds back through PG13 making this conditional
jcflack Apr 6, 2025
855fe29
Add to Glot64 example to show specialization
jcflack Apr 6, 2025
00aa09c
Remove a straggling import from ConstraintImpl
jcflack Apr 6, 2025
7d74296
Refine javadoc of PLJavaBasedLanguage.Routines
jcflack Apr 6, 2025
17fab97
Better LookupImpl error recovery; some tidying
jcflack Apr 15, 2025
f7d24eb
Let arrays of anyarray type be manipulated
jcflack Apr 25, 2025
c13448d
Use a smarter SwitchPoint in SwitchPointCache
jcflack Apr 25, 2025
927a3b3
API for a CatalogObject model of pg_transform
jcflack Apr 25, 2025
fb77dbd
Implementation of Transform model
jcflack Apr 25, 2025
1a4e9ba
API for handler to learn what transforms needed
jcflack Apr 25, 2025
174dda7
Implement PLJavaBased.transforms() API
jcflack Apr 25, 2025
1d4fce7
Check for UsingTransforms in dispatcher
jcflack Apr 25, 2025
bc6c8ca
Glot64 sample language implements UsingTransforms
jcflack Apr 25, 2025
dbbf1f0
API: separate Memo into Why and How memos
jcflack Apr 25, 2025
93b4cf0
Implement separation of Why and How memos
jcflack Apr 25, 2025
7d58eb7
Better Validator memos, and Handler/InlineHandler
jcflack Apr 25, 2025
5f61ba0
Generalize SupportMemo, start on Transform inval
jcflack Apr 25, 2025
16d6fae
Handle syscache invalidation for Transform
jcflack Apr 25, 2025
b20e97c
Prefer Function for SwitchPointCache initializer
jcflack Apr 25, 2025
6bc6656
Quick return in C syscache callbacks if no work
jcflack Apr 25, 2025
d52775c
Account for untested-because-unNamed catclasses
jcflack Apr 25, 2025
a158542
Move DualState.SingleSPIfreetuptable free action
jcflack Apr 26, 2025
5d9836c
API for PL/Java-based set-returning functions
jcflack May 9, 2025
ef2d1e0
Make DualState.CleanupTracker less restrictive
jcflack May 9, 2025
5a14083
Model PostgreSQL's ExprContext (internal only)
jcflack May 9, 2025
4c7e5d5
Implement set-returning function dispatching (VPC)
jcflack May 9, 2025
ef9ccd7
Add set-returning functions to Glot64 toy language
jcflack May 9, 2025
b8a4e9d
Add package-info.java for polyglot examples
jcflack May 23, 2025
cf4db3c
Handle dims=0 arrays gracefully
jcflack May 24, 2025
6090fa6
Pick a return type for RegClass.options()
jcflack May 24, 2025
7205289
Add some neglected RegClass accessors
jcflack May 25, 2025
99d46b2
Use relcache for tuple descriptor in more cases
jcflack May 25, 2025
9ff0e47
API for four new models reachable from RegClass
jcflack May 25, 2025
cf8aa4c
Implement four models API'd in previous commit
jcflack May 25, 2025
8aaeb04
Accessors in Database and RegClass for new models
jcflack May 25, 2025
d0c95c7
Break up DDRProcessor.java
jcflack May 26, 2025
b2aa816
Fix the two errors javadoc reports in pljava-api
jcflack May 26, 2025
d387386
Fix 9 javadoc errors in o.p.p.internal module
jcflack May 26, 2025
ac75aab
Fix the 3 javadoc errors in pljava-examples
jcflack May 26, 2025
05d8b4e
GetOldestSnapshot -> get_toast_snapshot
jcflack May 26, 2025
fc93da7
Merge doc/REL1_6_STABLE/jdocerrs into REL1_6_STABLE
jcflack May 27, 2025
ddc9348
Merge trackpg/REL1_6_STABLE/pg18 into REL1_6_STABLE
jcflack May 27, 2025
887dab1
Tighten implementation of SnippetTiebreaker
jcflack May 28, 2025
ceacc9a
Pacify MSVC about ereport(ERROR control flow
jcflack May 28, 2025
97137d0
Streamline anachronistic Ptr2Long union usage
jcflack May 28, 2025
1d84996
Set a better JLongGet(... example in DualState.c
jcflack May 28, 2025
bb36661
Merge bug/REL1_6_STABLE/issue527 into REL1_6_STABLE
jcflack May 29, 2025
d7f4cae
Merge chore/REL1_6_STABLE/msvcflow into REL1_6_STABLE
jcflack May 29, 2025
e68610f
Merge trackC/REL1_6_STABLE/PointerGetJLong into REL1_6_STABLE
jcflack May 29, 2025
234afe4
Be more informative about mishandled exceptions
jcflack May 29, 2025
69fc2a2
Hew to upstream's declarations-before-code style
jcflack May 29, 2025
ce467e4
Merge bug/REL1_6_STABLE/issue523 into REL1_6_STABLE
jcflack May 30, 2025
ac10833
Merge REL1_6_STABLE into master
jcflack May 30, 2025
ed47d4d
Merge master into REL1_7_STABLE
jcflack May 30, 2025
fb0791f
Merge REL1_7_STABLE into feature/REL1_7_STABLE/model
jcflack May 30, 2025
8e62acc
Fix new o.p.p.internal module javadoc errors
jcflack May 30, 2025
17a62ab
For PG 18, no more RegCollation.POSIX
jcflack May 30, 2025
a9047d0
attcacheoff is no longer a pg_attribute member
jcflack May 30, 2025
9f9bd20
Expand internals javadoc to package types/members
jcflack May 30, 2025
fe6e7da
Squash one could-be-used-uninitialized warning
jcflack May 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
288 changes: 288 additions & 0 deletions .github/workflows/ci-lazypg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,288 @@
# This workflow will build and test PL/Java against a version of PostgreSQL
# lazily obtained (either preinstalled in the GitHub Actions runner environment,
# or obtained from a package repository if the runner does not provide one).
# Arrange for the matrix to include a pg version, for cases where one must be
# installed.

name: CI lazy getting PostgreSQL

permissions:
contents: read

on:
push:
branches: [ master, REL1_7_STABLE, REL1_6_STABLE ]
pull_request:
branches: [ master, REL1_7_STABLE, REL1_6_STABLE ]

jobs:
build:
if: true

runs-on: ${{ matrix.oscc.os }}
continue-on-error: true
strategy:
matrix:
oscc:
- os: ubuntu-latest
cc: gcc
- os: macos-13
cc: clang
pg: 17
- os: macos-14
cc: clang
pg: 17
- os: windows-latest
cc: msvc
- os: windows-latest
cc: mingw
java: [11, 17, 21, 23]
exclude:
- oscc: {os: windows-latest}
java: 17
- oscc: {os: windows-latest}
java: 23

steps:

- name: Check for JDK preinstalled
id: jdkcheck
shell: bash
env:
JAVAVER: ${{ matrix.java }}
run: |
if
candidate="JAVA_HOME_${JAVAVER}_${RUNNER_ARCH}"
echo -n "Environment contains $candidate? "
[[ -n ${!candidate+set} ]]
then
echo yes
echo >>"$GITHUB_ENV" "JAVA_HOME=${!candidate}"
echo >>"$GITHUB_OUTPUT" java_found=true
elif
candidate="JAVA_HOME_${JAVAVER}_$(tr A-Z a-z <<<${RUNNER_ARCH})"
echo -ne 'no\n'"Environment contains $candidate? "
[[ -n ${!candidate+set} ]]
then
echo yes
echo >>"$GITHUB_ENV" "JAVA_HOME=${!candidate}"
echo >>"$GITHUB_OUTPUT" java_found=true
else
echo -e 'no\n'"only: ${!JAVA_HOME_*}"
echo >>"$GITHUB_OUTPUT" java_found=false
fi

- name: Fetch a JDK
if: ${{ 'false' == steps.jdkcheck.outputs.java_found }}
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b
with:
distribution: temurin
java-version: ${{ matrix.java }}

- name: Compute absolute paths for java and jshell
shell: bash
run: |
if [[ $RUNNER_OS == Windows ]]
then
echo >>"$GITHUB_ENV" "ABS_JAVA=$JAVA_HOME"'\bin\java'
echo >>"$GITHUB_ENV" "ABS_JSHELL=$JAVA_HOME"'\bin\jshell'
else
echo >>"$GITHUB_ENV" "ABS_JAVA=$JAVA_HOME/bin/java"
echo >>"$GITHUB_ENV" "ABS_JSHELL=$JAVA_HOME/bin/jshell"
fi

- name: Set PGCONFIG in environment, getting PostgreSQL if needed (!mingw)
if: ${{ 'mingw' != matrix.oscc.cc }}
shell: bash
env:
PGVER: ${{ matrix.oscc.pg }}
run: |
if [[ $RUNNER_OS == Linux ]]
then
echo >>"$GITHUB_ENV" PGCONFIG=pg_config
elif [[ $RUNNER_OS == Windows ]]
then
echo >>"$GITHUB_ENV" PGCONFIG="$PGBIN"'\pg_config'
elif [[ $RUNNER_OS == macOS ]]
then
echo '::group::brew update'
brew update
echo '::endgroup::'
echo "::group::brew install postgresql@$PGVER"
# HOMEBREW_GITHUB_ACTIONS will suppress the formula's initdb
HOMEBREW_GITHUB_ACTIONS=1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 \
brew install postgresql@"$PGVER"
echo '::endgroup::'
pfx=$(brew --prefix postgresql@"$PGVER")
echo >>"$GITHUB_ENV" PGCONFIG="$pfx/bin/pg_config"
fi

- name: Set PGCONFIG in environment, getting gcc and PostgreSQL (mingw)
if: ${{ 'mingw' == matrix.oscc.cc }}
shell: C:\shells\msys2bash.cmd {0}
run: |
pacman -S --noconfirm \
mingw-w64-x86_64-gcc \
mingw-w64-x86_64-postgresql
echo >>"$GITHUB_ENV" PGCONFIG='c:\msys64\mingw64\bin\pg_config'

- name: Report Java, Maven, and PostgreSQL versions
shell: bash
run: |
"$ABS_JAVA" -version
mvn --version
"$PGCONFIG"

- name: Obtain PG development files (Ubuntu, PGDG)
if: ${{ 'Linux' == runner.os }}
run: |
pgver=$("$PGCONFIG" --version)
pgver=${pgver##PostgreSQL }
pgver=${pgver%% *}
pgver=${pgver%.*}
echo '::group::Install PGDG key and repo'
curl -s -S https://www.postgresql.org/media/keys/ACCC4CF8.asc |
gpg --dearmor |
sudo dd of=/etc/apt/trusted.gpg.d/apt.postgresql.org.gpg
echo \
deb \
http://apt.postgresql.org/pub/repos/apt \
"$(lsb_release -cs)-pgdg" \
main |
sudo tee /etc/apt/sources.list.d/pgdg.list
echo '::endgroup::'
echo '::group::apt-get update'
sudo apt-get update
echo '::endgroup::'
echo "::group::apt-get install postgresql-server-dev-$pgver"
sudo apt-get install postgresql-server-dev-"$pgver" libkrb5-dev
echo '::endgroup::'

- name: Confirm PostgreSQL development files are present
shell: python
run: |
from os import getenv
from os.path import join
from re import sub
from subprocess import check_output

pgconfig = getenv('PGCONFIG')

def ask_pg_config(what):
return check_output([pgconfig, '--'+what]).splitlines()[0]

pgch = join(ask_pg_config('includedir-server'), b'pg_config.h')

with open(pgch, 'r') as f:
line = [ln for ln in f if ln.startswith('#define PG_VERSION_STR ')][0]

vers = sub(r'#define PG_VERSION_STR "(.*)"\n', r'\1', line)

print('PostgreSQL development files are present:', vers, sep='\n')

- name: Check out PL/Java
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
path: pljava

- name: Set plethora of MSVC environment variables (Windows MSVC)
if: ${{ 'Windows' == runner.os && 'msvc' == matrix.oscc.cc }}
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756

- name: Build PL/Java (Windows MSVC)
if: ${{ 'Windows' == runner.os && 'msvc' == matrix.oscc.cc }}
working-directory: pljava
# shell: cmd because of the issue described for ilammy/msvc-dev-cmd
# with Actions bash prepending stuff to the just-carefully-created PATH
shell: cmd
run: |
mvn clean install --batch-mode ^
-Dpgsql.pgconfig="%PGCONFIG%" ^
-Psaxon-examples -Ppgjdbc ^
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn

- name: Build PL/Java (Linux, macOS)
if: ${{ 'Windows' != runner.os }}
working-directory: pljava
run: |
mvn clean install --batch-mode \
-Dpgsql.pgconfig="$PGCONFIG" \
-Psaxon-examples -Ppgjdbc \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn

- name: Build PL/Java (Windows MinGW-w64)
if: ${{ 'Windows' == runner.os && 'mingw' == matrix.oscc.cc }}
working-directory: pljava
shell: C:\shells\msys2bash.cmd {0}
run: |
PATH='/c/msys64/mingw64/bin:'"$PATH"
"$M2"/mvn clean install --batch-mode \
-Dpgsql.pgconfig="$PGCONFIG" \
-Psaxon-examples -Ppgjdbc \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn

- name: Install and test PL/Java
working-directory: pljava
shell: bash
run: |
packageJar=$(find pljava-packaging -name pljava-pg*.jar -print)

mavenRepo="$HOME/.m2/repository"

saxonVer=$(
find "$mavenRepo/net/sf/saxon/Saxon-HE" \
-name 'Saxon-HE-*.jar' -print |
sort |
tail -n 1
)
saxonVer=${saxonVer%/*}
saxonVer=${saxonVer##*/}

jdbcJar=$(
find "$mavenRepo/org/postgresql/postgresql" \
-name 'postgresql-*.jar' -print |
sort |
tail -n 1
)

#
# The runner on a Unix-like OS is running as a non-privileged user, but
# has passwordless sudo available (needed to install the PL/Java files
# into the system directories where the supplied PostgreSQL lives). By
# contrast, on Windows the runner has admin privilege, and can install
# the files without any fuss (but later below, pg_ctl will have to be
# used when starting PostgreSQL; pg_ctl has a Windows-specific ability
# to drop admin privs so postgres will not refuse to start).
#
# The Git for Windows bash environment includes a find command, and the
# things found have unixy paths returned. Make them Windowsy here, with
# a hardcoded assumption they start with /c which should become c: (as
# appears to be the case in the Windows runner currently).
#
echo '::group::Install files from the package jar'
if [[ $RUNNER_OS == Windows ]]
then
pathSep=';'
"$ABS_JAVA" -Dpgconfig="$PGCONFIG" -jar "$packageJar"
function toWindowsPath() {
local p
p="c:${1#/c}"
printf "%s" "${p//\//\\}"
}
jdbcJar="$(toWindowsPath "$jdbcJar")"
mavenRepo="$(toWindowsPath "$mavenRepo")"
else
pathSep=':'
sudo "$ABS_JAVA" -Dpgconfig="$PGCONFIG" -jar "$packageJar"
fi
echo '::endgroup::'

"$ABS_JSHELL" \
-execution local \
"-J--class-path=$packageJar$pathSep$jdbcJar" \
"--class-path=$packageJar" \
"-J--add-modules=java.sql.rowset,jdk.httpserver" \
"-J-Dpgconfig=$PGCONFIG" \
"-J-DmavenRepo=$mavenRepo" \
"-J-DsaxonVer=$saxonVer" \
CI/integration
Loading
Loading