Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 70B49476791 for ; Wed, 16 Oct 2002 09:45:24 -0400 (EDT) Received: from mx02.ipaper.com (mx02.ipaper.com [141.129.1.11]) by postgresql.org (Postfix) with ESMTP id A62D4476723 for ; Wed, 16 Oct 2002 09:44:41 -0400 (EDT) Received: from S02ATW02.na.ipaper.com (s02atw02.ipaper.com [164.103.63.148]) by mx02.ipaper.com (8.10.2+Sun/8.10.2) with ESMTP id g9GDjbx25664; Wed, 16 Oct 2002 08:45:39 -0500 (CDT) Received: from 164.103.62.7 by S02ATW02.na.ipaper.com with ESMTP ( Tumbleweed MMS SMTP Relay (MMS v5.0)); Wed, 16 Oct 2002 08:44:31 -0500 X-Server-Uuid: AF46FF6A-C785-473C-8C32-637F1D084C73 Subject: Re: newbie qs; examining databases and tables To: rusty@socrates.Berkeley.EDU, pgsql-admin@postgresql.org X-Mailer: Lotus Notes Release 5.0.6a January 17, 2001 Message-ID: From: "Devinder K Rajput" Date: Wed, 16 Oct 2002 08:44:31 -0500 X-MIMETrack: Serialize by Router on SWMTA1.ipaper.com/IPAPER(Release 5.0.8 |June 18, 2001) at 10/16/2002 08:44:31 AM MIME-Version: 1.0 X-WSS-ID: 11B3B2B56882-03-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/112 X-Sequence-Number: 5970 log into psql using: psql db_name (from the command line) \d: Lists all tables in the current database (SHOW TABLES) \d table_name: lists all columns of the given table ( DESCRIBE table_name) \c new_db_name: switches connection to new database (USE db_name) \?: will list available commands \h: will list available SQL command \h sql_command_name: will display usage about the given sql command from linux command line, issue: psql -l ( lists all available databases, including Template) regards Devinder Rajput Stores Division Corporate Offices Chicago, IL (773) 442-6474 "Rusty Wright" cc: Sent by: Subject: [ADMIN] newbie qs; examining databases and tables pgsql-admin-owner@post gresql.org 10/15/2002 06:27 PM I'm someone with some mysql experience and need to set up postgres for a product we're evaluating. In mysql I can use SHOW DATABASES to list all of the databases on the system, USE DB1 to switch to one of the databases, SHOW TABLES to list all of the table names in the database I'm USEing, and DESCRIBE TABLE1 to list all of the column names, data types, etc. for a table. How do I do the equivalent with postgresql? Are there equivalent SQL commands? ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)