Re: Using Batch Files to Create DB Structure
От | brew@theMode.com |
---|---|
Тема | Re: Using Batch Files to Create DB Structure |
Дата | |
Msg-id | Pine.BSF.4.58.0507140304250.44370@themode.com обсуждение исходный текст |
Ответ на | Using Batch Files to Create DB Structure (Don Parris <gnumathetes@gmail.com>) |
Список | pgsql-novice |
Don.... > In MySQL, I could use a simple batch file to run all my table creation > statements: > mysql -u user -p mydb < /file/path/batchfile.sql > > Is this possible with PGSQL? Can I do this, for instance: > psql -W mydb < /file/path/batchfile.sql > > and get all my tables created? Yes. I always have to play with it to get the command line right. And then when loading a mysql dump into postgreSQL I have to play with it some more. What works best for me is to put drop table statements in at the begining of the dump, then I keep loading it in over and over, each time noting the errors and correcting the definitions until I get the table defined and the data loaded. The data types are slightly different mostly. There is a script to go from mysql to postgreSQL somewhere, but I've never used it. Always did it by hand. brew ========================================================================== Strange Brew (brew@theMode.com) Check out my Stock Option Covered Call website http://www.callpix.com and my Musician's Online Database Exchange http://www.TheMode.com ==========================================================================
В списке pgsql-novice по дате отправления: