{"action":"opened","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/26386","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/26386/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/26386/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/26386/events","html_url":"https://github.com/cockroachdb/cockroach/issues/26386","id":329195848,"node_id":"MDU6SXNzdWUzMjkxOTU4NDg=","number":26386,"title":"sql: add current_setting()","user":{"login":"BramGruneir","id":1614265,"node_id":"MDQ6VXNlcjE2MTQyNjU=","avatar_url":"https://avatars1.githubusercontent.com/u/1614265?v=4","gravatar_id":"","url":"https://api.github.com/users/BramGruneir","html_url":"https://github.com/BramGruneir","followers_url":"https://api.github.com/users/BramGruneir/followers","following_url":"https://api.github.com/users/BramGruneir/following{/other_user}","gists_url":"https://api.github.com/users/BramGruneir/gists{/gist_id}","starred_url":"https://api.github.com/users/BramGruneir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BramGruneir/subscriptions","organizations_url":"https://api.github.com/users/BramGruneir/orgs","repos_url":"https://api.github.com/users/BramGruneir/repos","events_url":"https://api.github.com/users/BramGruneir/events{/privacy}","received_events_url":"https://api.github.com/users/BramGruneir/received_events","type":"User","site_admin":false},"labels":[{"id":464498682,"node_id":"MDU6TGFiZWw0NjQ0OTg2ODI=","url":"https://api.github.com/repos/cockroachdb/cockroach/labels/A-sql-pgcompat","name":"A-sql-pgcompat","color":"22aa88","default":false}],"state":"open","locked":false,"assignee":{"login":"BramGruneir","id":1614265,"node_id":"MDQ6VXNlcjE2MTQyNjU=","avatar_url":"https://avatars1.githubusercontent.com/u/1614265?v=4","gravatar_id":"","url":"https://api.github.com/users/BramGruneir","html_url":"https://github.com/BramGruneir","followers_url":"https://api.github.com/users/BramGruneir/followers","following_url":"https://api.github.com/users/BramGruneir/following{/other_user}","gists_url":"https://api.github.com/users/BramGruneir/gists{/gist_id}","starred_url":"https://api.github.com/users/BramGruneir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BramGruneir/subscriptions","organizations_url":"https://api.github.com/users/BramGruneir/orgs","repos_url":"https://api.github.com/users/BramGruneir/repos","events_url":"https://api.github.com/users/BramGruneir/events{/privacy}","received_events_url":"https://api.github.com/users/BramGruneir/received_events","type":"User","site_admin":false},"assignees":[{"login":"BramGruneir","id":1614265,"node_id":"MDQ6VXNlcjE2MTQyNjU=","avatar_url":"https://avatars1.githubusercontent.com/u/1614265?v=4","gravatar_id":"","url":"https://api.github.com/users/BramGruneir","html_url":"https://github.com/BramGruneir","followers_url":"https://api.github.com/users/BramGruneir/followers","following_url":"https://api.github.com/users/BramGruneir/following{/other_user}","gists_url":"https://api.github.com/users/BramGruneir/gists{/gist_id}","starred_url":"https://api.github.com/users/BramGruneir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BramGruneir/subscriptions","organizations_url":"https://api.github.com/users/BramGruneir/orgs","repos_url":"https://api.github.com/users/BramGruneir/repos","events_url":"https://api.github.com/users/BramGruneir/events{/privacy}","received_events_url":"https://api.github.com/users/BramGruneir/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/cockroachdb/cockroach/milestones/13","html_url":"https://github.com/cockroachdb/cockroach/milestone/13","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/milestones/13/labels","id":2745639,"node_id":"MDk6TWlsZXN0b25lMjc0NTYzOQ==","number":13,"title":"2.1","description":"","creator":{"login":"knz","id":642886,"node_id":"MDQ6VXNlcjY0Mjg4Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/642886?v=4","gravatar_id":"","url":"https://api.github.com/users/knz","html_url":"https://github.com/knz","followers_url":"https://api.github.com/users/knz/followers","following_url":"https://api.github.com/users/knz/following{/other_user}","gists_url":"https://api.github.com/users/knz/gists{/gist_id}","starred_url":"https://api.github.com/users/knz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knz/subscriptions","organizations_url":"https://api.github.com/users/knz/orgs","repos_url":"https://api.github.com/users/knz/repos","events_url":"https://api.github.com/users/knz/events{/privacy}","received_events_url":"https://api.github.com/users/knz/received_events","type":"User","site_admin":false},"open_issues":567,"closed_issues":547,"state":"open","created_at":"2017-09-05T15:30:49Z","updated_at":"2018-06-04T20:00:58Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-06-04T20:00:58Z","updated_at":"2018-06-04T20:00:58Z","closed_at":null,"author_association":"MEMBER","body":"PGAdmin issues the follow query:\r\n\r\n```sql\r\nSELECT db.oid AS did,\r\n       db.datname AS name,\r\n       db.dattablespace AS spcoid,\r\n       spcname,\r\n       datallowconn,\r\n       pg_encoding_to_char(encoding) AS encoding,\r\n       pg_get_userbyid(datdba) AS datowner,\r\n       datcollate,\r\n       datctype,\r\n       datconnlimit,\r\n       has_database_privilege(db.oid, 'CREATE') AS cancreate,\r\n       current_setting('default_tablespace') AS default_tablespace,\r\n       descr.description AS comments,\r\n       db.datistemplate AS is_template,\r\n       (\r\n         SELECT array_to_string(ARRAY (\r\n          SELECT array_to_string(defaclacl::TEXT[], ', ')\r\n          FROM pg_default_acl\r\n          WHERE (defaclobjtype = 'r')\r\n            AND (defaclnamespace = 0::OID)\r\n         ), ', ')\r\n        ) AS tblacl,\r\n        (\r\n          SELECT array_to_string(ARRAY (\r\n            SELECT array_to_string(defaclacl::TEXT[], ', ')\r\n            FROM pg_default_acl\r\n            WHERE (defaclobjtype = 'S')\r\n              AND (defaclnamespace = 0::OID)\r\n          ), ', ')\r\n        ) AS seqacl,\r\n        (\r\n          SELECT array_to_string(ARRAY (\r\n            SELECT array_to_string(defaclacl::TEXT[], ', ')\r\n            FROM pg_default_acl\r\n            WHERE (defaclobjtype = 'f')\r\n              AND (defaclnamespace = 0::OID)\r\n          ), ', ')\r\n        ) AS funcacl,\r\n        (\r\n          SELECT array_to_string(ARRAY (\r\n            SELECT array_to_string(defaclacl::TEXT[], ', ')\r\n            FROM pg_default_acl\r\n            WHERE (defaclobjtype = 'T')\r\n              AND (defaclnamespace = 0::OID)\r\n          ), ', ')\r\n        ) AS typeacl,\r\n        (\r\n          SELECT array_agg((provider || '=') || label)\r\n          FROM pg_shseclabel AS sl1\r\n          WHERE sl1.objoid = db.oid\r\n        ) AS seclabels,\r\n        array_to_string(datacl::TEXT[], ', ') AS acl\r\nFROM pg_database AS db\r\nLEFT JOIN pg_tablespace AS ta\r\n  ON db.dattablespace = ta.oid\r\nLEFT JOIN pg_shdescription AS descr\r\n  ON ((db.oid = descr.objoid) AND (descr.classoid = 'pg_database'::REGCLASS))\r\nWHERE db.oid > NULL::OID\r\nORDER BY datname\r\n```\r\n\r\nDetails here:  https://www.postgresql.org/docs/current/static/functions-admin.html"}}
{"actor":{"display_login":"BramGruneir"}}