Re: Moving from MySQL to PGSQL....some questions

Поиск
Список
Период
Сортировка
От Michael Chaney
Тема Re: Moving from MySQL to PGSQL....some questions
Дата
Msg-id 20040225164050.GC6206@michaelchaney.com
обсуждение исходный текст
Ответ на Moving from MySQL to PGSQL....some questions  (Karam Chand <karam_chand03@yahoo.com>)
Список pgsql-general
On Wed, Feb 25, 2004 at 06:57:04AM -0800, Karam Chand wrote:
> 4.) I couldnot find any query to change the context of
> database like in MySQL :
>
> use database;

Your other questions were answered more than adequately by others, but I
thought I'd provide more details here.

If you're in the command line psql, then use "\c database" to accomplish
this.  The drawback is that you cannot change the database in that
manner programmatically.  If you're using Perl or PHP, for instance, you
must connect to the other database explicitly using the proper function.
In Perl, this means you must use DBI->connect again with the new
database name.

In MySQL, you can get data from another database by using the construct
"datbase.table" to refer to the table.  This doesn't work in Postgres.

If you need to do something like that, you likely need to be using
schemas.

I've put together a quick list of minor differences between MySQL and
Postgres (besides the obvious "real RDBMS" features that exist only in
Postgres) that should help you get started:

http://www.michaelchaney.com/mysql-to-postgres.html

That includes information on date handling, literal quoting, basically
anything that I ran in to while converting an application.  But it
should help you get started quickly.

Michael
--
Michael Darrin Chaney
mdchaney@michaelchaney.com
http://www.michaelchaney.com/

В списке pgsql-general по дате отправления:

Предыдущее
От: Jean-Michel POURE
Дата:
Сообщение: Re: Moving from MySQL to PGSQL....some questions
Следующее
От: Bill Moran
Дата:
Сообщение: Re: Moving from MySQL to PGSQL....some questions