rails is awesome

G

George Moschovitis

Other than the wonky SQL-MySQL compliance divide, are there specific
features that you can get out of PostgreSQL, or are a lot easier to use
in PostgreSQL, that might encourage a MySQL user like myself to change?
I've seriously considered switching to PostgreSQL 'cause it has a good
rep with people I trust, but every time I try to Google this topic I
never find something that convinces me to switch.

The most annoying thing with MySQL is that various features work
with various table types or version. For example: There are subseleicts
in 4.1, stored procedures in 5.0, other features will only be available
in 5.1, there are transactions in InnoDB tables, but a freetext index
only in MyISAM tables and stuff like that.

PostgreSQL has all the features right here, right now, has robust
libraries, is fast and has excellent documentation. The latest version
(8.0) works on Windows too.

In short, it just rocks!

George.

--
www.navel.gr | tel: +30 2106898050 | fax: +30 2106898437

web appliction engine: http://www.navel.gr/nitro
object relational mapping: (Og) http://www.navel.gr/nitro
have fun: http://www.joy.gr
 
S

Samuel Kvarnbrink

Other than the wonky SQL-MySQL compliance divide, are there specific
features that you can get out of PostgreSQL, or are a lot easier to
use in PostgreSQL, that might encourage a MySQL user like myself to
change? I've seriously considered switching to PostgreSQL 'cause it
has a good rep with people I trust, but every time I try to Google
this topic I never find something that convinces me to switch.

Well, since we're among Rubyists, PL/Ruby! :) Besides that, there are
lots of good reasons to give PostgreSQL a try. Free, fast, jam packed
with useful features, SQL92 compliant, and (most importantly) very
robust.

You may want to pay this site a visit for more info:
http://advocacy.postgresql.org/

...and maybe this one as well :)
http://sql-info.de/mysql/gotchas.html


//samuel

________________________
Samuel Kvarnbrink

(e-mail address removed)

"On two occasions I have been asked [by members of Parliament!],
Pray, Mr. Babbage, if you put into the machine wrong figures,
will the right answers come out?' I am not able rightly to
apprehend the kind of confusion of ideas that could provoke such
a question."
-- Charles Babbage
 
D

Dick Davies

* Francis Hwang said:
Other than the wonky SQL-MySQL compliance divide, are there specific
features that you can get out of PostgreSQL, or are a lot easier to use
in PostgreSQL, that might encourage a MySQL user like myself to change?
I've seriously considered switching to PostgreSQL 'cause it has a good
rep with people I trust, but every time I try to Google this topic I
never find something that convinces me to switch.

I'm afraid I don't know mySQL that well, so I'm not really the best to
answer :)

I've heard a lot of horror stories about missing features of mysql tha
I assume must have been fixed by now. See Google.

Online comparisons are about as objective as 'islam or judaism?' threads,
and far be it from me to break tradition, so here's my 2 euro:

When I made the effort to move my postgresql stuff over to mysql
the main sore thumbs that really annoyed me were (and I don't do any
clever db stuff, this is a few just simple tables. You think my ruby
sucks? you should see my SQL) :

* having to define a particular table type to get certain features.
* the syntax on simple stuff like 'create table' is just wrong :)
* mysql-over-ssl needs my.cnf tweaking - libpq handles it transparently
* mysql does'nt support external (pam) auth (that might sound perverse,
but with postgres users can have the same password for the db as they
do for imap/ssh/subversion/etc)
* ssl support in php-mysql isn't there. at all. I had to run 2 stunnels,
one on either end, to get my webserver talking securely to my db. Despite
mysqld having SSL support (startTLS, see). Sweet zombie Jesus. And
this appears to be the 'official' way of doing it??

Gimme a G. Gimme an R. Gimme an R.....
 
A

Austin Ziegler

* Austin Ziegler said:
* Austin Ziegler <[email protected]> [1142 14:42]:
In practice, with a putative Oracle connector to AR, AR simply
won't work, because Oracle's metadata tables always return the
data in uppercase -- unless the table name is quoted.

MySQL is a bad model -- it doesn't actually do much of anything
right.
And you just found this out?
Have you been living in a cave for the last 5 years? :)
No, I've known it for a long time. I just didn't realise until
the last couple of days that ActiveRecord embeds MySQL semantics
into its otherwise nice data modeling techniques.
Sorry, I'm being flippant because I'm creating a db for rails to
use, so I don't see this as a big issue. Having a legacy DB would
probably sober me up.

Well, the case that I saw was an external tool being used to create
a MySQL database -- and this creates tables with a default column of
"Id", forcing you to rename the column. Now, being a hardcore
database guy, I create all of my databases from a script, but I got
to thinking about how dumb this was for ActiveRecord to miss, given
that it gets everything else right. Then I started looking at MySQL,
and noted that on MySQL, it's not even consistent -- on Windows,
where filenames are case-preserving[1] then "id" and "Id" are the
same thing, but on Unix they're not.
But surely even then this shouldn't affect many people? (my class
still starts with a capital letter, right? And how many people
have a customers and a Customers table? )

