Skip to main content
1 vote
1 answer
75 views

I have created a function to return the db connection of a postgresdb using pgxpool. But I don't want to create multiple pools since i will be calling this function each time to execute a query. Since ...
lokesh's user avatar
  • 54
0 votes
1 answer
99 views

I am new to Docker and Golang. I am trying to run Golang server locally and connect it with my postgres docker image.Basically I want the DB to run as docker container with persitant volume Error PS C:...
harsh9607's user avatar
1 vote
1 answer
403 views

I used to use the pq library, now I want to use pgx. I have a task to abort a transaction if it has been running in the db for too long. pq is able to abort a transaction as soon as the context has ...
Violetta's user avatar
  • 619
1 vote
2 answers
139 views

Recently I observed OOMs in a PostgreSQL 16 server used by an application which made heavy use of prepared statements. Memory would gradually grow until hitting an OOM. How to limit the usage of ...
Nemo's user avatar
  • 2,602
0 votes
1 answer
690 views

I want to iterate over the values in a row with rows.Values() and that works but there is no clear way how can I check if each value has NULL (valid/invalid): rows, err := conn.Query(context....
RubenLaguna's user avatar
  • 25.6k
1 vote
1 answer
508 views

I'm learning to use sqlc (with pgx) my sqlc.yaml version: "2" sql: - engine: "postgresql" queries: "query.sql" schema: "schema.sql" gen: go: ...
Bino Oetomo's user avatar
1 vote
0 answers
54 views

I have two functions with similar functionality that I use to test concurrency. However, FetchUserForAuthV1 starts throwing errors with fewer requests compared to FetchUserForAuth. I’m sharing code ...
Deepen Patel's user avatar
1 vote
1 answer
788 views

I have a PostreSQL cluster where I have a master and a slave. I have seen that pgx/pgxpool supports simultaneous connection to multiple hosts, but I do not understand how requests will be executed ...
Nick Schemov's user avatar
2 votes
0 answers
52 views

I've been stuck this issue for the past few days. Here is my database that connects to the DB instance and attempts to run migrations against it: func connectToDb() (*pgxpool.Pool, error) { ...
squish's user avatar
  • 1,156
2 votes
2 answers
4k views

I have a code which does unit testing, where I prepare a database for the tests (I do not use sql-go-mock), so I want to insert returning id with a simple sql INSERT INTO, but for some reason pgx ...
Ivan's user avatar
  • 456
-1 votes
1 answer
145 views

Hi I'm trying to change user's password in postgres using pgx/v5 driver in Go _, err = conn.Exec(context.Background(), "ALTER USER $1 WITH PASSWORD $2", username, password) if err != nil { ...
user89978's user avatar
  • 194
2 votes
0 answers
243 views

I have used the ConnecConfig function to create a pool. However, I am not satisfied with building it at the code below. Compiler message: ConnectConfig not declared by package pgxpool package main ...
Mehmet's user avatar
  • 21
3 votes
1 answer
1k views

I have an SQL query that joins 2 tables: SELECT locations.id as id, locations.name as name, states.id as state.id, states.name as state.name FROM locations INNER JOIN states ON states.id = locations....
Ferares's user avatar
  • 846
2 votes
3 answers
4k views

I am trying to figure out a good solution for managing database transactions in Golang and use the same transaction between different services. Let's say I am building a forum, and this forum has ...
Sovak's user avatar
  • 453
2 votes
1 answer
2k views

Will this work with pgx in Go? func CreateTable( ctx context.Context, pgxPool *pgxpool.Pool, ) error { const tableQuery = ` INSERT INTO table (status) VALUES ('Active'); ...
ЯДPTГФИ's user avatar

15 30 50 per page
1
2 3 4 5
10