Migration from MySQL, some difficulties with DESCRIBE and SHOW

Поиск
Список
Период
Сортировка
Искать

Migration from MySQL, some difficulties with DESCRIBE and SHOW

От:
Wolfgang Draxinger <wdraxinger@darkstargames.de>
Дата:
I just migrated to PostgreSQL since this offers a few features I needes 
ugently, especially subqueries. However I got to stuck with DESCRIBE and 
SHOW commands. Are those not avaliable, or have they some special behaviour?
When trying a SHOW TABLES; I just get an error.

Wolfgang
--

Re: Migration from MySQL, some difficulties with DESCRIBE and SHOW

От:
"Eric Johnson" <ej@ejinnovations.com>
Дата:
Try:

\d tablename     for DESCRIBE functionality
\dt                    for SHOW TABLES functionality.


Hope that helps,
Eric


----- Original Message ----- 
From: "Wolfgang Draxinger" 
To: 
Sent: Sunday, August 03, 2003 2:44 PM
Subject: [NOVICE] Migration from MySQL, some difficulties with DESCRIBE and
SHOW


> I just migrated to PostgreSQL since this offers a few features I needes
> ugently, especially subqueries. However I got to stuck with DESCRIBE and
> SHOW commands. Are those not avaliable, or have they some special
behaviour?
> When trying a SHOW TABLES; I just get an error.
>
> Wolfgang
> --
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>


Re: Migration from MySQL, some difficulties with DESCRIBE and SHOW

От:
"paul butler" <paul@entropia.co.uk>
Дата:
Date sent:      	Sun, 03 Aug 2003 21:44:04 +0200
From:           	Wolfgang Draxinger 
To:             	pgsql-novice@postgresql.org
Subject:        	[NOVICE] Migration from MySQL, some difficulties with 
DESCRIBE and SHOW
I'm unfamiliar with mysql,
but I think what you are looking for in the psql client are these commands

SHOW TABLES:

 \d{t|i|s|v}... list tables/indexes/sequences/views

\d will give a list of all of these objects
\dt will give a list of only tables

mfx=# \d
              List of relations
       Name       |   Type   |     Owner
------------------+----------+---------------
 accent           | table    | Administrator
 accenttype       | table    | Administrator
 actor            | table    | Administrator
 actor_id_seq     | sequence | Administrator
 actoraudio       | view     | Administrator
 audio            | table    | Administrator
 audiotype        | table    | Administrator
(7 rows)


DESCRIBE: (I'm assuming this gives a listing of a table's structure)

\d tablename

mfx=# \d accent
               Table "accent"
   Column   |       Type        | Modifiers
------------+-------------------+-----------
 accenttype | character varying | not null
 id               | integer                 | not null
Primary key: accent_pkey
Triggers: RI_ConstraintTrigger_1673596,
          RI_ConstraintTrigger_1673602

Hope this helps

Paul Butler


> I just migrated to PostgreSQL since this offers a few features I needes 
> ugently, especially subqueries. However I got to stuck with DESCRIBE and 
> SHOW commands. Are those not avaliable, or have they some special behaviour?
> When trying a SHOW TABLES; I just get an error.
> 
> Wolfgang
> --
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend


Re: Migration from MySQL, some difficulties with DESCRIBE

От:
Francisco J Reyes <fran@natserv.net>
Дата:
On Sun, 3 Aug 2003, Wolfgang Draxinger wrote:

> I just migrated to PostgreSQL since this offers a few features I needes
> ugently, especially subqueries. However I got to stuck with DESCRIBE and
> SHOW commands.

As others mentioned you want to check the '\d' commands.
Do a \? and \help so you see some usefull online help. In particular there
is a syntax description of every command when you use \help

ie. \help alter table

Also search the web for "Practical PostgreSQL". I believe that book is
available online. Also check the online docs at
http://www.postgresql.org/docs/
FAQ