It would affect anyone that uses a real SQL92-compliant database
system.
But again, I'd see the postgres (or oracle, etc, etc) adapter as the
place to scatter a little 'tablename'.casecmp() magic to fix that..

I'm not sure about that. The issue does come in when you have quoted
tablenames as opposed to unquoted tablenames. ActiveRecord should
probably assume and enforce unquoted tablenames -- which means case-
insensitive tablenames.

-austin
[1] This is the right way to do case handling on filesystems. Even
HFS+ does it this way, even if UFS doesn't. I've never seen any
reason why the presence of Makefile and makefile would be
considered a Good Thing. Case-preserving is different than
straight case-insensitivity.
 
D

Daniel Berger

Jamis Buck said:
I'm definately not a DB expert, but I believe in this case Oracle, at
least, *is* case sensitive. Consider:

create table "credit_rating" (
...
);

create table "CREDIT_RATING" (
...
);

The above would create two distinct tables.

The keywords are case insensitive, but the column and table names can be
made case sensitive by putting them in quotes. If you omit the quotes,
the identifier is uppercased automatically.

In theory your are correct. In reality, no one does this. In
addition, no one creates tables with duplicate names in the same
schema differing only in case. If you do, please consider a career
outside of IT.

I don't know exactly how ActiveRecord works, but I would expect any
ORM to just do the right thing when it comes to table/column names and
case, i.e. it shouldn't care. At least, that's what I would do.

Regards,

Dan
 
D

David Heinemeier Hansson

Now, being a hardcore database guy, I create all of my databases from
a script, but I got to thinking about how dumb this was for
ActiveRecord to miss, given
that it gets everything else right.

I recognize that you care deeply about this issue, Austin. So I'd be
more than willing to favorably consider a patch that rectifies this
behavior to your pleasing. As long as everything is just business as
usual for lower-cased MySQL use and it's not a big ball of mud, I can't
see why this shouldn't have good chances to making it in.

I like passion. You certainly have it in abundance on this issue.
Hopefully you can channel this passion into a patch when your other
obligations have been met. Thanks.
--
David Heinemeier Hansson,
http://www.basecamphq.com/ -- Web-based Project Management
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://macromates.com/ -- TextMate: Code and markup editor (OS X)
http://www.loudthinking.com/ -- Broadcasting Brain
 
C

Carl Youngblood

Gavin said:
I was suprised with Jamis's Oracle examples; I always thought Oracle
was case-insensitive up the wazoo. But I guess I never tried quoting
table names etc. (yeah, *that's* intuitive...)
PostgreSQL does the same thing if you put the table/field names in quotes.

Carl
 
K

Klaus Momberger

Austin Ziegler said:
When you select the metadata from Oracle, if you have not quoted your
table names when creating them, they will be returned all uppercase.

Thus, ActiveRecord is broken for any likely Oracle application.

-austin

when you select the metadata from Oracle (user_tab_columns), you can
convert
them to lowercase inside the OracleAdapter. You just have to convert
them to lowercase consistently everywhere.

Quoting tablenames is not a bright idea, imho.

Rails may have some minor problems with Oracle, but I don't think the
case sensitivity of column names is one of them.

regards,

-klaus
 
A

Austin Ziegler

when you select the metadata from Oracle (user_tab_columns), you can
convert them to lowercase inside the OracleAdapter. You just have to convert
them to lowercase consistently everywhere.

Yes. That still doesn't fix that MySQL is broken as an application,
and people who are using MySQL after years of experience with real
databases will run into problems because of ActiveRecord's assumptions
and some of the brain-dead tools out there for MySQL.
Quoting tablenames is not a bright idea, imho.

It's still legal, and should be dealt with properly.
Rails may have some minor problems with Oracle, but I don't think the
case sensitivity of column names is one of them.

It is one, as of right now.

-austin
 
S

Stefan Schmiedl

Yes. That still doesn't fix that MySQL is broken as an application,

I wish people would stop exaggerating. Choosing the right job
for the tool at hand results in a lot more working programs.
Is Ruby broken because it's not Perl-compatible? Is Objective-C
broken because it can't cope with C++ code?

Sleep well, everybody.
s.
 
M

Mauricio Fernández

I wish people would stop exaggerating.
Choosing the right job for the tool at hand results in a lot more working programs.

I for one will keep looking for a job that suits my hammer.

;)
 
G

Glenn Parker

Stefan said:
I wish people would stop exaggerating. Choosing the right job
for the tool at hand results in a lot more working programs.
Is Ruby broken because it's not Perl-compatible? Is Objective-C
broken because it can't cope with C++ code?

Of course, the right tool for the right job, but what if I handed you a
screwdriver carved out of celery? MySQL incorporates "SQL" in its name,
but it does not begin to implement the SQL that the vast majority of SQL
developers have accepted. I wouldn't use MySQL as the standard of
comparison for the rest of the SQL world any more than I would try to
build a house using a child's scribbles.

