pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
newbie qs; examining databases and tables
8+ messages / 4 participants
[nested] [flat]

* newbie qs; examining databases and tables
@ 2002-10-15 23:16 Rusty Wright <rusty@socrates.Berkeley.EDU>
  2002-10-21 13:14 ` Re: newbie qs; examining databases and tables Andrew Perrin <clists@perrin.socsci.unc.edu>
  0 siblings, 1 reply; 8+ messages in thread

From: Rusty Wright @ 2002-10-15 23:16 UTC (permalink / raw)
  To: pgsql-admin

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?



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: newbie qs; examining databases and tables
  2002-10-15 23:16 newbie qs; examining databases and tables Rusty Wright <rusty@socrates.Berkeley.EDU>
@ 2002-10-21 13:14 ` Andrew Perrin <clists@perrin.socsci.unc.edu>
  2002-10-21 18:22   ` Re: newbie qs; examining databases and tables Rusty Wright <rusty@socrates.Berkeley.EDU>
  0 siblings, 1 reply; 8+ messages in thread

From: Andrew Perrin @ 2002-10-21 13:14 UTC (permalink / raw)
  To: Rusty Wright <rusty@socrates.berkeley.edu>; +Cc: pgsql-admin

SHOW DATABASES  --> \l
USE DB1         --> \c db1
SHOW TABLES     --> \d
DESCRIBE TABLE1 --> \d table1

ap

----------------------------------------------------------------------
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
clists@perrin.socsci.unc.edu * andrew_perrin (at) unc.edu


On Tue, 15 Oct 2002, Rusty Wright wrote:

> 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 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
> 




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: newbie qs; examining databases and tables
  2002-10-15 23:16 newbie qs; examining databases and tables Rusty Wright <rusty@socrates.Berkeley.EDU>
  2002-10-21 13:14 ` Re: newbie qs; examining databases and tables Andrew Perrin <clists@perrin.socsci.unc.edu>
@ 2002-10-21 18:22   ` Rusty Wright <rusty@socrates.Berkeley.EDU>
  2002-10-24 19:12     ` Re: newbie qs; examining databases and tables Ross J. Reedstrom <reedstrm@rice.edu>
  0 siblings, 1 reply; 8+ messages in thread

From: Rusty Wright @ 2002-10-21 18:22 UTC (permalink / raw)
  To: clists@perrin.socsci.unc.edu; +Cc: pgsql-admin

Ok, thanks.



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: newbie qs; examining databases and tables
  2002-10-15 23:16 newbie qs; examining databases and tables Rusty Wright <rusty@socrates.Berkeley.EDU>
  2002-10-21 13:14 ` Re: newbie qs; examining databases and tables Andrew Perrin <clists@perrin.socsci.unc.edu>
  2002-10-21 18:22   ` Re: newbie qs; examining databases and tables Rusty Wright <rusty@socrates.Berkeley.EDU>
@ 2002-10-24 19:12     ` Ross J. Reedstrom <reedstrm@rice.edu>
  0 siblings, 0 replies; 8+ messages in thread

From: Ross J. Reedstrom @ 2002-10-24 19:12 UTC (permalink / raw)
  To: Rusty Wright <rusty@socrates.Berkeley.EDU>; +Cc: clists@perrin.socsci.unc.edu; pgsql-admin

On Mon, Oct 21, 2002 at 11:22:31AM -0700, Rusty Wright wrote:
> Ok, thanks.

and one more:

\? -- lists 'slash' commands

And just in case it comes up:

launch psql with the -E switch, to see the SQL queries that
are performed to get that data.

Ross



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* newbie qs; examining databases and tables
@ 2002-10-15 23:27 Rusty Wright <rusty@socrates.Berkeley.EDU>
  0 siblings, 0 replies; 8+ messages in thread

From: Rusty Wright @ 2002-10-15 23:27 UTC (permalink / raw)
  To: pgsql-admin

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?



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: newbie qs; examining databases and tables
@ 2002-10-15 23:36 Rusty Wright <rusty@socrates.Berkeley.EDU>
  0 siblings, 0 replies; 8+ messages in thread

From: Rusty Wright @ 2002-10-15 23:36 UTC (permalink / raw)
  To: pgsql-admin

Sorry, nevermind; I discovered \? and figured it out.



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: newbie qs; examining databases and tables
@ 2002-10-16 13:44 Devinder K Rajput <Devinder.Rajput@ipaper.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Devinder K Rajput @ 2002-10-16 13:44 UTC (permalink / raw)
  To: rusty@socrates.Berkeley.EDU; pgsql-admin


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"                                                                                         
                    <rusty@socrates.Berkel       To:     pgsql-admin@postgresql.org                                        
                    ey.EDU>                      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)








^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: newbie qs; examining databases and tables
@ 2002-10-16 19:46 Devinder K Rajput <Devinder.Rajput@ipaper.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Devinder K Rajput @ 2002-10-16 19:46 UTC (permalink / raw)
  To: rusty@socrates.Berkeley.EDU; +Cc: pgsql-admin; pgsql-novice@postgresql.org


no problem.  I myself am relatively new to postgres.   The users on list
are very responsive whenever they can help.  I'm doing the same and trying
to put in my 2 cents.  Thanks guys!

Devinder Rajput
Stores Division Corporate Offices
Chicago, IL
(773) 442-6474


                                                                                                                        
                    "Rusty Wright"                                                                                      
                    <rusty@socrates.Ber       To:     Devinder.Rajput@ipaper.com                                        
                    keley.EDU>                cc:                                                                       
                                              Subject:     Re: [ADMIN] newbie qs; examining databases and tables        
                    10/16/2002 02:40 PM                                                                                 
                                                                                                                        
                                                                                                                        




Great, thanks.








^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2002-10-24 19:12 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-10-15 23:16 newbie qs; examining databases and tables Rusty Wright <rusty@socrates.Berkeley.EDU>
2002-10-21 13:14 ` Andrew Perrin <clists@perrin.socsci.unc.edu>
2002-10-21 18:22   ` Rusty Wright <rusty@socrates.Berkeley.EDU>
2002-10-24 19:12     ` Ross J. Reedstrom <reedstrm@rice.edu>
2002-10-15 23:27 newbie qs; examining databases and tables Rusty Wright <rusty@socrates.Berkeley.EDU>
2002-10-15 23:36 Re: newbie qs; examining databases and tables Rusty Wright <rusty@socrates.Berkeley.EDU>
2002-10-16 13:44 Re: newbie qs; examining databases and tables Devinder K Rajput <Devinder.Rajput@ipaper.com>
2002-10-16 19:46 Re: newbie qs; examining databases and tables Devinder K Rajput <Devinder.Rajput@ipaper.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox