While I'm adding a geometry column in PostGIS by using AddGeometryColumn then the error is
no function matches the given name and argument types. you might need to add explicit type casts
While I'm adding a geometry column in PostGIS by using AddGeometryColumn then the error is
no function matches the given name and argument types. you might need to add explicit type casts
First, as others have said, make sure you have PostGIS installed. Run this command to ensure that you have PostGIS installed,
SELECT postgis_version();
If you don't have postgis_version()
then you need to install PostGIS on the database. If it's not installed, you can try this when connected to the specific database you want to install PostGIS on,
CREATE EXTENSION postgis;
If that fails than you need to install or build PostGIS which then becomes a question of what operating system you're using. If you've got the extension downloaded and installed, run this in psql
\dfS AddGeometryColumn
If that works, then you have the function installed too but you're providing it the wrong types. We need the actual function call. Provide us what you're calling AddGeometryColumn()
with. Also, if your version of PostGIS is newer than 2.0, do not use AddGeometryColumn()
. It is not needed. Instead use the ALTER TABLE ADD COLUMN
with the subtype. Here is an example to add a geometry point in srs 4326.
ALTER TABLE some_table ADD COLUMN geom geometry(Point,4326);
i think because of these error arise from lack of postgis extension of postgres or not proper installation and its dependencies.
you can take more info here about proper installation.
sudo apt-get install pgadmin3 postgresql-9.1-postgis
i hope it helps you...
If PostGIS is properly installed, is the schema you installed the PostGIS functions to in your search path? You can check by using
SHOW search_path;
By default the PostGIS functions are installed in the public schema, so if public's in your search path and you've either installed the PostGIS extension for PostGIS or run the old sql install script then you're probably not providing the correct arguments to AddGeometryColumn. Did you use single quotes around the schema, table, and column names? Did you leave the quotes off when supplying the SRID and dimension arguments?
As per the guides, the best test for determining whether your installation is correct is going to be via CREATE EXTENSION PostGIS;
run from psql or PgAdmin.