【发布时间】:2013-07-20 10:13:01
【问题描述】:
我有以下代码在 Nhibernate 中为数据库生成架构
new SchemaExport(configuration).Execute(true, true, false);
但是当针对 PostgreSQL 数据库运行时,我最终会收到以下错误
[NpgsqlException (0x80004005): FATAL: 3D000: database "dbname" does not exist]
但是,如果我手动创建数据库,则会导出架构而不会出错。那么问题来了:为什么 Nhibernate SchemaExport 无法创建 PostgreSQL 数据库,而这却适用于 SQLite、MsSqlCe 和 MsSql Server 等其他数据库。
我搜索了在线文献,但找不到任何关于此问题的突出显示。
我正在使用 Nhibernate 3.3.1 和 PostgreSQL 9.2。
【问题讨论】:
-
不应该是
new SchemaExport(configuration).Create(true, true, false);吗? -
我觉得“database "dbname" does not exist”很清楚了吧?
标签: postgresql nhibernate