Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnLlz-0004ST-K0 for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Mar 2017 08:56:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cnLlz-0001cj-6J for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Mar 2017 08:56:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cnLlx-0001aI-13 for pgsql-hackers@postgresql.org; Mon, 13 Mar 2017 08:56:09 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnLlt-0007zU-Hl for pgsql-hackers@postgresql.org; Mon, 13 Mar 2017 08:56:07 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id EDD9F21C2484; Mon, 13 Mar 2017 11:56:02 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Subject: Re: IF NOT EXISTS option for CREATE SERVER and CREATE USER MAPPING statements DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1489395362; bh=mumhtmt75o9tXQA+PMx7hDf59loMW/Ui2OIA93C9Nhc=; h=To:References:From:Date:In-Reply-To; b=ko8A5Gm4KNFbzDsLJlgVgnRAGKxgG2bgvVSOyoxBsaYQrvS3WKSL8vtzg/ztJB9D3 JIC51EzI1R2HcnuHNOQdcYA5GMIbuYPjx8l3yJOVOPT1q7AyPNgKlcEVba4YUHHXTA IKwP7hG9afsrbqaEaKecZDJZ99eG6Eljr8KD3Kc4= To: Anastasia Lubennikova , Andrew Dunstan , pgsql-hackers References: <7c2ab9b8-388a-1ce0-23a3-7acf2a0ed3c6@postgrespro.ru> <4c7d935a-397d-16fe-c604-5e398cc1fc03@2ndQuadrant.com> From: Artur Zakirov Message-ID: Date: Mon, 13 Mar 2017 11:53:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 15.02.2017 20:54, Anastasia Lubennikova wrote: > > Done. > I have gotten the error that AlterUserMappingStmt doesn't have if_not_exists (in Russian): > gram.y: В функции «base_yyparse»: > gram.y:4918:7: ошибка: «AlterUserMappingStmt {aka struct AlterUserMappingStmt}» не содержит элемента с именем «if_not_exists» > n->if_not_exists = false; > ^~ After applying the CREATE USER patch in gram.y I have: > > AlterUserMappingStmt: ALTER USER MAPPING FOR auth_ident SERVER name alter_generic_options > { > AlterUserMappingStmt *n = makeNode(AlterUserMappingStmt); > n->user = $5; > n->servername = $7; > n->options = $8; > n->if_not_exists = false; > $$ = (Node *) n; > } > | CREATE USER MAPPING IF_P NOT EXISTS FOR auth_ident SERVER name create_generic_options > { > CreateUserMappingStmt *n = makeNode(CreateUserMappingStmt); > n->user = $8; > n->servername = $10; > n->options = $11; > n->if_not_exists = true; > $$ = (Node *) n; > } > ; Here ALTER USER MAPPING and CREATE USER MAPPING commands were mixed. -- Artur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers