Skip to content

Support for LOWER() function (ERROR: at or near "(": syntax error) #2206

@mtmacdonald

Description

@mtmacdonald

Hi!

I hit a small syntax error when testing if Doltgres can running SQL migrations for our product. The scenario is:

Create a table (works)

CREATE TABLE IF NOT EXISTS items (
  id SERIAL PRIMARY KEY,
  title VARCHAR(100) NOT NULL,
  metadata JSON,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Adding an index (with LOWER() function) (fails)

CREATE UNIQUE INDEX IF NOT EXISTS idx_items_title_lower ON items(lower(title));

-> ERROR: at or near "(": syntax error

Trying without the LOWER() function works. I'm not sure if Doltgres needs support for the function still, or if there's more going on here, but feedback would be appreciated.

This works:

CREATE UNIQUE INDEX IF NOT EXISTS idx_items_title_lower ON items(title);

I also saw error: expression index attribute is not yet supported in a similar script with this pattern (not sure if it's related, I can perhaps open a new ticket with steps to reproduce if it's not).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions