psql Questions
9
Solved
I set up the PostgreSQL using Docker Compose and the content of the file (compose.yaml) is like so:
name: postgres-container
services:
database:
image: postgres
restart: always
environment:
- ...
Susian asked 24/10, 2022 at 13:47
1
Today I was prompted to upgrade my OS from Ubuntu 14.04 LTS to 16.04 LTS. Generally speaking, it went smoothly. However, I did receive error messages indicating that the upgrade of PostgreSQL from ...
Nu asked 1/8, 2016 at 3:16
8
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/p.gauthamprasad/Downloads/pb/pbapp/manage.py", line 22, in <module...
Vicinage asked 27/10, 2022 at 5:39
8
Solved
How to make a query to the Postgres data dictionary to find out all the privileges that a particular user has.
I've been looking for a solution and I can not find anything. Thanks and good day
Geriatric asked 23/11, 2016 at 8:18
7
I have problem creating new psql user because I cannot log in psql as "postgres", I have tried
1. sudo -u postgres psql
2. sudo -u postgres createuser img_site -P -s -e
and they are all ask fo...
Benefic asked 1/9, 2013 at 4:50
5
Solved
I need to restore a big table (250mb) in PostgreSQL database in console tool. How I can do this using ps_dump or psql?
Apollonius asked 24/2, 2012 at 9:17
7
Solved
I'm playing around with Docker and I would like to Dockerize a Postgres container.
I'm following the official example but I can not connect to the image running using psql.
I created the Dockerfi...
Nievelt asked 13/10, 2014 at 15:8
2
6
Solved
I'm having trouble using PostgreSQL. I have recently installed this version (13+223.pgdg20.04+1) of postgresql package in ubuntu 20.04.
I'm trying to run psql command, but I get the following error...
Valdes asked 9/12, 2020 at 18:35
22
Solved
I am trying to connect to a Postgres database installed in a remote server using the following command:
psql -h host_ip -U db_username -d db_name
This is the error that occurs:
psql: could not con...
Faker asked 7/9, 2015 at 12:48
5
Solved
Is there are an easy way to do CREATE FUNCTION IF NOT EXISTS?
I have multiple schemas and I am preparing a script that will create missing objects in the target schema. The plan is to run a script ...
Lactose asked 12/10, 2021 at 20:52
4
If I am in the psql terminal then I can declare and use a variable like this:
\set message_id soifsdaofisd.gmail.com;
select * from emails where message_id = ':message_id';
How can I do this in ...
Homozygote asked 9/5, 2014 at 9:43
3
Solved
I installed a Postgres extension (unaccent) with
sudo su posgres
psql create extension unaccent
and now I can use unacccent in sql, but only if I am the Postgres user.
How do I make Postgres ex...
Pear asked 12/6, 2015 at 10:21
2
Solved
Is there any way to list all tables that contain certain keywords in psql?
In other words, is there a similar command as in mysql:
show tables like "%test%" ?
Soren asked 18/8, 2014 at 17:1
3
Solved
Here is my simple anonymous code block:
do $$
declare foo varchar(50) := '';
begin
for a in
select a from (values('foo'), ('bar'), ('fooBar')) s(a)
loop
foo := a;
print foo;
end loop;
end;...
Pepillo asked 11/4, 2013 at 12:54
25
Solved
I'm using Postgres.app for Mac. I've used it in the past on other machines but it's giving me some trouble when installing on my MacBook. I've installed the application and I ran:
psql -h localhost...
Davisson asked 13/7, 2013 at 19:18
2
Solved
I'm using Git Bash on Windows 10. I would like to import a SQL file to be run in my PostGres 12 local database. I tried the below
$ PGPASSWORD=$DB_PASSWORD psql -U${DB_USER} $DB_NAME < scripts/m...
Harrier asked 20/7, 2022 at 14:19
1
I created person table as shown below:
CREATE TABLE person (
id INTEGER,
name VARCHAR(20)
);
Then, trying to show the definition of person table with \d and \d+ got the error as shown below:
pos...
Bengt asked 18/1 at 16:56
2
Solved
While using psql, I want to change the initial database connection.
I had a database named "test" as the initial connection.
When running psql from the command line my prompt would be test=#
Aft...
Cutout asked 16/10, 2012 at 16:35
5
Is there a way to specify that when executing a sql script it stops when encountering the first error on the script, it usually continues, regardless of previous errors.
Spleen asked 18/12, 2010 at 21:54
11
I have a postgres database with multiple schemas. When I connect to the database from a shell with psql and I run \dt it uses the default connection schema which is public. Is there a flag I can sp...
Kindrakindred asked 4/12, 2015 at 22:10
16
Solved
In MySQL, I used use database_name;
What's the psql equivalent?
Scottie asked 16/10, 2010 at 17:9
19
Solved
I installed PostgreSQL via the graphical install on http://www.postgresql.org/download/macosx/
I see it in my applications and also have the psql terminal in my applications. I need psql to work i...
Slayton asked 22/3, 2016 at 13:7
5
Solved
I exported a postgresql database from an external server, and attempted to import it into my local server but got this error:
unrecognized configuration parameter "idle_in_transaction_session...
Headwater asked 8/1, 2017 at 0:30
4
Solved
What's the psql command to view all existing tablespaces?
\l+ displays all existing databases with their configured tablespace, but it won't display tablespaces which have been created but don't ...
Sisal asked 14/2, 2020 at 12:28
1 Next >
© 2022 - 2024 — McMap. All rights reserved.