Questions tagged [psql]

psql is official postgresql client

psql is the official postgresql database client. It provides a command line interface (CLI), and it can be used to establish an interactive session with a postgresql database server and execute SQL queries. It can also be used to import an SQL file and execute it against one of the postgrseql DBs.

50 questions
0
votes
2 answers

pg_dump fails as a cron job in one script but not another

I have two cron jobs on my AWS server (triggered via crontab -e) to invoke pg_dump on specific databases. The two scripts are identical with the exception of the target database they're backing up ($PG_SRC_DB). One fails at the pg_dump command but…
PGT
  • 101
  • 3
0
votes
4 answers

PostgreSQL 8.4 won't start after blackout

I have problem with starting PostgreSQL 8.4 on Ubuntu 9.10 Server after blackout. When I try to connect to the database it says: psql: server closed the connection unexpectedly This probably means the server terminated abnormally before or while…
RiZe
0
votes
2 answers

PostgreSQL password issue with psql

I'm trying to setup PostgreSQL onto a CentOS (that I connect through SSH). I need to unzip a package (so not downloading through yum or rpm): http://get.enterprisedb.com/postgresql/postgresql-9.3.4-3-linux-x64-binaries.tar.gz and set this up. I…
kolistivra
  • 343
  • 1
  • 3
  • 7
0
votes
1 answer

Unable to login in phpPgAdmin

I am trying to login to phpPgAdmin from a remote client. I've created the user root, but when I login phpPgAdmin returns an error message saying "Unable to login" When I check the log it says: "provided user name (root) and authenticated user name…
Alfons
  • 11
  • 1
0
votes
2 answers

Postgresql pgdump script on RHEL5: "failed: fe_sendauth: no password supplieddatabase "

What I'm trying to accomplish is having a pg_dump script run as a cron job. Right now I'm just trying to get the script to run by invoking it myself at the command line. I've searched the postgresql mailing lists and followed the postgresql…
Tim Sanders
  • 119
  • 1
  • 4
0
votes
3 answers

pgsql can connect, pgadmin cannot

We want only 1 role owning 1 database, Domain-unix Socket, no password postgres@luciol-essai:~$ more /etc/postgresql/8.4/main/pg_hba.conf | grep jppstphp local essais_php jppstphp trust postgres@luciol-essai:~$ Success…
0
votes
2 answers

Database not browsable during COPY on PostgreSQL

When using COPY to restore a CSV file, phppgadmin shows that the real database size(4GB) but when I choose to browse the table it shows Estimated row count to 0. I did a VACUUM ANALYZE. simple SELECT queries returns 0 rows, but the database size is…
Majid Azimi
  • 547
  • 1
  • 13
  • 29
0
votes
1 answer

ssl handshake failure with COPY on PostgreSQL

I'm restoring a CSV file to database with COPY command. The csv file is bziped. I use this command: bunzip2 -c -d online-20110923000001.csv.bz2 | psql -U user -h 127.0.0.1 -d testdb -c "COPY data FROM STDIN WITH CSV HEADER;" After some time it…
Majid Azimi
  • 547
  • 1
  • 13
  • 29
0
votes
1 answer

Problem with diacritics on psql 9.0 (PostgreSQL)

I have two instances of PostgreSQL installed on my server: 8.3 and 9.0. There seams to be some problem with Polish diacritic characters (like ółęąśżźć) on postgresql 9.0 client - psql. When I connect to DB (either 8.3 or 9.0) with psql 8.3 - I can…
grzaks
  • 335
  • 1
  • 3
  • 9
0
votes
0 answers

psql shell over ssh via bash script doesn't get user input

I'm opening a ssh connection and then go into a psql shell. This works, I get the prompt. I can also input commands like "\dt". But I don't get any output. As I can get output in general, I rather think the input didn't get to the remote or psql…
steros
  • 121
  • 5
0
votes
0 answers

Can't run psql backup in user-data script in AWS EC2

I have private subnet for my EC2 instance, I use NAT Gateway for it to access internet. I created user-data script for my EC2 where I've created docker-compose.yml with postgres service defined. After defining this i have: docker-compose up -d # i…
0
votes
1 answer

Postgres Role required to grant CONNECT on a specific database

I am trying to GRANT CONNECT on a DATABASE to a user as a schema owner in that database. The schema owner is not a superuser. Do I need to be the owner of a database to execute GRANT CONNECT ON DATABASE DBXXX TO USER_YYY; ?? What role should a user…
0
votes
1 answer

Security issue with pg_hba.conf

I have a PHP script on my server that needs access to a database user to work properly . The person who programmed that PHP script has told to add the following to pg_hba.conf : host all all 127.0.0.1/32 trust Can this cause any security related…
master lfc6
  • 27
  • 2
  • 7
0
votes
1 answer

Postgres Table size & record counts

I want to understand the below result behavior for finding a size for a table with x MB while try to count record in this table but no records found in postgres database db_server=# \dt+ List of relations Schema | …
Moustafa
  • 1
  • 2
0
votes
1 answer

How do I permanently upgrade psql client version in Google Cloud Shell?

From this answer I need to upgrade the psql in the Google Cloud Shell. But any upgrade I do there it shows a warning like this: Note that your Cloud Shell machine is ephemeral and no system-wide change will persist beyond session end. So how do I…
Zenko
  • 101
  • 3