Reputation: 2185
I have a sql script that creates several tables, a trigger, and a trigger function. All the commands work in pgAdmin when I execute them in the "Query" section. My goal is to put all these commands in a script so that I can set up the database on any machine relatively easily and quickly. When I attempt to run the script through psql, however, I get the following errors on all of the lines where I attempt to use Geography
types:
ERROR: type "geography" does not exist
It doesn't make sense because I can copy and paste the exact same queries into the query editor of pgAdmin and it works just fine. Does psql not support PostGIS? Or maybe just not the most recent version of PostGIS, 1.5.3, which includes the new Geography
types? Is there something I can do to fix this?
EDIT
An example of one of my queries:
CREATE TABLE source_imagery (
id SERIAL PRIMARY KEY,
image_type VARCHAR(1000),
image_path VARCHAR(1000),
boundary GEOGRAPHY(POLYGON, 4326),
image_time TIMESTAMP,
catalog_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Error message:
ERROR: type "geography" does not exist
LINE 5: boundary GEOGRAPHY(POLYGON, 4326),
^
Upvotes: 2
Views: 347
Reputation: 949
You can try to use the same psql that pgAdmin uses by pointing directly at it. On Mac OS X it is in pgAdmin3.app/Contents/SharedSupport/psql. However, what really matters is the version of the server (not the version of the client). You should verify that you are connecting to the same database in both cases.
Upvotes: 1