the bug is due to the change explained in the following thread: http://archives.postgresql.org/pgsql-hackers/2007-09/msg00933.php using dev-db/postgresql-server-8.3.4 and dev-db/postgresql-base-8.3.4 Reproducible: Always Steps to Reproduce: 1.emerge =dev-db/postgis-1.3.3 2.emerge --config postgis 3. (assuming a working postgresql-server-8.3.x installation) Actual Results: Configuring pkg... * Create or upgrade a spatial template and database. * Using the user postgres and the template_gis template database. * Please do 'export PG_USER=...' to use another user. * Please do 'export PGDATABASE=...' to set another template/database * name (templates name have to be prefixed with 'template'). * * Please hit ENTER if you want to create the template_gis * template database as postgres user, or Control-C to abort now... ERROR: VACUUM cannot be executed from a function or multi-command string * * ERROR: dev-db/postgis-1.3.3 failed. * Call stack: * ebuild.sh, line 49: Called pkg_config * environment, line 2678: Called die * The specific snippet of code: * VACUUM FREEZE;" || die "Unable to create ${mydb}"; * The die message: * Unable to create template_gis * * If you need support, post the topmost build error, and the call stack if relevant. * A complete build log is located at '/var/tmp/portage/dev-db/postgis-1.3.3/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-db/postgis-1.3.3/temp/environment'. * This ebuild is from an overlay: '/var/db/pkg/' * Expected Results: Configuring pkg... * Create or upgrade a spatial template and database. * Using the user postgres and the template_gis template database. * Please do 'export PG_USER=...' to use another user. * Please do 'export PGDATABASE=...' to set another template/database * name (templates name have to be prefixed with 'template'). * * Please hit ENTER if you want to upgrade the template_gis * template database as postgres user, or Control-C to abort now... * Updating the dynamic library references * Running soft upgrade postgis_major_version_check ------------------------------------------ Scripts versions checked for upgrade: ok (1 row) * You can now create a spatial database using : * 'createdb -T template_gis test' here's a patch that fixes the problem. it simply separates the vacuum command to be executed by a separate psql client process. -- /usr/portage/dev-db/postgis/postgis-1.3.3.ebuild 2008-05-21 19:06:55.000000000 +0300 +++ postgis-1.3.3.ebuild 2008-11-15 13:56:02.798131698 +0200 @@ -144,8 +144,8 @@ psql -q -U ${myuser} ${mydb} -c \ "UPDATE pg_database SET datistemplate = TRUE WHERE datname = '${mydb}'; - GRANT ALL ON table spatial_ref_sys, geometry_columns TO PUBLIC; - VACUUM FREEZE;" || die "Unable to create ${mydb}" + GRANT ALL ON table spatial_ref_sys, geometry_columns TO PUBLIC;" || die "Unable to create ${mydb}" + psql -q -U ${myuser} ${mydb} -c "VACUUM FREEZE;" fi else einfo
Created attachment 171797 [details, diff] attaching the messed patch given in the description as a file.
Thanks for your help, your modifications were used in the new 1.3.6 version in the portage tree and also ni the 1.3.3 one.