Re: IF NOT EXISTS option for CREATE SERVER and CREATE USER MAPPING statements

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>
Cc: Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: IF NOT EXISTS option for CREATE SERVER and CREATE USER MAPPING statements
Date: 2017-03-14 12:55:32
Message-ID: CAFjFpRe9YqyV+wXEmqyZ=iXnBbYVxjc8+tqjHpQ62NSCUZvRzA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

>
> Thanks for catching that.
> It was caused by a conflict on applying of the patch.
> Updated versions of both patches are attached.
>

We do not need extra line
<variablelist>
+
+ <varlistentry>
other usages of this do not have an extra line. Removed the extra line
in the attached patch.

I noticed that the earlier error message was using "server" instead of
"foreign server", while the new message uses the later one. Usually,
when converting an error to notice, we don't expect such changes. But
many other error messages are using "foreign server" instead of
"server", so probably this one needed a change anyway. But then, the
command to create a foreign server is not "CREATE FOREIGN SERVER",
it's "CREATE SERVER", so users are already getting confused?

I don't see similar change in the error message for the user mapping.
Do we need to change "server" to "foreign server" in case of user
mapping? The doc changes didn't compile with error
"osx:ref/create_user_mapping.sgml:52:15:E: document type does not
allow element "VARLISTENTRY" here; assuming missing "VARIABLELIST"
start-tag". The user mappings do not have name so the doc change was
slightly incorrect when it said "Do not throw an error if a user
mapping with the same name already exists.". I have corrected both
these things in the attached patch.

Other changes look good.

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

Attachment Content-Type Size
create_user_mapping_if_not_exists_3.0.patch application/octet-stream 5.0 KB
create_foreign_server_if_not_exists_3.0.patch application/octet-stream 5.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2017-03-14 13:00:36 Re: Foreign Join pushdowns not working properly for outer joins
Previous Message Heikki Linnakangas 2017-03-14 12:36:51 Authentication tests, and plain 'password' authentication with a SCRAM verifier