创建一个看不到其他银行对象的用户

问题描述

如何创建看不到任何银行对象的用户。我只会通过补助金向他释放的物化观点?

我这样创建用户

CREATE USER PAPER WITH LOGIN PASSWORD 'secure password' NOSUPERUSER NOINHERIT NOCREATEDB NOCREATEROLE norEPLICATION VALID UNTIL 'infinite';

GRANT SELECT ON vw_visao TO user;

但是当我与他登录pgadmin3时,他们可以看到银行的整个结构。

就像查看您有多少张表,函数以及表的函数和ddl中的sql一样。不要因为特权不足而选择任何东西。

我正试图防止允许用户执行这些命令。

有几个有趣的选项,请参见一些示例:

\d  list the database tables
\dv list database views
\di list enter code here the indexes of the database
\db list the tablespaces
\l list the databases
\dg list existing roles (users or groups)
\conninfo displays information about the current connection
\h list sql commands
\h command displays details about the command

解决方法

无法在PostgreSQL中的单个数据库中执行此操作。

一种可能性是使用<script> var number=1; for (var i=0;i<5;i++) { get_increased(number); } function get_increased(number) { console.log(number); number += number; //number is local to the get_increased function } </script> <script> var number=1; for (var j=0;j<5;j++) { get_increased(); } function get_increased() { console.log(number); number += number;//we are using the number defined above but the number is added to itself - giving a doubling each time } </script> <script> var number=1; for (var k=0;k<5;k++) { get_increased(); } function get_increased() { console.log(number); number += 1;//this gives the result asked for } </script> 外部表来引用另一个数据库中的表,该表的定义无法看到。