Skip to content

Instantly share code, notes, and snippets.

Xudong Zhang zxdvd

Block or report user

Report or block zxdvd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View postgresql_functions.sql
-- 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),
View .bash_profile
# 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.
You can’t perform that action at this time.