1

I am developing an app in flutter that connects to a PostgreSQL server in a raspberry pi. Everything works fine in debug mode but when I switch to release mode, I get this error message:

PostgreSQLSeverity.error : Attempting to execute query, but connection is not open.

Here is the connection code for helping with the solution:

    static PostgreSQLConnection openConnection(){
      var connection = PostgreSQLConnection(ip, port, dbName, username: 'xxxxxxxxx', password: 'xxxxxxxx');
      connection.open();
      return connection;
  }

I don't know where to start looking for an error or something. Any idea about how to deal with this issue?

Thanks.

2
  • Hi @morita_06, I am trying to do exactly the same as you (connect postgresql to flutter), please can you give some pointers or useful links. Thanks Commented Jul 21, 2020 at 14:18
  • @GraSim Hi, my problem was related to the release version. Besides that, the app connected fine to PostgreSQL. The accepted answer solved my issue. I could help you, if you facilitate me any email to write to you. Commented Jul 22, 2020 at 16:33

1 Answer 1

1

if you are connecting to your server through the Internet you need to add Internet permission in android. check this link for more info.

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.