Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 58F5564FD20 for ; Wed, 3 Sep 2008 13:53:44 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 88944-05 for ; Wed, 3 Sep 2008 13:53:41 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.229]) by postgresql.org (Postfix) with ESMTP id 469AB64FD06 for ; Wed, 3 Sep 2008 13:53:41 -0300 (ADT) Received: by rv-out-0506.google.com with SMTP id b25so3982839rvf.43 for ; Wed, 03 Sep 2008 09:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=mZTZ3KtNTq7QO4onQuYJW43rGq+0HuSQCbE0pi2KQhI=; b=GFDFME/B9zm3JAJbif5CjULjJsDou9ryUDVZvxAB0kijIsGStPfFvKT/Yu0a+/mUyw I2qhclTwSWr6n6XDRcpg+peJ8wpDIxMn0ogFhep9mkoxots3ulYc78yk+MJMzrqX6JaC riq3PLNRQ2rlWpuGcRvjvaYoCI4ORnxnxcpWA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Q3vKUXLQFNcVlczCMwNLeZXquqisDfmgJjn7RNdwQvOcag5k3Fib8h2D+ESBykrPfj 2ugxu//loS1XrvWdVWBxLld+b/jWsX6mw+BBBljWUqO1mJtUjN0fvMCRfyBcEvbXg7pP rsiCwnXBndiXrAKA+m9aXMiLueSSNQiyNkCqk= Received: by 10.140.201.8 with SMTP id y8mr5047784rvf.148.1220460820185; Wed, 03 Sep 2008 09:53:40 -0700 (PDT) Received: by 10.140.248.12 with HTTP; Wed, 3 Sep 2008 09:53:40 -0700 (PDT) Message-ID: Date: Wed, 3 Sep 2008 10:53:40 -0600 From: "Scott Marlowe" To: SCassidy@overlandstorage.com Subject: Re: Oracle and Postgresql Cc: PostgreSQL , pgsql-general-owner@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48BE0DF6.1010507@comcast.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/112 X-Sequence-Number: 137119 On Wed, Sep 3, 2008 at 9:36 AM, wrote: > > I don't know if Oracle changed recently, but the last few times I used it, > it was incredibly annoying having to put everything in a subquery to get a > LIMIT-type operation to work AFTER the sort, so that you could use their > ROWNUM. For example, to get the first 50 rows of a SELECT result. Their > ROWNUM worked BEFORE the ORDER BY, so to get the 1st 50 rows, you had to put > the query in a subselect, and say SELECT ... where ROWNUM <= 50. > > I love OFFSET ... LIMIT in PostgreSQL! I do a lot of web applications, and > it is incredibly handy to page output with. Yeah, those kinds of things drove me a little crazy. I think PostgreSQL's equivalent parsing peculiarity is the need to put certain things in an extra set of parens for creating an index. But really that's pretty minor compared to rownum versus order by firing order. One of the things an Oracle DBA coworker of mine found really bothersome at first in pgsql was that suddenly on large queries that he'd never needed an order by on Oracle, he was getting randomly ordered reporting data. He was flabbergasted that something would use an aggregation method that wouldn't result in an ordered set. He was sure it would be a loser with an order by but it was very very fast on large numbers of rows. I think that if you're really used to one database you'll find a new one bothersome in some ways, and a pleasure to use in others. Once I had installed rlwrapper on sqlplus I was ok. It wasn't in the same league as psql, which is the greatest command line sql monitor ever created, but having line editing and history made sqlplus usable. It was cool to hit !alter sess and get my previous default schema statement. All the Oracle DBAs around me were working in guis and they'd walk by and think I in psql, I'd ask them to look at something, like a query, and it would take them about 10 seconds to realize I was working on oracle from the command line. If I could ask for one thing from Oracle it would be that they borrow the basic operational characteristics of psql and stuff it into sqlplus or whatever they use. Having the \ commands and expanded versions in sqlplus would have been awesome.