Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E6D9EB5DBE0 for ; Wed, 25 May 2011 15:56:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 80763-01 for ; Wed, 25 May 2011 18:56:04 +0000 (UTC) X-Greylist: delayed 00:07:00.789331 by SQLgrey-1.7.6 Received: from mail-gx0-f174.google.com (mail-gx0-f174.google.com [209.85.161.174]) by mail.postgresql.org (Postfix) with ESMTP id 6111CB5DC04 for ; Wed, 25 May 2011 15:56:04 -0300 (ADT) Received: by gxk21 with SMTP id 21so3227710gxk.19 for ; Wed, 25 May 2011 11:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=SGwTh+ATVxerE0gUKk1UijpJlwDLn1qniB7lUiT3E+g=; b=Y/Ex6ue5sIyNbd4HGEOEi3l4YJtcXu/Ue1KrR6JKk6wxM77rx/UwY35ZMp9uNPPSRw Kod3mgHjNA0MEvY0a6vB5G/VMafDY/ReM082K9ti8m3s/KtkVc8MkRvwkgDxcgAsx6yI JSwWQ2xgV7WsV9OVRAMr6DtOCFhrNzC5h9yAg= 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:content-transfer-encoding; b=LH8NN6sGDbyvGxNH8jt36fwgx9pfhN0HoHneM1rcfaw85QOUjJTLC9CU8D1Iu3R1au rrQLkAoPonVU6LsA/JIJV0wxbojnBobL8KPqyS6s3wIXfOCJlGezN7EYg6pqx4K0v7YM ZcGBf6H8B6NPeBSyDO6QKGFNUI1Uq3me9hlqI= Received: by 10.91.113.2 with SMTP id q2mr7060agm.121.1306349343096; Wed, 25 May 2011 11:49:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.194.4 with HTTP; Wed, 25 May 2011 11:48:43 -0700 (PDT) In-Reply-To: <4DDD4E57.7070800@lerner.co.il> References: <4DDD358E.20307@lerner.co.il> <4DDD4E57.7070800@lerner.co.il> From: Alex Hunsaker Date: Wed, 25 May 2011 12:48:43 -0600 Message-ID: Subject: Re: Speeding up loops in pl/pgsql function To: "Reuven M. Lerner" Cc: pgsql-performance@postgresql.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201105/342 X-Sequence-Number: 43851 On Wed, May 25, 2011 at 12:45, Reuven M. Lerner wrote= : > Hi, Alex. =C2=A0You wrote: >> I think select E'\XXX' is what you are looking for (per the fine >> manual: >> http://www.postgresql.org/docs/current/static/datatype-binary.html) > > I didn't think that I could (easily) build a string like that from digits= in > a variable or a column, but I'll poke around and see if it can work. Well, if you build '\XXX' you can call escape(..., 'escape') on it like I did with the regex above.