Category : postgresql

I get an error password authentication failed for user "usertodoproject". Really losing my patience, so far I have done couple of new databases and used fpr example this ALTER USER todouser WITH PASSWORD ‘todo’; it did not help either. Any ideas? *EDIT IT IS DOCKER-COMPOSE FAULT NOT SETTINGS. App runs without docker. settings.py DATABASES = ..

Read more

I have run into a problem. I have this SQL query (for RedShift) in AirFlow: SQL_QUERY = (f""" … WITH all_unputs AS ( SELECT fct_dc.collect_project_id AS fct_dc_collect_project_id, replace(inp.text, ‘},{‘, ‘},-{‘) AS text, … """) Somewhere in place ‘},{‘, ‘},-{‘ he starts to swear that the syntax is not correct and on closed brackets: f-string: single ..

Read more

I am trying to connect to a remote PostgresSQL database using the psycopg2 library in Python. So far, I have verified that I can connect and use my cursor to perform a simple query on an existing table: import psycopg2 conn = psycopg2.connect(dbname=’mydb’, user=’postgres’, password=’mypassword’, host=’www.mydbserver.com’, port=’5432′, sslmode=’require’) cur = conn.cursor() cur.execute(‘SELECT * FROM existing_schema.existing_table’) ..

Read more

I am using the script that contains the code below query = """ALTER TABLE table_name ALTER COLUMN column_name NUMERIC (22,6);""" self.cursor.execute(query) self.connection.commit() but i get error below psycopg2.errors.SyntaxError: syntax error at or near "NUMERIC" Have you encountered error like this? I have searched nothing is out on the internet. PS: I have used DECIMAL instead ..

Read more

jsonb column text_results contains values in the following form : {‘Name’ : ‘john doe’ , ‘id’ : ‘123’} On querying Select text_results->>’Name’ as Name from user_master or Select json_extract_path_text(text_results::json,’Name’) as name from user_master it always return None without any error even though values are present. Need help with rectifying the error or any other way ..

Read more