Skip to main content
0 votes
0 answers
35 views

psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL: password authentication failed for user "postgres" with correct port

I installed PostgreSQL from the official website, on mac (macos 15.4), M1. During installation it asked for a password, I provided a simple password. However, when I try to connect, it asks for a ...
Dilyara Arynova's user avatar
0 votes
0 answers
29 views

Psql : Error connection whenever I try to use psql

I've seen this issue posted quite a few times, and I’ve gone through many of the existing threads and tried every suggested solution, but nothing has worked so far. So I decided to ask here directly. ...
user24537176's user avatar
1 vote
1 answer
30 views

How to check if table have column id ERROR: record "new" has no field "id"

I want to create an audit log table and attach trigger for the table to tables that have an id. When I insert record into an association table which doesn't have id, it triggers the following error ...
rak1n's user avatar
  • 825
0 votes
1 answer
31 views

Ctrl+C exits psql instead of starting a new line

On windows psql shell, pressing ctrl+c exits psql completely whereas sources say that its supposed to quit only the current query line that is it should go from postgres-# to postgres=#. And ctrl+l ...
Kavinkumar S's user avatar
1 vote
1 answer
34 views

force postgresql client to output valid json after EXPLAIN

when in psql: postgres=# EXPLAIN (ANALYSE, FORMAT JSON) SELECT a FROM t; QUERY PLAN ------------------------------------------------------- [ ...
oran g's user avatar
  • 181
1 vote
2 answers
52 views

Importing CSV To Postgres, Translating Text To Booleans

I need to import a CSV file into a PSQL database, and I need to convert a column full of "No" and "Yes" into True/False. Also, I need to select which CSV columns I'm importing into ...
Noah Shrewsbery's user avatar
0 votes
1 answer
68 views

How to restore postgres backup using kubernetes exec command [closed]

I'm trying to restore the PostgreSQL backup using this command kubectl exec -i cnpg-cluster-1 -n lc -- psql --username="postgres" --dbname="data" --password < "/tmp/backup-...
user2315104's user avatar
  • 2,772
0 votes
1 answer
75 views

The table I created in pgAdmin is not found in psql

I created a table in pgAdmin 4 and connected to it asyncpg in my Python code. When I use the \dt command in psql, it gives the error "Did not find any relations." But I created the table in ...
xblackcat's user avatar
0 votes
1 answer
52 views

Postgres localhost connection timeout (but was working before)

>> psql psql: error: connection to server at "localhost" (::1), port 5432 failed: Connection refused (0x0000274D /10061) Is the server running on that host and accepting TCP/IP ...
Jason's user avatar
  • 2,160
0 votes
0 answers
42 views

PostgreSQL , shared environment [duplicate]

PostgreSQL version (14.17) I have a PostgreSQL setup where I want to restrict a role, user1_db, to only see and connect to specific databases it has been granted access to. I've tried with the ...
include's user avatar
1 vote
1 answer
39 views

How to get ON_ERROR_STOP=1 to work with \! in psql

If I have a script like this: select 1; select wrong; select 1; I can run it in postgres and the 1st and third commands run: 20:18:19:~ $ psql postgres postgres psql (14.1) Type "help" for ...
Richard Wheeldon's user avatar
0 votes
0 answers
18 views

Database: migration against the ID field

I have a PSQL database with related relations, and I already have record store in the tables. I need to update the default value for the id field in the relations from CUID to UUID. I'm using Prisma ...
Tomax47's user avatar
  • 31
0 votes
1 answer
73 views

Syntax error in `JSON_EXISTS` function in PostgreSQL

I want to fetch the data if a particular employee id exists using JSON_EXISTS function. But I am getting syntax error, not sure where I am wrong. Can someone suggest? create table test ( id int ...
Madhu's user avatar
  • 49
1 vote
1 answer
28 views

How do I capture the output of \conninfo into a variable in postgresql's psql?

I'm writing a psql sql script to generate an sql script. The way I do this, is by writing every ouputline to a temptable and later on \copy that to the output sql file. I'd like to include the \...
Peter Van Biesen's user avatar
2 votes
1 answer
43 views

Variables in looping condition in a postgreSQL while loop

I'm using psql to process a sql file. A parameter is sent to the psql call as: -v myVar=5 The SQL file needs to loop from 1 till myVar and do some stuff. i is a being declared as DECLARE i integer = 1;...
Ron Tuffin's user avatar
  • 54.7k

15 30 50 per page
1
2 3 4 5
251