当前位置:网站首页>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简直莫名其妙,不知所谓。
边栏推荐
- fluke dtx-1800测试精度有必要进行原厂校准吗?
- What is the purpose of database read-write separation [easy to understand]
- 纳米金偶联抗体/蛋白试剂盒(20nm,1mg/100μg/500 μg偶联量)的制备
- Knowledge description framework of foreign patent documents based on knowledge elements
- 世界肝炎日 | 基层也能享受三甲资源,智慧医疗系统如何解决“看病难”?
- 技术选型Rust——事后分析
- For the next generation chromebook, MediaTek launched new chipsets mt8192 and mt8195
- Matlab | basic knowledge summary I
- 1945. sum of digits after string conversion
- 面向千元级5G手机市场,联发科天玑700发布
猜你喜欢

Research on the recognition method of move function information of scientific paper abstract based on paragraph Bert CRF

小程序开发需要什么技术

蚂蚁集团境外站点 Seata 实践与探索

Week 6 Linear Models for Classification (Part B)

HCIA comprehensive experiment (take Huawei ENSP as an example)

Versailles ceiling: "the monthly salary of two years after graduation is only 35K, which is really unpromising ~ ~"

Uncaught Error:Invalid geoJson format Cannot read property ‘length‘ of undefind

OA项目之会议通知(查询&是否参会&反馈详情)

Explain C language 12 in detail (C language series)
![[geek challenge 2019] secret file & file contains common pseudo protocols and gestures](/img/aa/a169cdd8cc6cdfda6d2777511b4dd2.png)
[geek challenge 2019] secret file & file contains common pseudo protocols and gestures
随机推荐
Vimtutor编辑
关于一些小需求,用案例方式记录
The Swedish court lifted the 5g spectrum auction ban on Huawei and ZTE
Is it necessary to calibrate the fluke dtx-1800 test accuracy?
openEuler Embedded SIG | 分布式软总线
基于属性词补全的武器装备属性抽取研究
Modify the port number of MySQL (is there a problem modifying the port number of MySQL)
如何高效、精准地进行图片搜索?看看轻量化视觉预训练模型
Cy3/Cy5/Cy5.5/Cy7荧光标记抗体/蛋白试剂盒(10~100mg标记量)
Layout the 6G track in advance! Ziguang zhanrui released the white paper "6G unbounded AI"
华为发布首款电驱动系统DriveONE:充电10分钟续航200km
It is said that Microsoft has obtained the supply license for Xianghua! Will Huawei usher in the full lifting of the ban?
First week of internship diary
fluke dtx-1800测试精度有必要进行原厂校准吗?
[geek challenge 2019] secret file & file contains common pseudo protocols and gestures
HCIA综合实验(以华为eNSP为例)
开放式耳机哪个音质好、公认音质好的气传导耳机推荐
For the next generation chromebook, MediaTek launched new chipsets mt8192 and mt8195
Talk about row storage and column storage of database
Week 6 Linear Models for Classification (Part B)