ALTER TABLE fails when changing column type due to index with bit_ops opclass

Поиск
Список
Период
Сортировка
От Manuel Rigger
Тема ALTER TABLE fails when changing column type due to index with bit_ops opclass
Дата
Msg-id CA+u7OA4=vs9LjjP_643kgLRENv2eW+8v+5M8QGsY3Sg1K_18fg@mail.gmail.com
обсуждение исходный текст
Ответы Re: ALTER TABLE fails when changing column type due to index with bit_ops opclass  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Hi everyone,

Consider the following statements:

CREATE TABLE t0(c0 BIT VARYING(1));
CREATE INDEX i0 ON t0(c0 bit_ops);
ALTER TABLE t0 ALTER c0 TYPE TEXT; -- ERROR:  operator class "bit_ops"
does not accept data type text

Altering the column type fails, which is somewhat unexpected, since it
does not seem to cause problems for other opclasses. For example, the
following executes without errors:

CREATE TABLE t0(c0 TEXT);
CREATE INDEX i0 ON t0(c0 text_ops);
ALTER TABLE  t0 ALTER c0 TYPE BIT VARYING(1) USING c0::bit varying(1);

Is this a bug or expected? I can reproduce this on a recent trunk
version (b3c265d).

Best,
Manuel



В списке pgsql-bugs по дате отправления:

Предыдущее
От: Prasad Jadhav
Дата:
Сообщение: Re: BUG #16126: Missing the sp_OACreate procedures
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16127: PostgreSQL 12.1 on Windows 2008 R2 copy table from ‘large 2GB csv’report “iso-8859-1 error”