Use this tag to indicate that your question is about PostgreSQL version 14. Questions concerning database administration should go to https://dba.stackexchange.com/
Questions tagged [postgresql-14]
227 questions
0
votes
1 answer
global current_setting does not return value
Engine: asyncpg
Postgres version: 14
Hi! I need to set global variables when I am creating pool.
I use set_config in init function for each connection:
async def init(con):
configs = [
f"SELECT set_config('element_type.boolean',…

Prosto_Oleg
- 322
- 3
- 13
0
votes
1 answer
Passing an Object (User Defined Type) to a Function in PostgreSQL
Given the following example database, how do I invoke the function called account_upsert with an object of core.account_type? I'm currently getting 42P01: relation account doesn't exist. account in this context is the parameter of the function, not…

JGx714791
- 51
- 7
0
votes
1 answer
How to explode a list of string into new columns
I have a table in postgresql 14 like this one:
text classes
some string [food, drink]
another string [food, medicine, drink]
another random [car]
And I want to get this as output:
text class_1 …

math_guy_shy
- 161
- 6
0
votes
2 answers
How to syntactically indicate a table for altering its column in postgres sql
I am trying to alter a table by changing the datatypes of a few columns from text to integer/boolean/date
When I try to execute it as
alter table "TimeSeriesData" alter COLUMN "details_id" TYPE BIGINT;
I get this error
ERROR: column "details_id"…

Ann
- 137
- 1
- 11
0
votes
1 answer
What is the location for pg_upgrade_dump log file?
I am trying to run a pg_upgrade on my existing 12.8 postgres and migrate it to 14.3 with docker based installation. I got the below error :
Performing Upgrade
------------------
Analyzing all rows in the new cluster ok
Freezing…

darecoder
- 1,478
- 2
- 14
- 29
0
votes
0 answers
Safely calling a stored procedure in sqlalchemy ona postgresdb
I am trying to find a way to call stored proc with parameters -sp using sqlAlchmey. I found lots of answers non that solved my specific problem. As far as I understand we can always pass parameters to the sqlAlchemy text by first formatting the…

Grumpyahdu
- 1
- 2
0
votes
1 answer
using pgpool, i got empty value in replication state
I'm trying to use pgpool to postgres HA.
node_id | hostname | port | status | pg_status | lb_weight | role | pg_role | select_cnt | load_bala
nce_node | replication_delay | replication_state | replication_sync_state |…

hyungs
- 1
- 1
0
votes
1 answer
Postgres PgAgent job status not running
The job status keeps showing as F in the Statistics -> Status
I did run the code of the job in the query area and it works but I don't know why it's failing.enter image description here

infernus
- 78
- 4
0
votes
0 answers
I need to group (tbl_types.name AS type) in a same row (postgres 14)
I need help with a select in postgres, I need to group X types into a single line, for example: type: multiple, trully, I need help on the type column
SELECT tbl_questions.id AS id,
tbl_questions.question AS question,
tbl_questions.year AS year,…
0
votes
1 answer
PostgreSQL: Efficiently aggregate a list query result into JSON object
I need to return a result from a query in which I match one row from a table, then aggregate in JSON from up to 500,000 text values that reference that row.
The JSON must be a map where the names are data points. It needs to be a key:value object,…

Alechko
- 1,406
- 1
- 13
- 27
0
votes
2 answers
Issue in creating a class instance using mikro-orm and typescript and inserting into postgresql database
I'm trying to code along to this React GraphQL TypeScript tutorial
The project uses MikroOrm to communicate with a PostgreSQL database.
Goal: To create an instance of post and insert it into the database.
Currently I'm at minute 19.53 and I'm stuck…

Olivia
- 115
- 6
0
votes
1 answer
Crafting manual pg_depend entry
I would like to create an UNLOGGED materialized view. I seem to understand that is not possible with the current implementation of Postgresql (14).
I am investigating whether it is possible for me to do the following:
Given that I have two tables A…

Antonio L.
- 41
- 7
0
votes
1 answer
SQL update column used by generated column
In Postgresql 14, I have:
CREATE TABLE items
(
id bigint NOT NULL PRIMARY KEY,
name varchar(40) not null,
name_search tsvector GENERATED ALWAYS AS (to_tsvector('simple', name)) STORED
);
Now I would like to update the table, to make the…

Alex
- 4,607
- 9
- 61
- 99
0
votes
1 answer
Can Postgres table partitioning by hash boost query performance?
I have an OLTP table on a Postgres 14.2 database that looks something like this:
Column | Type | Nullable |
----------------+-----------------------------+-----------
id | character varying(32) |…

okrunner
- 3,083
- 29
- 22
0
votes
0 answers
SparkSQL query using "PARTITION by" giving wrong output
I have a bunch of csv files for which I am using Pyspark for faster processing. However, am a total noob with Spark (Pyspark). So far I have been able to create a RDD, a subsequent data frame and a temporary view (country_name) to easily query the…

Pankaj
- 1
- 1