This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setting PATH for Python 3.5 | |
# The orginal version is saved in .bash_profile.pysave | |
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}" | |
export PATH | |
## | |
# Your previous /Users/zxd/.bash_profile file was backed up as /Users/zxd/.bash_profile.macports-saved_2015-12-25_at_23:41:43 | |
## | |
# MacPorts Installer addition on 2015-12-25_at_23:41:43: adding an appropriate PATH variable for use with MacPorts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- function to get user privileges of all tables in schemas | |
create or replace function get_user_table_privs(schemas text[], username text) returns table (username text, schema text, relname regclass, privs text[]) AS $$ | |
select $2, n1.nspname::text, c1.oid::regclass, | |
array_remove(ARRAY[ | |
(case when has_table_privilege($2, c1.oid, 'SELECT') then 'SELECT' else NULL END), | |
(case when has_table_privilege($2, c1.oid, 'INSERT') then 'INSERT' else NULL END), | |
(case when has_table_privilege($2, c1.oid, 'UPDATE') then 'UPDATE' else NULL END), | |
(case when has_table_privilege($2, c1.oid, 'DELETE') then 'DELETE' else NULL END), | |
(case when has_table_privilege($2, c1.oid, 'TRUNCATE') then 'TRUNCATE' else NULL END), | |
(case when has_table_privilege($2, c1.oid, 'REFERENCES') then 'REFERENCES' else NULL END), |