Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56466 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21215 invoked from network); 22 Nov 2011 11:36:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Nov 2011 11:36:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=kassner@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kassner@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.42 as permitted sender) X-PHP-List-Original-Sender: kassner@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:61370] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/D1-05712-5298BCE4 for ; Tue, 22 Nov 2011 06:36:05 -0500 Received: by bkbzt4 with SMTP id zt4so86259bkb.29 for ; Tue, 22 Nov 2011 03:36:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=7s8pVI0H7negMXTqePZ3q9CF46aect+E3ixPDR9eAA8=; b=h9eMAwOUUIulIdOKlWhEtj2GoG4b5XlvW43R7PoHKJOEi12tPvPGqmG0dgieqdDmVh hNE7TwqsL2DwRdOSeeu0tvyMk6fdcXOwLDjISBuA8xwwvr0h20uXITJaHXSuPNtzQjzC 4XXpRcNi1+1i6ms+4dzKxjUr1rrZfOMiYmnsE= Received: by 10.205.119.11 with SMTP id fs11mr19246114bkc.58.1321961762287; Tue, 22 Nov 2011 03:36:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.158.1 with HTTP; Tue, 22 Nov 2011 03:35:41 -0800 (PST) In-Reply-To: References: Date: Tue, 22 Nov 2011 09:35:41 -0200 Message-ID: To: Yasuo Ohgaki Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] pg_escape_literal(), pg_escape_identifier() patch From: kassner@gmail.com (Rafael Kassner) Amazing! I was in big troubles with multibyte escaping a couple years ago. Nowadays, after a big ship of encoding problems (not only with db, but navigator encoding, proxy caching and so on), I've ported everything to UTF-8 (this included rewrite a 8 years old application). I guess this is a good implementation, considering that many people still use old PostgreSQL versions. About pg_escape_identifier, fixes this an old problem when we use some reserved column names, like "login"? On Mon, Nov 21, 2011 at 8:41 PM, Yasuo Ohgaki wrote: > Hi all, > > I've posted pgsql patch that adds > pg_escape_literal()/pg_escape_identifier() which escapes SQL literal > and idetifier. (i.e. table names, filed names, etc) > > https://gist.github.com/1381181 > > When I post a patch while ago, someone mentioned about that pgsql > module own escape implementation may not be needed. I'm OK with both > with/without pgsql own escape implementation. I ported escaped > function that handles multibyte string correctly, in case of libpq > does not have it. i.e. PostgreSQL 8.4 or less. As far as I know, older > PostgreSQL (at least 8.0 >) handles literal/identifier escape > correctly. > > It seems trunk is open for new feature. I'll commit the patch as is if > there is no objection. > > Any comments? > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Atenciosamente, Rafael Kassner