Re: Postgres and MySQL Rosetta stone??

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Postgres and MySQL Rosetta stone??
Дата
Msg-id dcc563d10801100730i51365f09o5b2f82c3b80e13bf@mail.gmail.com
обсуждение исходный текст
Ответ на Postgres and MySQL Rosetta stone??  (leonardz <leonardz@sympatico.ca>)
Ответы Re: Postgres and MySQL Rosetta stone??  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
Список pgsql-general
On Jan 9, 2008 12:19 PM, leonardz <leonardz@sympatico.ca> wrote:
> I am reading through HeadFirst SQL (an OReilly book) which uses
> specific MySQLisms in its examples. I use postgres on our databases.
> Some examples are easy to work around, some are not .
>
> Is there a rosetta stone (table of commands in one and equivalents
> inthe other) available?

I've found that a familiarity with the pgsql docs is a necessity when
using examples from other dbs.  Knowing where ot look is half the
battle.

> In particular, MySQl seems to have richer string functions to parse
> out sub strings and als trim a string for automatic table insertion
> from long multifield strings.

Have you read the postgresql manual on string functions?  Seriously,
it's easily a match for MySQL in that arena, and beats it hands down
in a few.

http://www.postgresql.org/docs/8.2/static/functions-string.html

Trimming a string automatically to fit (I think that's what you're
alluding to there) is broken behaviour.  I.e. if I have a varchar(10)
and insert the string 'abcdefghijklmnopqrstuvwxyz' I SHOULD get an
error.  That string's too big.  I don't want my database chopping up
my data as it sees fit by default.  Especially since in pgsql it's
quite easy to setup a trigger to "do the right thing" whatever I might
deem that to be.

I'd suggest loading up the latest mysql stable release as well as
postgresql and playing around with the examples in mysql first to make
sure you've got them down, then translating them to postgresql.  It's
a good training exercise, and will improve your skills in two dbms
instead of just one.

I also think (much as Erik stated) that you'd be better off with a
pgsql, or at least ansi standard SQL oriented book.

В списке pgsql-general по дате отправления:

Предыдущее
От: "Merlin Moncure"
Дата:
Сообщение: Re: Can I create a TYPE (or DOMAIN) with arguments?
Следующее
От: "Scott Marlowe"
Дата:
Сообщение: Re: performance differences of major versions