In case it's not clear, I agree very strongly with Austin in this
debate. SQL is a mature and well-documented language that deserves some
respect. There is a great deal of power that can be leveraged by
embracing the SQL standard, and ignoring that standard is a wasted
opportunity.

On the other hand, Rails is young and growing, and we shouldn't be too
discouraging just because the author can't fix everything at once. :)
I would venture to guess that case-sensitivity in table names is not a
very hard problem to deal with. If I can figure it out, I'll do what I can.
 
S

Stefan Schmiedl

Of course, the right tool for the right job, but what if I handed you a
screwdriver carved out of celery?

I'd try to preserve it as a sample of craftmanship.
If you expected me to really work with it, I'd try to preserve you as a
sample of a completely different kind ;->
MySQL incorporates "SQL" in its name,
but it does not begin to implement the SQL that the vast majority of SQL
developers have accepted. I wouldn't use MySQL as the standard of
comparison for the rest of the SQL world any more than I would try to
build a house using a child's scribbles.

In case it's not clear, I agree very strongly with Austin in this
debate. SQL is a mature and well-documented language that deserves some
respect. There is a great deal of power that can be leveraged by
embracing the SQL standard, and ignoring that standard is a wasted
opportunity.

Borland Database Engine (BDE) SQL, ODBC SQL, MS Jet SQL, MS SQLServer T-SQL:
All claim to accept (some variant of) SQL where you can easily stumble
over more or less subtle differences. If you're lucky, they are caught
as errors by the receiving server, if not, you get some very interesting
bugs to hunt for.

All I expect of something called SQL is that the basic keywords and
syntax are there. Everything else I look up when I work with it.

To veer off on a tangent, what I'd really like to see is a database
engine offering somewhat more oriented towards the original ideas of
relational algebra than SQL does. The implementation used in Suneido
(www.suneido.com, probably still windows only) is very interesting, IMO.

Enough. On to other things.
s.
 
M

Michael Gebhart

Hi,

yeah I only can agree. I've started learning ruby a few weeks ago and read
an article about rails in a german linux magazine and suddenly tried: It's
really great!

Sometimes it seems to be a little bit slow, but the time I need to develop a
small webapplication is really short. And: Ruby and rails are just at the
beginning. The performance will be more and more better in the future.

So: Great work!

Mike
 
D

David Heinemeier Hansson

Sometimes it seems to be a little bit slow, but the time I need to
develop a
small webapplication is really short. And: Ruby and rails are just at
the
beginning. The performance will be more and more better in the future.

The next release is a MAJOR step forward in the speed department for
development. It used to be that Rails was pretty slow for development
(~1 reg/sec), but then really fast in production.

Now with advances in library management, it's possible to use FCGI,
mod_ruby, and cached WEBrick for development. This means that its MUCH,
MUCH faster. Really a joy to work with. I can't wait to get 0.9 out
with it.
--
David Heinemeier Hansson,
http://www.basecamphq.com/ -- Web-based Project Management
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://macromates.com/ -- TextMate: Code and markup editor (OS X)
http://www.loudthinking.com/ -- Broadcasting Brain
 
M

Michael Gebhart

Hi,

thank you for your answer! Sounds really great! Can't wait installing and
testing it :)

Mike
 
L

Luc Heinrich

David Heinemeier Hansson said:
I can't wait to get 0.9 out with it.

And I can't stop thinking that, somehow, a "Programming Rails, The
pragmatic programmer's guide" would be one hell of a cherry on top of
the cake. :)
 
D

David Heinemeier Hansson

D

David Heinemeier Hansson

thank you for your answer! Sounds really great! Can't wait installing
and
testing it :)

It's already possible now, today, to taste... THE FUTURE!!!

Or with less dramatics, you can do "gem update -s
http://gems.rubyonrails.org", and all the dandy beta gems will be
installed on your system. You'll have to look at the changelogs to get
an idea of what has changed, though:

http://dev.rubyonrails.org/trac.cgi/file/trunk/actionpack/CHANGELOG
http://dev.rubyonrails.org/trac.cgi/file/trunk/activerecord/CHANGELOG
http://dev.rubyonrails.org/trac.cgi/file/trunk/railties/CHANGELOG
--
David Heinemeier Hansson,
http://www.basecamphq.com/ -- Web-based Project Management
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://macromates.com/ -- TextMate: Code and markup editor (OS X)
http://www.loudthinking.com/ -- Broadcasting Brain
 
D

Dick Davies

* Luc Heinrich said:
And I can't stop thinking that, somehow, a "Programming Rails, The
pragmatic programmer's guide" would be one hell of a cherry on top of
the cake. :)

Rails has got the mindshare at the minute, I'd expect
someone to be on it soon.

Reloadable FCGI will be a real boon (though last time I
tried out Struts I went for a smoke between HTTP requests,
it was that slow).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top