pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Artur Zakirov <a.zakirov@postgrespro.ru>
To: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: IF NOT EXISTS option for CREATE SERVER and CREATE USER MAPPING statements
Date: Mon, 13 Mar 2017 11:53:33 +0300
Message-ID: <d6de307d-47ff-0c1d-4eae-d8200c5d3f45@postgrespro.ru> (raw)
In-Reply-To: <d5993f84-cefb-55a4-f052-6fc090183fd6@postgrespro.ru>
References: <7c2ab9b8-388a-1ce0-23a3-7acf2a0ed3c6@postgrespro.ru>
	<4c7d935a-397d-16fe-c604-5e398cc1fc03@2ndQuadrant.com>
	<d5993f84-cefb-55a4-f052-6fc090183fd6@postgrespro.ru>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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



view thread (8+ messages)  latest in thread

Message-ID: <d6de307d-47ff-0c1d-4eae-d8200c5d3f45@postgrespro.ru>
Permalink:  ../d6de307d-47ff-0c1d-4eae-d8200c5d3f45@postgrespro.ru/
Also on:    postgresql.org/message-id/d6de307d-47ff-0c1d-4eae-d8200c5d3f45@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: a.zakirov@postgrespro.ru, a.lubennikova@postgrespro.ru, andrew.dunstan@2ndquadrant.com
  Subject: Re: IF NOT EXISTS option for CREATE SERVER and CREATE USER MAPPING statements
  In-Reply-To: <d6de307d-47ff-0c1d-4eae-d8200c5d3f45@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox