我应该为我创建的新创建的 PostgreSQL 模式使用正确的文件扩展名是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45194474/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 02:36:27  来源:igfitidea点击:

What is the correct file extension I should use for a newly created PostgreSQL schema that I created?

databasepostgresqlfile

提问by nasaQuant

I have created a new schema for a new PostgreSQL DB that I want to create (IF NOT EXISTS).

我为我想要创建的新 PostgreSQL 数据库创建了一个新模式(如果不存在)。

What should the file extension be for this document so that I can run it from psql, .dbu or .sql?

该文档的文件扩展名应该是什么,以便我可以从 psql、.dbu 或 .sql 运行它?

采纳答案by lopezdp

.dbu is used as a "Database Utility" file

.dbu 用作“数据库实用程序”文件

You need to use .sql

你需要使用 .sql

Then from psql you can use something like:

然后从 psql 你可以使用类似的东西:

SET search_path = schemaName, something_else;
SELECT * FROM tableName;        -- schemaName.tableName

or something to that effect depending on what you're trying to accomplish...

或者达到这种效果的东西取决于你想要完成的事情......