Skip to content

Commit

Permalink
Use process_sql for ownership.
Browse files Browse the repository at this point in the history
  • Loading branch information
iangow committed Jan 11, 2024
1 parent 9ba220d commit 1fc16df
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions wrds2pg/wrds2pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,11 @@ def wrds_update(table_name, schema,
create_role(engine, schema)

sql = f'ALTER TABLE "{schema}"."{alt_table_name}" OWNER TO {schema}'
with engine.connect() as conn:
conn.execute(text(sql))
process_sql(sql, engine)

if not role_exists(engine, "%s_access" % schema):
create_role(engine, "%s_access" % schema)

sql = f'GRANT SELECT ON "{schema}"."{alt_table_name}"'
sql += f' TO {schema}_access'
res = process_sql(sql, engine)
Expand Down

0 comments on commit 1fc16df

Please sign in to comment.