本文介绍了如何在不使用架构前缀(Postgres + PHP)的情况下访问架构中的表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在模式下创建了一些表。目前,我可以使用以下模式访问模式中的表:

I have some tables created under a schema. At the moment, I can access the table within the schema using:

select * from myschema.mytable

我正在寻找避免使用架构名称的方法。

I am searching for ways to avoid using the schema name. something like:

select * from mytable

但是我找不到答案。

您能帮忙吗?谢谢

推荐答案

模式搜索路径对此适用:

Schema search path would work for this:

To查看当前值:

SHOW search_path;

更改值(追加新模式):

To change the value (append new schema):

SET search_path TO myschema,public;

已记录在

这篇关于如何在不使用架构前缀(Postgres + PHP)的情况下访问架构中的表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 03:37