pycharm and postgres: ERROR: Unsupported startup parameter: extra_float_digits - postgresql

Having issue to connect to PostgreSQL 9.0 database from PyCharm. I already tried adding older jdbc driver manually but still getting the same error: "ERROR: Unsupported startup parameter: extra_float_digits".

The "fix" is to add this to the config.ini under the [pgbouncer] section:
ignore_startup_parameters = extra_float_digits
Details here: https://github.com/Athou/commafeed/issues/559

I had this error using the PostgreSQL JDBC driver connecting to PgBouncer. The fix was to add the following to pgbouncer.ini (which was already in the file but commented out):
ignore_startup_parameters = extra_float_digits
(similar to the previous answer but different config file)

Related

flyway, added additional JDBC driver, still getting "No database found to handle" [duplicate]

This question already has answers here:
Is there a way to use Flyway on AS400?
(2 answers)
Closed last month.
The driver in question is jt400.jar; I copied it to the driver directory of my flyway installation.
This is the content of the file flyway.config in my project directory:
flyway.locations=filesystem:.
flyway.url=jdbc:as400://192.168.1.1/myschema;naming=system;errors=full
flyway.user=myschema
flyway.password=***
Calling flyway in my project directory produces the error:
No database found to handle jdbc:as400://192.168.1.1/myschema;naming=system;errors=full
With networking debug tools I checked that it didn't even try to establish the connection to the db, so the problem should be the driver.
Calling flyway with -X option to get more detail for the error, i get the following:
PS C:\Users\alex\Documents\myprj> flyway migrate -X
DEBUG: Loading config file: C:\Program Files\Red Gate\Flyway Desktop\flyway\conf\flyway.conf
DEBUG: Unable to load config file: C:\Users\alex\flyway.conf
DEBUG: Loading config file: C:\Users\alex\Documents\myprj\flyway.conf
DEBUG: Using configuration:
DEBUG: flyway.driver -> com.ibm.as400.access.AS400JDBCDriver
DEBUG: flyway.jarDirs -> C:\Program Files\Red Gate\Flyway Desktop\flyway\jars
DEBUG: flyway.locations -> filesystem:.
DEBUG: flyway.password -> ***
DEBUG: flyway.url -> jdbc:as400://192.168.1.1/myschema;naming=system;errors=full
DEBUG: flyway.user -> myschema
ERROR: Unexpected error
org.flywaydb.core.api.FlywayException: No database found to handle jdbc:as400://192.168.1.1/myschema;naming=system;errors=full
at org.flywaydb.core.internal.database.DatabaseTypeRegister.getDatabaseTypeForUrl(DatabaseTypeRegister.java:441)
at org.flywaydb.core.internal.jdbc.DriverDataSource.<init>(DriverDataSource.java:496)
at org.flywaydb.core.internal.jdbc.DriverDataSource.<init>(DriverDataSource.java:476)
at org.flywaydb.core.api.configuration.ClassicConfiguration.configure(ClassicConfiguration.java:2062)
at org.flywaydb.core.api.configuration.FluentConfiguration.configuration(FluentConfiguration.java:1341)
at org.flywaydb.commandline.Main.getLegacyConfiguration(Main.java:675)
at org.flywaydb.commandline.Main.main(Main.java:509)
I tried to add an explicit reference to my driver class adding the following line to flyway.conf:
flyway.driver=com.ibm.as400.access.AS400JDBCDriver
The result is the same.
Currently you cannot use flyway with i-series (as400) as there is no published code for that purpose. Flyway at currently documented versions only supports the Db2-LUW variant of Db2 (Linux/Unix/Windows).
You are free to write your own module to support the i-series, or pay others to do that.

Cant import table to H2O, using Postgresql JDBC in Ubuntu

