Thread: Re: PL/Java 1.5.2 - fixes one regression in date conversion in 1.5.1
Hi, If I'm checking in the right place https://yum.postgresql.org/11/redhat/rhel-7.5-x86_64/ ... the version of PL/Java that I'm seeing there is still 1.5.1. Please forgive this repeat announcement if the 1.5.2 package is already in the works. It would be valuable to have 1.5.2 packaged, because it fixes a known bug in java.sql.Date conversion that was in 1.5.1. Thanks! -Chap On 11/05/18 13:35, Chapman Flack wrote: > --- > Note to packagers - please make sure the newly-added file > $sharedir/pljava/pljava--1.5.1--1.5.2.sql will be installed, alongside > those from prior releases. It is found in the > pljava-packaging/target/pljava-*.jar file but not in any build directory (it > gets added > synthetically to the jar file based on a template). > --- > > > PL/Java 1.5 brings functions, triggers, and types in Java to PostgreSQL > releases from 11 back to 8.2. Release 1.5.2 fixes a regression in 1.5.1 > that affected the conversion of PostgreSQL date values to Java java.sql.Date > objects. > > Project site: http://tada.github.io/pljava/ > Release notes: http://tada.github.io/pljava/releasenotes.html > > ## Change > > Before 1.5.1, PostgreSQL date, time, and timestamp values could be accessed > in PL/Java as java.sql.Date, java.sql.Time, and java.sql.Timestamp objects. > PL/Java 1.5.1 added the option of accessing those values as objects of new > classes in the Java 8+ java.time package. The new classes are recommended as > a superior API for accessing dates, times, and timestamps. > > However, one regression resulted in the older conversion between PostgreSQL > date and java.sql.Date, leading to an error of one day for some dates of the > year in some time zones. Release 1.5.2 restores the former behavior. > > Please see the release notes for more complete information. > > Availability: > > 1.5.2 is available from GitHub as a source release, which builds quickly > using Maven: > > Release page: https://github.com/tada/pljava/releases/tag/V1_5_2 > > This wiki page will add links to prebuilt packages that become available: > https://github.com/tada/pljava/wiki/Prebuilt-packages >
Hi Chapman, On Tue, 2019-01-01 at 00:04 -0500, Chapman Flack wrote: > If I'm checking in the right place > https://yum.postgresql.org/11/redhat/rhel-7.5-x86_64/ > > ... the version of PL/Java that I'm seeing there is still 1.5.1. > > Please forgive this repeat announcement if the 1.5.2 package is already > in the works. It would be valuable to have 1.5.2 packaged, because it > fixes a known bug in java.sql.Date conversion that was in 1.5.1. Updated to 1.5.2 yesterday. Sorry for the delay. Regards, -- Devrim Gündüz EnterpriseDB: https://www.enterprisedb.com PostgreSQL Consultant, Red Hat Certified Engineer Twitter: @DevrimGunduz , @DevrimGunduzTR
Attachment
On 1/2/19 2:04 PM, Devrim Gündüz wrote: > > Updated to 1.5.2 yesterday. Sorry for the delay. That was fast, thanks! ... but it does not have these files: usr/pgsql-*/share/pljava/pljava--1.5.0--1.5.2.sql usr/pgsql-*/share/pljava/pljava--1.5.1--1.5.2.sql Without those files, ALTER EXTENSION pljava UPDATE; will fail for sites that have 1.5.0 or 1.5.1 installed already. The build process puts such files directly into the installer jar, as copies of pljava--.sql with the right names. Your packaging process seems to bypass the installer jar, so will have to be responsible for making those files. It could make the needed copies or links at build time, or even just include one of them and make the remaining copies/links on the target system in a post-install script. More on that (and also on debuginfo and examples) was in [1]. Thanks, -Chap [1] https://www.postgresql.org/message-id/5BC924A4.7080709%40anastigmatix.net
Hi Chapman, On Wed, 2019-01-02 at 14:34 -0500, Chapman Flack wrote: > ... but it does not have these files: > > usr/pgsql-*/share/pljava/pljava--1.5.0--1.5.2.sql > usr/pgsql-*/share/pljava/pljava--1.5.1--1.5.2.sql I actually committed it a few mins ago :) https://git.postgresql.org/gitweb/?p=pgrpms.git;a=commit;h=00dc4f440d958eb464615602ccb9e51cc83630ef > Without those files, ALTER EXTENSION pljava UPDATE; will fail > for sites that have 1.5.0 or 1.5.1 installed already. > > The build process puts such files directly into the installer jar, > as copies of pljava--.sql with the right names. > > Your packaging process seems to bypass the installer jar, so will > have to be responsible for making those files. It could make the > needed copies or links at build time, or even just include one > of them and make the remaining copies/links on the target system > in a post-install script. > More on that (and also on debuginfo and examples) was in [1]. They are already in 1.5.2-1. Pushed 1.5.2-2 to repos, that include the .sql files. Thanks! Regards, -- Devrim Gündüz EnterpriseDB: https://www.enterprisedb.com PostgreSQL Consultant, Red Hat Certified Engineer Twitter: @DevrimGunduz , @DevrimGunduzTR
Attachment
On 1/2/19 2:45 PM, Devrim Gündüz wrote: >> More on that (and also on debuginfo and examples) was in [1]. > > They are already in 1.5.2-1. > > Pushed 1.5.2-2 to repos, that include the .sql files. Ah, there they are. Thanks! -Chap
On 1/2/19 5:09 PM, Chapman Flack wrote: > On 1/2/19 2:45 PM, Devrim Gündüz wrote: > >>> More on that (and also on debuginfo and examples) was in [1]. >> >> They are already in 1.5.2-1. >> >> Pushed 1.5.2-2 to repos, that include the .sql files. > > Ah, there they are. Thanks! It turns out to be almost right. The update .sql files appear to be links to pljava--1.5.2.sql, but that is the file used for a new installation. ALTER EXTENSION UPDATE fails if that file is used. There is a file in the source tree named pljava--.sql and that one is the template for all (trivial) update scripts. The installer jar produced by the build process simply includes that file under all of the necessary update script names (and not under its own name). It would be possible to do that, or to make one of the named update scripts a copy of it and the rest all links to that one, etc. Sorry for the unexpected structure. -Chap
On 01/03/19 11:25, Chapman Flack wrote: >> On 1/2/19 2:45 PM, Devrim Gündüz wrote: >>> Pushed 1.5.2-2 to repos, that include the .sql files. > > It turns out to be almost right. The update .sql files appear > to be links to pljava--1.5.2.sql, but that is the file used for > a new installation. ALTER EXTENSION UPDATE fails if that file is used. > > There is a file in the source tree named pljava--.sql and that > one is the template for all (trivial) update scripts. The > installer jar produced by the build process simply includes that > file under all of the necessary update script names (and not > under its own name). > > It would be possible to do that, or to make one of the named > update scripts a copy of it and the rest all links to that one, > etc. Can this be fixed? As it stands in 1.5.2-2, ALTER EXTENSION UPDATE still breaks. Thanks, -Chap
Ping? On 1/10/19 8:50 AM, Chapman Flack wrote: > On 01/03/19 11:25, Chapman Flack wrote: >>> On 1/2/19 2:45 PM, Devrim Gündüz wrote: >>>> Pushed 1.5.2-2 to repos, that include the .sql files. >> >> It turns out to be almost right. The update .sql files appear >> to be links to pljava--1.5.2.sql, but that is the file used for >> a new installation. ALTER EXTENSION UPDATE fails if that file is used. >> >> There is a file in the source tree named pljava--.sql and that >> one is the template for all (trivial) update scripts. The >> installer jar produced by the build process simply includes that >> file under all of the necessary update script names (and not >> under its own name). >> >> It would be possible to do that, or to make one of the named >> update scripts a copy of it and the rest all links to that one, >> etc. > > Can this be fixed? As it stands in 1.5.2-2, ALTER EXTENSION UPDATE > still breaks. > > Thanks, > -Chap >
Hi Chapman, On Tue, 2019-01-22 at 11:05 -0500, Chapman Flack wrote: > Ping? Ack. Apologies. Will look soon. Cheers, -- Devrim Gündüz Open Source Solution Architect, Red Hat Certified Engineer Twitter: @DevrimGunduz , @DevrimGunduzTR
Attachment
Ping? On 1/10/19 8:50 AM, Chapman Flack wrote: > On 01/03/19 11:25, Chapman Flack wrote: >>> On 1/2/19 2:45 PM, Devrim Gündüz wrote: >>>> Pushed 1.5.2-2 to repos, that include the .sql files. >> >> It turns out to be almost right. The update .sql files appear >> to be links to pljava--1.5.2.sql, but that is the file used for >> a new installation. ALTER EXTENSION UPDATE fails if that file is used. >> >> There is a file in the source tree named pljava--.sql and that >> one is the template for all (trivial) update scripts. The >> installer jar produced by the build process simply includes that >> file under all of the necessary update script names (and not >> under its own name). >> >> It would be possible to do that, or to make one of the named >> update scripts a copy of it and the rest all links to that one, >> etc. > > Can this be fixed? As it stands in 1.5.2-2, ALTER EXTENSION UPDATE > still breaks. > > Thanks, > -Chap
Ping? On 1/10/19 8:50 AM, Chapman Flack wrote: > On 01/03/19 11:25, Chapman Flack wrote: >>> On 1/2/19 2:45 PM, Devrim Gündüz wrote: >>>> Pushed 1.5.2-2 to repos, that include the .sql files. >> >> It turns out to be almost right. The update .sql files appear >> to be links to pljava--1.5.2.sql, but that is the file used for >> a new installation. ALTER EXTENSION UPDATE fails if that file is used. >> >> There is a file in the source tree named pljava--.sql and that >> one is the template for all (trivial) update scripts. The >> installer jar produced by the build process simply includes that >> file under all of the necessary update script names (and not >> under its own name). >> >> It would be possible to do that, or to make one of the named >> update scripts a copy of it and the rest all links to that one, >> etc. > > Can this be fixed? As it stands in 1.5.2-2, ALTER EXTENSION UPDATE > still breaks. > > Thanks, > -Chap
Hi Chapman, On Tue, 2019-02-26 at 13:38 -0500, Chapman Flack wrote: > Ping? How does it look now? # ll *sql lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.0--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.0-BETA1--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.0-BETA2--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.0-BETA3--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.1--1.5.2.sql -> /usr/pgsql-11/share/pljava/pljava--.sql lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.1-BETA1--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.1-BETA2--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.1-BETA3--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql -rw-r--r-- 1 root root 3228 Feb 26 22:13 pljava--1.5.2.sql -rw-r--r-- 1 root root 2433 Feb 26 22:13 pljava--.sql -rw-r--r-- 1 root root 3580 Feb 26 22:13 pljava--unpackaged--1.5.2.sql Regards, -- Devrim Gündüz Open Source Solution Architect, Red Hat Certified Engineer Twitter: @DevrimGunduz , @DevrimGunduzTR
Attachment
On 2/26/19 2:16 PM, Devrim Gündüz wrote: > How does it look now? > > # ll *sql > lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.0--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql > lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.0-BETA1--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql > lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.0-BETA2--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql > lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.0-BETA3--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql > lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.1--1.5.2.sql -> /usr/pgsql-11/share/pljava/pljava--.sql > lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.1-BETA1--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql > lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.1-BETA2--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql > lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.1-BETA3--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql > -rw-r--r-- 1 root root 3228 Feb 26 22:13 pljava--1.5.2.sql > -rw-r--r-- 1 root root 2433 Feb 26 22:13 pljava--.sql > -rw-r--r-- 1 root root 3580 Feb 26 22:13 pljava--unpackaged--1.5.2.sql Hi Devrim, Thanks for taking a look ... that's better, with one complication, though. It has links for updating 150-BETA* to 150, 151-BETA* and 150 to 151, 151-BETA* and 151 to 152, which would be the typical arrangement for a typical extension, and would cause PostgreSQL to automatically apply multiple scripts in sequence. The multiple script sequence won't work in PL/Java though, because the updating work is really done inside PL/Java at its own startup, which can't be repeated over a single backend connection. (You have seen that they are all links to one script, which does nothing but store the library pathname and exnihilo=false (indicating update) in a table and LOAD the library, which unconditionally applies any schema updates needed to match its own version. PostgreSQL itself treats later LOADs of the same library as no-ops, so I couldn't make the multiple-script sequence work if I wanted to). This is sort of an imperfect fit with the PG extension conventions, but PL/Java 1.5.x still supports PG versions older than the extension feature, so updating has to be easy for them too. So the intent for packaging is to include a link pljava--foo--1.5.2.sql for every plausible prior version foo, so PostgreSQL will choose a one-script update path no matter which prior version is installed. The actual files placed into an "official" build can be found starting here: https://github.com/tada/pljava/blob/REL1_5_STABLE/pljava-packaging/build.xml#L280 Thanks! -Chap
Hi Devrim, I assume it's straightforward to change the symlinks to have the right names? Regards, -Chap On 2/26/19 4:18 PM, Chapman Flack wrote: > On 2/26/19 2:16 PM, Devrim Gündüz wrote: >> How does it look now? >> >> # ll *sql >> lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.0--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql >> lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.0-BETA1--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql >> lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.0-BETA2--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql >> lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.0-BETA3--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql >> lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.1--1.5.2.sql -> /usr/pgsql-11/share/pljava/pljava--.sql >> lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.1-BETA1--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql >> lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.1-BETA2--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql >> lrwxrwxrwx 1 root root 39 Feb 26 22:13 pljava--1.5.1-BETA3--1.5.1.sql -> /usr/pgsql-11/share/pljava/pljava--.sql >> -rw-r--r-- 1 root root 3228 Feb 26 22:13 pljava--1.5.2.sql >> -rw-r--r-- 1 root root 2433 Feb 26 22:13 pljava--.sql >> -rw-r--r-- 1 root root 3580 Feb 26 22:13 pljava--unpackaged--1.5.2.sql > > Hi Devrim, > > Thanks for taking a look ... that's better, with one complication, though. > > It has links for updating 150-BETA* to 150, 151-BETA* and 150 to 151, > 151-BETA* and 151 to 152, which would be the typical arrangement for a > typical extension, and would cause PostgreSQL to automatically apply > multiple scripts in sequence. > > The multiple script sequence won't work in PL/Java though, because > the updating work is really done inside PL/Java at its own startup, > which can't be repeated over a single backend connection. > (You have seen that they are all links to one script, which does > nothing but store the library pathname and exnihilo=false (indicating > update) in a table and LOAD the library, which unconditionally applies > any schema updates needed to match its own version. PostgreSQL itself > treats later LOADs of the same library as no-ops, so I couldn't > make the multiple-script sequence work if I wanted to). > > This is sort of an imperfect fit with the PG extension conventions, > but PL/Java 1.5.x still supports PG versions older than the extension > feature, so updating has to be easy for them too. > > So the intent for packaging is to include a link pljava--foo--1.5.2.sql > for every plausible prior version foo, so PostgreSQL will choose > a one-script update path no matter which prior version is installed. > > The actual files placed into an "official" build can be found > starting here: > > https://github.com/tada/pljava/blob/REL1_5_STABLE/pljava-packaging/build.xml#L280 > > Thanks! > -Chap >