Обсуждение: Noobie Questions...

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

Noobie Questions...

От
Dan Ostrowski
Дата:
Hello. I am a self taught PHP programmer looking to start using PostgreSQL
because It seems to have a more useful feature set than MySQL, and I am
starting on some VERY large projects. Also i like the sound of PL/Perl
since I am familiar with Perl.

I have a lot to learn in a short amount of time... ( so it will be just
like everything else *grin* ).. So I had a few questions:

1) I have heard some bad things about the dump function in PostgreSQL. Is
there an alternative and how do the backup options available stack up?

2) Where would YOU go, if you had to, to find out exactly what kind of
ANSI standards might be implemented in SQL 92? Specifically I have written
a lot of php Object files that use SQL queries, but they are mostly for
use on MySQL. I have a PostgreSQL database abstraction layer WRITTEN, but
I just need to know what kind of things I can throw at it, if you follow
me? In other words, I need to figure out what stuff will cross over from
MySQL to PostgreSQL as far as SQL syntax goes. Any links?

And YES i have a book ( PostgreSQL Developers Handbook by SAMS )  and YES
i am digesting it as fast as possible. ^_^  Thanks very much for any help
you can lend. I am sure I will have more n00bish questions in the future.

best regards,
dan

Re: Noobie Questions...

От
"scott.marlowe"
Дата:
On Wed, 28 Aug 2002, Dan Ostrowski wrote:

> Hello. I am a self taught PHP programmer looking to start using PostgreSQL
> because It seems to have a more useful feature set than MySQL, and I am
> starting on some VERY large projects. Also i like the sound of PL/Perl
> since I am familiar with Perl.
>
> I have a lot to learn in a short amount of time... ( so it will be just
> like everything else *grin* ).. So I had a few questions:
>
> 1) I have heard some bad things about the dump function in PostgreSQL. Is
> there an alternative and how do the backup options available stack up?

Read all the docs at www.postgresql.org

Read the sections on administration.  Postgresql is much more powerful
than MySQL, but with that greater power comes greater responsibility (i.e.
postgresql will NOT just run without some kind of daily maintenance
scheduled to keep it happy)

Read the sections on how to tune your queries and such.

> 2) Where would YOU go, if you had to, to find out exactly what kind of
> ANSI standards might be implemented in SQL 92? Specifically I have written
> a lot of php Object files that use SQL queries, but they are mostly for
> use on MySQL. I have a PostgreSQL database abstraction layer WRITTEN, but
> I just need to know what kind of things I can throw at it, if you follow
> me? In other words, I need to figure out what stuff will cross over from
> MySQL to PostgreSQL as far as SQL syntax goes. Any links?

Postgresql in general has a fairly good implementation of SQL92.  The only
feature that I can think of that is ANSI SQL that MySQL has that
postgresql doesn't (yet) is "alter table drop column".

There are tons of little featurettes that MySQL has that you won't find in
Postgresql, but these are NOT ANSI SQL, but extensions that MySQL only
has.

My last advice is to look at other people's code, you'll find a lot of it
out there, at places like devshed and phpbuilder.


Re: Noobie Questions...

От
Bruce Momjian
Дата:
scott.marlowe wrote:
> Postgresql in general has a fairly good implementation of SQL92.  The only
> feature that I can think of that is ANSI SQL that MySQL has that
> postgresql doesn't (yet) is "alter table drop column".

The DROP COLUMN feature will be in 7.3, due out in a few months.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Noobie Questions...

От
Dan Ostrowski
Дата:
> http://techdocs.postgresql.org, there might be one or two on migrating from
> MySQL.

Thanks! OMW there right now.

> The hardest part, if you have PHP code, will be changing all the database calls,
> just because PHP is database-specific.

Actually, I have created database Abstraction layers.  So when I make an object called DATABASE, and then call
$DATABASE->query();it doesn't matter if the database object is a PG database, MySQL database, or Oracle database. =) 

Thanks again,
dan

Re: Noobie Questions...

От
Andrew Sullivan
Дата:
On Wed, Aug 28, 2002 at 10:38:49AM -0600, Dan Ostrowski wrote:

> 1) I have heard some bad things about the dump function in PostgreSQL. Is
> there an alternative and how do the backup options available stack up?

What bad things?  You should always use pg_dump to backup your
database.

> 2) Where would YOU go, if you had to, to find out exactly what kind of
> ANSI standards might be implemented in SQL 92? Specifically I have written

You want to know what's in the SQL 92 standard, or you want to know
where PostgreSQL violates the spec?  In the latter case, every
command listed in

<http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/sql-commands.html>

has a little bit at the end that tells you how compliant it is.

> me? In other words, I need to figure out what stuff will cross over from
> MySQL to PostgreSQL as far as SQL syntax goes. Any links?

Note that MySQL has some _really_ non-compliant bits, so you may have
to think more SQL-ishly to do some things that you are used to doing
in MySQL-ish ways.

A

--
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110