From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steve Purcell Newsgroups: gmane.emacs.devel Subject: Re: sql-interactive-mode not recognising psql prompts Date: Tue, 9 Feb 2016 21:12:41 +1300 Message-ID: References: <947A3DE2-06B1-43EB-B3B3-DA1DE7EFA611@sanityinc.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1455005607 18563 80.91.229.3 (9 Feb 2016 08:13:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Feb 2016 08:13:27 +0000 (UTC) To: emacs-devel , bruce.connor.am@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 09 09:13:07 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aT3Q3-0006wd-5n for ged-emacs-devel@m.gmane.org; Tue, 09 Feb 2016 09:13:07 +0100 Original-Received: from localhost ([::1]:53009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT3Q2-0003FK-IL for ged-emacs-devel@m.gmane.org; Tue, 09 Feb 2016 03:13:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT3Pp-0003EV-GG for emacs-devel@gnu.org; Tue, 09 Feb 2016 03:12:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aT3Pm-0002HE-Bb for emacs-devel@gnu.org; Tue, 09 Feb 2016 03:12:53 -0500 Original-Received: from purcellpeople.com ([85.214.32.38]:48842 helo=h1189701.stratoserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aT3Pm-0002Gm-5Q for emacs-devel@gnu.org; Tue, 09 Feb 2016 03:12:50 -0500 Original-Received: from [192.168.0.10] (unknown [210.54.38.34]) by h1189701.stratoserver.net (Postfix) with ESMTPSA id C937A27AC0B6; Tue, 9 Feb 2016 09:12:46 +0100 (CET) In-Reply-To: X-Mailer: Apple Mail (2.3112) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 85.214.32.38 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:199578 Archived-At: On 9 Feb 2016, at 09:16, Artur Malabarba = wrote: >=20 > On 8 Feb 2016 5:05 pm, "Steve Purcell" wrote: > > Yes, possibly. And in fact :alnum: would be better than :alpha:, of = course=E2=80=A6 > > > > And since the rules for database names are probably much the same as = for other SQL identifiers, there=E2=80=99s a chance \\s (symbol = constituent) would work too. >=20 > Yes. I'm not familiar with the fine details of SQL syntax, but = \\w\\|\\s is generally a better bet than just \\w. >=20 The pathological case is pretty bad, in fact: createdb " foo bar " works and creates a prompt such as " foo bar =3D#=E2=80=9D. According to the relevant section postgres manual [1], pretty much any = characters are valid in a database name. So we can choose between = matching =E2=80=9Creasonable=E2=80=9D database names with a tight = regexp, e.g. one beginning =E2=80=9C^[[:alnum:]_]*=E2=80=9D, or matching = all allowable names with a permissive regexp which will likely match all = sorts of spurious output. I=E2=80=99d suggest the former, and will = attach a patch to that effect to issue 22596. [1] = http://www.postgresql.org/docs/current/interactive/sql-syntax-lexical.html= #SQL-SYNTAX-IDENTIFIERS=