Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akEkN-0004Q5-Cp for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Mar 2016 17:45:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1akEkM-0002Vq-Ga for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Mar 2016 17:45:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1akEiz-00010M-JR for pgsql-hackers@postgresql.org; Sun, 27 Mar 2016 17:43:41 +0000 Received: from mail-lb0-x235.google.com ([2a00:1450:4010:c04::235]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1akEiq-0006DX-HI for pgsql-hackers@postgresql.org; Sun, 27 Mar 2016 17:43:40 +0000 Received: by mail-lb0-x235.google.com with SMTP id y6so16540974lbj.0 for ; Sun, 27 Mar 2016 10:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joh-to.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=0og7tLrW/kD/0AYn6yP8k4l2cQ6cd5HGdkZmvodFx3o=; b=D2gPu9WVScGtZEctt6iros2fYLZRqSP8pnFfqxPCez3Xejk0HOAPBADKMVegNscBtA k/K7fOr8zPGYdC5xQSy0A94nLCgvQP4029NjlK2tZLanFMy1AHGkWR8CFKqGyPVR9Tk8 sU2NK5JqXL+jmZukHuWMb2czbI5OOKobmSTdg3pRdV4K2fNOFsRarjgd4exPk1st8c9f bJMURafBjO7eSE3+MxX3UaEzzpcsI9CGjti/A0Vcy7J2KNwskZ5lzM6AWcT3olAwwRaV O4hdhdjT+hcOzx9A9gHMqznSiYjAOE7nXrOzp0SxOj1rP8C7UsUL6mYZFP6ec3TXq77i EAyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=0og7tLrW/kD/0AYn6yP8k4l2cQ6cd5HGdkZmvodFx3o=; b=ZdUUB7D8eOH+jl6C5FfVr9toYTD4A71k3o9ji//TPd9MqiTBnribnk6hm2nutP0pyS 5xAcuzGIJedxJ2fETJGDAvF1L4WmS1KkmFfaaOvWsJdwME3p4YJdwAwkDy8Djyub237I ORoe2BWRR+jUeR5+TIlQteGj6jA679JabGHs8K99nJmu6z8hPOxsMMuf+JEJ+Kb/VtHP TMTbYt1+HA4ktm0XaUdtDYoiy1pObEuYzN36M17gjGgsHZrYHpR1QLrWeb28FNRCqOR0 +de1zDzGb//yX0oqG0GG+0qFpqdIYJF/LGJ4L1HZI24cCaANNpxRtA27AfS+N11jUvn2 1blg== X-Gm-Message-State: AD7BkJKqDCdQ+GeAmQMnzkS/h2OyR1f4R5rGZ0tY0U8W/w0K4kQ0jqPkZSa1ohWdg0HOIA== X-Received: by 10.112.159.200 with SMTP id xe8mr8912088lbb.75.1459100609976; Sun, 27 Mar 2016 10:43:29 -0700 (PDT) Received: from [172.20.10.3] (c-5eeaaaa3-74736162.cust.telenor.se. [94.234.170.163]) by smtp.googlemail.com with ESMTPSA id pe7sm3355187lbc.14.2016.03.27.10.43.28 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Mar 2016 10:43:29 -0700 (PDT) Subject: Re: [PATCH] Alter or rename enum value To: =?UTF-8?Q?Dagfinn_Ilmari_Manns=c3=a5ker?= , pgsql-hackers@postgresql.org References: <56E049CC.8010201@dunslane.net> <25605.1457539654@sss.pgh.pa.us> <56E05635.70908@dunslane.net> <28167.1457543612@sss.pgh.pa.us> Cc: Tom Lane , Andrew Dunstan , Matthias Kurz , Jim Nasby , "David G. Johnston" From: Marko Tiikkaja Message-ID: <56F81BBF.7010905@joh.to> Date: Sun, 27 Mar 2016 19:43:27 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 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.6 (--) 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 2016-03-27 19:30, Dagfinn Ilmari Mannsåker wrote: > ilmari@ilmari.org (Dagfinn Ilmari Mannsåker) writes: > >> I was bored and thought "how hard could it be?", and a few hours' >> hacking later, I have something that seems to work. It doesn't do IF >> NOT EXISTS yet, and the error messaging could do with some improvement, >> and there are no docs. The patch is attached, as well as at >> https://github.com/ilmari/postgres/commit/enum-alter-value > > Here's v3 of the patch of the patch, which I consider ready for proper > review. A couple of trivial comments below. + ALTER VALUE [ IF EXISTST ] TO [ IF NOT EXISTS ] typo EXISTST + If IF EXISTS or is IF NOT EXISTS + is specified, it is not an error if the type doesn't contain the old double is + if the old value is not alreeady present or the new value is. typo alreeady + * RenameEnumLabel + * Add a new label to the enum set. By default it goes at copypaste-o? + if (!stmt->oldVal) { not project curly brace style .m -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers