Re: GUI for Postgres Management? PostgreSQL vs MySQL.

From: Matthew Nuzum <cobalt(at)bearfruit(dot)org>
To: Aleksei Wolff <aleksei_wolff(at)yahoo(dot)com>
Cc: Postgres General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: GUI for Postgres Management? PostgreSQL vs MySQL.
Date: 2002-11-25 15:00:51
Message-ID: 1038236454.3523.209.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

My 2 cents worth, since no one else has mentioned these on the list:

First of all, for a GUI admin tool, if you're running RedHat 7.3 (or 8.0
and you have a little patience) you can run the RedHat Database admin
tool. You can download the ISO image from their website www.redhat.com
and install from there. It's about 80 MB, so you'd need a fast
connection. I found it well worth the effort.

For MySQL vs. PostgreSQL; Like you, I questioned which was better for
me. I started out using MySQL because of the great deal of initial
documentation in the PHP world. Then I started using both Postgres and
MySQL depending on which one was available to me. All of these jobs
were small sites that didn't need too much. I could not see how either
database had an advantage in this realm, because they both performed
well.

The difference came when I started working on a slightly larger
projects. I found that by using Postgres, I had to write less PHP code
to get my job done. I used Views and User Defined Functions
(procedures) to make things easier. I'll give you an example of what I
mean in just a moment.

To make an even stronger case for Postgres, just in the last two weeks,
I began using Triggers with my procedures. Last night, I was able to
delete a couple hundred lines of PHP code from a single file because of
a 60 line procedure I was able to make. It makes my PHP code much
simpler to read, manage and debug.

Here's a real simple example of a procedure that makes life easier.

Imagine a table that has this structure:
Table Name: stats
id (int)
account (int)
ip_address (varchar)
req_page (varchar)
req_time (timestamp)

It is a hit counter and stores a record for each page view that one of
your customer's websites gets.

You can then write two procedures that help you with the dates, they
would be:
this_month() - returns the first day of the current calendar month
next_month() - returns the first day of the next calendar month.

You can then simplify your code and your queries by doing something like
this:
Select count(*) from stats where req_time
BETWEEN this_month() and next_month();
This would show you the number of page views you've received the current
month.

You may be thinking, "Procedures? You mean I have to learn another
language?" Procedures are easy. For many simple procedures, you simply
use SQL, which you probably already know. Here's an example of how you
might write the "this_month()" function:

CREATE FUNCTION this_month() RETURNS timestamp AS '
SELECT date_trunc(''month'' FROM now());
' LANGUAGE 'sql';

Now that I know how to use these advanced features of Postgres, I find
that I use them all of the time in my functions. I'd have a hard time
switching back to MySQL.

I suspect that you would have little problem using Postgres in place of
MySQL in your normal routine.

I hope this helps you choose the database tool that fits your needs,
Matthew Nuzum

> Hello,
>
> I am new to PostgreSQL. I am wondering if there is currently a GUI
> management tool available to be used with PostgreSQL? I am debating
> between MySQL and PostgreSQL.
>
> I like MySQL because of its GUI management tool and because (according
to
> soom books) its tight integration with PHP.
>
> On the other hand PostgreSQL has a PL/SQL "like" enhancement which I
really
> like too.
>
> I plan on installing on Linux for DB/Web application I am hoping to
build.
> Is there any performance advantages in using PostgreSQL over MYSQL?
>
> Any help would be appreciated in helping me make up my mind.
>
> Alex-
>
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-11-25 15:51:09 Re: Turning off triggers ?
Previous Message PostgreSQL Manager Team 2002-11-25 14:56:52 ANN: EMS PostgreSQL Manager 0.95 released!