Opened 5 years ago

Closed 5 years ago

Last modified 5 years 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 5 years ago.
Patch to fix the bug

Download all attachments as: .zip

Change History (11)

by matti, 5 years ago

Attachment: postgis_restore.pl.patch added

Patch to fix the bug

comment:1 by strk, 5 years ago

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 by matti, 5 years ago

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 by Sandro Santilli <strk@…>, 5 years ago

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 by strk, 5 years ago

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 by Sandro Santilli <strk@…>, 5 years ago

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 by Sandro Santilli <strk@…>, 5 years ago

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 by davis, 5 years ago

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 by Sandro Santilli <strk@…>, 5 years ago

In 3b80f48/git:

Fix switches order for pg_restore

References #4605 in master branch

comment:9 by Sandro Santilli <strk@…>, 5 years ago

In f1795b54/git:

Fix switches order for pg_restore

References #4605 in 3.0 branch

comment:10 by Sandro Santilli <strk@…>, 5 years ago

In a8e0c27/git:

Fix switches order for pg_restore

Closes #4605 again in 2.5 branch

Note: See TracTickets for help on using tickets.