I am using PostgreSQL 8.4, and I have some *.sql files to import into a database. How can I do so?
From the command line:
From the
Note that you may need to import the files in a specific order (for example: data definition before data manipulation). If you've got
Here's the documentation of the |
|||||||||||||||||||||
|
in command line first reach the directory where psql is present then write commands like this:
and then press enter psql asks for password give the user password: then write
then press enter insertion done. |
|||||||||||||
|
Be careful with "/" and "\". Even on Windows the command should be in the form:
|
||||
|
Well, the shortest way I know of, is following:
database_name: Which database should you insert your file data in. file_path: Absolute path to the file through which you want to perform the importing. host_name: The name of the host. For development purposes, it is mostly Upon entering this command in console, you will be prompted to enter your password. |
||||
|