Slashdot Mirror


Comparing MySQL and PostgreSQL 2

Mr. Jax writes "6 years ago Mr Poet submitted the story Comparing MySQL and PostgreSQL. Since then both databases have evolved to wherever they are today. Are the points raised 6 years ago still valid? What has changed? Are there other things to consider since then (e.g. licensing)?" This is certainly a valid question since both databases have had to evolve with the times. Have these applications been specialized to fit a particular niche market or are they both still strong competitors? What does the horizon look like for the development of these programs, especially considering the recent MySQL partnership with SCO?

157 of 902 comments (clear)

  1. Get off it ScuttleMonkey by Anonymous Coward · · Score: 4, Insightful

    SCO bought a freakin license to include a copy of MySQL that's not GPL. It's not like SCO bought the company.

    1. Re:Get off it ScuttleMonkey by ray-auch · · Score: 3, Interesting

      SCO bought a freakin license to include a copy of MySQL that's not GPL. It's not like SCO bought the company

      No, it's like MySQL _sold_ them something.

      There are (I expect) a large number of people reaing this who believe that SCO is not a company you should do business with.

      It would be interesting to know why MySQL did business with SCO, maybe on principle they turn no customer away, or maybe a need for money overrode. The latter case might be a legitimate concern for the community.

    2. Re:Get off it ScuttleMonkey by Saeed+al-Sahaf · · Score: 4, Insightful
      No, it's like MySQL _sold_ them something.

      Well, MySQL AB is a for-profit company, they sell things to people. And, last time I looked into it, SCO wasn't gassing people or mowing down rain forrest, or something. Sure, they are obnoxious, but the truth is, so are many commercial companies we deal with every day.

      But does it even matter? The jokes on SCO, they paid to use something in a product very few companies will buy.

      More fun than dragging out this, would be guessing what non-issue Slashdot will toss up on their front page next in an attempt to stir shit and boost their dieing readership?

      --
      "Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
    3. Re:Get off it ScuttleMonkey by entrylevel · · Score: 2, Interesting

      The jokes on SCO, they paid to use something in a product very few companies will buy.
       
      More precisely:
      The joke's on SCO, they paid for something that very few companies have to pay for, to use in a product that very few companies will buy. Additionally, for those companies already own UnixWare or OpenUNIX, MySQL AB already provides installation instructions and patches for them. Finally, for the exceptionally lazy, SCO themselves provide a GPL'd version for you to download for free!
       
      More on-topic, isn't this story a dupe? Granted I wouldn't expect these editors to search back 6 years to find it, but I would at least expect them not to be 6 releases behind on the PostgreSQL version number! Oh wait...

      --
      Karma: Incomprehensible (Mostly affected by posting at +5, reading at -1, and metamoderating everything unfair.)
    4. Re:Get off it ScuttleMonkey by pallmall1 · · Score: 2, Insightful

      Sure, they are obnoxious, but the truth is, so are many commercial companies we deal with every day.

      That's true, there are a lot of obnoxious commercial companies, but SCO has actually surpassed just being obnoxious. Their business model actually includes getting revenue from suing or threatening to sue their customers. That's way beyond what other obnoxious companies do. I'm not saying other companies have never sued a customer, I'm saying that SCO is doing this to extort money from their customers and also from people who don't even use SCO products (like linux users.)

      The SCOboys putrid conduct doesn't stop there. Just read over their press releases over the last couple of years and you'll find them so full of lies, contradiction, and deceit you will be amazed. Really. SCO is in a whole class of their own.

      So, in this case, it does matter that MySQL has partnered in this manner with SCO. It says to me that MySQL might not be mowing down the rainforest, but they're willing to sell the mowers to the ones who are.

      --
      3 things about computers: they're alive, they're self-aware, and they hate your guts.
    5. Re:Get off it ScuttleMonkey by Ohreally_factor · · Score: 2, Funny

      Nor do the sell mobility. What's your point?

      --
      It's not offtopic, dumbass. It's orthogonal.
  2. Yawn.... by truckaxle · · Score: 3, Insightful

    This is a prefect flame fest topic - great scheduling for a vacation day. I will venture to guess the posts will be well into the 1000's Now what does it matter if Mysql partnered up with SCO. SCO as a O/S provider is history may a well extract a scraps of meat from the bones.

  3. Another question by Eightyford · · Score: 4, Insightful

    Sure it's slashdot and we all love free software, but how do these two compare with oracle, sql server and other non-free db's?

    1. Re:Another question by Anonymous Coward · · Score: 2, Informative

      Not really. Oracle has the 'non benchmarking' clause that prevents you from doing that. If people were able to compare it to, say, PostgreSQL, and publish the results you'd see a lot pgsql boxes replacing expensive Oracle licenses. MS's SQL server is a total joke.

    2. Re:Another question by Jerry · · Score: 4, Interesting

      PostgreSQL compares very well to Oracle.

      I use PostgreSQL as a test database against which I write and test QT applications. I can switch an app between the two backends by changing only a few lines of code and recompiling, or I can build the switching capability into the app. Using PostgreSQL reduces the number of access licenses required for Oracle, or doesn't waste existing connections.

      If I had my way I'd use PostgreSQL as the primary database, but some folks believe you've gotta pay money or the app isn't any good. As long as it's their money and not mine.

      --

      Running with Linux for over 20 years!

    3. Re:Another question by Dogtanian · · Score: 4, Insightful

      Oracle has the 'non benchmarking' clause that prevents you from doing that.

      Then arrange to have the benchmarking done in a country which won't uphold anti-competitive bullshit clauses (and when Oracle protest that the license lets them sue the guy in the jurisdiction of Buttfuck, Illinois, will tell them where they can stick their extradition request).

      Although I reckon such a case (brought by Oracle) might still get thrown out in a US court, I wouldn't bet my life savings on that, and the US legal system means you're unlikely to get fees paid if Oracle lose (does this *ever* happen in the US?); a great way for the large company to effectively win by attrition if the benchmarkers don't have that much money.

      --
      "Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
    4. Re:Another question by ron_ivi · · Score: 5, Informative

      This page is the best document I've seen comparing each of the majordatabases (Oracle, Postgresql, DB2, MySQL, SQL Server) not directly against each other, but against the SQL Standard. In cases where at least one of the databases differs from the standard, this guy's article shows both the SQL called for by the standard, and how each of the implementations may either follow or deviate from the standard.

    5. Re:Another question by Trigulus · · Score: 2, Insightful

      A joke in what way? I have run several MS-SQL servers for many years and the only two things that continualy bother me is the lack of being able to include an auto-numbered column in results without using something expensive like functions and the lack of paged (limit) result sets. I am however in the process of migrating to PostgreSQL.

      --
      If something exists that does not need a creator (god) then why must the cosmos need one?
    6. Re:Another question by clambake · · Score: 2, Funny

      They don't compare very well at all... Oracle doesn' hold a candle to postgres.

    7. Re:Another question by Stinking+Pig · · Score: 4, Insightful

      SQL Server gets a lot of flack on /., I'd be interested to know why? I've worked a fair amount with it, Oracle 8 and 9, Postgres, and a little bit of MySQL. I've also done extensive benchmark testing of SQL/Oracle/Postgres handling the same load on the same hardware (shh, don't tell Oracle :).

      My experience leads me to beleive the following things:
      1) MS-SQL is a high quality database that is ridiculously easy to set up, tune, and maintain. It is also very expensive.
      2) Postgres is a high quality database that is ridiculously easy to set up and maintain, but fairly difficult to tune. However, its performance is just as good as SQL server as long as you stay away from nested loops(*). It is also fairly inexpensive (free license, but increased TCO).
      3) Oracle is a pig, and it requires a professional, certified swineherd. If you spend an amazing amount of money on licenses, gear, and certified DBAs you will presumably get good performance; I however was never able to get it past 60% of the performance of MS-SQL or Postgres.

      (*) Nested loops are like candy to SQL server, and I've heard this is the same for Sybase (understandably). Deep sets of nested loops will kick the other databases I've tested in the teeth. Given an instruction with several nested loops and 16 million rows of data, I got results from SQL server in 5 minutes, results from Oracle 9 in an hour, and results from Postgres in 18 hours. This was a year ago and Postgres has changed, so it might be better now. Does MySQL handle them well?

      --
      "Nothing was broken, and it's been fixed." -- Jon Carroll
    8. Re:Another question by kimanaw · · Score: 2, Informative
      ...but some folks believe you've gotta pay money or the app isn't any good.

      There are good reasons to pay someone for support, if the people you're paying know their stuff. If you're building enterprise level, mission critical data warehouses, you'll want immediate access to expert help when things go horribly wrong. And Sorbannes/Oxley reinforces that need.

      For those seeking paid support, there are several companies working to do interesting things with Pg:

      • GreenPlum also working to enhance Pg with the Bizgress project
      • EnterpriseDB - working to make Pg interoperable w/ Oracle tools
      • Netezza - MPP appliance h/w running a modded version of Pg

      There are some other outfits dedicated to Pg support, but I can't recall the particulars...

      Meanwhile, MySQL still seems to be having difficulty getting stored procs and real views released...5.0 is starting to make Longhorn's development schedule look like a quarterly maintenance release.

      It's also interesting that TFA didn't mention the rise of alternatives ranging from SQLite (which pretty much does everything that folks used MySQL for in the first place, but wo/ any license confusion), to Firebird, to the recently open'd Ingres.

      --
      007: "Who are you?"
      Pussy: "My name is Pussy Galore."
      007: "I must be dreaming..."
    9. Re:Another question by Enrico+Pulatzo · · Score: 2, Insightful

      My biggest beef with SQL Server is that I'm used to using PostgreSQL and like things such as SELECT * FROM tablename LIMIT 5 OFFSET 20 to get a partial results list. With SQL Server I can select the TOP 5 results, but cannot offset them server side, which means I have to send more data to my client program which I don't wanna do. It's got a few little foibles other than that that bug me, but none of them come close to bothering me as much as the LIMIT/OFFSET one.

      (secretly posting this to lure someone into refuting/solving my problem)

    10. Re:Another question by ttfkam · · Score: 2, Informative
      Damn! DB2 looks damn good in that comparison.

      I loved the CHAR type section, specifically the MySQL entry:
      Breaks the standard by silently inserting the string, truncated to specified column CHAR-length.
      (It's actually not completely silent, as it issues warnings if values were truncated: If you manually check for warnings, you will know that something bad happened, but not which of the rows are now invalid.)
      Beautiful.
      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    11. Re:Another question by dotgain · · Score: 5, Interesting
      Get over yourself. If a DBA fails to "recongnize their lack of skills", maybe they're doing just fine with the management tools. If his skills are so lacking he'll screw up his own database eventually.

      Creating graphical tools to enable more people to do more things easier is a part of Microsoft's business model. SQL Server Enterprise Manager etc. are just examples of where they've succeeded here.

      Personally I'd love to see an open source equivalent of these tools, the offerings I've looked at so far are unfortunately lacking.

      And don't give me crap about being a click-and-drool reboot monkey. I'm sick of typing SQL to get things done, when I can grant permissions by picking users from a list and ticking the right boxes.

      Did you use telnet to post your slashdot comment? No, you used a graphical browser. Because you don't want to type the http request, and the graphical browser presents the HTML to you in a way that is more natural and effective for you.

      Seeing me use Enterprise Manager does not make my co-workers think that they could do my job just as easily. They do not end up thinking any "fool" can do it.

    12. Re:Another question by Anonymous Coward · · Score: 2, Interesting

      SQL server gets bashed on slashdot just because it's made by microsoft. If it's linux/FOSS oriented, then it's cool n stuff. This is the slashdot mindset.

      Oracle is not only more complicated than SQL server, but much more expensive to buy/maintain/administer (than not only SQL server but pretty much every other DB I've used).

      Price comparison between Oracle 10g Enterprise Ed vs SQL server 2000 Enterprised Ed; with management tools + advanced security features + business intelligence features (OLAP); for a 2 cpu box (which aren't dual core - because if they're dual core then double the oracle costs - only them counts cores as separate CPUs):

      Oracle: 192000$
      MS SQL: 39998$

      Nearly 5 times the price (not just like 50% or such which would already be significant). At that price I'd expect to get a LOT more than I'm actually getting. Plus, Oracle on that same hardware won't actually be faster. Oracle may have a couple extra nice features, but nothing to warrant paying 5 times as much for. Not counting that for our Oracle DBs, you'll have to pay a lot for a competent DBA (senior oracle DBAs make a killing and are in shortage too).

      SQL server routinely wins on all kind of benches against Oracle, it's usually (always?) FAR cheaper, much easier to use and administer, more widely known (so many MS certified kids know MS SQL vs the few who know oracle), SQL server is much better integrated with Visual Studio for internal apps (winforms or asp.net - using SqlClient) and everything, SQL server's enterprise manager is much better than oracle's tools, and it offers all most big corporations need (there's nothing in oracle we're really missing).

      I'm sick of trolls who've never seen or tried SQL server and bash it for no reason at all. It's a VERY GOOD database, lots of big corporations use it (we do) and are very happy about it.

      We've actually considered other databases as well (like Matisse), and there's LOTs of others we'd have picked over oracle if it wasn't for SQL server (Postgres included). Oracle just doesn't make sense to use in 99% of cases, it's just too fucking expensive.

    13. Re:Another question by nogginthenog · · Score: 2, Insightful

      Erm, MS SQL *is* scalable. Do you have at an iota of knowledege or experience on the subject? How much does pay you to post these lies? Come on, at least provide some detail for your arguement! MS SQL is perfectly scalable here for me.

      I'm normally MS fan but MS SQL is an very good (if expensive) tool (but then, they didn't write it, but that's another story).


      Escuse any typos, I'm drunk...

    14. Re:Another question by einhverfr · · Score: 2, Informative

      You could also use the server-side cursor and scroll forward without sending that info to the client.

      --

      LedgerSMB: Open source Accounting/ERP
    15. Re:Another question by NickFortune · · Score: 5, Interesting
      Compares very well to Oracle? In what metric?

      Please, Oracle has a ton of features that just aren't there in PostgreSQL

      "What metric" is the right question. But I'm not convinced that the best answer is "comparative length of feature lists". One man's feature is another man's bloat, after all.

      I've been writing database apps for a living since 1984. I've worked on trading systems for stockbrokers and multinational merchant banks; I've worked for telecoms giants and for manufacturers. I can't think of a single oracle feature that I've ever needed to use that wasn't available in PostgreSQL.

      Admittedly, this has a lot ot do with my style - I'm old school enough that I write my logic in C, C++ or Perl and use the database purely for storing and retrieving data. DBMS vendors (and some database researchers, to be fair) would like coders to do program purely with database packages. I've always though this a supremely boneheaded idea - I trust database designers to design databases, but not progamming langauges thank you. However, if that approach appeals, then you probably need a lot more features than I do.

      But they ain't necessary, and it most assuredly is possible to write non-trivial real-world apps using the PostgreSQL feature set.

      --
      Don't let THEM immanentize the Eschaton!
    16. Re:Another question by Craig+Davison · · Score: 3, Interesting

      The only rows that would get sent back from the server are the ones you want; the temporary table exists server-side.

      Yes, you could use a cursor instead, but to avoid problems if the table gets updated while your cursor is open, you'd either have to lock the table or deal with errors from the server.

    17. Re:Another question by Saturn49 · · Score: 2, Interesting

      I've recently ported an mid-size level enterprise application to both MySQL and Oracle from MS SQL. Amongst this was a data layer in C# and about 200 stored procedures. I have this to say:

      Besides the null/empty string thing, converting to Oracle was a breeze. Oracle even provides a migration wizard, that, with a little tuning, converted most of the stored procedures automatically.

      On the other hand, working with stored procedures in a beta version of MySQL 5.x was a huge pain. The utilities didn't support them well, and crashed constantly. I eventually gave up trying to use the included utilities and stuck with the console. I would think beta meant "most usable", but that was nowhere near the case.

      The .NET connector was buggy as heck. Just getting a stored procedure to run took me two days due to a case sensitivity problem. The error messages were hugely cryptic (stored procedure not found actually created a message like "Invalid attempt to access a field before calling Read()"). I had to dig down into the code and make fixes myself to get a reliably working connector, since it didn't handle all whitespace between parameters in a stored procedure properly.

      As mentioned elsewhere, MySQL has no problem inserting bogus data into fields, such as 00/00/00 00:00:00 for a date/time. That wouldn't be so bad, except it completely borks up the .NET connector when trying to read that data (it throws an exception and won't return any data.)

      Now, some of this I'd rack up to it being a beta, which is fine. Beta software has bugs. BUT, the length of time it took to get those bugs recognized and fixed was over a month! (see bugs 9722 and 9668.) It took another 2 months before those fixes were included in a release. One was erroneously marked as duplicate, even though there is no other bug in the system (earlier or later) describing the same problem. Requests to find out what it was "duplicating" went ignored. I have no idea if that bug is actually fixed or not now. I'd expect a company with a product in beta to be responsive to people putting it through its paces, and acknowledge and fix bugs quickly. Neither happened.

      The kicker was when we contacted MySQL to get some sort of developer license. We wanted to include the .NET connector in our general release, since our data layer compiled against it. Their own sales people were clueless as to how to go about such a thing and eventually concluded it wasn't possible. What sort of company makes a developer component that you can't license?

      We finally gave up on MySQL. We were 90% done converting, ran up against the licensing wall and simple dropped the project. We may revisit when 5.x is released and stable if they actually have some sort of developer license for their COM/ODBC components.

    18. Re:Another question by Pig+Hogger · · Score: 2, Informative
      Admittedly, this has a lot ot do with my style - I'm old school enough that I write my logic in C, C++ or Perl and use the database purely for storing and retrieving data. DBMS vendors (and some database researchers, to be fair) would like coders to do program purely with database packages. I've always though this a supremely boneheaded idea - I trust database designers to design databases, but not progamming langauges thank you.
      Seems that the bonehead is not where one thinks. By putting the transaction logic in the database, you put it where it will interact the most efficiently possible with the data, inside the database server itself. This also has the advantage of centralizing that logic at one place, so the clients do not have to worry about it while accessing the database. This means that the clients can be varied and need less ressources to run.
    19. Re:Another question by huiac · · Score: 3, Insightful

      Please, don't take away my stored procedures. They give me:

          - Complex column & table constraints;
          - Rapid retrieval of rows satisfying particular conditions, by indexing on a complex expression;
          - Programmable actions on insert/update/delete (triggers)
          - Updateable views

      huiac at internode.on.net

    20. Re:Another question by tjstork · · Score: 2, Informative

      The money you are spending for Oracle in the above case gets you some features that SQL Server flat out doesn't have. Like all things, you do have to know what you are doing with Oracle, but, if you do, you get some features that make or break a big, big application.

      uber partioned indexes
      uber materialized views
      outstanding mvcc transaction support

      SQL Server 2005 is supposed to have some of these features in it, plus the kitchen sink, but then I would expect the price to move on that.

      The other thing is that with Microsoft you generally are going to spend an extra $2000 / developer for tools.

      --
      This is my sig.
    21. Re:Another question by grassbeetle · · Score: 5, Interesting
      No. He got it right the first time. Why on earth would you want your RDBMS vendor cramming their lousy procedural programming language down your throat? For the privilege of burning cycles for your application code on CPUs that you've paid your database vendor upwards of $10k per core for licenses? Or is it because your control-freak DBAs like the app code right up close to the data where they can micro-manage it. The only folks with a worse appreciation of programming languages and application design than sysadms are DBAs.

      Finally, if you want to scale, getting your app code out of the DB is the best first step. Outside the database server you can throw cheap app servers at a problem if you need to. Growing your DB server is another beast altogether. Despite the IBM/Oracle propaganda, big grown-up businesses are very hesitant to cluster their databases. Not just the cost but for tuning and safety (the odds of bugs in this super-complex technology bringing them down). In general, you have one live DB server for an app and at least one failover. Growing that single DB server is a lot harder than throwing in a few more pizza boxes, or whatever.

    22. Re:Another question by MoralHazard · · Score: 2, Informative

      Then arrange to have the benchmarking done in a country which won't uphold anti-competitive bullshit clauses (and when Oracle protest that the license lets them sue the guy in the jurisdiction of Buttfuck, Illinois, will tell them where they can stick their extradition request).

      When you're sueing someone, there's no extradition--that's solely for criminal proceedings. There is no analogous concept in civil litigation. It doesn't matter WHERE the violation of the contract takes place. You could have someone in Venezuala, or on Mars, perform the benchmarking, and you'd STILL get sued in a California court (assuming that's what Oracle wrote into the license agreement).

      So if Oracle has a contract/license agreement with a customer that says "no benchmarking", and another clause that says "all disputes will be settled in Marin Co., CA", they don't have to bother with Buttfuck, IL at all:
              1) Oracle files lawsuit against customer in Marin Co. court.
              2) Marin Co. court looks at the contract clause governing jurisdiction, agrees that Marin is a valid court to hear the case.
              3) Lawsuit proceeds.

      If the defendant doesn't respond or show up, Oracle automatically wins the suit by default, and a judgement is entered against the defendant. Then Oracle has a court order, valid in EVERY other county in the USA, demanding that the defendant pay the judgement.

      And Buttfuck, IL will enforce the order.

      (If it were THAT easy to get out of a contract clause, wouldn't

    23. Re:Another question by einhverfr · · Score: 4, Insightful

      Admittedly, this has a lot ot do with my style - I'm old school enough that I write my logic in C, C++ or Perl and use the database purely for storing and retrieving data. DBMS vendors (and some database researchers, to be fair) would like coders to do program purely with database packages. I've always though this a supremely boneheaded idea - I trust database designers to design databases, but not progamming langauges thank you. However, if that approach appeals, then you probably need a lot more features than I do.

      The best approach IMO is somewhere in the middle. I think both extremes are boneheaded.

      Your RDBMS is there to do three things:
      1) Store data
      2) Maintain data (i.e. triggers, check constraints, etc)
      3) Present your data (views, possible some stored procedures, etc).

      I generally try to avoid programming directly against stored procedures. If necessary, I will write a view and update rules/triggers (depending on the RDBMS) to make this appear like a table.

      In general your data model logic should be entirely contained within and enforced by the database (Date's Central Rule). This does not mean that application function should be a stored procedure. Far from it. Instead, by doing things this way, you can do a fair bit of heavy lifting in the RDBMS where appropriate, and have your application logic in the application where it belongs.

      For example, sending email from the database backend is not really the best solution to any problem I am aware of in large part because this would happen outside of transactional control. Instead, use a trigger to place an item in a queue that an external program can use to send it. This way if your transaction rolls back after the email is sent.... ;-)

      People on both extremes simply don't understand the features and limitations of the transactional and relational models.

      --

      LedgerSMB: Open source Accounting/ERP
    24. Re:Another question by NickFortune · · Score: 2, Insightful
      Your RDBMS is there to do three things: 1) Store data 2) Maintain data (i.e. triggers, check constraints, etc) 3) Present your data (views, possible some stored procedures, etc).

      I've never been entirely convinced by item three. Views are occasionally useful, but if you have a user interface that allows ad-hoc queries, they may be the only way to enforce data security. But if you're writing apps you may as well code the query directly. You'll need to change the code if the view changes, but apart from a few ultra-generic table based apps, that is always going to be true.

      Far from it. Instead, by doing things this way, you can do a fair bit of heavy lifting in the RDBMS where appropriate, and have your application logic in the application where it belongs.

      I'd agree with that. I'll occasionally break the rule for pragmatic reasons and I don't always make best use of constraints and their ilk, but I have to agree with the sentiment.

      Instead, use a trigger to place an item in a queue that an external program can use to send it. This way if your transaction rolls back after the email is sent.... ;-)

      Unless I'm misunderstading you, that cannot happen. Assuming your emailer is a little app that sits on top of the mail queue table and periodically issues "select * from...", then it never sees the queued message, because it doesn't de-cloak until the transaction commits. I think that was your point.

      The best approach IMO is somewhere in the middle. I think both extremes are boneheaded.

      The boneheadedness I meant lies in using programmng languages developed by database vendors. They're almost always awful.

      For one thing, they tend to hold the database as being more important than the language, so you get languages where the only iteration is using cursor selects for example.

      Then there is the "everything has to look like SQL and/or PL/I" syndrome, which sees table definition syntax being reused to specify parameter passing.

      Finally there is the "SQL is a static, descriptive language, therefore our coding langauge must work the same way" disease, which gives us langauges with all the frustrations of coding in lisp or prolog, but without the cool stuff which makes those languages fun.

      Anyway, enough with the rant. Bit of a hobbyhorse of mine, as you may have guessed :)

      --
      Don't let THEM immanentize the Eschaton!
    25. Re:Another question by ajs · · Score: 3, Interesting

      "He got it right the first time. Why on earth would you want your RDBMS vendor cramming their lousy procedural programming language down your throat?"

      Let's just stop right here. The answer to this question was settled sometime around the introduction of the electric lightbulb, and it has little to do with programming paradigm.

      Logic in the database is almost always a bad idea. It introduces complexity in source code management, release engineering, application de-centralization, etc. The database's code optimization is also rarely on-par with external langauges. It's also essential at times. There is a fine line to be drawn between performance needs and software engineering needs. As a very, very rough metric, based only on personal experience, I would say that you should place code into the database only when that code reduces the amount of data that must be moved to the application by at least and order of magnitude. This goes for everything from the most complex stored procedure to the simplest sort (though be careful to be aware of when sorts are free because of storage implementation, and don't be afraid to put conditional logic into code based on storage engine).

    26. Re:Another question by Aceticon · · Score: 5, Insightful

      I've worked for several years both creating programs inside the database and on a server layer outside it (and also just about every other layer).

      I have to agree with grassbeetle above.

      Software architecture-wise:
      - You can't make a scalable architecture if you put everything in one single place (in this case the database).
      - You will be hard-pressed to create a failure tolerant architecture if you stuff everything in a single point of failure.
      - Databases are NOT application servers. They are designed with data storage and retrieval in mind, not reliable execution of complex business logic. Amongst other things databases do not make available in an easy and/or reliable way some of the standard application server functionality.
      - All external components of the application (for example UIs) have to connect to the database. You're now stuck to using the connection protocols from the chosen database. This might cause all sort of problems with security, firewalls, use of asychronous messaging, availability of adaptors in the platform you are deploying your applications to, etc...
      - Spliting your application accross several servers or in a multi-tiered geographical distribution is much harder.
      - All coders have to have a good knowledge on how to work with the specific database you are using.
      - Programing inside databases is not standartized. Different databases and indeed different versions of the same database have sometimes different versions of the same language or different libraries available. The language/libraries have not been so throughly used/tested/examined by a big user comunity (while for example standard C/Java/etc libraries have been thouroughly debugged in billions of man-hours of use). This means more library bugs and a lack of third party tools for software design and development inside the database.
      - Facilities such as version control, source control, etc are either not available or difficult to use in a reliable manner.
      - Availability of compatible 3rd party libraries or application modules is very, very restricted by comparison to NOT having your server side logic all inside the database.
      - Forget about moving databases in the future. Also, simple migrating to a newer version of the database can be a nightmare.

      Software design-wise, the design of the software will be strongly constrained by the internal structure of the database:
      - Information flows will mostly have to be database-like information flows
      - A true object oriented structure is pretty much impossible. At the most you can do weakly connected islands with an objecte oriented structure. If the database language you have to use is procedural forget about OO design.
      - Server-side initiated connections to outside entities, thread control, ditributed transactions and other more advanced functionalities are pretty much impossible.
      - Usage/integration with 3rd party libraries or application modules is very hard or even impossible.

      Software programming-wise, and from my experience (mostly Oracle):
      - The language sucks.
      - The application libraries (not the DBA ones) suck big time.

      Simply put, a software architect that puts all server-side logic inside the database is with this single choice removing almost all his other architecture options and creating/fortifying vendor lock-in of the application to the database itself and 3rd party tools and also of the development team itself by means of the knowledge experience they have/will gain with said database and said 3rd party tools.

      Such a person should IMHO either be demoted to a place were he/she can't cause any damage or fired outright.

    27. Re:Another question by einhverfr · · Score: 2, Interesting

      I've never been entirely convinced by item three. Views are occasionally useful, but if you have a user interface that allows ad-hoc queries, they may be the only way to enforce data security. But if you're writing apps you may as well code the query directly. You'll need to change the code if the view changes, but apart from a few ultra-generic table based apps, that is always going to be true.

      Never done any data warehousing, have you?

      With updateable views, you can separate the physical data storage mechanism from the way it is presented to the application. Some cool things you can do here include:

      1) Normalize your data storage, and denormalize your API.

      2) Have several different applications see the database as if it were conforming to their own expectations.

      (i..e I can run several different application off the same database even if I don;t have the source code to the app and they require different database schemas).

      --

      LedgerSMB: Open source Accounting/ERP
    28. Re:Another question by NickFortune · · Score: 2, Informative
      Never done any data warehousing, have you?

      You got me. Nothing serious, anyway.

      With updateable views, you can separate the physical data storage mechanism from the way it is presented to the application.

      mmm... but updatable views are problematic on a number of levels. For one thing, they don't work reliably, since you can't update a derived value, for instance. And theroretically they're a mess, since you should be updating a transient derived relation that strictly speaking ceases to exist before you even issue the update.

      I'm not sure I'd want users inputting data into a data warehouse via the same view that they use to access the data anyway. There's too much derived and summarised data kicking around for my liking.

      It does sound a cool way to present a read-only interface though.

      --
      Don't let THEM immanentize the Eschaton!
    29. Re:Another question by NickFortune · · Score: 2, Insightful
      In some cases they are not easy to work with but you should be able to get around all these issues.

      For example in PostgreSQL, you have to define update/insert/delete rules. Sometimes these can be tricky ...

      mmm... that's what I mean. If the views get too complex then maintaining them may become more expensive than writing a comparatively simple interface app. Views appear to offer a generic plug-in solution, but as you say, it isn't always that simple.

      I think the problem is that updatable views are a kludge. They don't work in terms of the relational model, and that's why they throw up such problems. I think they are fundamentally the wrong approach, but I'm realist enough to use them if they save me a lot of work. But it'd have to be a fairly specialised set of circumstances...

      --
      Don't let THEM immanentize the Eschaton!
  4. Helllooo?? Editors?? by wfberg · · Score: 4, Informative

    Not only is this article just 2 links to some other slashdot articles, but the "comparison" of mysql and postgres article from 6 years ago.. Doesn't compare them! It's an article, like this one, asking for some comments.. So not only does this article add no news for nerds, it even misrepresents links to this very site, which the editors, again, are too lazy to even follow? Come on, people!

    This sort of whoring-for-comments article should be a poll.

    --
    SCO employee? Check out the bounty
  5. My point of view by TruthSeeker · · Score: 2, Informative

    I'm using both, but mainly Postgres. From what I can tell:

    Postgres 7.5
    Pros:
    - Supports stored procedures
    - Supports triggers
    - Supports schemas
    Cons:
    - Heavy on resources

    MySQL 4.0
    Pros:
    - Fast
    - Easier to find PHP scripts that use it
    Cons:
    - Bad relational support (and yes, I know about InnoDB, but even then, it's a bit ... well, bad)
    - No stored procedures/triggers
    - Easily corrupted by crashes.

    --
    I sense much beer in you. Beer leads to intoxication, intoxication leads to hangover. Hangover leads to sobering.
    1. Re:My point of view by einhe1t · · Score: 4, Informative

      Parent is comparing non-current versions, and making up false "cons" for mysql, out of thin air...

      Mysql 4.1 is the current stable version, and 5.0 is nearing release.

      4,1 has excellent relational support, it is damn near impossible to corrupt if db design is correct, and innodb is great. IIRC ./ has been running on mysql + innodb for years. It also support clustering "out of the box".

      5.0 has views, triggers, stored procedures etc, and it's still amazingly fast.

      Note: I base my mysql 4.1 comments on the linux version. I have heard that there is a version of mysql for windoze, but I can't vouch for it, and for all I know, it could be a disaster, but I don't really have anything definitive to say about it. Who knows, maybe original poster is talking about mysql on windoze (shrug)

    2. Re:My point of view by scrutty · · Score: 4, Informative

      There is no postgresql release 7.5. The last 7.x release was 7.4 , the current stable is 8.0 with 8.1 in beta.

      --
      -- Oh Well
    3. Re:My point of view by Tablizer · · Score: 2, Insightful

      And they're much easier to work with than oracle (where you often get the impression that they intentionally obfuscate things to justify the cost).

      To be fair, Oracle targets the really high-end apps or performance where hiring a dedicated Oracle expert(s) is worth it.

      I doubt even Postgre can match the performance, reliability, and scalability of Oracle. Only IBM DB2 can come close so far. Postre may compete with Sybase and SQL-Server's level.

      Thus, you are comparing apples to oranges.

      Although for read-only speed, some RDBMS do seem faster than Oracle. Oracle seems optimized for a fairly even mix of reads and writes and reliability. Thus, if you sacrafice one of these, you perhaps may find something a bit faster (or at least easier to tune for such.)

      (And please find a better name for Postgre. I keep thinking "post nasal green drip" when I see the name.)

    4. Re:My point of view by asdfghjklqwertyuiop · · Score: 2, Interesting

      4,1 has excellent relational support, it is damn near impossible to corrupt if db design is correct, and innodb is great. IIRC ./ has been running on mysql + innodb for years. It also support clustering "out of the box".


      Excellent relational support? Please. Does 5.0 fix the issue where an insert of an invlalid date into a date field will instead insert '00-00-0000' into the field instead of aborting, like real databases do? And what the fuck is the 00-00-0000 default anyway? That isn't even a valid date unless mysql is running on a 13 month calendar! How about SQL standard comments? How about when you have a NOT NULL column and insert default values, does 5.0 abort or just totally ignore the constraint and insert a 0 or NULL?

      Enterprise ready... excellent relational support... sure. They don't even have the relational database 101 stuff working yet.

    5. Re:My point of view by tangledweb · · Score: 5, Funny

      So this is what passes for "Score 5: Informative" now?

      Invent an imaginary version of postgres to compare to a real version of MySQL, then spout some fictional cons. In that case:

      I'm using both, but mainly Postgres. From what I can tell:

      Postgres 7.841
      Pros:
      - Supports african dialects such as Kaliharinese
      - Adds extra features when it detects that the user is a Womble
      - Compatible with IP/feline
      Cons:
      - Runs slowly if you try to quieten your hard drives with banana peels

      MySQL 4.841
      Pros:
      - Written entirely by Ooompa Loompas
      - Discourages the use of Perl
      Cons:
      - Supports animal testing. Drips of MySQL are places in the eyes of penguins to check for irritation.
      - Shows signs of money contamination, which brings hippies out in a rash
      - Does not support transactions.

  6. Also by TheRaven64 · · Score: 4, Funny

    I have been wondering, which is better, vi or emacs?

    --
    I am TheRaven on Soylent News
    1. Re:Also by cnettel · · Score: 4, Funny

      Regarding potential for being a RDBMS, I would vote for emacs. I'll leave it to you to decide if that's a good thing...

  7. Re:The most interesting part of the old article... by adamwood · · Score: 2, Funny

    You are such a noob :-)

  8. Re:Been using MySQL, but... by Anonymous Coward · · Score: 3, Informative

    In recent versions of PostgreSQL, VACUUM still exists but is non-locking (i.e. it will not block concurrent database activity). There are tools available to run VACUUMs automatically as the database is in use, and recent versions of Postgres have been tuned so that the I/O performed by VACUUM should have less of an effect on the rest of the system.

  9. Re:Popularity by mellon · · Score: 4, Insightful

    MySQL is like Microsoft. It's not entirely compatible with the standard, but everybody is using it, so if you want to use their software, you have to use it too. I have a copy of PostgreSQL and a copy of MySQL on my server, because Wikipedia doesn't work with PostgreSQL. I presume this is because the developers started working with MySQL back in the bad old days when it was _really_ incompatible, and their code now contains dependencies on MySQL.

    I don't really know what to say about all of this - these incompatibilities are really frustrating as an end-user of this software, but I understand that it's hard to make things work with both MySQL and PostgreSQL, and resources are limited. What frustrates me is that these incompatibilities create a form of lock-in - once you've based your app on MySQL, you are stuck with it.

    I suspect that if you were to start now, and to use the SQL spec rather than the MySQL documentation as a reference while doing your development, you would wind up with something that was a lot more portable, so this isn't actually an argument against using MySQL. It's more an argument towards sticking to standards when using whatever db you choose, so that when the time comes to use a different DB backend, you aren't faced with a monumental refactoring job.

  10. Found one! :) by Spy+der+Mann · · Score: 2, Informative
    1. Re:Found one! :) by llefler · · Score: 2, Informative

      Ok, that's a silly review. For MySQL they claim to be comparing the features of 4.1.x, and yet under features: views, schemas, subselects, stored procedures, triggers - yes (>=5.0)

      If they're going to compare releases, compare apples to apples. Either pick stable releases or development releases. And FWIW, nobody that I know personally has been able to get MySQL 5.0 to run reliably, if they can even get it to launch. If we use MySQL for a project, it's 4.1.

      --
      It is amazing what you can accomplish if you do not care who gets the credit. -- Harry Truman
  11. Re:popularity by Jerry · · Score: 3, Insightful
    He didn't seem to be at all bothered that this the main argument people give for using windows.


    That's probably because those features are part of PostgreSQL and is the main argument for why people believe that PostgreSQL is overtaking MySQL. Also the fact the PostgreSQL can run PL/SQL with only some modifications, and visa-versa.

    --

    Running with Linux for over 20 years!

  12. Spatial databases by MostlyHarmless · · Score: 4, Informative

    I don't have any thoughts about the more general question, but PostgreSQL is much better at storing spatial data than MySQL. MySQL has spatial functions built in, but it only supports a subset of the OpenGIS functions (basically anything that can be done entirely with bounding boxes). PostgreSQL uses an external modulem PostGIS, which supports the full OpenGIS specification and a bunch of other extension functions besides. I've used MySQL by default simply because it is more familiar to me, but I've switched to PostgreSQL for my current project simply because of the spatial data module.

    --
    Friends don't let friends misuse the subjunctive.
  13. Re:popularity by Bloater · · Score: 4, Informative

    MySQL's biggest problem is that if you try to update or insert with invalid data, in many cases it successfully inserts wrong data. PostgreSQL doesn't do that.

    PostgreSQL has this nice Object-Relational model where tables can be derived from each other, but there are some nasty bugs that mean I think those features are still best avoided.

    Overall, though, I think PostgreSQL is by far the better RDBMS.

  14. PostgreSQL is supreme A LOT by michalf · · Score: 4, Interesting

    there is a short (decent) comparison at this url.
    From my point of view (web application developer, Ozone framework author and the author of a few rich-content websites I can say for sure: I am more than happy to discover PostgreSQL. Why? More Oracle-like, transactions, nested transactions, views, sql-schema... I doubt MySQL 5.0 will come even close to the standard of PosgtreSQL.
    Some can say MySQL is fast. No, it is not. When you run more than 100 users at once PostgreSQL is faster. MySQL has stupid table-locking mechanism that decreases performance significantly under high load.
    I would say: PostgreSQL seems to be slower, is not perfectly optimized, but much better goals in its design were used. And one of the goals ic SQL conformance. MySQL is FAR from the SQL standard.
    If you want to migrate from MySQL to e.g. Oracle - it is a pain. But PG is much closer to it.
    IMHO PostgreSQL is an industry-standard database and we use it for almost every project now. We have used MySQL some time ago and believe me - the difference is huuuuuge. PG is a real database. MySQL seems like a table-managing-application ;-)

    best regards - michal

    1. Re:PostgreSQL is supreme A LOT by jamie · · Score: 2, Informative

      Do you know MySQL has had transactions for years now? And SAVEPOINT transactions (like Postgres, I believe). And views in 5.0. The table-locking engine you're thinking of (MyISAM) hasn't been current for maybe 4 years. If you can't handle 100 users at once blame your design, not MySQL -- MySQL powers Slashdot :)

    2. Re:PostgreSQL is supreme A LOT by ttfkam · · Score: 3, Funny
      MySQL 5.0 is still in development. 4.1 is still the most up-to-date production branch.

      You're right that InnoDB has supported row-level locking for some time now. PostgreSQL uses MVCC so that you don't need a lock at all most of the time.
      MySQL powers Slashdot
      Considering how often Slashdot goes down when they have a cluster of MySQL boxes for redundancy, that's hardly an endorsement of quality.
      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    3. Re:PostgreSQL is supreme A LOT by pHDNgell · · Score: 4, Informative

      Can you be more specific? How often does slashdot go down?

      Slashdot has a subtle ``down'' state where they only serve static pages. It causes neat things to break like the RSS feed that I get for my home page (any request returns a static page).

      Wikimedia Foundation also runs on a small cluster of MySQL servers

      Perhaps you don't remember their recent outtage that took the entire thing off the internet for a day or two while they had to completely rebuild their database from backups. All of the mySQL apologists were quick to point out that databases should be expected to be all corrupt and stuff when they lose power. Users of real databases were amazed that anyone would think that.

      --
      -- The world is watching America, and America is watching TV.
    4. Re:PostgreSQL is supreme A LOT by Anonymous Coward · · Score: 2, Informative

      Well, I hate MySQL as much as the next poor slob who had an old version eat a lot of his data... but you're dead wrong on the Wikipedia point.

      Wikipedia has never had a substantial mysql related failure. The outage you're talking about was due to the upgrade to mediawiki 1.5, it was a planed and announced outage that took about as long as we announced it would take, although we'd been hoping for about half the time. MySQL performed flawlessly during this process which involved churning around more than 80gb of data and hundreds of millions of rows.

      The only MySQL related issue that was had in the whole thing was a MySQL quirk triggered bug in mediawiki 1.5 that wasn't discovered until we went live with the new code. A race condition due to table level locking was causing hard cpu pegging and timeouts as every session tried to process the expired blocked user list at once. This wasn't directly a MySQL bug but wouldn't have been an issue with PgSQL (due to MVCC) or if our software wasn't coded with a very MySQL mindset (treat the database like a dumb object store) with 99.99% of the smart stuff in the same PHP that serves every page up.

    5. Re:PostgreSQL is supreme A LOT by pHDNgell · · Score: 2, Informative

      Wikipedia has never had a substantial mysql related failure. The outage you're talking about was due to the upgrade to mediawiki 1.5, it was a planed and announced outage that took about as long as we announced it would take, although we'd been hoping for about half the time.

      No, the outtage I'm talking about was described on the wikipedia site as having been caused by a power outtage that caused database corruption.

      Here's the slashdot article to jog your memory.

      --
      -- The world is watching America, and America is watching TV.
  15. I used to like MySQL by caluml · · Score: 5, Insightful

    The DBAs I worked with always told me "Postgres is better". But I tried it a good few years ago, couldn't install it, it didn't "just work", and I was not that good with Linux at the time, so I just moved on to the next thing - MySQL.
    MySQL was good enough, and all the stuff that hardened DBAs said to me - "It doesn't do transactions", or "It handles NULLs wierdly", etc, just didn't apply.

    But when I tried to do a query like this: SELECT * FROM foo where bar NOT IN (SELECT blib from wheee) - MySQL advised me that it "didn't do" "NOT IN" queries. I tried to work around it, but after trying all the JOINs I could, it just didn't seem like something that I could get round. (I wasted quite a long time trying to work around this, and although I'm sure that some really top DBAs out there can do it, I couldn't.)

    So, mysqldump > mysql.dump, and then restore into Postgres. :%s/mysql_/pg_/g in all my PHP files. Change mysql_error to pg_last_error, and fiddle with pg_num_rows, and it all worked. Moreover, one huge query that took 25 seconds to complete in MySQL (lots of JOINS and nastiness) took about 1 second in Postgres.
    I've never looked back. MySQL is now just coming to fill in all the gaps it's missing - but just go with Postgres. It's rather good.
    No mention of SQL servers can go without the Gotchas: Mysql and Postgres. The worst MySQL is probably that it modifies data as you insert it without throwing an error. Yuk.

    1. Re:I used to like MySQL by croddy · · Score: 2, Informative

      mysql> select count(*) from users where id not in (1, 2, 3, 4, 5);
      +----------+
      | count(*) |
      +----------+
      |       93 |
      +----------+
      1 row in set (0.12 sec)

      mysql> create table strings (stuff varchar(8));
      Query OK, 0 rows affected (0.03 sec)

      mysql> insert into strings values ('abcdefghijk');
      ERROR 1406 (22001): Data too long for column 'stuff' at row 1

      mysql>

    2. Re:I used to like MySQL by DrXym · · Score: 2, Informative
      Besides these days, Postgres is very easy to setup. I use in Windows XP and it even comes with an installer, ODBC drivers, help and pgAdminIII. It works wonderfully. I even had it hooked up to the new OpenOffice 2.0 database application.


      I'm certainly no power user but Postgres strikes me as an extremely well featured DB. I use MSDE / MS SQL server at work for an app with transactions, stored procedures, triggers and views and expect it would be straightforward (not trivial but straightforward) to port it to Postgres.


      Sadly though, there's no incentive since MSDE is "free". Basically MSDE is a cut down SQL server which is no bad thing. But I'd love to see Postgres bundled in a similar form on XP - just the engine but nothing else. I reckon lots of apps need a database engine and Postgres fits the bill quite nicely. It would even be a smaller redistributable than MSDE too.

    3. Re:I used to like MySQL by croddy · · Score: 4, Informative

      mysql> select count(*) from users where id not in (select id from users where id%2 != 0);
      +----------+
      | count(*) |
      +----------+
      |       48 |
      +----------+
      1 row in set (0.01 sec)

      mysql>

  16. Re:The most interesting part of the old article... by DAldredge · · Score: 3, Funny

    So are you :)

  17. Re:Popularity by TheMMaster · · Score: 3, Insightful

    I hate to burst your bubble here, but ALL dbms's are slightly different from eachother, this is largly because the SQL spec leaves room for these kind of things.
    It's not like there is a HUGE difference, as long as no dbms specific procedural language was used (think plsql (oracle)) it's pretty trivial to port an application from one dbms to the other
    The biggest differences are usually pretty subtile and indeed rather frustrating, but by no means hard to solve.
    The biggest and most 'incompatible' difference between postgres and mysql is the autoincrement field really, the rest is just small fish to fix.

    --
    Fighting for peace is like fucking for virginity
  18. Not exactly ... by khasim · · Score: 4, Insightful

    If I go to the store and buy a copy of MSOffice, that's one thing.

    If I get a site license from Microsoft, that's something else.

    If Bill Gates and I do a press release about our new partnership, that's an entirely different thing.

    SCO and MySQL AB did the press release thing. That's not the same as SCO buying a license to distribute.

    1. Re:Not exactly ... by Quarters · · Score: 4, Insightful
      Press releases have no bearing whatsoever on the level of business relationships. Press releases happen if someone (or some-company) has enough money (~$300US) to do a wire release and has something to say. They're just an advertising medium. Nothing more, nothing less.

      I could do a press release about how I just bought a tube of toothpaste at the local Kroger. The wire service(s) would happily take my money and put the story on their distribution network(s). Big whoop.

    2. Re:Not exactly ... by SnowZero · · Score: 2, Funny

      This is important though. MySQL can only redeem itself now by issuing another press release which says that partnering with SCO "made them feel dirty."

  19. MySQL vs. Oracle by solman · · Score: 2, Informative

    Except for big iron (where DB2 dominates) and Micorosft environments (where SQL server dominates), Oracle is the dominant player.

    I recently moved my deployments from Oracle to MySQL because:

    1. MySQL supports all of the Oracle features you need to build and operate an enterprise software system.

    2. MySQL's new administration tools are significantly better than Oracle's out of the box tools (This is why a year ago I refused to use MySQL for production, and now I've switched everything).

    3. MySQL is much easier to manage. I don't know anybody who runs a heavily loaded Oracle server in production without spending significant $$$ on DBAs and commercial tools. I feel quite comfortable doing this with MySQL.

    4. MySQL performs pretty much the same as Oracle out of the box (and I think it is easier to tune).

    5. MySQL's supposed gotchas pale in to comparison to Oracle's. When I first used MySQL BLOBs it simply worked. I opened up the administration programs and I could actually see the images in the database. It was so beautiful I wanted to cry. I can't count the number of times I went through Oracle BLOB/CLOB hell with different platforms. (Not just getting them in there, but actually getting them to work with third party applications which is the real pain.)

    I think that anybody deploying Oracle for non-Oracle applications is going to have to very seriously consider MySQL if for no other reason than all the DBA salaries you can get rid of.

    If you want to buld a $1M cluser, stick with Oracle (for now). If you want to run application specifically designed by (or for) Oracle, stick with Oracle. Otherwise, switch at the first opportunity.

    1. Re:MySQL vs. Oracle by Just+Some+Guy · · Score: 4, Informative
      MySQL supports all of the Oracle features you need to build and operate an enterprise software system.

      As of today, MySQL 4.1 is the current release. 5.0, the current development snapshot, is the first to support stored procedures. Since the choice today is between a tested system and stored procedures, it most certainly does not "support all the Oracle procedures [I] need to build and operate an enterprice software system".

      Next year? Maybe. Right now? No way, according to mysql.com.

      --
      Dewey, what part of this looks like authorities should be involved?
    2. Re:MySQL vs. Oracle by oGMo · · Score: 4, Informative
      MySQL supports all of the Oracle features you need to build and operate an enterprise software system.

      HAHA. Right. Tablespaces? Failover? High availability? Row-level locking? Stored procedures? Triggers? Multimaster replication? SQL conformity? I could go on, and on...

      MySQL's new administration tools are significantly better than Oracle's out of the box tools (This is why a year ago I refused to use MySQL for production, and now I've switched everything).

      MySQL is much easier to manage. I don't know anybody who runs a heavily loaded Oracle server in production without spending significant $$$ on DBAs and commercial tools. I feel quite comfortable doing this with MySQL.

      Yes, Oracle's builtin tools suck. However, others are available. This is basically "I'm not an Oracle DBA, but MySQL was easy for me, so it's better than Oracle!"

      MySQL performs pretty much the same as Oracle out of the box (and I think it is easier to tune).

      Yes, and anyone who's using a db tuned out of the box isn't doing significant work.

      [snip whining about blobs]

      Blah, blah, Oracle is hard. Get a DBA and a real developer. This is what they're paid for.

      I think that anybody deploying Oracle for non-Oracle applications is going to have to very seriously consider MySQL if for no other reason than all the DBA salaries you can get rid of.

      Oh, that's right, you want us to get rid of the people with a clue, because you have to pay them. Brilliant! So I guess we'll call you at 3am on Sunday morning when our servers crashed, we have to restore from rollback segments on our failover cluster... oh wait. MySQL can't do that.

      If you want to buld a $1M cluser, stick with Oracle (for now). If you want to run application specifically designed by (or for) Oracle, stick with Oracle. Otherwise, switch at the first opportunity.

      If you're building a big expensive app, you might look and see if PgSQL can support you. If you're building a crappy little webapp, you might check out PgSQL, because it's fun and you'll get some experience with a real database.

      Given PgSQL is free and not all that hard to manage, I can't think of a single reason for switching to MySQL.

      --

      Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

    3. Re:MySQL vs. Oracle by ttfkam · · Score: 5, Informative
      1. MySQL supports all of the Oracle features you need to build and operate an enterprise software system.
      Ummm... no. MySQL does not have user-defined data types, object-relational extensions, full support for the CHECK constraint (a big one IMHO), views in a stable release, updatable views, rules, stored procedures in a stable release, synonyms, support for more than one autoincrement column per table, automatic conversion of code pages between client and server, nested transactions, complete trigger support, access privilege grouping, access to multiple databases in one session, multi-master replication, gateways to other DBMSs, XML data and transformation tools, and better tools for recovery from failures.

      You can use MySQL for your enterprise apps, but it is not Oracle. MySQL, while boasting impressive database sizes, is not even close to competing with Oracle (or DB2 or Sybase) on the largest deployed database sizes.
      2. MySQL's new administration tools are significantly better than Oracle's out of the box tools (This is why a year ago I refused to use MySQL for production, and now I've switched everything).
      The enterprise is not as price-sensitive as the SOHO market. Very few that buy an enterprise Oracle license use the out-of-the-box tools.
      3. MySQL is much easier to manage. I don't know anybody who runs a heavily loaded Oracle server in production without spending significant $$$ on DBAs and commercial tools. I feel quite comfortable doing this with MySQL.
      See my answer to number 2.
      4. MySQL performs pretty much the same as Oracle out of the box (and I think it is easier to tune).
      Only in environments that MySQL can handle. Oracle can handle scenarios where MySQL cannot run at all let alone run fast.
      5. MySQL's supposed gotchas pale in to comparison to Oracle's. When I first used MySQL BLOBs it simply worked. I opened up the administration programs and I could actually see the images in the database. It was so beautiful I wanted to cry. I can't count the number of times I went through Oracle BLOB/CLOB hell with different platforms. (Not just getting them in there, but actually getting them to work with third party applications which is the real pain.)
      Agreed. Oracle definitely has its warts.

      That said, migration to and from Oracle is easier with PostgreSQL or Firebird -- especially if you start on the lower end. MySQL has been so far from SQL standard compliance, you may not know when you're doing something really weird. MySQL 5.0's strict mode has helped tremendously with this. Too bad it's not ready for production yet.
      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    4. Re:MySQL vs. Oracle by Hiro+Antagonist · · Score: 2, Interesting

      Other people have made similar comments, but I just feel the need to chime in.

      Mind telling me how you're going to move ten terabytes of data around on a $10K server? With full replication (so you're going to need another server at a remote location), tens of millions of transactions every hour, with complete integrity checking and automatic failover to secondary and tertiary systems?

      Because that's what McKesson does. I don't work there, just got a tour of the datacenter when I was looking for a job a few years ago, and the amount of data they push and prod is amazing. A 10K server, even with an assload of IDE disks in one huge raid, can't even come close to what you can do with a Sun Enterprise server tied to Fibrechannel disk arrays.

      MySQL is for SOHO and small-business use, and depending on it for larger things is a recipe for trouble; where's the transaction and constraint checking in the current stable version? What about stored procedures (again, those are in beta)?

      What's worse is that MySQL includes datatypes (like sets) that are, from the perspective of a relational model, completely incorrect, and this makes transitioning to a larger database much harder.

      I use MySQL for simple jobs, and PostgreSQL when Real Work needs to be done.

      --

      --
      I Hit the Karma Cap, and All I Got Was This Lousy .sig.
    5. Re:MySQL vs. Oracle by MyHair · · Score: 2, Insightful

      Given PgSQL is free and not all that hard to manage, I can't think of a single reason for switching to MySQL.

      Because a project you download is hard-coded to it. (Mambo, some BBSes, eCommerce sites, etc.) I like PgSQL better than MySQL, but I keep having to use MySQL for the PHP projects I play with.

    6. Re:MySQL vs. Oracle by einhverfr · · Score: 2, Interesting

      3. MySQL is much easier to manage. I don't know anybody who runs a heavily loaded Oracle server in production without spending significant $$$ on DBAs and commercial tools. I feel quite comfortable doing this with MySQL.

      Sure. This is one of Oracle's big downsides. But this hardly means that MySQL is the right tool for the job....

      4. MySQL performs pretty much the same as Oracle out of the box (and I think it is easier to tune).

      Under what kind of load? How many are complex queries, and how many are read-only? MySQL performs well with simple read-only queries, but does not do well under serious load with a mixture of complex queries and writes.

      This makes MySQL perfect for content management and pretty piss poor for anything else.

      5. MySQL's supposed gotchas pale in to comparison to Oracle's.

      Hardly. Any "rdbms" that truncates your data silently and does not enforce CHECK constraints is not suitable for enterprise applications almost by definition. If you don't know why, I think you should read up on relational theory.

        When I first used MySQL BLOBs it simply worked. I opened up the administration programs and I could actually see the images in the database. It was so beautiful I wanted to cry. I can't count the number of times I went through Oracle BLOB/CLOB hell with different platforms. (Not just getting them in there, but actually getting them to work with third party applications which is the real pain.)

      Again, if Oracle is too much of a PITA, look at EnterpriseDB. It is basically PostgreSQL with some additional features to make it work with Oracle-only applications. This means your Oracle apps just work, and your PostgreSQL apps just work. And you save a bundle or two of money.

      --

      LedgerSMB: Open source Accounting/ERP
    7. Re:MySQL vs. Oracle by Cylix · · Score: 2, Informative

      Depends on hwo they were coded.

      Some things are not that bad to port to psql and some well... are.

      I've seen more then one project using a multi-vendor db API. Didn't work 100% last time I used something like this, but it wasn't horrible to make a few adjustments to get searches working correctly. (The outstanding one was all searches in mysql were case insensitive and for postgres I had to change a parameter for case insensitive operation)

      --
      "You should always go to other people's funerals; otherwise, they won't come to yours." -- Yogi Berra
    8. Re:MySQL vs. Oracle by pushf+popf · · Score: 2, Interesting

      Systems this large typically don't need a general purpose database, they need custom software designed specifically for the required tasks.

      This is another fallacy that's been foisted on the business community: that if you have data, you need a database.

      I actually designed a system similar to the one you mentioned. The initial specs called for called for importing, merging sorting and outputting 50 - 75 Gb of data each day.

      Even with a 16 processor boxe and a SAN, Oracle took 22 hours to process 24 hours worth of data.

      I finally convinced the company that just because they had a hammer, the problem wasn't necessarily a nail, rewrote the required functionality in a C application with NO DATABASE, and the sort/merge/output ran in less than 2 hours on an old leftover dual 500 Mhz Sun box we had laying around.

      No staff of DBAs, no huge Oracle licence fees.

      Although they never shared the savings information with me, it had to be over a million $/year.

    9. Re:MySQL vs. Oracle by bmalia · · Score: 2, Insightful

      1. MySQL supports all of the Oracle features you need to build and operate an enterprise software system.

      Thanks for the laugh!

      --
      There's no place like ~/
  20. Don't forget Interbase/Firebird by ThinkThis · · Score: 3, Informative

    Our company has developed an app used at several hundred sites on the Interbase/Firebird platform. (Firebird is now the only open source version). It is stable, quick, low maintenance with support for transactions, triggers, row level lockinge, etc. I would consider MySQL for web development because it comes preinstalled on many hosts and because of the number of tools available.

  21. Web Tools by mikeboone · · Score: 2, Insightful

    So far I've stuck with MySQL for most of my projects since phpMyAdmin is so much better than phpPgAdmin. I can almost always get a web-based database tool running on the platform I'm developing for.

    If there's a better web interface for Postgres than phpPgAdmin, let me know so I can try it.

  22. Heavy by HadenT · · Score: 5, Informative

    I'm using PostgreSQL and MySQL, from my experience:
    1. I've never encountered corrupted data with mysql (It seems to be urban legend), and I have worked on tables with billions rows for two years.
    2. PostgreSQL has more features and/or is more complete (simple example can be auto_increment vs. sequences)
    3. PostgreSQL is heavier, and I hate statistics collector subprocess via udp (which seems to be eating 1-2% cpu all the time)*
    4. mysql isn't much (if any) faster.

    * - it's unlikely but possible my configs are to blame.

  23. Mysql is very isp friendly by Billly+Gates · · Score: 4, Insightful

    The one good thing I have to say about mysql is that its multi-user friendly for hundreds of accounts.

    For a mom and pop ISP with only 3 or 4 employees this is significant. Is it feature filled? No

    Its just included in the default user account which is difficult if not impossible with posgresql unless you manually install it for each account.

    Users on the web dont need something heavy unless they are a commercial website. Also there are a ton of php and perl scripts and tools for users to use.

    This is why msql is so popular. Its what ISP's prefer.

    1. Re:Mysql is very isp friendly by WereTiger · · Score: 2, Informative

      Speak for yourself, I'm an IT Manager for a Communications company and we've found MySQL to perform far worse for heavy load usage as compared to Postgres. We've migrated completely to Postgres with no regrets and significant performance increase.

      --
      If you're hearing rhetoric about Linux, open source, or Mac and everyone's bashing Microsoft, you've found Slashdot.
    2. Re:Mysql is very isp friendly by Billly+Gates · · Score: 2, Insightful

      Postgresql is a much better database. No doubt about it. I would prefer it if I were writting an application.

      However if your a small isp with little to no support staff mysql is the easiest to install and configure for average home users and small business on a server farm. That is all I am saying and why mysql is incredibly popular. Its just what the ISP's love using and including by default.

      The same reason Windows and Dos became popular. Its the OS OEM's love to include.

    3. Re:Mysql is very isp friendly by ttfkam · · Score: 3, Informative

      Debian: apt-get install postgresql (or use Synaptic)
      Gentoo: emerge postgresql
      Fedora: rpm -Uvh postgresql-8.0.3.i386.rpm (or select the "Database" package during install)
      Windows: setup.exe

      Easy administration from Windows, OS X, Linux, and BSD with PgAdmin.

      Or were you talking about a manual install? Sure that's harder, but most of us don't do manual installs. Just those crazy Slackware folks and their ilk. ;-)

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    4. Re:Mysql is very isp friendly by schon · · Score: 3, Interesting

      Its just included in the default user account which is difficult if not impossible with posgresql unless you manually install it for each account.

      Complete, utter bullshit.

      PostgreSQL does *NOT* need to be "manually installed" for each user any more than MySQL does.

      there are a ton of php and perl scripts and tools for users to use.

      This is the reason why MySQL is more popular for ISPs - because there is a bunch of PHP code that runs only on it.

      Its what ISP's prefer.

      No, it's what ISPs offer. And they offer it because people ask for it.

    5. Re:Mysql is very isp friendly by quanticle · · Score: 2, Interesting

      The thing is that all of the above processes require root access. If you're going with a 3rd party hosting service, that's something you won't have. This is what the grandparent poster was talking about. The reason that MySQL is so popular is that ISPs include it, and that those who need a database on their website are therefore "locked into" MySQL.

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
    6. Re:Mysql is very isp friendly by electroniceric · · Score: 2, Interesting

      The simple reason people get started with MySQL is that it's popular. So there are more tutorials on how to get started, more books, more widgets and wizbangs that work with MySQL, etc. This also means there is a larger network of people to answer questions.

      Contrary to popular opinion however, Postgres is now extremely easy to install and administer, either on Windows or *nix, has excellent resource use (i.e., on my Windows box, it's much more lightweight than MySQL), and it has an GUI admin tool right in the box. And because of its liberal licensing scheme (BSD), you can use it for anything you like. What of that makes it hard for ISPs to run Postgres? The only hard thing I can think of is finding people who know it.

      I'll concede that postgres' user model is rather limited, but this is slated for substantial improvement (conversion to roles) in version 8.1 now in beta.

      Postgres really has a rather extraordinary feature set: what other DBMS (open or closed source) has Perl and Ruby procedural languages (PL/Ruby), or an (admittedly incomplete) statistical procedure language (PL/R), custom aggregrates, Kerberos authentication? And in my experience you have all that stuff there if you need it (which as you correctly point out, most simple database driven pages do not), but it does get in your way when you don't use it, and it's there for you to grow with when you want it.

    7. Re:Mysql is very isp friendly by ClayDowling · · Score: 2, Interesting

      PostgreSQL was held back for years by documentation that made the user account and security system seem arcane. I finally decided to bite the bullet and install PostgreSQL. It turns out that the security system isn't any more arcane than MySQL, the documentation just made it seem harder.

      Personally I like the features of PostgreSQL better, probably because I've been working with databases professionally for roughly ten years. For a lot of situations though MySQL is not only adequate, but an ideal choice because you can usually count on people having access to it.

  24. But would Kroger co-release it? by khasim · · Score: 2, Interesting

    Would a Kroger executive talk enthusiastically about your new "partnership" with them?

    Usually, companies don't want to be seen publicly supporting nutcases who try to make a news story about buying some toothpaste.

    SCO can have the press conferences it wants and tell everyone whatever they want ... but it changes when another company is quoted as saying anything more than "we sold them a license and we'll sell you one too!"

    1. Re:But would Kroger co-release it? by bitingduck · · Score: 3, Funny

      Would a Kroger executive talk enthusiastically about your new "partnership" with them

      But it would make a great story in the Onion...

      "Kroger DEO David Dillon said that he was 'very pleased to have the opportunity to supply toothpaste and other oral hygiene products to Quarters, who is widely known for is impeccable white teeth and fresh breath.'"

  25. Haw haw by Safety+Cap · · Score: 4, Informative

    Parent is comparing non-current versions, and making up false "cons" for mysql, out of thin air...

    5.0 has views, triggers, stored procedures etc, and it's still amazingly fast.

    So, if I try to insert, say, a string of 10 chars into a varchar(9) field, what will it do? Will the magic version 5 reject it, as ever real database does, or will it truncate it silently, just as Toy databases (ala MySql 4.x) are wont to do?

    What about the whole not-null thing? You know, if a field is set to NOT NULL and you don't populate it when you insert a row, a real database will reject it, where as a Toy database will accept it (MySql 4.x again!) and populate it with ... some other value.

    --
    Yeah, right.
    1. Re:Haw haw by schon · · Score: 4, Insightful

      Truncating varchars is handy for webforms... you don't want to reject the data..

      Yes, I do. That's why I set the length in the first place. If I wanted to truncate the data, I'd tell the DB to do that.

      if you REALLY need the logic to reject things like blank inputs in web forms then you should be doing that in your application logic anyway

      This is the problem with MySQL's cheerleaders - they believe that the app designer should re-invent the wheel, rather than expecting the DB to do the stuff that it's supposed to do.

      Why on earth should I have to write extra code to check each input field, when I should just be able to send the results to the DB, and return the error message to the client if it fails?

      just trying to relay the idea that in the context that mysql is usually used, these small quirks don't have a large impact.

      The only reason that people believe that they don't have a large impact is because they don't actually understand the *reasons* for the correct behaviour. The attitude is "well, I'm a programmer, so I'll just program around the problems", rather than expecting the DB to handle it (like it's supposed to.)

    2. Re:Haw haw by slamb · · Score: 3, Insightful
      but usually the data isn't important enough (like a slashdot post) to really care if a couple words get chopped off by accident

      That is exactly the MySQL attitude. The problem is that my data tend to be important, or I wouldn't be putting them in a RDBMS. I'd rather the database assume the usual, safe thing - data should not silently truncated. If I want to throw away my data, I'll do it explicitly.

      And filling in NOT NULLS is also handy for the same reason.... if you REALLY need the logic to reject things like blank inputs in web forms then you should be doing that in your application logic anyway....

      What I REALLY need is for the database to pay attention to the constraints I specify. If I didn't care if these fields were blank, I wouldn't have said "NOT NULL".

      I am by no means sticking up for non-conformity... just trying to relay the idea that in the context that mysql is usually used, these small quirks don't have a large impact.

      That is not the context in which mysql.com is claiming their database is usually used. They claim they have a real database.

  26. Coolest Feature of Postgresql by daperdan · · Score: 2, Interesting

    I've used both databases for years and they both have their place. One thing that is rarely mentioned about Postgresql is the Table inheritance. I have yet to find this feature in another RDMS. Anyone know of a database out there that supports this feature?

    It allows you to create a table that inherits the fields of a parent table. Each time you insert data into the child table the parent also gets a record. You can use regular expressions to select from all child tables. Very cool and useful.

  27. good one by qda · · Score: 3, Funny

    "Since then both databases have evolved to wherever they are today." Thank you for that profound insight..

  28. Re:The most interesting part of the old article... by tzanger · · Score: 3, Funny

    As are you. :-p

  29. Re:The most interesting part of the old article... by Paul+Crowley · · Score: 2, Funny

    How do you think I feel?

  30. Re:The most interesting part of the old article... by billysara · · Score: 3, Funny

    Where-as you're a long-timer? ;-)

  31. Sco Partners With MySQL AB by burnin1965 · · Score: 4, Informative

    Get your facts straight coward:

    "As part of the agreement, the companies will work together on a range of joint marketing, sales, training, business development and support programs"

    http://www.mysql.com/news-and-events/news/article_ 948.html

    burnin

  32. Message bearer by burnin1965 · · Score: 4, Insightful

    True, but then again it also depends on who is bearing the news as well.

    Considering you are nobody your press release wont really mean much. And I would also go so far as to say The SCO Group are nobody as well and their press releases don't mean much.

    However, if Kroger made a big deal about your toothpaste purchase in the news section of their website it may actual be something to consider.

    When SCO made their press release I didn't pay much attention because I have become very skeptical of any messages that come out of their organization. But it is disconcerting when MySQL considers the partnership to be news worthy as well:

    http://www.mysql.com/news-and-events/news/article_ 948.html

    burnin

  33. Forget Interbase/Firebird by Just+Some+Guy · · Score: 2, Informative
    The last time I used Firebird on a major project, it sucked so badly that I wrote a program to convert its databases to PostgreSQL (even if they contained unreadable rows that kept the normal utilities from working). Unless Firebird's undergone the same kind of rewrite that Netscape did while becoming Mozilla, I wouldn't touch it with a ten-foot pole.

    To each his own, of course, and the situation may indeed have improved. I don't see any clear advantage that it has over PostgreSQL, though, and I doubt it'll ever gain much momentum.

    --
    Dewey, what part of this looks like authorities should be involved?
    1. Re:Forget Interbase/Firebird by Unordained · · Score: 4, Interesting

      I had mod points, and as a Firebird user, I was going to mod up the grandparent -- Firebird is very often ignored despite a host of positive features.

      But as you had a bad experience, and you link to your problem list, I thought I'd respond instead. Better to answer questions than just mod up friendlies.

      - Database path: Yes, firebird supports aliases. Our app doesn't use them, but they're there.
      - ISQL: I hear Oracle's SQL*Plus isn't much better. However, I use isql every once in a while, and I have command-history, backspacing, etc. available to me. From what I hear, it's more of a function of the shell you use (around isql) than isql itself. If you set up your environment properly, isql and its ilk automatically get command-history. (That's what I'm told, note. Anyone who can explain this is welcome to. I'm not a sysadmin.)
      - Never seen it freeze.
      - Corruption: we've had exactly one database issue, where it seems a backup/restore script ran in the middle of the day, restoring the database to its state from 4 hours earlier. In 4 years of use, with somewhere around 60 users in a medical clinic/insurance/billing environment, we've had no corruption. Using forced-writes is important, however. The careful-write strategy is really, really reliable, but it still can't protect you from faulty hard drives or operating systems that refuse to send data to the disk in the order requested (cf. Windows). M1 Abrams tank story, anyone?
      - IBDataPump and other third-party tools exist for some of the other features you're interested in. I'm not sure I know how even I feel about some things only being offered by third-parties. Oracle's tools suck enough people buy other products ... heck, why bother? Just develop a good RDBMS with a good API, and let others fight it out? (That's an open question.)

      Feature-wise, and maybe target-audience-wise, Firebird and PostgreSQL are similar. Stored procedures, triggers, check constraints, MVCC (Postgresql seems to have copied MVCC off of Interbase, note), savepoints/nested (but not concurrent) sub-transactions, etc. It lacks a lot of the UDT (type) features of PostgreSQL (you can define domains, but not entirely new datatypes) -- note that Postgres was specifically designed with UDT's in mind. Firebird does support UDF (function) features though, and you can get some of the same flexibility that way if you're masochistic (save data in octet or blob fields and use UDF's to interpret the data). Pg also has neat SP language support, letting you write your SPs in a variety of languages -- Fb doesn't. Unlike Postgres, it's really easy to install, particularly on windows (that was a problem for Pg up until semi-recently) and it practically maintains itself. (Happily, the Pg team eventually got their vacuum, equivalent to Fb's sweep, to not take down the database, so Pg can now run 24/7 too.) Fyracle has been trying to make Firebird more Oracle-like in SP language support and some of Oracle's more interesting query abilities (CONNECT BY). Yes, I occasionally get feature-lust and look at other DBMS's. I don't need Oracle features, but Pg features would sometimes be nice. But I don't use Pg, so I don't know what annoyances it has that Pg users would be thinking about. Maybe it's all-around better, I don't know.

      Both are really good projects, with their own strengths. I would say comparing Firebird and PostgreSQL is a much fairer comparison than Pg and MySQL or MySQL and Fb. Pg and Fb are more of a 'niche' comparison. MySQL has nowhere near the features of either of them, isn't nearly as safe, and just isn't designed with the same requirements in mind.

      Every single experience I've had with MySQL has been one of "fixing" stuff for a MySQL user who just couldn't get things to work. Joins that wouldn't work (but should have), joins that were slow, data being eaten ... And then there's reliability ... ugh. MySQL just wasn't designed with data integrity in mind, while Pg and Fb were. "Foreign key constraints can be

  34. One thing to consider - collations and Unicode sup by melted · · Score: 4, Informative

    One thing to consider - collations and Unicode support. Believe it or not, folks, Postgres does NOT support case-insensitive string comparisons. Or, more exactly it does, but you end up doing full table scan and converting everything into upper/lowercase, which is not an option on all but the smallest of the datasets. And even converting to upper/lowercase is a BIG problem for PostgreSQL, because it's UNICODE support is quite poor. So if your project has even remote possibility of using non-English textual data in lookups, steer clear of PostgreSQL.

    There's a discussion about including support for IBM ICU, but as of right now there's no proper collations/unicode support in PgSQL, aside from storing character data in UTF-8.

    MySQL is much better in this regard.

  35. The scoreboard by ttfkam · · Score: 4, Informative

    http://www.huihoo.com/postgresql/mysql-vs-pgsql.ht ml

    Changes/corrections since that study was made:

    PostgreSQL now natively supports BLOBs directly in tables (bytea type) as opposed to using oid references.

    PostgreSQL has always had "better than row level" locking, Multi-Version Concurrency Control.

    PostgreSQL has added Java and Ruby to its list of stored procedure languages.

    ----------------

    Now, here's the caveat. MySQL 5.0 is still marked as a "development release (use this for previewing and testing new features)" so I didn't include it in the above. If we include MySQL 5.0, we must also include PostgreSQL 8.1, currently in beta.

    MySQL 5.0 adds views, stored procedures, triggers, cursors, the bit data type, up to 65K varchar fields, two new storage engines (federated and archive), and a strict mode.

    PostgreSQL 8.1 adds two-phase commits, a role system, shared row level locks using SELECT, and many speed improvements.

    The strict mode in MySQL is most exciting to me. I always bought the argument that MySQL could have fewer features in exchange for greater speed. But there is no excuse (in my opinon of course) to accept random strings into numeric fields and other such contrivances (MySQL gotchas). Data integrity in a database should not be an optional feature.

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
  36. It really doesn't matter. by MikeFM · · Score: 2, Insightful

    I write my db code to abstract all my queries away from the rest of my program. You access the queries I've writen via a XML-RPC interface. That way if you need to switch db all you have to do is rewrite your queries and none of your app code needs to change.

    Issues like speed, resource usage, sql features, etc really don't matter very much as for 99% of db applications it just makes no difference at all and for the 1% it does then you'd better hire someone that knows the differences in dbs without having to look it up on Slashdot.

    Most of the time it is better just to use the basics. I see people doing EVERYTHING in the db. Stored procedures, adding 1 + 1, massice complicated joins that'd be easy to do in anything other than SQL, etc. A big mistake. The db is the single hardest portion of your application server to replicate and load balance (even with the db supporting things like clustering). It's better to write your glue code in a normal language and just abstract that glue code as a sepperate service and use the db just for storing and retrieving data.

    --
    At what price learning? At what cost wisdom? The price is a man's peace of mind, and the cost is his life.
    1. Re:It really doesn't matter. by tzanger · · Score: 5, Informative

      I disagree.

      Putting everything (by everything I mean business logic) in the DB is the only sane way to keep your data consistent across multiple access methods. You simply can't thow data at a DB and then try to code and maintain consistent business logic in a half dozen client apps. You might be able to get away with a shared client access lib but even that can get messy.

      Let's face it: Your data's in the DB. Why pull it all into the application to work on some small subset? Do all the queries and joins and clauses and increments in the database. The DB knows best where the data is and how you're going to be tinkering with it (so long as you give it sufficent hints), so it's the only sane method to access your data in a logical fashion. That's precisely why all these scripting languages and language interfaces exist.

      I too use XML-RPC and SOAP (moreso the latter it seems, as XML-RPC is a little too light IMO) to access my data, but you can bet your sweet bippy I'm having the DB do as much as possible in order to transfer as little data as possible across my app-db link.

    2. Re:It really doesn't matter. by musicmaker · · Score: 3, Insightful

      An classic example of a MySQL Idiot. You put things in the database so that they are _atomic_. You want things to either compmletely succeed or completely fail. Most application layers cannot do this successfully, and you end up with corrupt data.

      And go ahead, tell my that having corupt data doesn't matter. Then I'll throw sarbanes-oxley at you and laugh.

      --
      Everyone is living in a personal delusion, just some are more delusional than others.
  37. Sorry... by biglig2 · · Score: 3, Funny

    ...does this count as a dupe? Or is there a statute of limitations thing going on here?

    --
    ~~~~~ BigLig2? You mean there's another one of me?
  38. who to what? by cxreg · · Score: 2, Funny

    Comparing MySQL and PostgreSQL 2

    Is that the only way that MySQL can look favorable? By comparing to version 2 of Postgres?

    fnord

  39. A small thread from the past by leoboiko · · Score: 2, Informative

    I once asked on slashdot about why people use MySQL and how does it compares to PostGreSQL. Got a bunch of interesting responses.

    --
    Prescriptive grammar:linguistics :: alchemy:chemistry. Stop being a nazi and learn some science.
  40. I must disagree. by Stu+Charlton · · Score: 2, Insightful

    MySQL is much easier to manage. I don't know anybody who runs a heavily loaded Oracle server in production without spending significant $$$ on DBAs and commercial tools. I feel quite comfortable doing this with MySQL.

    In other words, you're not actually running an enterprise-scale software system (which would require significant $$$, professional DBAs, and tools no matter WHAT database product you're using). You're running a single-man shop.

    This is a great troll -- all of your points are sufficiently broad as to be impossible to prove or disprove either way. They're all obvious personal opinions but phrased as facts. Who's to say that any arbitrary enterprise software system can be satisfied with MySQL's features, or another's isn't? Or that you find MySQL's administration tools better than Oracle's (which I find to be therichest out there). Or that any "gotchas" you've had with BLOBs and CLOBs seem purely anecdotal.

    The number of features that Oracle has over MySQL is simply staggering, as is its ability to robustly handle enormous concurrent loads. Its clustering support, backup & recovery abilities, and query optimizer are second-to-none. I'm glad you've found a cheap and better alternative, but I hardly think it's applicable to all.

    --
    -Stu
  41. Re:I have a small problem... by FooAtWFU · · Score: 2, Informative

    Have you recompiled MySQL? If so, have you changed anything in the source, and are you going to sell this modified version? If so, you must include the source of your modified version with any sales, under the terms of the GPL. If not, you're probably okay without switching at all. This is probably the case if you can ship MySQL separately from whatever application that you're developing, and if you can use an existing MySQL database without installing a new one yourself. (obligatory IANAL bit here)

    --
    The World Wide Web is dying. Soon, we shall have only the Internet.
  42. SCO issued a press release. by falconwolf · · Score: 5, Informative

    There isn't one from MySQL AB.

    Actually there is a press release on MySQL's website:

    SCO Partners With MySQL AB to Lower Costs and Increase the Power & Scalability of Modern Database Solutions

    Falcon
  43. Re:The most interesting part of the old article... by dave · · Score: 2, Funny

    Sorry billysara, I must have beat you by a few minutes. :)

  44. Re:Popularity by jadavis · · Score: 3, Informative

    but ALL dbms's are slightly different from eachother

    MySQL is far away and completely alone in it's flavor of SQL and behavior. There are all kinds of strange things it does, like use the "`" to quote identifiers. Oracle, PostgreSQL, SQL Server, &c. all have their differences. But they all look a lot more like eachother than any of them look like MySQL.

    The biggest and most 'incompatible' difference between postgres and mysql is the autoincrement field really, the rest is just small fish to fix.

    Actually, the biggest differences are regarding types and constraints, in my opinion. For instance, MySQL thinks February 31st is a date, PostgreSQL does not. PostgreSQL enforces constraints, MySQL does not. MySQL NULL handling is non-standard.

    --
    Social scientists are inspired by theories; scientists are humbled by facts.
  45. Re:Popularity by kryonD · · Score: 3, Insightful

    "I hate to burst your bubble here, but ALL dbms's are slightly different from eachother, this is largly because the SQL spec leaves room for these kind of things."

    I hate to burst your bubble, but the differences have nothing to do with a poorly designed spec. They have everything to do with companies either being too lazy, or too stubborn to adjust to and adhere to the specs. Even M$, who created the ODBC standard fails to adhere 100% to it in both Access and MS SQL.

    In their defense however, DBMS's have often evolved far faster than the specs could keep up resulting in dozens of different ways to do something the specs didn't originally cover. However, my forgiveness ends right where the spec catches up and then the dbms developers fail to add compatibility to their product. The fear that compatibility will leave room open for customers to migrate to a competing product is exactly why the USA is about 2 to 3 years behind in technology right now. Go to NTT Docomo's website and look at their newest line of phones and you will note two very distinct trends:

    #1 The lowest model blows away all US phones.

    #2 They all share the same baseline standard design...which forces them to compete in the non-standard areas...which rewards the consumer with a consistant design and interface and innovation.

    Wake me up when companies (or even OSS project managers) in the US stop screwing their customers with proprietary interfaces designed to lock in their customer base. I really don't measure a product's worth by the number of users it has....otherwise I'd still be using IE.

    --
    I've dirtied my hands writing poetry, for the sake of seduction; that is, for the sake of a useful cause. --Dostoevsky
  46. Just compared MySQL 4.0.12 vs PG 8.0.3 by adturner · · Score: 4, Insightful

    Short story, mysql.com's interpretation of the GPL is frankly a lot more strict then mine or my reading of the FSF's FAQ on the GPL. If it wasn't for that, I'd still be using MySQL for my company's application since I'm more familar with it.

    Anyways, PostgreSQL IMHO has some things going for it:
    - More features like triggers, stored procs, schemas, subselects, etc then the current stable version of MySQL supports. About the only thing I find myself using are subselects which are just a nice to have.
    - Attempts to be "safer" with your data via WAL, etc. Good for unreliable environments.
    - Tends to follow the SQL standards closer then MySQL
    - Is BSD licenced so you don't have to worry about licensing issues.
    - #postgresql on freenode is great. The people there are intelligent, knowledgeable and friendly if you're not an *sshole. They've helped me a lot.

    The problems I have with PostgreSQL is that:
    - INSERT is very slow (about 3x slower compared to MySQL/InnoDB) for my dataset. The "answer" is to use the COPY command or disable your indexes/FK's which is f*cking lame since you loose all your relational integrity. I was willing to trade off performance for disaster prevention (system crash, power failure, etc) by disabling WAL, but you can't actually do that.
    - The OSS tools available aren't as good for postgres as they are for MySQL. I've yet to find anything as nice or complete as phpmyadmin for Pg or something that supports schema's for ER Diagrams. Frankly, I'm sick and tired of designing my DB in vim.
    - Having to run vacuum all the time to help the query optimizer figure things out. Why this doesn't happen automagically in the background without me having to worry about it is beyond me.
    - In general, I find the documentation on mysql.com superior to on postgresql.org, but #postgresql more then makes up for it.

    Frankly, all the technical "problems" in MySQL or Pg can be worked around if you're willing to think out side of the box.

    1. Re:Just compared MySQL 4.0.12 vs PG 8.0.3 by Khazunga · · Score: 3, Informative
      - INSERT is very slow (about 3x slower compared to MySQL/InnoDB) for my dataset. The "answer" is to use the COPY command or disable your indexes/FK's which is f*cking lame since you loose all your relational integrity. I was willing to trade off performance for disaster prevention (system crash, power failure, etc) by disabling WAL, but you can't actually do that.
      Wrap the inserts in a transaction. Auto-commits force OS syncs, and these are slooow.
      - The OSS tools available aren't as good for postgres as they are for MySQL. I've yet to find anything as nice or complete as phpmyadmin for Pg or something that supports schema's for ER Diagrams. Frankly, I'm sick and tired of designing my DB in vim.
      PhpPgAdmin is way better than vim. Granted, PhpMyAdmin is better, but the difference is no showstopper.
      - Having to run vacuum all the time to help the query optimizer figure things out. Why this doesn't happen automagically in the background without me having to worry about it is beyond me.
      Like pg_autovacuum?
      - In general, I find the documentation on mysql.com superior to on postgresql.org, but #postgresql more then makes up for it.
      Better than the interactive manual?
      --
      If at first you don't succeed, skydiving is not for you
  47. Stored Procedures! by matchboy · · Score: 2, Interesting

    Above all things... this is one of my favorite features of PostgreSQL. MySQL has nothing of the sort. Procedural Languages... yum. I recently showed on my blog how I could interact with an instance of DRb from inside of PostgreSQL. How cool is that? MySQL has nothing like this. I'd also guess that a majority of the applications that use MySQL could use SQLite instead and as soon as that becomes more popular, we'll see less MySQL usage.

    --

    Robby Russell
    PLANET ARGON
    Robby on Rails
  48. Re:What does postgres mean? by HermanAB · · Score: 3, Informative

    Most databases are descended from the Interactive Graphics Retrieval System INGRES. The original coder of Ingres later started a follow on project called Postgres and when SQL was standardised it became PostgreSQL. Basically, there are only about 4 database families: SAP, Ingres, DB2 and Oracle. I prefer using Postgres simply because it is funded by the nice US taxpayers through DARPA. If it is good enough for the military, it should be good enough for me...

    --
    Oh well, what the hell...
  49. MySQL vs. PostgreSQL -- Real World by philovivero · · Score: 4, Informative

    I've read a few of the replies to this story. It's interesting to read some of the pro-PostgreSQL peoples' opinions. They're rather dated.

    The more I learn about MySQL (from the perspective of someone who was initially gung-ho about PostgreSQL), the more I realised the shortcomings of MySQL weren't really shortcomings. They were misunderstandings. Yes, this can sometimes be as bad, when a default option is a stupid option (like table-level locking, as the parent and other PostgreSQL fans complain about).

    Then I quit that job and went to work at Friendster, which is also a big MySQL shop. What I learned then was that when used properly, MySQL can scale to amazing proportions. Millions of transactions per hour (I won't be too specific being as I don't want to be sued into oblivion now that I'm an ex-Friendster employee).

    Keep in mind that Friendster isn't alone. Google and Yahoo! use MySQL. For production loads. Big, big production loads.

    What I didn't like about PostgreSQL was the weird licensing problems. Yes, bizarre as it may be, the BSD license they chose over GPL causes it to be bizarre. You can't get replication without downloading some weird third-party patch and recompiling (because the patch is GPL). Screw that. MySQL has it built in to the supported binaries you get from their site.

    Without replication, your DBMS is useless. It's pretty clear from reading the parent post that Michalf doesn't really understand replication. If he did, he might think a moment about his statement that MySQ can't scale to more than 100 users at once. Friendster had millions (at once). Yahoo! has at last estimate nearly a hundred million users at once.

    Last I checked PostgreSQL (admittedly, 6-9 months ago?) it just wasn't viable. Really replication was about the only thing holding it up, except I know another engineer who worked extensively with PostgreSQL internals (hacking it up to create a DBMS cluster, actually) and he said their I/O internals were bad/slow. Hopefully he's wrong, but I know before I deploy PostgreSQL I'm going to be carefully benchmarking it before doing so. Keeping in mind that I never deploy an RDBMS in a tiny little "more than 100 users" environment like the parent poster.

    Sorry for the long-winded rant. It's just that I've been wishing/hoping/praying PostgreSQL would be the winning RDBMS in this battle for years, and every time I think it's going to be any good, it goes and shoots itself in the foot somehow, which makes me sad. Currently, I'm still a fulltime MySQL DBA.

    Caveat: Much of what I've said here only applies in high volume RDBMS environments. If your environment is low volume, PostgreSQL may be a better choice.

    1. Re:MySQL vs. PostgreSQL -- Real World by dodobh · · Score: 3, Informative

      Yahoo! uses MySQL for minor, readonly stuff. All writes are written to InnoDB tables, and those are slow. That is replicated to MyISAM tables, which are used as caches.

      PostgreSQL replication? is here. BSD licensed too.

      Oh, and .org uses PostgreSQL as a backend. Let me know when Yahoo! starts using MySQL for its financial accounting stuff.

      --
      I can throw myself at the ground, and miss.
    2. Re:MySQL vs. PostgreSQL -- Real World by timeTumbler · · Score: 2, Interesting

      PostgreSQL has come a long way in 6-9 months. Please take a look at today's SLONY replication, at commercial support *and value-add* companies like http://www.commandprompt.com/, and http://www.enterprisedb.com/. Replication is here...don't worry. And by the way, sounds like EnterpriseDB is putting replication in place between Oracle and PostgreSQL...could be interesting...

  50. Check Out PostgreSQL 8.1 Beta by einhverfr · · Score: 3, Informative

    The one good thing I have to say about mysql is that its multi-user friendly for hundreds of accounts.

    Not really. PostgreSQL had MySQL beat there. You can assign permissions to groups. With large numbers of accounts, this becomes problematic with MySQL.

    PostgreSQL 8.1 beta further improves this by supporting the concept of roles. A role is like a user or group except that they can be nested. This allows even easier administration of databases with hundreds or thousands of user accounts.

    Users on the web dont need something heavy unless they are a commercial website. Also there are a ton of php and perl scripts and tools for users to use.

    Commercial as in what? A mom-and-pop web-store? I would call that commercial and because MySQL will *truncate* numbers to fit fields if they are too big, I would say PostgreSQL is needed for that.

    You are right in that MySQL is quite adequate for content management provided (of course) that you don't need to integrate it with other buisness apps. If you do, you can either go to PostgreSQL (and take advantage of schemas) or use PostgreSQL with DBI-Link to pull the data from MySQL. DBI-Link is easily one of the coolest new projects for PostgreSQL as it allows any data source reachable via Perl's DBI interface to be seen as a table from within PostgreSQL.

    --

    LedgerSMB: Open source Accounting/ERP
  51. Comparison of MySQL, PostgreSQL, Oracle, MS SQL... by einhverfr · · Score: 4, Informative

    No benchmarks here but benchmarks are largely useless in the database world anyway unless they are run on your specific application.

    Oracle: Very portable database, replaces many OS functions and is extremely tunable. Downside: $$ and the fact that the tuning options are extremely complex allowing your DBA to spend all his time tuning the database, and your second DBA to spend all his time tuning the tables..... (/sarcasm)

    One of the odd problems with Oracle is that empty strings and nulls are seen as equivalent (and Oracle DBA's seem to think that an empty string and a null are the same thing). The general concensus in the RDBMS industry is that these are not the same.

    MS SQL Server: A Windows-only RDBMS which is tightly integrated with Windows in terms of memory management. Quite extensible, less costly and simpler to administrate than Oracle. Will tie you to Windows. Troubled security history.

    PostgreSQL: An Open Source RDBMS designed to target Oracle's market. Extremely powerful and full featured. Attempts to tune itself to the greatest extent possible and relies on the OS for additional tuning. Downside is that it is not as widely used as the others listed above. Stored procedures are available in a much wider number of languages than in any other RDBMS in this comparison.

    MySQL: A popular open source database manager (neither really relational nor a management system). Provides a simple non-standard subset of SQL for the interaction with various resources. Downside is that it does not do much integrity checking and does not enforce much integrity (valid dates include 0000-00-00 and 2004-02-31). Furthermore it will *truncate* numbers that are too large to fit in a number field making it unfit for any purpose where it must track money. It is more widely used than any other open source RDBMS.

    FirebirdSQL. A good RDBMS designed really for Windows but ported over to UNIX/Linux. Fairly extensible and stable but largely undocumented. Lacks many of the data types available in all other databases listed here.

    --

    LedgerSMB: Open source Accounting/ERP
  52. extensions by InsaneCreator · · Score: 2, Interesting

    After 4 years of using both PostgreSQL and MySQL, I'd say that one of the biggest differences between them is their extensibility.

    If PG lacks a feature, you have a very good chance of finding a script or an extension which implements equivalent functionality. Materialized views, ordering by different locales and hierarchical queries are some examples of this.

    On the other hand, if MySQL doesn't have a feature you need, you're pretty much screwed.

  53. SP's are only the beginning by einhverfr · · Score: 4, Interesting

    For an enterprise system,you also need:

    1) Views
    2) Triggers
    3) Integrity Enforcement (i.e. if you try to insert 1000000 into a numeric(4,2) column of your enterprise accounting app you should get an error and not have something inserted).

    As your system gets large you may also want:

    1) Table partitioning
    2) Functional Indexes, i.e. create index on table foo (md5(bar))
    3) Partial indexes (i.e. create index on table foo (bar) where open IS TRUE)

    MySQL hardly offers all of these capabilities.

    PostgreSQL 8.1 will offer all of them in usable forms.

    BTW, for those interested, my site has a whitepapers section which has a MySQL to PostgreSQL migration guide.

    --

    LedgerSMB: Open source Accounting/ERP
    1. Re:SP's are only the beginning by einhverfr · · Score: 2, Interesting

      I don't think it will support things like table partiitoning though in any maintainable form.

      For example, in PostgreSQL 8.1 I can do something like (pseudocode here):

      create table master_table(
      id serial,
      date_entered date,
      open bool,
      state CHAR(2),
      data text
      );

      create table arizona_table () INHERITS (master_table) CHECK state = 'AZ';

      create rule arizona_rule ON insert to master_table where state ILIKE 'AZ' DO INSTEAD insert into arizona_table (id, date_entered, open, state, data) values (new.id, new.date_entered, new.open, 'AZ', new.data);

      Now all all entries to master table with the state field ILIKE 'AZ' (i.e. AZ, Az, az, aZ) will have their dates entered into arizona_table instead. Furthermore, if I want to do something like:

      SELECT * from master_table where state = 'AZ';

      PostgreSQL 8.1 will only look in the child tables which allow state to equal AZ. If the system is well designed, it will only look in the table which holds Arizona records. This is important for data data warehousing solutions (which MySQL really doesn't even try to handle).

      MySQL 5 may be useful when it comes out and will be a strong step in the right direction. However, many of these features take a long time to get right. I.e. PostgreSQL has had views and rules since 1995 I think.

      --

      LedgerSMB: Open source Accounting/ERP
  54. My Grief by Positronic · · Score: 2, Interesting

    I don't know the details about the internal workings of either one, but they both bug me.

    For years I've hated MySQL's install process. Call me old fashioned but I just want to

    ./configure
    make
    make install

    It makes upgrading and maintaining my servers really nice. MySQL is just an annoyance.

    Today I tried PostgresSQL, and I was happy to see a typical install process. Then I finished and I was blown away that it requires a shell in order to run. I understand that daemons need user accounts, but it just doesn't seem secure to give a daemon a shell.

    IMO MySQL is a pain, and PostgresSQL is a joke.

  55. Slashdot uptime by ttfkam · · Score: 2, Interesting

    There's more to uptime than the box(es) being up. Netcraft doesn't count when Slashdot has returned 500 status codes because the back-end (read: database) fell over. While it speaks volumes about the reliability of Apache over long periods of time, Netcraft uptimes mean didley in this case for MySQL.

    Don't get me wrong. Slashdot's reliability has been steadily improving over the years. Perhaps this is an indication of the stability of MySQL improving over the same interval.

    ----

    Also remember that older articles are archived -- removed from active database queries/updates and rendered to flat text files. Once again, it speaks highly of Apache rather than MySQL.

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
    1. Re:Slashdot uptime by jamie · · Score: 4, Informative
      The 500s you see are almost always due to load on the webheads (rendering pages takes a lot of CPU) and occasionally to planned restarts (we toast a few hundred connections every time we upgrade the code, basically because we're too lazy to gracefully integrate restarts with the LB proxy). Sometimes due to a DDoS or network outages.

      We haven't had any serious MySQL load problems in over a year, with the exception of one targeted DDoS which wedged up our search DB slave for a while. Slashdot hasn't had any MySQL reliability problems since we moved to 4.0. Our master DB has been running the same version of 4.0.x since early 2003 and it just keeps going, it never crashes. Later versions of 4.0.x are probably more reliable, but we have no need to upgrade because it just works. The only time it went down was last month when the OS finally threw a kernel panic, which sucked, but wasn't MySQL's fault.

      Anyway, the point someone was trying to make is that MySQL isn't ready for high-traffic enterprise sites, which I hope we can all agree is just silly. Slashdot's not even the best example, go look at Wikipedia, CraigsList, LiveJournal, Yahoo, Google, etc.

  56. Re:Friendster by ttfkam · · Score: 2, Insightful

    And Friendster was also slower than tar for a very long time. In addition, when you make changes in Friendster, you may have to wait for those changes to become visible to others. They have some very aggressive caching.

    On second thought, who knows? Maybe it used to. That would explain the constant downtime and speed problems.

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
  57. Re:Sure there is a difference: by einhverfr · · Score: 2, Interesting

    No. It is the difference between a bucket you *know* is empty and a bucket that contains an unknown.

    --

    LedgerSMB: Open source Accounting/ERP
  58. Re:Popularity by Tony+Hoyle · · Score: 2

    When I write code I write a backend to support multiple databases. I have to if I want to sell any product.

    Sqlite for the quick install 'embedded version'
    Mysql/Pgsql for those that use it
    MSDE/SQLServer for Microsoft types
    Oracle for large businesss.
    ODBC for everything else

    Guess which one is the hardest to get working? Luckily Mysql support is EOL now... the license issues have killed it (can't use anything over mysql 3.23 and that doesn't have proper variable binding).

  59. Solved: CREATE INDEX id1 ON T1 (lower(x)); by Anonymous Coward · · Score: 2, Informative

    > Postgres does NOT support case-insensitive string
    > comparisons. Or, more exactly it does, but you
    > end up doing full table scan and converting
    > everything into upper/lowercase

    The case-insensitive comparison is done like this:

    select * from T1, T2 where lower(x)=lower(y);

    If you have normal indexes on x and y, this won't use them and you'll get a sequential table scan. To be useful for this query, you need indexes on lower(x) and lower(y), e.g.

    CREATE INDEX idx1 ON T1 (lower(x));
    CREATE INDEX idx2 ON T2 (lower(y));

    This is described on the reference page for CREATE INDEX.

    I suggest that you ask on the mailing list next time you find a "showstopper" problem - people really are using PostgreSQL for serious applications, and an obvious thing like this would have been fixed long ago.

    1. Re:Solved: CREATE INDEX id1 ON T1 (lower(x)); by melted · · Score: 2, Interesting

      I know this, smartass.

      Now try the same for Unicode (i.e. non English) strings. Your lower(x) doesn't work for them.

      The first approach suggested by you has horrible select performance and leads to full table scans (that's on top of not working with international chars).

      The second approach screws up INSERT performance, which would be OK if it worked well with Unicode strings. Which it doesn't.

      So next time before you unleash your righteous criticism on someone, do some hands-on testing.

    2. Re:Solved: CREATE INDEX id1 ON T1 (lower(x)); by alyandon · · Score: 2, Informative

      If you truly believe Unicode support is fundamentaly broken in some way then why not help the project out by filing a bug report with a specific example that demonstrates the problem?

      The instructions for filing a bug report are at:
      http://www.postgresql.org/docs/current/static/bug- reporting.html

  60. CPanel is very isp friendly by Christopher+B.+Brown · · Score: 2, Informative
    ISPs use MySQL(tm) because cPanel includes a bunch of tools that use and support MySQL, and numerous ISPs use cPanel.

    That's the primary reason, as far as I can see.

    --
    If you're not part of the solution, you're part of the precipitate.
  61. What Friendster did by PCM2 · · Score: 2, Informative
    That's what Friendster used, the MySQL binaries you can download from the mysql.com site?
    No, they did not. InfoWorld ran a case study recently on exactly what Friendster did with MySQL. They tweaked it in practically every conceivable way and customized it heavily (with a lot of support from MySQL AB). Friendster is pretty much the quintessential "bleeding-edge" MySQL shop.
    --
    Breakfast served all day!
  62. Re:Comparison of MySQL, PostgreSQL, Oracle, MS SQL by einhverfr · · Score: 2, Informative

    No other RDBMS has had the number or severity of viruses target it as MS SQL Server. Need I remind people of the SQL-Slammer worm? And this was not about blank SA passwords (unlike previous worms).

    SQL-Server holds the dubious honor of being the host for the virus which spread around the world fastest.

    --

    LedgerSMB: Open source Accounting/ERP
  63. Re:popularity by Bloater · · Score: 2, Interesting

    > If you're trying to insert invlaid data, you're the only one to blame.

    That would be fine if the database were compiled into the application and strongly type-checked by the compiler. Even small software can't be reliably checked by humans, and the database is connected to at runtime so the compiler can't really do it.

    With schemas this can be done better. The compiler could know the types that the database supports and the software is compiled against the schema specification, then as you connect ot the database, the schema is checked for agreement and the compiler had assured the types (and the database author had provided classes to compile against). Then you can be *reasonably* safe, but shit can still happen (database version changes, nearly compatible competitor is substituted, etc). When that shit happens, you need to know that the database has its shovel ready. Its because of the loose connection between the application and database that the database must provide this assurance and it can't just be left to the application compiler to check everything at compile time.

  64. PostgreSQL is "more relational" by Anonymous Coward · · Score: 2, Interesting

    If anybody here has actually studied database theory, you know that the relational model allows you to do a lot of cool things. For instance:

    #1 updateable views (these are like subroutines calls in programming language: they allow you to abstract and refactor)

    #2 arbitrary database contraints (these let you say, for instance, that tuple X refers to a tuple in relation A OR relation B, but not both. or that the string in attribute Z must not contain spaces).

    #3 real type constraints: can't store integers into a string attribute, and vice-versa

    #4 user-defined types: need to store IP addresses, JPEGs, XML data, etc, and declare constraints.

    #5 arbitrary relational expressions. for example, I'd like to join two tables and then project the result, then join the result with something else. Compare with arithmatic: most languages let you nest and group expressions arbitrarily: A + ((B*C+2) * D)

    Once I design my database using relational principles, I have to find an actual physical database to implement it with. Since there are no relational databases today (except maybe Dataphor), I have to settle for an SQL database. Now. Which should I choose? Open source is usually more flexible, let's see how MySQL and PostgreSQL fare:

    MySQL

    #1: no updateable views. In fact, no views at all in any release version.

    #2: No triggers to implement these.

    #3: ugh, no

    #4: no

    #5: yes, finally they have sub-selects, which is a wordy way of writing out relational expressions, but that's the best we can do with SQL.

    Let's see how PostgreSQL meets my needs:

    #1: no updateable views, but you can intercept inserts and updates and send them to your own code.. good enough.

    #2: simulated with triggers, we can do it.

    #3: yes

    #4: yes

    #5: yes, sub-selects here too, and Postgres had them longer

    So, if the relational model is a "10", and MySQL is a "2", then Postgres is at least a "3" or "4". I.e., MySQL is a SUBSET of PostgreSQL. Maybe if you're hacking together a blog or LiveJournal or something, you can away without having this stuff (heck, you can probably just use flat files). But for any real database app that involves money or requires accuracy, I'll stick PostgreSQL.

    Remember folks, the purpose of a database is DATA INTEGRITY, not data storage. Once you figure this out, like Codd did in the 70's, you'll be a much better programmer, and you'll laugh at stuff like MySQL (just like Lisp programmers laugh at BASIC programmers).

  65. Re:popularity by schovanec · · Score: 2, Insightful
    why do people rely on the database to do their data validation? That should be done in the application code long before you ever run an insert or update. If you're trying to insert invlaid data, you're the only one to blame.

    The DBMS is not validating the user's input. That is the application's job. The DBMS is validating that the data an application is trying to store conforms to the schema. The DBMS is your last hope of having correct data. Your application could be blowing chunks all over the place. As long as the data is correct, then the problem can be fixed.

    In a small web environment this distinction is harder to see. There is usually only one version of the client application in existence. In a larger system you can't always trust the application. Servers in a large server farm may have slightly different versions (e.g. if updates are applied in stages to avoid crashing the entire system because something was missed in testing). Different applications sharing the data (e.g. common data but different needs: sales and management). You might also have a "thick" client application the versions of which are often very difficult to control. If one in-use version validates incorrectly then you can't trust the data anymore, even if the majority of in-use versions are correct.

  66. Comparison Grid by Joe5678 · · Score: 2, Informative

    I'm not sure why I don't see this mentioned yet, but this wikipedia article has a great grid that compares major database systems.

  67. Re:Popularity by huiac · · Score: 2, Insightful

    I call bullshit.

    While it may not be the best design, SQL *is* the abstraction layer of choice for using an RDBMS. As written it's weird, inconsistent, potentially unparseable and arguably incomplete, but that doesn't mean it's inefficient (arguments about whether NULL values should be allowed notwithstanding).

    I've written SQL for MySQL, Informix (IDS & SE), Postgresql and Oracle. Supporting all of them at once is essentially impossible (on date handling alone), but using the 'right kind of quotes', standard SQL syntax and type names for simple scalars and so on makes the differences minimal in most areas.

    The remainder of the differences range from substantial missing features (stored procedures, foreign keys, triggers) which might rule a specific DBMS out for a given design, and stupid misfeatures which most databases have in some measure (I'll give Oracle a guernsey for 'select ... from dual'), but which MySQL appears to make a specialty of (and appears to have little inclination to fix).

    I've been in the position of taking code originally written for Informix or MySQL and having to port it to PostgresQL or Oracle, and the more standard it looked the easier it was. Why port it if it was working fine? Well, *we* had more than one customer; try telling them that they should install MySQL alongside their Oracle server...

    You refer to built-in functions, different syntax, different data types etc.: SQL provides a standard library of SQL functions, and most good DBMSes allow you to define your own in SQL, C or Java, as well as 'private' languages like PlSQL and PlPgSQL; differing syntax should have no impact on how efficient a query is; and while the standard SQL types are limited, they are sufficient for a wide range of applications, and where there's a genuine need the major players have responded with very similar features (e.g., int8 and 'serial' types) that map well onto each other.

    If you care, and your RDBMS supports views and stored procedures, then there's an excellent chance that you can provide a clean, efficient (within the limits of the DBMS) and consistent interface across a number of RDBMS's; it may take more time than writing a straight-to-MySQL (or whatever) app might, but it will be more portable and maintainable (and for complex apps, it may reduce your coding time in any event).

    huiac at internode.on.net

  68. PostgreSQL SCO "relationship" by tangledweb · · Score: 5, Insightful

    So what exactly is the difference between the MySQL-SCO relationship and the PostgreSQL-SCO realtionship that were announced at about the same time?

    MySQL has only one commercial vendor, who helpfully call themselves MySQL AB, so even Slashdot readers can understand what they sell. So SCO made a deal with them to compile and test a certified MySQL binary for SCO.

    PostgreSQL has had a number of failed commercial vendors over the years, but one current one is EnterpriseDB. Maybe not having the word PostgreSQL in the company name confused slashdot readers who think Walmart sell Wals?

    eWeek report it as the same deal. "SCO has added open source database vendors MySQL and EnterpriseDB to its partner list, said SCO President and CEO Darl McBride"

    What is the difference?

    Oh, I forgot. This is slashdot where MySQL is evil because they charge for some things and where we all sit around and pretend that MySQL does not have transactions and that PostgreSQL vacuum is a good thing.

    Yay for Postgres/Perl. Boo for MySQL/PHP. Can I have mod points now?

    1. Re:PostgreSQL SCO "relationship" by Anthony+Boyd · · Score: 2, Insightful
      So what exactly is the difference between the MySQL-SCO relationship and the PostgreSQL-SCO realtionship that were announced at about the same time?

      Well, anyone who glances at my posting history will know that I'm not exactly a fan of the PostgreSQL community (although the technology is looking good in 8.1). However, I'd prefer to dislike PostgreSQL for legitimate reasons, so let's clear up that press release that you linked to. It mentions the company, EnterpriseDB, and says they "make the PostgreSQL database." However, the PostgreSQL fans here on Slashdot have pointed out that EnterpriseDB is just one of a few companies that offer commercial branches of PostgreSQL. EnterpriseDB supposedly doesn't own it, control it, or speak for it. They are separate entities. The PostgreSQL developers apparently want to distance themselves from this, which I think is the correct move. In fact, I think they should be doing it more loudly. At least enough so that I don't have to. :)

      Yay for Postgres/Perl. Boo for MySQL/PHP.

      If PostgreSQL really does distance itself from EnterpriseDB and SCO, then yes, yay for them. But if you want, we can still dislike them for other reasons. As for MySQL, I think they really have made a blunder here. In fact, they've made two. They made the mistake of bragging about their deal with the devil in a press release, and then stuck with it as people began to voice concerns. So yeah, boo on MySQL.

      Of course, despite the booing, I'm still hoping MySQL will do a 180 degree turnaround on this. Their community -- both employees and users -- is very friendly and productive. The communities that have sprung up around other database products are typically missing one of the two (friendly but not productive, or productive but not friendly).

  69. Re:popularity by lamber45 · · Score: 2, Insightful
    You can avoid that problem in MySQL by enabling strict mode. By the way, MySQL 5 also supports triggers and views.

    It's true that MySQL does not have syntax for object-oriented queries. The object-relational model is significantly different from the relational model; there are a lot of applications where it's not needed.

    I guess neither Postgres nor MySQL supports native storage of XML. However, it might not be too hard to implement. 6 years ago, neither database could store GIS data; today, they both can.

  70. Answers: by einhverfr · · Score: 4, Informative

    1: ANSI is "Hello World" MySQL is '0'

    2: ANSI is error, and abort the inserting transaction. MySQL inserts 'Hell'.

    Another case in point:

    mysql> create table test (
            -> test numeric(4,2));
    Query OK, 0 rows affected (0.05 sec)

    mysql> insert into test (test) values (10000000);
    Query OK, 1 row affected (0.01 sec)

      mysql> select * from test;
    +--------+
    | test |
    +--------+
    | 999.99 |
    +--------+
    1 row in set (0.00 sec)

    So if this number was important and meant something (which it would in production) you just entered bad data into your database!

    --

    LedgerSMB: Open source Accounting/ERP
  71. Re:SQL Loop example? by einhverfr · · Score: 2, Informative

    The nested loop is a type of query plan not a type of SQL Statement. It is hence a feature of an implimentation and not of the language.

    For example.

    Suppose I do:

    SELECT * from mytable_1 where f_key IN (select p_key from mytable_2 where condition IS TRUE);

    The simplest way to try to do this is to select every p_key from mytable_2 where condition IS TRUE and then query table_1 for the row in which mytable_1.f_key = mytable_2.p_key

    This is the nested loop. It wasn't too long ago when nested loops where the default query plan for all types of joins. Now (for obvious reasons) they are the plan of last resort. More likely, PostgreSQL would choose a merge join for this type of subquery, or so we would hope.

    Subqueries used to be popular when all joins were handled via nested loops because you could force the RDBMS engine to run fewer loops by forcing the inner-most subquery to be the one returning the fewest rows. Nowadays, all really good RDBMS's rewrite subqueries as if they were joins and will try to do other query plans on them instead.*

    Does this make sense?

    My favorite nested loop nightmare was when PostgreSQL was running a nested loop against an empty table thousands of times and eating up CPU activity doing it. Three seconds or so of doing something entirely meaningless.....

    * This is not always possible. I have written many queries looking for possible duplicate entries into a database. These often run nested loop query plans because of the complexity of the search conditions in the self join.

    --

    LedgerSMB: Open source Accounting/ERP
  72. Re:What does postgres mean? by hey+hey+hey · · Score: 2, Informative
    Most databases are descended from the Interactive Graphics Retrieval System INGRES.

    Care to name a couple? DB2 comes from System/R. Oracle seems to be home grown. Sybase came indirectly from Britton Lee, but was mostly written from scratch. SQL Server came from Sybase. Certainly RTI's product was based on Ingres.

    The original coder of Ingres later started a follow on project called Postgres and when SQL was standardised it became PostgreSQL.

    Hate to break it to you, but there was a HELL of a lot more than one person coding Ingres, over a very long time.

    Joe Kalash
    Chief Programmer, Ingres Project
    1982-1985
    (I may still have some business cards to prove it)

  73. MySQL data corruption by DMNT · · Score: 2, Interesting

    I run quite a big forum, most active in its kind in Finland. One day in June the site just didn't let anyone sign in or show threads or messages. So I login:

    [x@x forum]$ mysql -p x
    Enter password:
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Didn't find any fields in table 'backup_yabbse_instant_messages'
    Didn't find any fields in table 'backup_yabbse_log_activity'
    Didn't find any fields in table 'backup_yabbse_log_errors'
    Didn't find any fields in table 'yabbse_members'
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 168027 to server version: 4.1.11-Debian_2woody1-log

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> select * from yabbse_members;
    ERROR 1016 (HY000): Can't open file: 'yabbse_members.MYI' (errno: 145)
    mysql>

    After that I repaired my members table, losing all the rows. Luckily backups were recent enough, losing only 7 latest registered members (of some thousands).

    After that, I occasionally get MySQL error messages from the e-mail warning system, but repair table helped and didn't lose data.

    --
    ?SYNTAX ERROR
  74. MySQL MAXDB, Ingres + pricing on various DBs by t482 · · Score: 2, Informative

    MySQL MaxDB (formerly known as SAPDB) is comparable with Postgresql in terms of features. It suffers a similar lack of recognition with hosting companies and php developers. Ingres is another "enterprise" ready db that is available open source.

    Who supports XA Transactions?
    MySQL - Not yet (planned in 5.0.12?)
    SAPDB/MAXDB - Yes (limitations?)
    Postgresql - No - in the works (8.1/8.2?)
    Firebird - Yes
    Berkeley DB - Yes
    Ingres - Yes (limitations?)

    Pricing vs Proprietary
    Oracle: $58K CDN per CPU + 10% maint
    DB2: $55K CDN per CPU + 10% for maint
    MS SQL Server: $3K CDN per year per server (enterprise edition)
    MySQL MAX DB: $1,800 CDN per CPU + 10% maint
    Postgresql: Free + Support
    Ingres: Free + support

  75. Re:popularity by jedidiah · · Score: 2, Insightful

    Why do people depend on the database?

    Easy, it's centralized and easy to manage. This is the same reason that anyone uses a large robust server to begin with.

    It is far easier to lock down one database than n+1 applications and ad hoc query users. Abstraction and modularization is good. This is computer science.

    --
    A Pirate and a Puritan look the same on a balance sheet.
  76. Re:popularity by arkanes · · Score: 2, Interesting

    This is the single most common response to people pointing out MySQLs data validation issues, and I think it pretty much sums up both the attitude of the typical MySQL developer as well as the reason for MySQLs popularity: People who totally misunderstand both the theory and importance of databases. Amusingly, this same sector of people (because this argument essentially becomes "don't write buggy code, every") have produced some of the most atrociously written and flawed applications to ever be used on the Internet. Except for sendmail.