I am having trouble to import a sql table to H2O.ai using Postgresql JDBC Driver in Ubuntu. I'm getting the follow error:
ERROR MESSAGE:
SQLException: ERROR: relation "XXX" does not exist
Position: 22
Failed to connect and read from SQL database with connection_url: jdbc:postgresql://localhost:5432/...**
I am executing H2O with the follow command:
java -cp h2o.jar:/usr/share/java/postgresql-9.4.1212.jar water.H2OApp
The JDBC driver is installed and already try to construct the Connection URL in several ways.
I'm using this one right now:
jdbc:postgresql://localhost:5432/XXX?&useSSL=false

Specify `statement_timeout` in Postgresql with sqlalchemy?

The following statement_timeout option works on some Postgresql databases and on others, I get Unsupported startup parameter: options. Why?
Is this possibly a difference between Postgres 9.4 and 9.6? This works with the former servers and fails with the latter.
from sqlalchemy import create_engine
# As is: Unsupported startup parameter: options
db_engine = create_engine("postgresql://user:pw#host/database",
connect_args={"options": "-c statement_timeout=1000"})
with db_engine.connect() as db_connection:
print("got it")
Specifically, I get:
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) ERROR: Unsupported startup parameter: options
You may have been connecting to those databases via PgBouncer.
If so, add ignore_startup_parameters = options to pgbouncer.ini under the [pgbouncer] section.
From https://www.pgbouncer.org/config.html#ignore_startup_parameters:
By default, PgBouncer allows only parameters it can keep track of in startup packets: client_encoding, datestyle, timezone and standard_conforming_strings. All others parameters will raise an error. To allow others parameters, they can be specified here, so that PgBouncer knows that they are handled by the admin and it can ignore them.
Default: empty
References:
https://github.com/pgbouncer/pgbouncer/issues/295
https://github.com/pgbouncer/pgbouncer/issues/496

PropelBundle database:create for postgres

I've installed propel bundle for symfony2.
my database configuration is:
propel:
dbal:
driver: pgsql
user: postgres
password: postgres
dsn: pgsql:host=localhost;port=5432;dbname=test_database
options: {}
attributes: {}
When i wan to create this database from console (console propel: database:create) i have got strange error : Unable to open PDO connection [wrapped: SQLSTATE[08006] [7] FATAL: database "pgsql" does not exist.
i created pgsql database on my localhost and everything was good. Database "test_database" was succesfull created. Can somebody explain me why i got this previous error? On mysql i've created database without any problems.
This issue was a bug in the PropelBundle, it has been fixed by the following commit (even if the commit message is about MySQL, it fixes other RDBMS): https://github.com/propelorm/PropelBundle/commit/b4475d27fb1eb846d10cc2d2e2bd164f037508e3
I 've installed new PropelBundle via Composer and everything is ok now. I think maybe it was a problem with 1.0 bundle , now I have 1.1

How to disable Postgresql messages translation

Is there a way to disable the Postgresql translation of messages? I´m running my appl and Postgresql on a pt_BR Windows machine and when a exception is thrown the error message is translated to Portuguese, like:
Caused by: org.postgresql.util.PSQLException: ERRO: relação "unidade_federacao" não existe
Posição: 25
I would like the messages to appear in English.
I´m using the driver postgresql-8.4-701.jdbc3.jar on a Java (with Hibernate) app.
thanks in advance,
Fabrício Lemos
You could change lc_messages in postgresql.conf or just per database:
ALTER DATABASE dbname SET lc_messages=en_us;
See also the manual.
Under Windows, some psql error messages are getting translated corresponding to the format setting in Windows settings -> Clock, Language, and Region -> Change location -> Formats -> Format.
To prevent a mix of translated and untranslated messages, I've set this format to "English (United States)".
execute the following query to your database in order to find the postgres.conf file which is loaded for the configuration:
SHOW config_file;
Edit your postgres.conf file with your prefered lc.... lc_messages,lc_numeric...etc.
i think you can change all with lc_ALL
example : lc_ALL=en_US.UTF-8
Finally execute the following command to reload conf.
SELECT pg_reload_conf();