{"issue":{"created_at":"2011-12-15T09:12:40Z","state":"closed","updated_at":"2011-12-15T16:33:13Z","user":{"gravatar_id":"99d5ef2d7a453192340ca2c8adc21aa9","id":1178055,"url":"https://api.github.com/users/kirantpatil","avatar_url":"https://secure.gravatar.com/avatar/99d5ef2d7a453192340ca2c8adc21aa9?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"kirantpatil"},"comments":1,"body":"System Information:\r\n--------------------------\r\nFedora Linux 15\r\n\r\n[akshatha@localhost reconnoiter]$ postgres --version\r\npostgres (PostgreSQL) 9.0.6\r\n\r\nEarlier I tried to run the scaffolding.sql using psql, it gave me error, so I reordered the scaffolding.sql file content as follows,\r\n\r\nsnippet of scaffolding.sql file\r\n-------------------------------------------\r\ncreate user reconnoiter;\r\ncreate database reconnoiter with owner = reconnoiter;\r\ncreate user stratcon with encrypted password 'stratcon';\r\ncreate user prism with encrypted password 'prism';\r\n\\c reconnoiter reconnoiter;\r\n\r\ncreate language plpgsql;\r\ncreate schema noit;\r\ncreate schema stratcon;\r\ncreate schema prism;\r\nalter user stratcon set search_path to noit,public;\r\nalter user prism set search_path to noit,public;\r\n\r\nbegin;\r\n\r\ngrant usage on schema stratcon to stratcon;\r\ngrant usage on schema stratcon to prism;\r\ngrant usage on schema noit to stratcon;\r\ngrant usage on schema noit to prism;\r\ngrant usage on schema prism to prism;\r\n\r\n------------------------------------------------------------------------------------\r\n\r\nI am getting psql:scaffolding.sql:11: ERROR:  permission denied error on line 11 and 12 which are,\r\nalter user stratcon set search_path to noit,public;\r\nalter user prism set search_path to noit,public;\r\n\r\nExcept those two errors, the rest of scaffolding.sql installs properly.\r\n\r\nError Output:\r\n------------------\r\n-bash-4.2$ psql\r\npsql (9.0.6)\r\nType \"help\" for help.\r\n\r\npostgres=# \\i scaffolding.sql \r\npsql:scaffolding.sql:1: ERROR:  role \"reconnoiter\" already exists\r\npsql:scaffolding.sql:2: ERROR:  database \"reconnoiter\" already exists\r\npsql:scaffolding.sql:3: ERROR:  role \"stratcon\" already exists\r\npsql:scaffolding.sql:4: ERROR:  role \"prism\" already exists\r\nYou are now connected to database \"reconnoiter\" as user \"reconnoiter\".\r\npsql:scaffolding.sql:7: ERROR:  language \"plpgsql\" already exists\r\nCREATE SCHEMA\r\nCREATE SCHEMA\r\nCREATE SCHEMA\r\npsql:scaffolding.sql:11: ERROR:  permission denied\r\npsql:scaffolding.sql:12: ERROR:  permission denied\r\nBEGIN\r\nGRANT\r\nGRANT\r\nGRANT\r\nGRANT\r\nGRANT\r\nCREATE FUNCTION\r\n","assignee":null,"id":2564479,"number":37,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[],"title":"psql:scaffolding.sql:11: ERROR:  permission denied for database operation \"alter user stratcon set search_path to noit,public;\"","html_url":"https://github.com/omniti-labs/reconnoiter/issues/37","closed_at":"2011-12-15T16:33:13Z","url":"https://api.github.com/repos/omniti-labs/reconnoiter/issues/37","milestone":null},"action":"created","comment":{"created_at":"2011-12-15T16:33:13Z","updated_at":"2011-12-15T16:33:13Z","user":{"gravatar_id":"99d5ef2d7a453192340ca2c8adc21aa9","id":1178055,"url":"https://api.github.com/users/kirantpatil","avatar_url":"https://secure.gravatar.com/avatar/99d5ef2d7a453192340ca2c8adc21aa9?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"kirantpatil"},"body":"Earlier I enabled trust for only local.\r\n\r\nNow I enabled trust for host and the db connection happens.\r\n\r\n/var/lib/pgsql/data/pg_hba.conf snippet:\r\n-------------------------------------------------------\r\n# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD\r\n\r\n# \"local\" is for Unix domain socket connections only\r\n# local   all             all                                     ident\r\n# local   all             all                                     trust\r\n# IPv4 local connections:\r\n# host    all             all             127.0.0.1/32            ident\r\n host    all             all             127.0.0.1/32            trust\r\n# IPv6 local connections:\r\nhost    all             all             ::1/128                 ident","id":3164898,"url":"https://api.github.com/repos/omniti-labs/reconnoiter/issues/comments/3164898"}}