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

From: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
To: Karam Chand <karam_chand03(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Moving from MySQL to PGSQL....some questions
Date: 2004-02-25 15:25:37
Message-ID: Pine.LNX.4.44.0402251620260.10106-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 25 Feb 2004, Karam Chand wrote:

> 1.) What is template1 and template0? I assume these
> are system databases. Am I right?

When you create a new database what you get is a copy of template1.

template0 is alsmost not used. If you mess up template1 so you can't
create usable new databases one can use template0 to create a new
template1.

The system tables are a bit complexed and some are shared between all
databases.

> 3.) To get all the database is the server we use query
> like -
>
> select datname from pg_database

or \l in psql

> 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.

yes, pg_database is a shared table.

> 4.) I couldnot find any query to change the context of
> database like in MySQL :
>
> use database;

\c in psql.
>
> 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?

\d and others.

\? is a useful command. Also the man page (man psql) can help.

--
/Dennis Björklund

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karam Chand 2004-02-25 15:45:06 Re: Moving from MySQL to PGSQL....some questions
Previous Message cnliou 2004-02-25 15:17:04 Re: invalid memory alloc request size