I am running python tests like this.
python manage.py test
.....
[snip]
.....
LINE 1: SELECT (idx([snip])...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
I am on ubuntu, with postgres 9.1, and Django 1.5.x, I am also using nose.
So my tests can't find the idx function.
I have installed the intarray extension, which has the idx
functions. I can verify it by:
psql (9.1.10)
Type "help" for help.
postgres=# use template1
postgres-# \dx
List of installed extensions
Name | Version | Schema | Description
----------+---------+------------+--------------------------------------------------------------------
hstore | 1.0 | public | data type for storing sets of (key, value) pairs
intarray | 1.0 | public | functions, operators, and index support for 1-D arrays of integers
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(3 rows)
postgres-# use template_postgis;
ERROR: syntax error at or near "use"
LINE 1: use template1
^
postgres=# use template_postgis
postgres-# \dx
List of installed extensions
Name | Version | Schema | Description
----------+---------+------------+--------------------------------------------------------------------
hstore | 1.0 | public | data type for storing sets of (key, value) pairs
intarray | 1.0 | public | functions, operators, and index support for 1-D arrays of integers
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(3 rows)
postgres-#
This code runs correctly with my dev environment. (Using the same postgres install, but which also has intarray).
It looks this issue was solved in:
Installing hstore extension in django nose tests
But I have tried the steps in that question with no help.