无法使用Wix工具集创建Postgresql数据库

时间:2019-04-19 14:45:40

标签: postgresql wix

我正在尝试使用Wix ToolSet在PostgreSQL中创建数据库,但是我总是收到错误“错误-2147467259:创建SQL数据库失败:pontow,错误详细信息:未知错误”。当我尝试创建数据库或简单执行对现有数据库的错误时出现错误“无法连接到SQL数据库。(-2147467259 pontow)”。我进行了一些研究,似乎访问被拒绝,但是无法正常工作。

我已经尝试过:

  • 更改'postgresql.conf'并设置'listen_address ='*'';
  • 更改“ pg_hba.conf”并添加“托管所有0.0.0.0/0信任”行;
  • PostgreSQL v9.6和v11.2;
  • 授予“所有人”对PosgreSQL文件夹和子文件夹的完全权限;
  • 使用Wix'sql:SqlDatabase'SQL身份验证和Windows身份验证;

我正在使用Windows 10 x64 Wix ToolSet v3.11。

我的Product.wsx文件:

    <Binary Id="CreateTable" SourceFile=".\CreateTable.sql"/>
    <Property Id="SQLUSERNAME" Secure="yes">postgres</Property>
    <Property Id="SQLPASSWORD" Secure="yes">test</Property>
    <Property Id="SQLSERVER" Secure="yes">localhost</Property>
    <Property Id="SQLSERVERPORT" Secure="yes">5432</Property>
    <Property Id="DATABASE_NAME" Secure="yes">pontow</Property>

    <util:User Id="SQLUser" Name="[SQLUSERNAME]" Password="[SQLPASSWORD]" />
    <Directory Id='TARGETDIR' Name='SourceDir'>
      <Directory Id='ProgramFilesFolder' Name='PFiles'>
        <Directory Id='InstallDir' Name='Test'>

          <Component Id="SqlComponent" Guid="35e0e97e-cdce-428b-b553-d82fadf56b28" KeyPath="yes">

            <sql:SqlDatabase Id="SqlDatabase" Database="[DATABASE_NAME]" User="SQLUser"
                             Server="[SQLSERVER],[SQLSERVERPORT]" CreateOnInstall="yes" DropOnUninstall="yes" ContinueOnError="no">
              <sql:SqlScript Id="CreateTable" BinaryKey="CreateTable" ContinueOnError="no" ExecuteOnInstall="yes"/>
            </sql:SqlDatabase>
          </Component>

        </Directory>
      </Directory>
    </Directory>

    <Feature Id='SqlFeature' Title='SqlFeature' Level='1'>
      <ComponentRef Id='SqlComponent' />
    </Feature>

我希望使用Wix Toolset创建PosgreSQL数据库,或者从Setup.exe创建数据库的任何建议都会受到欢迎。

1 个答案:

答案 0 :(得分:0)

WixSqlExtension仅支持SQL Server,而不支持PostgreSQL。

相关问题