mysql -> postgres

Tom Emerson plug-discuss@lists.plug.phoenix.az.us
Wed, 26 Jun 2002 21:09:02 -0700 (MST)


Short List:

as the "postgres" user (during install, you identified a "postgres" user, 
right?), from a shell command line:

createuser
Enter name of user to add: mike
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? y

(assuming your login account is "mike")

Now, as the user "mike":
createdb firstdb
psql firstdb
firstdb=#  <- the psql command line prompt for database "firstdb"
firstdb=# \?    <- to see a list of backslash commands.
firstdb=# \d    <- to list all tables.
firstdb=# \h    <- for help on SQL commands.

etc... explore from here.  If you write a ".pgsqlrc" (or whatever it is.. 
check the docs), you can setup your psql environment to suit.  (I think 
mysql has a similiar .mysqlrc file?)

http://www.postgresql.org/idocs/ has complete documentation, including 
newbie pages (if memory serves me correctly).

permissions: like many commercial cousins, postgresql handles a lot 
through the "grant" statements.  If you are unfamiliar with "grant" & 
"revoke", learn them. (sorry if that sounds harsh, ... i'm dimly 
remembering some sort of perm manipulation thang in mysql that I have long 
forgotten.  "grant" & "revoke" show up in a lot of db systems, handy to 
know for the day you have to work on some other db).

If you are familiar with typical sql and RDBMS, you'll pick it up quickly.  
Thing I like most about psql, just about everything I need is available 
from within the psql shell.  (I'm a command line bigot).

If you have a windoze box that needs to manipulate a pgsql db, check out 
the windows ODBC for postgresql 
and the really nifty windows tool: pgAdmin II 
(google search on these, you'll find 'em quick).

I'm wishing for that pgAdmin II port for Linux, for the GUI inclined, it 
is really quite nice.  (anybody?  does this exist?)

Dig into stored procedures and triggers, this is one of the very fine 
features of postgresql, especially if you are into heavy db app 
development.

 - tom e.
----------------

On Wed, 26 Jun 2002, Mike wrote:

I have been using MySQL for quite some time and feel
right at home with it..... I would like to begin learning
postgresql. 

I have just installed it (as a Debian snob, apt-get made that
pretty brainless), and need a starting point.

Using MySQL, I am spoiled by mysqlshow, and walking right
into the mysql db and setting up perms for something I created
with mysqladmin create 'dbname'. This is my only baseline, and
would love for someone to point me to some docs that address
the basics for postgres.

v/r
mike
________________________________________________
See http://PLUG.phoenix.az.us/navigator-mail.shtml if your mail doesn't post to the list quickly and you use Netscape to write mail.

PLUG-discuss mailing list  -  PLUG-discuss@lists.plug.phoenix.az.us
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss