Linked Questions

8 votes
1 answer
17k views

pg_dumpall without prompting password [duplicate]

We are trying to automate the backup of all PostgreSQL databases of a cluster, and we decided to use 'pg_dumpall' utility. But we couldn't find a way to execute 'pg_dumpall' without prompting password....
jithin giri's user avatar
0 votes
1 answer
737 views

How to type text in CMD with batch file? [duplicate]

Sorry if my question sounds a little bit obvious but I'm a little bit new on creating batch files, so the problem is the next one: I'm creating a batch file that would to be open CMD and then go to a ...
Xkid's user avatar
  • 419
0 votes
0 answers
53 views

Postgres How to execute SQL statement from command line [duplicate]

I'm using Ubuntu i want to execute : sudo -i -u postgres testodb < db.sql . this doent working. any help Thanks
Abbassi's user avatar
763 votes
12 answers
884k views

How do I specify a password to 'psql' non-interactively?

I am trying to automate database creation process with a shell script and one thing I've hit a road block with passing a password to psql. Here is a bit of code from the shell script: psql -U $...
Alex N.'s user avatar
  • 16.1k
3 votes
1 answer
16k views

Connect with psql from remote machine to remote postgres database with saved password

I am working on a remote Unix machine where I connect via SSH from my local machine. There is a Postgres database on another host that I need to connect from my remote machine using psql. I would ...
user90772's user avatar
  • 377
2 votes
1 answer
7k views

\i psql permission denied

I am trying to run a .sql script that uses postgresql. I have installed postgresql, and created a database to run the script in however I continuously get permission denied error on the file. ...
Fletchy's user avatar
  • 361
0 votes
1 answer
4k views

Execute 50k insert queries in postgresql dbeaver

Is there any possibility to insert 50k datasets into a postgresql database using dbeaver? Locally, it worked fine for me, it took me 1 minute, because I also changed the memory settings of postgresql ...
Blnpwr's user avatar
  • 1,875
1 vote
0 answers
4k views

psql: fe_sendauth: no password supplied with pgpass

I am trying to connect to the PostgreSQL-11 using psql-11 and pgpass as I want to avoid password request. I used following post: Run a PostgreSQL .sql file using command line arguments. I checked ...
Kosta's user avatar
  • 55
1 vote
1 answer
1k views

DROP Postgres SCHEMA or TABLE using Windows Batch File

I want to perform DROP and CREATE SCHEMA in PostgreSQL using Batch file. I have PostgresSQL installed on many machines without any interface like PgAdmin. I am looking for a simple solution to let ...
Ummi's user avatar
  • 13
1 vote
1 answer
2k views

Getting 'psql: FATAL: database "forum.sql" does not exist' Error

I'm currently running Linux Mint 17.2 XFCE, and am currently taking the Udacity Intro to Relational Databases course. A few days ago I installed PostGreSQL as part of the program. A part of the course ...
Josh Kraushaar's user avatar
0 votes
1 answer
748 views

How to create a script that automatically creates a PSQL database locally?

I have a React/Node.js project, in which I want to have a local database for development purposes. I have the SQL code to create and populate tables in a file called db-setup.sql. How would I go ...
anInputName's user avatar
0 votes
1 answer
657 views

Run Postgres File from Command Line (Without actually printing out code)

I can successfully run SQL (Postgres) files from command line following instructions here: Run a PostgreSQL .sql file using command line arguments In particular, I use something like psql -d ...
Vincent's user avatar
  • 9,006
0 votes
0 answers
508 views

Postgres EDB Run a sequence of sql files

I'm attempting to run a sequence of SQL files using PEM. From the Oracle database I used: @path_to_file1.sql @path_to_file2.sql @path_to_file3.sql How do I do this using Postgres Enterprise Manager (...
Yore's user avatar
  • 440
0 votes
0 answers
370 views

ProcessBuilder to execute .sql script files is hanging

I'm using ProcessBuilder to run Postgres SQL scripts and my process seems to hang, because I'm not getting the exit value. My code has a test method that loads and executes certain SQL files. I then ...
Rebecca's user avatar
  • 21
0 votes
1 answer
169 views

How to pass the parameter with the file while executing the postgresql command in the comand line?

I have a file named insert_all.sql which contains the content as below. Here v1 is the parameter to be passed. do $$ begin delete from tabledetails where table_name = '$(v1)'; end; $$...
Abimanyu's user avatar
  • 165