Re: BUG #11524: Unable to add value to ENUM when having AUTOCOMMIT disabled in psql

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Feike Steenbergen <feikesteenbergen(at)gmail(dot)com>
Cc: Tomas Vondra <tv(at)fuzzy(dot)cz>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #11524: Unable to add value to ENUM when having AUTOCOMMIT disabled in psql
Date: 2014-10-01 01:20:50
Message-ID: CAB7nPqQHNr97k0J-rACXk2Py6NrEzLqDeiSR=PjEL_EwNuUR=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Sep 30, 2014 at 9:05 PM, Feike Steenbergen <
feikesteenbergen(at)gmail(dot)com> wrote:
> There seems to be a provision in ./src/bin/psql/common.c for these
> statements. The function is command_no_begin.
This function skips BEGIN statements for queries that cannot run within a
transaction block by scanning keywords at the beginning of the query
string, and it is true that CREATE TYPE ... ADD VALUE is not added. Now,
skip_white_space is able to skip whitespaces and comments but it is harder
to analyze the type name itself as it could be a combination of the
keywords you are analyzing, for example let's imagine this valid custom
type:
=# CREATE TYPE "create type foo add value" AS (a INT);
CREATE TYPE
=# \dT
List of data types
Schema | Name | Description
--------+-----------------------------+-------------
public | "create type foo add value" |
(1 row)
It is true that this behavior could be improved by having an additional
function able to skip an object name safely for a query string, but I
simply imagine that such additional logic has not been added in psql until
now because of the lack of complains about this behavior on a feature that
has been released 3 years ago.
Regards,
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2014-10-01 04:11:55 Re: BUG #11457: The below query crashes 9.3.5, but not 9.3.4
Previous Message Paul Dasari 2014-09-30 20:49:15 Re: BUG #11528: Max Index Keys