Skip to content

sql: ltree2text produces incorrect result #156479

@mgartner

Description

@mgartner

In Postgres:

SELECT ltree2text('foo.bar.baz'::LTREE);
--  ltree2text
-- -------------
--  foo.bar.baz
-- (1 row)

SELECT ltree2text('foo.bar.baz'::LTREE) = 'foo.bar.baz'::TEXT;
--  ?column?
-- ----------
--  t
-- (1 row)

In CockroachDB, the result is incorrectly wrapped in single quotes:

SELECT ltree2text('foo.bar.baz'::LTREE);
--    ltree2text
-- -----------------
--   'foo.bar.baz'
-- (1 row)

SELECT ltree2text('foo.bar.baz'::LTREE) = 'foo.bar.baz'::TEXT;
--   ?column?
-- ------------
--      f
-- (1 row)

SELECT ltree2text('foo.bar.baz'::LTREE) = $$'foo.bar.baz'$$::TEXT;
--   ?column?
-- ------------
--      t
-- (1 row)

Jira issue: CRDB-56033

Metadata

Metadata

Assignees

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.O-qaP-2Issues/test failures with a fix SLA of 3 monthsT-sql-queriesSQL Queries Teambranch-masterFailures and bugs on the master branch.branch-release-25.4Used to mark GA and release blockers and technical advisories for 25.4docs-known-limitationtarget-release-25.4.1target-release-26.1.0

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions