当前位置:网站首页>kingbase中指定用户默认查找schema,或曰用户无法使用public schema下函数问题
kingbase中指定用户默认查找schema,或曰用户无法使用public schema下函数问题
2022-07-28 20:09:00 【左直拳】
kingbase有一些古怪的设置,search_path就是其中一例。这个命令是设置用户默认的schema。如果不设置,比如用户user1想读取schema2下的表,那在sql中就要指明schema。如:
select * from schema2.table1;
如果不想这么折腾,那就将schema2指定为user1的默认schema:
alter user user1 set search_path to schema2;
但是!以上这个句子有问题!会造成user1的默认schema只是schema2,从而丢失了公共schema public的默认访问权。其实这个search_path和windows环境变量中的path类似,它可以指定多个。上面指定了一个,覆盖了默认,原本天然可以访问public下元素的,现在就不行了。前不久,我们有个kingbase库安装了kingbaseGIS,加入了对空间数据的支持。而这些空间函数,位于public下:

结果执行下面SQL,死活不行,总是报错,认不了这个ST_Polygon。
SELECT ST_Polygon(ST_GeomFromText(
'LINESTRING(75.15 29.53,77 29,77.6 29.5, 75.15 29.53)'),
4326);
将用户的权限赋到无所不能了,还是不行。后来还是人大金仓的人发现了问题症结所在,就是这个seach_path问题。正确的做法是:
alter user user1 set search_path to schema2,PUBLIC,SYS_CATALOG;
kingbase源自postgreSQL。估计这个毛病是继承下来的。这个search_path简直莫名其妙,不知所谓。
边栏推荐
- Mysql的B+树高度计算
- 基于对象的实时空间音频渲染丨Dev for Dev 专栏
- Introduction to wechat applet development, develop your own applet
- 实现瀑布流效果
- It is said that Microsoft has obtained the supply license for Xianghua! Will Huawei usher in the full lifting of the ban?
- I have been in the industry for 4 years and changed jobs twice. I have understood the field of software testing~
- Summary of 29 typical problems in Devops planning and construction of securities enterprises based on containerized PAAS platform
- 日志瘦身神操作:从5G优化到1G到底是怎么做到的!(荣耀典藏版)
- Leetcode 142. circular linked list II [knowledge points: speed pointer, hash table]
- ST法国三座工厂大罢工,芯片缺货情况或将更加严重!
猜你喜欢

MATLAB从入门到精通 第1章 MATLAB入门
![[极客大挑战 2019]Secret File&文件包含常用伪协议以及姿势](/img/aa/a169cdd8cc6cdfda6d2777511b4dd2.png)
[极客大挑战 2019]Secret File&文件包含常用伪协议以及姿势

Construction of Chinese traditional embroidery classification model based on xception TD

How to understand data mesh

LeetCode·581.最短无序连续子数组·双指针

Week 6 Linear Models for Classification (Part B)

Pytorch学习记录(三):随机梯度下降、神经网络与全连接

Pytoch learning record (III): random gradient descent, neural network and full connection

软考 --- 数据库(3)数据操作

Adventures of little mouse: behind the scenes gags of moss 2
随机推荐
How to understand data mesh
Research on the recognition method of move function information of scientific paper abstract based on paragraph Bert CRF
Leetcode 19. delete the penultimate node of the linked list [knowledge points: speed pointer, recursion, stack]
Vimtutor编辑
Versailles ceiling: "the monthly salary of two years after graduation is only 35K, which is really unpromising ~ ~"
基于对象的实时空间音频渲染丨Dev for Dev 专栏
Achieve waterfall effect
Adventures of little mouse: behind the scenes gags of moss 2
开放式耳机哪个品牌好、性价比最高的开放式耳机排名
如何高效、精准地进行图片搜索?看看轻量化视觉预训练模型
高举5G和AI两面旗帜:紫光展锐市场峰会火爆申城
将字符串指针赋值给数组[通俗易懂]
The Swedish court lifted the 5g spectrum auction ban on Huawei and ZTE
openEuler Embedded SIG | 分布式软总线
节省70%的显存,训练速度提高2倍!浙大&阿里提出在线卷积重新参数化OREPA,代码已开源!(CVPR 2022 )
RHCSA第一天
Matlab | basic knowledge summary I
MATLAB从入门到精通 第1章 MATLAB入门
LeetCode链表问题——142.环形链表II(一题一文学会链表)
开放式耳机哪个音质好、公认音质好的气传导耳机推荐