在SQLite中你可以做到
sqlite3 i.db < x.sql
Run Code Online (Sandbox Code Playgroud)
where x.sql是一个create table语句,i.db是数据库
PostgreSQL中的等价物是什么?
Postgres的默认命令行工具是psql它支持命令行参数来指定数据库和脚本名称:
psql -d db_name -f x.sql
Run Code Online (Sandbox Code Playgroud)
有关详细信息(例如,如何指定要用于连接的数据库用户),请参阅手册:https://www.postgresql.org/docs/current/static/app-psql.html
| 归档时间: |
|
| 查看次数: |
1059 次 |
| 最近记录: |