0

i want to view data table on my postgres database running on heroku.i can view my table throw view.php which was included to same server.but when i try to connect pg database throw c# ,it gives me error.i recognize that host is in error is my ip address . after googling i found that i need to edit hba.pba file.i have installed psql(shell) terminal and i try command SHOW hba_file .but it's say must be superuser to examine "hba_file" can someone help me to solve my problem

Npgsql.NpgsqlException was unhandled
  HResult=-2147467259
  Message=FATAL: 28000: no pg_hba.conf entry for host "61.642.163.26", user "fharmfggzvbzn", database "df4a8lse4537sb", SSL off
  Source=Npgsql
  ErrorCode=-2147467259
  BaseMessage=no pg_hba.conf entry for host "61.642.163.26", user "fharmfggzvbzn", database "df4a8lse4537sb", SSL off
  Code=28000
  ColumnName=""
  ConstraintName=""
  DataTypeName=""
  Detail=""
  ErrorSql=""
  File=auth.c
  Hint=""
  Line=486
  Position=""
  Routine=ClientAuthentication
  SchemaName=""
  Severity=FATAL
  TableName=""
  Where=""
  StackTrace:
       at Npgsql.NpgsqlState.<ProcessBackendResponses_Ver_3>d__9.MoveNext()
       at Npgsql.NpgsqlState.ProcessAndDiscardBackendResponses(NpgsqlConnector context)
       at Npgsql.NpgsqlConnectedState.Startup(NpgsqlConnector context, NpgsqlConnectionStringBuilder settings)
       at Npgsql.NpgsqlConnector.Open()
       at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection)
       at Npgsql.NpgsqlConnectorPool.RequestPooledConnectorInternal(NpgsqlConnection Connection)
       at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection Connection)
       at Npgsql.NpgsqlConnection.Open()
       at WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) in c:\Users\Madhawa\AppData\Local\Temporary Projects\WindowsFormsApplication1\Form1.cs:line 57
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at WindowsFormsApplication1.Program.Main() in c:\Users\Madhawa\AppData\Local\Temporary Projects\WindowsFormsApplication1\Program.cs:line 19
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

after googling i found that i need to edit hba.pba file.i have installed psql(shell) terminal and i try command SHOW hba_file .but it's say must be superuser to examine "hba_file" can someone help me to solve my problem

1 Answer 1

2

The crucial point there is:

Message=FATAL: 28000: no pg_hba.conf entry for host "61.642.163.26", user "fharmfggzvbzn", database "df4a8lse4537sb", SSL off

You must request an SSL connection. Heroku does not permit non-SSL connections. See the nPgSQL documentation for how to request an SSL connection.

You cannot edit pg_hba.conf on Heroku, it's a managed PostgreSQL install that you don't get full control of (but in exchange, you don't have to manage it as much).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.