Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 27DEF632919 for ; Wed, 24 Mar 2010 16:13:57 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 20410-07 for ; Wed, 24 Mar 2010 19:13:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by mail.postgresql.org (Postfix) with ESMTP id 699A7632817 for ; Wed, 24 Mar 2010 16:13:46 -0300 (ADT) Received: by qw-out-2122.google.com with SMTP id 8so2103385qwh.61 for ; Wed, 24 Mar 2010 12:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=+KKt7B/cQkRi6jYDTzT/nh2pzsNS9ZNBRrInxZcDZjY=; b=u0D9ABuLKVC0auJrF0Sxp9qp56IuXOk6E9MWDpHndxqhpWj0V35tATocvOmbimUPJU 371bAf47fjj/qQX68BuBPZpDrST86/f38woNkhQrqJwWY/0anC0TSzBLc/1EHg0VYLn3 fsQxUFiU9sARBslP03s2knuwEoLHZAoa4TqGI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=nJIl9ZjfbZxG4VgzK2hmCyB65lyM0kg/aalUpPkdpltMdj/tPSeb+/1U+IJoiW5vGC P5vzyJ4fwsSjbDYG1BIZMNvRfszAhQ9elqsRqSj7R928ybv3NaHhfJkX1GSOWSsAb5xh 92JLHT/fZCZnvdkSRlyee8Yhlsxjo/bGUsQLE= MIME-Version: 1.0 Received: by 10.229.211.140 with SMTP id go12mr5167892qcb.49.1269458024152; Wed, 24 Mar 2010 12:13:44 -0700 (PDT) In-Reply-To: References: <20100324140832.GA5864@apartia.fr> From: Josh Kupershmidt Date: Wed, 24 Mar 2010 15:13:24 -0400 Message-ID: <4ec1cf761003241213p26d5bccesdaf5283dda2725ca@mail.gmail.com> Subject: Re: window function to sort times series data? To: John Gage Cc: pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/178 X-Sequence-Number: 33885 On Wed, Mar 24, 2010 at 2:38 PM, John Gage wrote: > In going through the arcana of string functions, I have come across the > following series of selects that contain, for me, a mysterious "$re$". > > -- return all matches from regexp > SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque)$re$); The $re$ is just an arbitrary identifier for a dollar-quoted string constant. See: http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html Maybe you're on an old version which doesn't support dollar-quoted strings? On 8.3 for the above query, I get: SELECT regexp_matches('foobarbequebaz', $re$(bar)(beque)$re$); regexp_matches ---------------- {bar,beque} (1 row) Josh