Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 8D326B62929 for ; Thu, 2 Jun 2011 12:28:05 -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 87932-07; Thu, 2 Jun 2011 15:27:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id CFA3EB62926; Thu, 2 Jun 2011 12:27:57 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id BA763348045; Thu, 2 Jun 2011 08:27:56 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FV-pB4sEHw-U; Thu, 2 Jun 2011 08:27:54 -0700 (PDT) Received: from perhan.alvh.no-ip.org (unknown [190.95.16.242]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 38E4E348044; Thu, 2 Jun 2011 08:27:54 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id E5ED56E3F8; Thu, 2 Jun 2011 11:27:43 -0400 (CLT) Content-Type: text/plain; charset=UTF-8 Cc: Robert Haas , Tatsuo Ishii , mangoo , scott.marlowe , Kevin.Grittner , pgsql-hackers Subject: Re: pgpool versus sequences From: Alvaro Herrera To: Tom Lane In-reply-to: <15726.1307027400@sss.pgh.pa.us> References: <26909.1306965898@sss.pgh.pa.us> <27741.1306968830@sss.pgh.pa.us> <20110602.080816.460114267356667394.t-ishii@sraoss.co.jp> <1306971997-sup-5549@alvh.no-ip.org> <14930.1307025118@sss.pgh.pa.us> <1307026309-sup-4021@alvh.no-ip.org> <15726.1307027400@sss.pgh.pa.us> Date: Thu, 02 Jun 2011 11:27:43 -0400 Message-Id: <1307028328-sup-9800@alvh.no-ip.org> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201106/142 X-Sequence-Number: 188855 Excerpts from Tom Lane's message of jue jun 02 11:10:00 -0400 2011: > Alvaro Herrera writes: > > Excerpts from Tom Lane's message of jue jun 02 10:31:58 -0400 2011: > >> That's a lot of work for a purely cosmetic issue, though. What would be > >> trivial is to let this work: > >> regression=# lock table s1; > >> ERROR: "s1" is not a table > > > Yeah, though it'd be nice to avoid this: > > > alvherre=# create schema public_too; > > CREATE SCHEMA > > alvherre=# set search_path to 'public_too', 'public'; > > SET > > alvherre=# create table public_too.s1 (); > > CREATE TABLE > > alvherre=# create sequence public.s1; > > CREATE SEQUENCE > > alvherre=# begin; > > BEGIN > > alvherre=# lock s1; > > LOCK TABLE > > > At this point we have a lock on the table, but if we change LOCK to also > > look for sequences, the behavior would change. > > No it wouldn't. You seem to be imagining that sequences live in a > different namespace from tables, but they don't. There can only be one > relation that "s1" will refer to for any search_path setting. Doh, I see that I messed up and reversed the schemas in the search_path line above. If I fix that I get the expected error: alvherre=# set search_path to 'public', 'public_too'; SET alvherre=# lock s1; ERROR: «s1» no es una tabla ("s1" is not a table). What I was imagining was that LOCK was using search path to look only for tables and ignoring sequences. -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support