This can be done via Studio or pgAdmin |||III
Using Studio
- Expand the Jobs node, right click on Unassigned tasks and select New Task.
- Create a Workflow Stored Procedure Task and give it a Name e.g. Create SDW User.
- Select the Spatial Data Warehouse Connection, Click on the All radio button and select the Function astun.sdw_new_user. From v6.0.0 select astun from the Function filter and pick sdw_new_user.
Select the username parameter and enter the name of the user you wish to create by typing in the Edit parameter 'username' box. Repeat for the password and makeadmin (which should be false) parameters e.g.
Note Ensure makeadmin is false.
- Click the Run button to run the task. You should see the dialog SPTask 'Create SDW User' completed successfully. Click OK
- Click Save to save your new task details.
- Create a second stored procedure task second Stored Procedure Task and give it a Name e.g. All database connection for User.
- Select the Spatial Data Warehouse Connection. Select Workflow from the Function filter and pick wkf_executecmd.
Provide the following SQL as the cmdtoexecute parameter and run the task, changing the <user name> as required:
Code Block grant connect on database sdw to <user_name>;
...
- Open pgAdmin III and connect to PostgreSQL as an Admin user.
- Click on the node for your Spatial Data Warehouse database (sdw) in the tree view.
- Click on the SQL button and launch the query window.
Type the following command in the query pane changing the <user name> & <password> as required::
Code Block SELECT astun.sdw_new_user('<user name>','<password>',false);
e.g.
...
Code Block
...
grant connect on database sdw to <user_name>;