Search Postgresql Archives

Install scripts?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rookie question... I'm converting a MySQL database to Postgre. In MySQL, all the tables are defined in seprate 'table_name.sql' file.

There is one 'install.sql' file which does something like:

DROP DATABASE db_name IF EXISTS (<--- is there something similar in Postgre? Like the CREATE OR REPLACE FUNCTION)

CREATE DATABASE db_name;

USE db_name;

SOURCE users.sql;
SOURCE teams.sql;
SOURCE players.sql;

etc.

Using the mysql command like tool, you just run "source install.sql" and the whole database is loaded.

How do you do this with Postgre? I tried using the "insert filename" command, but one file cannot seem to load another (ie, a SELECT filename gives me an error) and to start with, I cannot find something similar to "USE DATABASE" ....

Thanks!



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
     subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
     message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux