About 5,270,000 results
Open links in new tab
  1. 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:

  2. 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 …

  3. PostgreSQL - query from bash script as database user 'postgres'

    Once you're logged in as postgres, you should be able to write: psql -t -d database_name -c $'SELECT c_defaults FROM user_info WHERE c_uid = \'testuser\';' to print out just the value …

  4. PostgreSQL: Show all the privileges for a concrete user

    Nov 23, 2016 · 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 …

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

    Jan 16, 2019 · I don't know what you are doing wrong, your "psql -c" command works perfectly fine: ads@diamond:~$ psql -c "begin; create schema test_schema; create table …

  6. Restore a postgres backup file using the command line?

    while using psql if your user (for e.g. postgres) has a password set then -W option should be used. For e.g. on Ubuntu without doing su postgres anywhere from terminal $ psql -h localhost …

  7. 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.

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

    Jul 20, 2016 · 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: boron.production=> \o /tmp/output

  9. What is the default password for Postgres - Stack Overflow

    If you run psql.exe and enter that password, it won't work. The problem is that PostgreSQL chooses the logged in Windows user as active user, but that is not the default user that was …

  10. How can I connect to a database as another user? - Stack Overflow

    The accepted answer tells you how to login as a user before you run psql prompt. But if you want to switch between users inside psql prompt, you can use \c (connection command)