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

Поиск
Список
Период
Сортировка
От Shridhar Daithankar
Тема Re: Moving from MySQL to PGSQL....some questions
Дата
Msg-id 403CBBD2.9030708@frodo.hserus.net
обсуждение исходный текст
Ответ на Moving from MySQL to PGSQL....some questions  (Karam Chand <karam_chand03@yahoo.com>)
Ответы Re: Moving from MySQL to PGSQL....some questions  (Karam Chand <karam_chand03@yahoo.com>)
Re: Moving from MySQL to PGSQL....some questions  (Shachar Shemesh <psql@shemesh.biz>)
Список pgsql-general
Karam Chand wrote:
> 1.) What is template1 and template0? I assume these
> are system databases. Am I right?

Yes. whenever a new database is created, these databases are copied there. So
these are like initial master copies.

> 2.) When I create a database using CREATE DATABASE
> stmt. a new DB is created where it has 4 schemas and
> around 100 tables. These are the system tables keeping
> information about everything in the database? I hope I
> am correct :)

Yes.

> 3.) To get all the database is the server we use query
> like -
>
> select datname from pg_database
>
> I means that there exists a table pg_database in all
> the database and all the pg_database table(s) are
> updated whenever a user issues CREATE DATABASE stmt.
>
> Why I am saying so coz in PgAdmin III i can see these
> tables in all the databases?

Some tables such as users/passwords/groups and databases are shared across all
the databases. You are looking at same data.
>
> 4.) I couldnot find any query to change the context of
> database like in MySQL :
>
> use database;
>
> or am i missing something?

Any postgresql session has to connect to a database. To connect to different
database, you need to initiate a new connection or drop existing one and create
new one.

You can not switch the database-connected-to on the fly.

> 5.) In MySQL, there are many command like show tables,
> show databases etc. to get object details. I cant see
> anything similar in PGSQL. After searching the net i
> find that i have to execute certain queries to fetch
> those queries. Is this the only way?

No. Simplest would be issuing \? on psql prompt. It will tell you plethora of
options/commands using which you can accomplish many task. Just remember that
these are not SQL command provided by server. It is the psql application which
provide these commands. So you cannot use them in say php.

> Any help would be appreciated.

HTH

  Shridhar

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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: Moving from MySQL to PGSQL....some questions
Следующее
От: "cnliou"
Дата:
Сообщение: Re: invalid memory alloc request size