[postgis-devel] [raster] Testing out-db and regular blocking

Mateusz Loskot mateusz at loskot.net
Tue Feb 26 07:39:34 PST 2013


On 26 February 2013 15:32, Bborie Park <dustymugs at gmail.com> wrote:
> Ah.  I see what might be going on.  It looks like there's an error
> creating the implicit exclusion index for the
> enforce_spatially_unique_rast constraint.  It looks like postgres
> tries to create the exclusion index with the same name as the
> constraint, but fails as it already exists...
>
> NOTICE:  ALTER TABLE / ADD EXCLUDE will create implicit index
> "enforce_spatially_unique_rast" for table "indb"
> ...
> NOTICE:  Returned error message: relation
> "enforce_spatially_unique_rast" already exists
>
> Confirmed using a simplified test case.  I wonder if this is the
> expected behavior in PostgreSQL.
>
> {{{
> CREATE TABLE foo AS
>         SELECT
>                 id
>         FROM generate_series(1, 5) t(id);
> CREATE TABLE bar AS
>         SELECT
>                 id
>         FROM generate_series(1, 5) t(id);
> ALTER TABLE foo
>         ADD CONSTRAINT enforce_unique_id EXCLUDE (id WITH =);
> ALTER TABLE bar
>         ADD CONSTRAINT enforce_unique_id EXCLUDE (id WITH =);
> }}}

Bborie,

Yes, it looks you've pinned down the problem:

$ raster2pgsql -R -C -r  /home/mloskot/data/geotiff/world.tif t1 > t1.sql
$ psql -d rasters2 -f t1.sql

psql:t1.sql:4: NOTICE:  ALTER TABLE / ADD EXCLUDE will create implicit
index "enforce_spatially_unique_rast" for table "t1"

psql:t1.sql:4: NOTICE:  Unable to add constraint: enforce_spatially_unique_rast

psql:t1.sql:4: NOTICE:  SQL used for failed constraint: ALTER TABLE
public.t1 ADD CONSTRAINT enforce_spatially_unique_rast EXCLUDE
((rast::geometry) WITH =)

psql:t1.sql:4: NOTICE:  Returned error message: relation
"enforce_spatially_unique_rast" already exists

Shall I open a ticket?

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net



More information about the postgis-devel mailing list