About 53 results
Open links in new tab
  1. Run PostgreSQL queries from the command line - Stack Overflow

    Oct 30, 2013 · psql -U username -d mydatabase -c 'SELECT * FROM mytable' If you're new to postgresql and unfamiliar with using the command line tool psql then there is some confusing …

  2. Run a PostgreSQL .sql file using command line arguments

    Mar 16, 2012 · psql --version which psql Mine is version 9.1.6 located in /bin/psql. Create a plain textfile called mysqlfile.sql Edit that file, put a single line in there:

  3. How to show data in a table by using psql command line interface?

    Mar 26, 2020 · 215 Is there a way to show all the content inside a table by using psql command line interface? I can use \list to show all the databases, \d to show all the tables, but how can I …

  4. postgreSQL - psql \\i : how to execute script in a given path

    psql -f createDB.sql I want the script to call other scripts (separate ones for creating tables, adding constraints, functions etc), like this:

  5. PostgreSQL: How to pass parameters from command line?

    I have a somewhat detailed query in a script that uses ? placeholders. I wanted to test this same query directly from the psql command line (outside the script). I want to avoid going in and repl...

  6. Postgresql -bash: psql: command not found - Stack Overflow

    The program executable psql is in the directory /usr/pgsql-9.2/bin, and that directory is not included in the path by default, so we have to tell our shell (terminal) program where to find psql.

  7. sql - What is the difference between "psql -c" and "psql -f" when ...

    Jan 16, 2019 · psql -f create_schema_and_table.sql My questions are: What is the difference between executing queries with "psql -c" and "psql -f"? How can the same result be achieved …

  8. psql - write a query and the query's output to a file

    Jul 20, 2016 · 16 In postgresql 9.3.1, when interactively developing a query using the psql command, the end result is sometimes to write the query results to a file:

  9. How to execute multiple queries using psql command from bash …

    Mar 2, 2015 · I need to execute postgresql queries from command line using psql -c command. For every psql command, it opens a new tcp connection to connect to the database server and …

  10. Connect to remote PostgreSql database using Powershell

    You must have psql in your path or reference it, its within e.g. C:\Program Files\PostgreSQL\12\bin. Should be able to type "psql" and see output within powershell.