使用psql时为什么没有Postgres提示输入密码?

时间:2017-03-17 20:23:19

标签: postgresql

鉴于以下pg_hba.conf,为什么运行DECLARE @sql AS NVARCHAR(MAX) DECLARE @cols1 AS NVARCHAR(MAX) DECLARE @cols2 AS NVARCHAR(MAX) SELECT @cols1= ISNULL(@cols1 + ',','') + QUOTENAME(name), @cols2= ISNULL(@cols2 + ',cast(','cast(') + QUOTENAME(name) + ' as nvarchar(max))'+ QUOTENAME(name) FROM (select c.name from sys.tables t inner join sys.columns c on c.object_id = t.object_id where t.name = 'globals' ) cols1 SET @sql = N'SELECT g.property, g.value FROM (SELECT ' + @cols2 + ' FROM globals) Person UNPIVOT (value FOR property IN (' + @cols1 +')) AS g; ' EXEC sp_executesql @sql 时Postgres没有提示输入密码?

<div>
   <span class="icon">icon</span>
   <input id="input" class="input error" type="text" />
   <label for="input"></label>
<div>

1 个答案:

答案 0 :(得分:0)

documentation州:

  

用户主目录中的文件.pgpass或PGPASSFILE引用的文件可以包含在连接需要密码时使用的密码(并且没有指定密码)。