Questions tagged [postgres-14]

35 questions
0
votes
1 answer

Break update operation when function returns NULL value in PostgreSQL

Let' assume I have a table named mytable: I have one function which returns text and sometime it can return NULL also. ( this is just demo function in real use case function is complex ) CREATE OR REPLACE FUNCTION parag_test (id text) RETURNS…
Parag Jain
  • 612
  • 2
  • 14
  • 31
0
votes
1 answer

PostgreSQL INSERT multiple JSONB columns for record

I am unable to insert multiple python dict into separate JSONB columns for a new record (auto ID) for one cur.execute using python with pyscopg2. I am able to insert each dict individually, but without specifying an ID, it creates new…
rnwtenor
  • 13
  • 2
0
votes
1 answer

sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedObject) collation "utf8" for encoding "UTF8" does not exist

I'm currently running into the following error with SQLAlchemy and postgresql, when running alembic upgrade head sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedObject) collation "utf8" for encoding "UTF8" does not exist I'm initialising…
Micheal J. Roberts
  • 3,735
  • 4
  • 37
  • 76
-1
votes
3 answers

`row_number() over ()` causes drastically slow query only in Production and sort of fixes itself by upgrading from version 14.8 to 15

I have a new database with only about 225 rows. I was facing a slow query issue only on the postgres running in production on my Ubuntu server. It was reporting 423.460 ms for the execution time. The postgres on my development Mac wasn't having the…
-1
votes
1 answer

Postgresql, cast character varying list to array

Have a table with a character varying column with values such as ['abcd1234', 'defghij13'] When trying to test with string_to_array function select string_to_array('["abcd1234"]', ', ') returns {"[\"abcd1234\"]"} Can this be done within postgres…
Jenobi
  • 368
  • 4
  • 12
1 2
3