Bug 255969 - www/hs-postgrest: Added an option for support database connection poolers and small cleanup
Summary: www/hs-postgrest: Added an option for support database connection poolers and...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Li-Wen Hsu
Depends on:
Reported: 2021-05-18 09:38 UTC by Dmitry Wagin
Modified: 2021-06-19 09:56 UTC (History)
1 user (show)

See Also:

hs-postgrest.diff (3.78 KB, patch)
2021-05-18 09:38 UTC, Dmitry Wagin
dmitry.wagin: maintainer-approval+
Details | Diff
hs-postgrest.patch (4.56 KB, patch)
2021-06-02 13:17 UTC, Dmitry Wagin
dmitry.wagin: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Wagin 2021-05-18 09:38:56 UTC
Created attachment 225058 [details]

- Added a POOLER option for support connection poolers (like PgBouncer, Odyssey, etc) in transaction mode. The option disables usage of prepared statements.

- Moved a plist from pkg-plist to Makefile.

- Added nginx before-condition to rc-script.

Some discussions about this:


Comment 1 Dmitry Wagin 2021-06-01 08:58:23 UTC
Comment 2 Li-Wen Hsu freebsd_committer 2021-06-02 08:27:27 UTC
(In reply to Dmitry Wagin from comment #1)
I got this:

===>  Patching for hs-postgrest-7.0.1_4
===>  Applying extra patch /usr/ports/www/hs-postgrest/files/extra-patch-hasql-1.4.2_library_Hasql_Private_IO.hs
No file to patch.  Skipping...
1 out of 1 hunks ignored--saving rejects to hasql-1.4.2/library/Hasql/Private/IO.hs.rej
Can't create hasql-1.4.2/library/Hasql/Private/IO.hs.rej, output is in /tmp/patchrq64xKQVnY9: No such file or directory
===>  FAILED Applying extra patch /usr/ports/www/hs-postgrest/files/extra-patch-hasql-1.4.2_library_Hasql_Private_IO.hs

Can you help to check this one?

BTW, if possible, please submit the patch with `git format-patch` which is easier for committer and other tools to apply. It's preferred but not strict requirement.

Comment 3 Dmitry Wagin 2021-06-02 13:17:20 UTC
Created attachment 225498 [details]

The problem has been occurred after 1db88699b09ff53bf0029cb8a01dad1e7f646a4c ( https://cgit.freebsd.org/ports/commit/?id=1db88699b09ff53bf0029cb8a01dad1e7f646a4c )
Comment 4 Dmitry Wagin 2021-06-15 09:21:26 UTC
Comment 5 Li-Wen Hsu freebsd_committer 2021-06-15 16:08:42 UTC
Testing in my poudriere.
Comment 6 Li-Wen Hsu freebsd_committer 2021-06-16 06:38:31 UTC
Is this part also necessary? nginx isn't listed as a dependency of this port:

diff --git a/www/hs-postgrest/files/postgrest.in b/www/hs-postgrest/files/postgrest.in
index 7dac382dd80a..7ad89ce8615a 100644
--- a/www/hs-postgrest/files/postgrest.in
+++ b/www/hs-postgrest/files/postgrest.in
@@ -2,6 +2,7 @@
 # PROVIDE: postgrest
+# BEFORE: nginx
 # KEYWORD: shutdown
 # Add postgrest_enable="YES" to /etc/rc.conf to enable PostgREST:
Comment 7 Dmitry Wagin 2021-06-16 13:49:16 UTC
(In reply to Li-Wen Hsu from comment #6)

In most cases PostgREST (as a backend) are used with nginx (as a frontend). This change avoids race conditions at the start and stop.
Comment 8 commit-hook freebsd_committer 2021-06-19 09:56:45 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a45ed18ebabb5a37a5b3552bb1acda8d6f285721

commit a45ed18ebabb5a37a5b3552bb1acda8d6f285721
Author:     Dmitry Wagin <dmitry.wagin@ya.ru>
AuthorDate: 2021-06-02 11:45:46 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2021-06-19 09:54:12 +0000

    www/hs-postgrest: Added an option for support database connection poolers

    Small cleanups included

    PR:             255969

 www/hs-postgrest/Makefile                          | 33 +++++++++++++---------
 ...s_hasql-1.4.2_library_Hasql_Private_IO.hs (new) | 13 +++++++++
 www/hs-postgrest/files/postgrest.in                |  1 +
 www/hs-postgrest/pkg-plist (gone)                  |  2 --
 4 files changed, 34 insertions(+), 15 deletions(-)