Skip to content

psql tab-completion shows "INVISIBLEINCREMENT" instead of separate "INVISIBLE" and "INCREMENT" options #1135

Description

@yuanyl630

Bug Report

IvorySQL Version

IvorySQL 5.0 (based on PostgreSQL 18.0)

OS Version (uname -a)

Linux (any version)

Configuration options ( config.status --config )

N/A (affects all configurations)

Current Behavior

When using psql tab completion for ALTER TABLE <table> ALTER COLUMN <col> SET command, the completion shows INVISIBLEINCREMENT as a single option instead of separate INVISIBLE and INCREMENT options.

Example:
ivorysql=# alter table itest1 alter column a set
( COMPRESSION DATA TYPE EXPRESSION INVISIBLEINCREMENT MINVALUE NOT NULL STATISTICS
CACHE CYCLE DEFAULT GENERATED MAXVALUE NO START STORAGE

Expected behavior/code

The tab completion should display INVISIBLE and INCREMENT as two separate options:
ivorysql=# alter table itest1 alter column a set
( COMPRESSION DATA TYPE EXPRESSION INVISIBLE MINVALUE NOT NULL STATISTICS
CACHE CYCLE DEFAULT GENERATED INCREMENT MAXVALUE NO START STORAGE

Step to reproduce

  1. Connect to IvorySQL using psql in Oracle mode
  2. Create a table: CREATE TABLE itest1 (a int, b text);
  3. Type: ALTER TABLE itest1 ALTER COLUMN a SET and press TAB
  4. Observe that INVISIBLEINCREMENT appears as a single option

Additional context that can be helpful for identifying the problem

The bug is caused by a missing comma in src/bin/psql/tab-complete.in.c at line 2925.

Before (buggy):
COMPLETE_WITH("(", "COMPRESSION", "DATA TYPE", "DEFAULT", "EXPRESSION", "GENERATED", "NOT NULL", "STATISTICS", "STORAGE", "INVISIBLE"
/* a subset of ALTER SEQUENCE options */
"INCREMENT", "MINVALUE", "MAXVALUE", "START", "NO", "CACHE", "CYCLE");

After (fixed):
COMPLETE_WITH("(", "COMPRESSION", "DATA TYPE", "DEFAULT", "EXPRESSION", "GENERATED", "NOT NULL", "STATISTICS", "STORAGE", "INVISIBLE",
/* a subset of ALTER SEQUENCE options */
"INCREMENT", "MINVALUE", "MAXVALUE", "START", "NO", "CACHE", "CYCLE");

In C, adjacent string literals without a comma are automatically concatenated, so "INVISIBLE" "INCREMENT" becomes "INVISIBLEINCREMENT".

This bug was introduced in commit 510fd2a when adding invisible column support.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions