About 735,000 results
Open links in new tab
  1. Run a PostgreSQL .sql file using command line arguments

    Mar 16, 2012 · Open a terminal and make sure you can run the psql command: psql --version which psql Mine is version 9.1.6 located in /bin/psql. Create a plain textfile called mysqlfile.sql. …

  2. How to execute a SQL script (.sql file) in Postgres - SysOpsPro

    Apr 11, 2023 · In this guide, we covered two methods for executing SQL scripts in PostgreSQL and redirecting their output to a file: Using the psql prompt with \i and \o commands. Executing …

  3. How To Execute SQL Statements From A File On A PostgreSQL

    Jan 29, 2023 · In this post, we’ll discuss how to import and execute a SQL file into a PostgreSQL database using the psql command, and how to resolve the most common errors that might …

  4. Run a PostgreSQL .sql File using command line arguments

    Dec 23, 2024 · In PostgreSQL, you can execute SQL scripts stored in .sql files directly from the command line using the psql command-line tool. This is especially useful for running complex …

  5. How to Run a .SQL File in PostgreSQL: A Step-by-Step Guide for ...

    Oct 30, 2023 · But what is the best way to run a .sql file in PostgreSQL? In this comprehensive 2500+ word guide, you‘ll learn: What SQL scripts are and why they are useful; The step-by …

  6. How to Run SQL File in PSQL - Delft Stack

    Feb 2, 2024 · This article explains how to run a SQL file direct from terminal/command-line or psql shell. For that, you need to specify the hostname, port, username, and database name.

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

    Sep 2, 2023 · In this guide, we'll address the common issue of running these inserts via the command line, provide easy solutions, and ensure you can add those statements to your table …

  8. command line - Beyond psql: Alternative Methods for Running PostgreSQL

    Apr 26, 2025 · To execute a .sql file without arguments: -f my_script.sql: Specifies the path to the SQL file. -d mydatabase: Specifies the database name. -U postgres: Specifies the username. …

  9. Execute a script SQL file in PostgreSQL - SmartTechWays

    Apr 19, 2023 · Run a SQL file using the command line in PostgreSQL Run the SQL file with the PSQL utility which connects with the PostgreSQL database psql -h localhost -d Store -U admin …

  10. postgresql - how to execute .sql files in postgres database

    Mar 30, 2017 · Use the psql command line tool: This command executes all commands line-by-line (except when the file contains BEGIN…END blocks. In this case, commands in blocks …

  11. Some results have been removed
Refresh