Slashdot Mirror


PostgreSQL 8.0 Released

Christopher Cashell writes "The PostgreSQL project has released version 8.0 of their well known Object-Relational Database. New features include: Win32 Native Server, Savepoints, Point-In-Time Recovery, Tablespaces, and lots more. Downloads are available via bittorrent for Unix/Linux, and the much anticipated Win32 version, or via ftp (use a mirror!)." (Here's the official announcement.)

23 of 556 comments (clear)

  1. Great by Anonymous Coward · · Score: 5, Informative

    Great, but why should I use PostgreSQL when I already have a database, you might ask? Here's why.

  2. plperl by michaelhood · · Score: 3, Informative

    One of the most exciting features of 8.0 is plperl, their Perl-based server side language, allowing for triggers and persistent storage. On another note, I wish MySQL would catch up to PgSQL. Even if you don't like MySQL, the competition keeps them innovating. If PgSQL is light years ahead, what's pushing them?

    1. Re:plperl by AhBeeDoi · · Score: 4, Informative
      One of the most exciting features of 8.0 is plperl, their Perl-based server side language

      I'm not convinced. SQL is supposed to a standard, so you can move from one database server to another with not much effort. This is a big step away from that. Much like the features you'd find in Oracle or MS SQL.

      Hardly.

      First of all, SQL is supposed to be a sub-language used by other languages to access an RDMS. PL/Perl is a server side procedural language which allows you to write PgSQL functions in Perl. How standard is PL/SQL for Oracle? It's proprietary. In fact, Oracle and MS SQL are not entirely compliant with SQL 92 as they have their own extensions.

  3. Web Server Difficulties by Reality_X · · Score: 5, Informative

    Hi Folks,

    Please take it easy on 'wwwmaster'.

    'www' fell over a couple of hours ago, and a couple of mirrors are coming online to round-robin the address.

    Can someone please change the the first link ("PostgreSQL project") in the story to point to 'www'?

    Thanks.

  4. I've been waiting for this by wackysootroom · · Score: 4, Informative

    Goodbye Oracle, hello PostgreSQL. Now I can have a mostly SQL92 compliant database with ACID, transactions and now PITR and tablespaces that I can use on the server and on a win32 desktop.

    For those of you wanting a great frontend, try PGAdmin3. It works on Win32 and Linux.

  5. What's New in 8.0 by Pan+T.+Hose · · Score: 5, Informative

    An adequate replacement for MySQL on Windows. Can anyone say WAPP instead of LAMP?

    Not only that. Here's the most important link: What's New in 8.0. (To editors: why there are links to torrents, but no link to features?)

    --
    Sincerely,
    Pan Tarhei Hosé, PhD.
    "Homo sum et cogito ergo odi profanum vulgus et libido."
  6. Re:Erm? by Erik+Hensema · · Score: 4, Informative
    In PostgresQL you can make a table inherit parts of another table. This is what's meant by object relational. Example (from the docs):
    CREATE TABLE cities (
    name text,
    population float,
    altitude int -- (in ft)
    );

    CREATE TABLE capitals (
    state char(2)
    ) INHERITS (cities);
    --

    This is your sig. There are thousands more, but this one is yours.

  7. Re:Erm? by Delirium+Tremens · · Score: 3, Informative
    From http://www.postgresql.org/docs/7.3/interactive/use r-preface.html:

    PostgreSQL offers substantial additional power by incorporating the following additional concepts in such a way that users can easily extend the system:

    • inheritance
    • data types
    • functions

    Other features provide additional power and flexibility:

    • constraints
    • triggers
    • rules
    • transactional integrity

    These features put PostgreSQL into the category of databases referred to as object-relational. Note that this is distinct from those referred to as object-oriented, which in general are not as well suited to supporting traditional relational database languages. So, although PostgreSQL has some object-oriented features, it is firmly in the relational database world.

  8. Re:How does it compare to Oracle? by nemesisj · · Score: 4, Informative

    It's got a long way to go as far as enterprise features.

    There is no clustering support in PostgreSQL (and I mean real clustering, not some Java hack where transactions are shipped off to two separate DB servers, both of which don't know they're part of a cluster). This is pretty much a show stopper as far as using PostgreSQL in the company I work for, as high availability is a large concern, and any downtime would be serious.

    In previous versions of PostgreSQL, the pg_dump and pg_restore tools were not very good - dumps that included tables or views often would fail on reimport because PostgreSQL wouldn't know the order in which to import everything. You also had to pass in a number of options on the command line just to get a dump that made sense, and large object support was kind of clunky.

    That said, I still use PostgreSQL for many many projects and have used PostgreSQL for many years. It's a great product, but it isn't near Oracle in terms of enterprise level features.

  9. Re:Replication and vacuum? by IsleOfView · · Score: 3, Informative
    Yes and Yes.

    Master-Slave replication is available through Slony1. (This is currently used by Afilias on the .info domain) Slony2 is in progress and will provide multi-master replication.

    Vacuuming is still necessary, but it no longer locks tables. The distribution includes a utility called pg_autovacuum which can take care of all the vacuuming tasks on an automated basis if you desire. (The gentoo release automatically installs this with a nice init script :) )

  10. Use Slony for replication by chriskl · · Score: 3, Informative

    Check out the new Slony replication engine:

    http://www.slony.info/

    It is probably the best master->slave data replication engine for PostgreSQL at the moment. It is free and developed by one of the core developers.

  11. Re:Two more features... by JohanV · · Score: 4, Informative

    Most of your first request is already implemented in PostgreSQL 8. You can combine a hot backup of the files on the filesystem with the WAL-archiver to have the backup feature you want. It is not per tablespace (yet) so you have to backup your entire database.

    For the second request, keep a close eye on the mailinglists. Affilias has hired a core developer to make it happen.
    The first stage, master-slave replication, has been released in the form of Slony-1. Yes, it is an add on. No, it is not integrated. But you can add Slony-1 to a running system and add slaves without ever taking the master down, and it is backwards compatible so you can even use it to upgrade running 7.3.x installations to PostgreSQL 8.
    The second stage, Slony-2, will be a full multi-master replication solution. (I read something about a 'kickoff' meeting today hosted by Affilias.) The goal is to be able to take a single, out of the box installation of PostgreSQL, plug Slony-1 into it, replicate the database to another box and when that box has caught up switch to full multi-master mode under Slony-2.
    The code won't fall out of the sky tomorrow, but people are working on it.

  12. Re:Mac OS X support? by SuperBanana · · Score: 3, Informative
    My favoured platform though is Mac OS X. There's a whole list of platforms in the FAQ, but Mac isn't amongst them. So my questions are is Mac OS X supported, and if so are there any plans to make a Mac OS X .pkg installation file?

    7.x compiles right out of the box- in fact, Apple's Remote Desktop system actually installs and uses PostgreSQL for all its data storage (client system data and whatnot; ARD can collect a lot of per-system data). Very slick.

  13. Re:PGSQL has its own gotchas by Cajal · · Score: 5, Informative

    In MySQL (with MyISAM tables), the reason things like count(*) are fast is that MyISAM pre-computes those values. It can do this because it locks the table on insert and update. PostgreSQL doesn't lock the table on modifications -- it allows concurrent access via Multi-Version Concurrency Control (MVCC). Basically, each row in the DB has additional information (used internally by PostgreSQL), which stores which transaction created and last modified the row. PG uses this to determine if any given row should be "visible" to the current transaction. Because this informaiton is constantly changing (and varies from transaction to transaction), you can't precompute things like count(*) and sum(*). See http://developer.postgresql.org/pdf/internalpics.p df for more info (start around page 56).

  14. Re:How does it compare to Oracle? by kpharmer · · Score: 4, Informative

    Postgresql is ready to take on the smaller, non-critical databases that oracle used to get. This is significant proportion of the databases out there, and will take revenue away from oracle. (Mysql will actually probably take more revenue away, but it has too many quality problems and functionality gaps to really deserve to.)

    But there are many other, more demanding databases that postgresql isn't yet ready for. Oracle, DB2, and even SQL Server 2005 all have very mature & solid: optimizers, replication, partitioning solutions, parallelism, failover/clustering support, etc.

    Here are two examples:

    Using db2 for example, you can create a view which is automatically populated by the database like a table (MQT). Then any queries against the base tables that could be sped up by hitting this view will be rewritten by the engine to hit the view. Now, this might seem like needless fluff if you're just writing a hobby php app. But if you need to implement a commercial app like SAP with its 6,000 tables - and you have performance issues - you can make adjustments in the database layer this way. Also, if you're provoding adhoc reporting for hundreds of users on a terrabyte of data - this technique can provide *dramatic* performance benefits.

    Another example is partitioning. Back to db2 (which I work with the most): you can spread a database across a dozen separate servers using a hashkey. Now, every query will have all dozen servers working independently on its own fraction of the data. On each of those servers, you can then partition again, this time using ranges or values (MDC) - so that data that doesn't apply to a query will be skipped in tablescans of that table. Using these techniques you can get sub-second response to *adhoc* queries against a terrabyte of data - without indexes (notoriously unreliable here).

    Lots more examples where the above came from. Sure, you will pay real money for licensing, hardware, and labor to implement these. Then again, the two above features actually save you in hardware costs. Additionally, some problems are big enough that they can easily justify the cost of licensing a product like this. I've seen these techniques used to save companies million, even hundreds of millions of dollars.

  15. Re:It's easier to install and admin than mysql by DigitalRaptor · · Score: 3, Informative

    Threads have to do solely with 3rd party plugins, not with PHP itself. PHP5 is completely thread safe.

    --
    Lose Weight and Feel Great with Isagenix
  16. Re:PGSQL has its own gotchas by amorsen · · Score: 4, Informative
    If your RDBMS is doing a full table scan just to do a count(*), then it (or your code) is badly broken.

    Postgres knows how many rows are in the table, but it does not know how many of those you can see. Some of them may be inserted speculatively by another transaction. Postgres needs to go through each row to determine whether or not that row is actually visible to you. It is possible to turn this into an O(1) operation if you're willing to do sufficient work on inserts and deletes. Whether this is a good tradeoff depends on how often you do count(*) compared to how often you do inserts and deletes.

    --
    Finally! A year of moderation! Ready for 2019?
  17. Re:How does it compare to Oracle? by chriskl · · Score: 3, Informative

    Try Slony for full, production quality replication on PostgreSQL:

    http://www.slony.info/

  18. Almost accurate by einhverfr · · Score: 3, Informative

    While I think that PostgreSQL is the best open source database out there, there is one very important gotcha wrt: MVCC which can cause data integrity. This only happens when autovacuum is not running, of course.

    If you run enough transactions between vacuum runs (iirc a billion), the transaction counter will wrap around and suddenly your data does not have a consistant point of reference regarding visible transactions. Now, if you wait for a billion transactions to run VACUUM, you either:
    1) Have extremely poor performance anyway (not to mention having all your stats off so the planner is doing seq scans when it should use an index)
    2) Are doing something with the database which I cannot imagine (I guess a huge number of select statements could cause this, but updates cause old tuples to sit around, so you would have bad performance).

    Now, I am not aware of this ever actually having happened, but it is in the documentation, so I figure I should point it out. Of course if you let the database get to this point, then you have bigger problems than your data (chief among them being the IT staff and/or management)..

    In general, PostgreSQL focuses on data integrity to a degree not seen elsewhere in the open source database world. Even Firebird does not have such a heavy focus in this area, though to be fair it is a different enough product that their focus works well in their target markets.

    My company offers application development, remote administration, and implimentation services for PostgreSQL, MySQL, and Firebird. I am very excited about this release because it will enable us to do more with the database manager which makes us most productive.

    As a side note, PostgreSQL-Win32 will not run on Win9x because it requires an NTFS filesystem, iirc. So it is not a perfect solution for Windows development yet (until Win9x fades into the distance or until they decide that they should port it to FAT). Of course you could still use the Cygwin installation, I think. But it is better, IMO, to run it on a arguably stable system anyway.

    --

    LedgerSMB: Open source Accounting/ERP
  19. Change Column Types - finally by EugeneK · · Score: 3, Informative
    from the release notes :

    Change Column Types

    A column's data type can now be changed with ALTER TABLE.



    Before, to do this, you had to create a temporary table with the changed column type, copy all the data over to it, and then rename the temp table as the old table.

    Thank you Postgres team! Now, if we can rename a column, that would be a nice bonus.

  20. That's really dumb. by emil · · Score: 3, Informative

    You're telling me that MySQL locks the entire table when I insert a row? You must be joking - that would bring a database to it's knees.

    I'm an Oracle guy, and this is how they do it:

    • If you have an index on a NOT NULL column, count(*) will count the index, and it will be fast(er). If you don't have a suitable index, you will incur a full table scan. This is reasonable.
    • An Oracle table can have one or more "FREELISTS" - an insert will attempt to find a block from an available freelist, and a row lock will be applied to the transaction header of that block. If you have high insert activity, you can (re)build your table with more FREELISTS. You can have multiple transactions hitting a block if you don't exceed MAXTRANS. If you decided to shove the block clear full of data and you set INITTRANS to 1, you effectively have block-level locking, not row-level locking.
    • Oracle NEVER escalates a lock, and there is no table of locked rows in memory (and you should run away from any database that has such a structure).

    Oracle has the best technology in the industry, hands down (DB2 didn't even get triggers until v5). Postgres appears to be paying much more attention to Oracle's methods than MySQL.

    Guess which database I'd use if I had no money to spend?

    1. Re:That's really dumb. by Cajal · · Score: 4, Informative
      You're telling me that MySQL locks the entire table when I insert a row? You must be joking - that would bring a database to it's knees.

      MySQL can use different "storage engines" for different tables. One of their older (and arguably, more widely deployed) engines in MyISAM, which does table-level locking (their newer engine, InnoDB, does row-level locking). From the MySQL Manual (sec 7.3.1):

      Currently, MySQL supports table-level locking for ISAM, MyISAM, and MEMORY (HEAP) tables, page-level locking for BDB tables, and row-level locking for InnoDB tables.

      and from Section 7.3.2:

      To achieve a very high lock speed, MySQL uses table locking (instead of page, row, or column locking) for all storage engines except InnoDB and BDB.

      This is one of the many problems with MySQL. I agree with you that Oracle (and PostgreSQL) are much better designed.

  21. It looks like a great year for PostgreSQL by smchris · · Score: 3, Informative


    Oxford University announced a while back that they will be scrapping most of their proprietary DBs for PostgreSQL over the course of '05:

    http://news.zdnet.co.uk/software/applications/0% 2C 39020384%2C39173013%2C00.htm