The context is pertinent as it demonstrates behaviour different than other (more manual) successful attempts.
Deploying a rails application with postgres and postgis extension to AWS EC2 instance, using the rubber gem, database migration initiates but halts with
undefined method 'point' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter: is being generated when reaching
t.point :lonlat, :srid => 3785
This is indicative of the extension not being accessed.
The database is created with user postgres (and I surmise this may be an initial problem, leading to permissions issues). When logging in as postgres and access psql for the database,
CREATE SCHEMA postgis; and
CREATE EXTENSION PostGIS WITH SCHEMA postgis; return errors because they already exist. So the extension is installed.
SELECT PostGIS_full_version(); fails. I have found by trial and error that
SET search_path = public, postgis; will activate PostGIS_full_version. However, even when activated, if a database migration is launched immediately after as ubuntu user, it fails just as well; thus the extension is not accessible (or the search_path is not granted to all).
I have also found that after a
sudo service postgresql restart the
SELECT PostGIS_full_version(); fails anew for the postgres user.
Behaviour is consistent between 9.3 and 9.4
How can the search_path be persistent and available across users?
[note: question posted to this site as the hunch is that it is a postgresql user permission and object access issue]