Skip to main content

Questions tagged [psql]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
455 views

I installed Postgresql. While trying to create user in psql, I messed up the configuration settings. Now, I can't even uninstall or install completely

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://apt.postgresql.org/pub/repos/apt jammy-pgdg InRelease:...
Kiransurya Madiyan's user avatar
2 votes
0 answers
4k views

How to manually uninstall PGAdmin4 from macOS?

I have tried removing manually by removing PGAdmin4 from my applications folder. I also followed a few steps from this post here. To my surprise some of the files existed and I was able to remove them....
Ahmed's user avatar
  • 121
0 votes
3 answers
221 views

Import psql dump without change in pg_hba.conf?

For some time I've been working on an install script for Tryton ERP on Linux systems. Meanwhile, most things are working, but I do not get around one challenge: I need to provide the option to import ...
herrdeh's user avatar
1 vote
0 answers
423 views

PostgreSQL sum function resurns different result when run multiple of times with psql

I have this query : SELECT SUM(median) FROM my_table WHERE id = 100 -- median is of type float4 When I run from psql, it returns slightly different result for multiple of runs (For example 1000.08, ...
Philippe's user avatar
  • 145
1 vote
1 answer
2k views

psql command not taking password from .pgpass file

psql -U postgres -h 127.0.0.1 postgres I am using the above command to connect to the postgres running on my system. It asks for password Whereas I have setup .pgpass file in the current directory ...
bittu's user avatar
  • 11
0 votes
1 answer
945 views

Reduce the permission of a file in linux

psql -h 127.0.0.1 throwing this error : .pgpass has group or world access; permissions should be u=rw (0600) or less How do I reduce the permissions currently it shows : -rwxrwxrwx
Amit wadhwa's user avatar
1 vote
1 answer
2k views

bash - passing an sql query as an argument to psql

I have the following SQL query that executes correctly in the psql shell: SELECT c.component_name AS "Component", c.component_version_name AS "Component Version", c....
xgkphdx's user avatar
  • 11
3 votes
2 answers
437 views

Viewing wide terminal output in tmux

I enjoy using psql with Tmux and Vim, using Vim to edit my queries and send them to psql in another Tmux pane. This is a fantastic workflow, far superior to a GUI like DBeaver in my opinion, but: It ...
LondonRob's user avatar
  • 435
1 vote
1 answer
184 views

Is there an equivalent of .ssh/config for use with psql?

In the .ssh/config file (at least that's the usual default location), I can define hostname, username, port, etc. for ssh connections and store it with an easy to use name. That allows me to call ssh ...
karpfen's user avatar
  • 151
1 vote
1 answer
109 views

Why do I get error "/var/lib/pgsql/.role.sh: not found" from postgres in docker?

I have PostgreSQL running in Docker. The host system is Ubuntu 18.04.3. Every time I execute some SQL in PostgreSQL I get /var/lib/pgsql/.role.sh: not found Does anyone know why this is or at least ...
Filip Sjöstrand's user avatar
-2 votes
1 answer
220 views

All my tables inserted with a .sql file are gone when I close a session in Postgres

So I'm new to psql so sorry for the noob question. Not sure if relevant but I'm using Ubuntu 19.04 installed on a USB stick with persistent memory (used mkdisk). Everything works fine but I have ...
Electrolite's user avatar
0 votes
1 answer
1k views

i can not connect to psql

i typed psql and it's show this error psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/...
Quân's user avatar
  • 1
1 vote
1 answer
2k views

Can't create extension orafce in Postgresql

my os is redhat 7.3 and I am trying to install orafce to postgresql with psql version 9.2 and server version 9.6. Firstly, i try to install via the script orafce downloaded on github but after reading ...
MaximusPrime's user avatar
1 vote
1 answer
414 views

Force transactions in psql

When I use the psql console, is it possible to force any inserts/updates/deletes to be run in a transaction? Or do I always have to explicitly start every command with 'BEGIN'?
mawaldne's user avatar
  • 2,746
2 votes
1 answer
16k views

-bash: psql: command not found

I'm on a Mac 10.11 running psql -h localhost -U monitor -W postgres and I kept getting -bash: psql: command not found This is what I have in my paths. /usr/local/bin /usr/bin /bin /usr/sbin /sbin /...
code-8's user avatar
  • 444
1 vote
1 answer
869 views

Run shell and check port of specific postgresql version in ubuntu

Several versions of postgresql (9.3, 9.4 and 9.5) on a server with different ports and I want to start the shell of a specific one. If I run the shell: psql It returns: psql (9.5.0, server 9.3.10) ...
Joost Döbken's user avatar
3 votes
1 answer
683 views

pgAdmin III writes files with junk in them, which causes PSQL to fail

I encountered the dilemma of needing to run some psql console commands because a colleague needed to use psql's \i directive in a saved script to execute additional SQL-statements from another file, ...
Seldom 'Where's Monica' Needy's user avatar
4 votes
0 answers
890 views

Can't tab complete in psql

For some reason, tab-completion isn't working in psql on my Mac. I can tab complete table and field names just fine in Ubuntu, but pressing TAB fails to work in Mac OS X. I can successfully use my Up/...
mcandre's user avatar
  • 3,078
1 vote
1 answer
426 views

psql ignores my PAGER variable

I want to use less as my default pager. Therefore I have PAGER=less in my .bashrc. It's sourced properly: $ echo $PAGER less However, psql still uses more if I call it with psql. BUT: If I call it ...
musiKk's user avatar
  • 375
2 votes
1 answer
2k views

How to display server name in psql prompt

I have two servers running same PostgreSQL databases where one is production and one is development snapshot. It would be very handy for me if I could show the server name in the psql prompt (like ...
Nemanja Boric's user avatar
1 vote
1 answer
3k views

Postgresql query within a bash script

We are having an issue with a postgresql bash query. The output of the query from the bash script add's additional quotes around the date. Please can you help me fix it?! Script: #!/bin/sh ...
GuruFrog's user avatar
0 votes
1 answer
537 views

Change how PSQL shows queries

This is a minor issue, but it's driving me nuts. Anyways, on some of my servers I'm running PostgreSQL 8.4. When using PSQL (also 8.4), queries are shown with a less-like interface, which I'm quite ...
Theron Luhn's user avatar
0 votes
1 answer
4k views

How to change output pattern in shell?

I run the psql command from a Linux shell. The resulting output looks like a table: Name Age ----------------- John 24 But I would like to get the result with commas like ...
Sai Ye Yan Naing Aye's user avatar
2 votes
1 answer
2k views

(-bash: initdb: command not found) When installing postgres mac

I get the following error (-bash: initdb: command not found) in the terminal when trying to install postgres on my mountain lion mac osx? Also, does any one have a good resource for installing ...
user avatar
6 votes
3 answers
3k views

To have Vim Psql's editor

I have a Fresh Ubuntu installation. I have no personal dot-files active. I run unsuccessfully \e file.sql in Psql, when I have the following in my .bashrc, since Nano opens instead of Vim export ...
Léo Léopold Hertz 준영's user avatar