maschinenmensch / edifice

A database of the built environment in Chicago
5 stars 1 forks source link

Errors on running edifice_initialization_script.sql #17

Open mccc opened 11 years ago

mccc commented 11 years ago

See below. This happens when running the

psql -U edifice -h localhost -d edifice -f sql_init_scripts/edifice_initialization_script.sql

part of the script. None of these are showstoppers, the other tables/rules all get created just fine.

  1. The ward27 schema, I have no idea, can't find any reference to that elsewhere..
  2. I'm not sure about the geometry_columns rules. Anyone know how to query rules from the psql shell?
  3. The last set of errors I suspect has to do with the main difference between the setup_edifice.py script and Cory's database, which is that the former tries to ensure that everything is handled by a non-superuser 'edifice' user. Basically, only the postgres superuser would be able to issue those commands to revoke/grant access to schema PUBLIC. Also, those four commands seem to not necessarily be important as the second two invert the first two, so maybe we can just drop them. Some more careful consideration of Cory's use of schemas (overall a good idea) and potential problems with the non-superuser is probably warranted.
psql:sql_init_scripts/edifice_initialization_script.sql:8575: ERROR:  schema "ward27" does not exi
st
LINE 2: ...s_sig2.tif_name, tifs_in_wards_sig2.tot_area FROM ward27.tif...
                                                             ^

psql:sql_init_scripts/edifice_initialization_script.sql:11700: ERROR:  rule "geometry_columns_delete" for relation "geometry_columns" already exists
psql:sql_init_scripts/edifice_initialization_script.sql:11707: ERROR:  rule "geometry_columns_insert" for relation "geometry_columns" already exists
psql:sql_init_scripts/edifice_initialization_script.sql:11714: ERROR:  rule "geometry_columns_update" for relation "geometry_columns" already exists

psql:sql_init_scripts/edifice_initialization_script.sql:12097: WARNING:  no privileges could be revoked for "public"
REVOKE
psql:sql_init_scripts/edifice_initialization_script.sql:12098: WARNING:  no privileges could be revoked for "public"
REVOKE
psql:sql_init_scripts/edifice_initialization_script.sql:12099: WARNING:  no privileges were granted for "public"
GRANT
psql:sql_init_scripts/edifice_initialization_script.sql:12100: WARNING:  no privileges were granted for "public"
mccc commented 11 years ago

Addendum to above: I now know that the current edifice database creates schemas/tables under the username 'cory' -- however I don't know if that user has been granted special permissions. Those permissions for the 'cory' user can, however, probably be checked with sufficient postgres meta-database query wizardry.