Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a create table functions that is separate for the execute function #13

Open
aylapear opened this issue Sep 23, 2022 · 1 comment
Open

Comments

@aylapear
Copy link
Member

Your Idea

The create_table() function will:

  • open the connection
  • set the role
  • execute the SQL command
  • close the connection

The parameter to set the role will be NULL as default which means the original user is used or the name of the role will be provided and the function will set it to that role.

The difference in this function is the role is set before the SQL command is executed, this will allow new tables that are created to be owned by the set role or the direct user.

This should eliminate the need for the reassign-table-owner-postgres.R script because the tables will already be owned by the data manipulator role instead of by the employee user.

@aylapear
Copy link
Member Author

The difference of this function for the execute() functions is that the role is set before performing the SQL command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant