Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1emlyV-0008JV-SQ for pgsql-general@arkaria.postgresql.org; Fri, 16 Feb 2018 19:47:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emlyU-0001pp-DZ for pgsql-general@arkaria.postgresql.org; Fri, 16 Feb 2018 19:47:14 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1emlyT-0001pf-UW for pgsql-general@lists.postgresql.org; Fri, 16 Feb 2018 19:47:14 +0000 Received: from mail-oi0-x232.google.com ([2607:f8b0:4003:c06::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1emlyR-00016D-AU for pgsql-general@postgresql.org; Fri, 16 Feb 2018 19:47:12 +0000 Received: by mail-oi0-x232.google.com with SMTP id c83so1910836oib.1 for ; Fri, 16 Feb 2018 11:47:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgsqlrocket-com.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=5/xVIqhTLLJOpSEEnNyrr2VLbMYIXSyR86zpU2mZO6k=; b=vlIWXjjvTwQaL2pSYMoGCpaMeBBJHQrxAu9xTtZ85RO8/XGMvr3ia5u1fnteL+Mjak fEP+HMwC0JeSoPGNezXswmG9kA2r2q68PBamwuSzX1ho4iSZl8ntY+n62OGNgyVjQXCj lC5dL5Hvy41Rukrn/kMyCUN3hEsYW8fD5m5l8x5CfFYRldRv/v3Y24H6Ka58D3Zpn/eQ Gm+sFe3/61y+1erizw13xbtTyIHxJwcT2j1y2w18pII1VIbcqon/3pDMDlzZ2Oe3FHDR 25/3kPPRUp4k8jSunRhBJjKwKBuqyzKF7vzRFfkdytqm/81VIuLGlsjo8A3C5v0DYVXl dZfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=5/xVIqhTLLJOpSEEnNyrr2VLbMYIXSyR86zpU2mZO6k=; b=S8zkwfl8jENT1VR5pCO0U4ZSw0nlNkoVvzh/z2/lBKDwR6ckZJWx9LtEvM+CM1vpSH qYTK22XEUfWp4SfzTMlFQIKL4uoihXMyc9DN5zH0ZLic45ln5FVsTcG4VQoBPP+sNg4H qHgJ03eRebycm/vYJkBhnv0nq7pbsssiJNwfBSDKP0mkD/O5qccUu0BY0Me/tma0QMa5 NSrRDysHEf7+NoonM2EvgJNvFq06Zwjah5KFFuiVQcAIRp+tXu8FpFU0po0hZ5aoxBJU Bscyg5HSy1Vx2p0srzIFdav4Fj5UmGWKGf4WCiFcGAeyeIaUZw1EZPA0QcNlgG/RPKmv OsrQ== X-Gm-Message-State: APf1xPD9YACzgjaePn+sWxd0tiNpmKFaMqIhKSgDuX5XzuIupYJEkQn4 heqw5V2q9ZZ0pYwoq6Ma6p4WuQZdvR4= X-Google-Smtp-Source: AH8x225zf+bLnepIt+qzhK+6266vdd4a/6RxqckSo/zfOzbidMaGUshfEDV4C0kM/62FGivhpJ/pPQ== X-Received: by 10.202.1.86 with SMTP id 83mr4615431oib.240.1518810429695; Fri, 16 Feb 2018 11:47:09 -0800 (PST) Received: from localhost.localdomain ([65.132.155.214]) by smtp.gmail.com with ESMTPSA id l37sm10433269otb.6.2018.02.16.11.47.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 11:47:09 -0800 (PST) To: Postgres General From: chris Subject: gathering ownership and grant permissions Message-ID: <2bc1e56d-74ea-3590-a253-970f0e564467@pgsqlrocket.com> Date: Fri, 16 Feb 2018 12:47:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk HI, I would like to know if there is a better way to grab the grant permissions  as well as the "owner to" of a table. I can currently do this through a pg_dumb with greps for "^grant" and "^alter" but than I need to do a word search of those lines looking for the specific answers which gets much more involved. I essentially need to know what grant command was ran and use that grant permission to set to a variable for a script. Ex: GRANT ALL ON TABLE testing TO bob; then set only the "all" to a variable. And then same for the ALTER .... OWNER TO bob. This is on postgresl 9.6. Thank you, Chris