Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#4605 closed defect (fixed)

perl /usr/pgsql-12/share/contrib/postgis-3.0/postgis_restore.pl fails with error pg_restore: error: one of -d/--dbname and -f/--file must be specified

Reported by: matti Owned by: strk
Priority: medium Milestone: PostGIS 3.0.1
Component: postgis Version: 3.0.x
Keywords: Cc:

Description

perl /usr/pgsql-12/share/contrib/postgis-3.0/postgis_restore.pl fails with error pg_restore: error: one of -d/--dbname and -f/--file must be specified The calls of pg_restore are missing options -f - I followed Hard upgrade according to the document https://postgis.net/docs/manual-3.0/postgis_installation.html#hard_upgrade I am using Red Hat Enterprise Linux 8 and RPM packages from postgresql.org repository.

Attachments (1)

postgis_restore.pl.patch (969 bytes) - added by matti 3 months ago.
Patch to fix the bug

Download all attachments as: .zip

Change History (11)

Changed 3 months ago by matti

Attachment: postgis_restore.pl.patch added

Patch to fix the bug

comment:1 Changed 3 months ago by strk

Hi, any chance to test your patch against an earlier version of PostgreSQL ? It looks like you have been using PostgreSQL-12, which is pretty new. We want PostGIS 3.0 to support PostgreSQL from version 9.5 onward (PostGIS 2.5 should support also PostgreSQL 9.4)

See: https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS

comment:2 Changed 3 months ago by matti

PostgreSQL 9.4 and 9.5 seem to support the -f - option and it is the default. https://www.postgresql.org/docs/9.4/app-pgrestore.html https://www.postgresql.org/docs/9.5/app-pgrestore.html

comment:3 Changed 3 months ago by Sandro Santilli <strk@…>

In cbf2cb1/git:

Fix postgis_restore.pl for use with PostgreSQL 12

Retains compatibilty with PostgreSQL 9.4 onward
(PostgreSQL 9.3 would break)

See https://www.postgresql.org/docs/VERSION/app-pgrestore.html

Patch by Matti Linnanvuori

References #4605 in master branch

comment:4 Changed 3 months ago by strk

Owner: changed from pramsey to strk
Status: newassigned

Thanks, I'll backport in all braches down to 2.5 then (first one to support PostgreSQL 12)

comment:5 Changed 3 months ago by Sandro Santilli <strk@…>

In cd33bc5/git:

Fix postgis_restore.pl for use with PostgreSQL 12

Retains compatibilty with PostgreSQL 9.4 onward
(PostgreSQL 9.3 would break)

See https://www.postgresql.org/docs/VERSION/app-pgrestore.html

Patch by Matti Linnanvuori

References #4605 in master branch

comment:6 Changed 3 months ago by Sandro Santilli <strk@…>

Resolution: fixed
Status: assignedclosed

In e14749c/git:

Fix postgis_restore.pl for use with PostgreSQL 12

Retains compatibilty with PostgreSQL 9.4 onward
(PostgreSQL 9.3 would break)

See https://www.postgresql.org/docs/VERSION/app-pgrestore.html

Patch by Matti Linnanvuori

Closes #4605 in 2.5 branch

comment:7 Changed 3 months ago by davis

Row 148 should be

open( INPUT, "pg_restore -f - -L $manifest $dumpfile |") || die "$me:\tCan't run pg_restore\n";

not

open( INPUT, "pg_restore -L $manifest $dumpfile -f - |") || die "$me:\tCan't run pg_restore\n";

comment:8 Changed 3 months ago by Sandro Santilli <strk@…>

In 3b80f48/git:

Fix switches order for pg_restore

References #4605 in master branch

comment:9 Changed 3 months ago by Sandro Santilli <strk@…>

In f1795b54/git:

Fix switches order for pg_restore

References #4605 in 3.0 branch

comment:10 Changed 3 months ago by Sandro Santilli <strk@…>

In a8e0c27/git:

Fix switches order for pg_restore

Closes #4605 again in 2.5 branch

Note: See TracTickets for help on using tickets.