doltgresql icon indicating copy to clipboard operation
doltgresql copied to clipboard

Allow `TEXT` columns in keys (without prefix length)

Open fulghum opened this issue 1 year ago • 0 comments

PostgreSQL allows TEXT columns to be used in keys (without having to specify a prefix length), but Doltgres does not.

PostgreSQL:

CREATE TABLE users (
    username text NOT NULL PRIMARY KEY,
    karma numeric NOT NULL
);
CREATE TABLE

  Doltgres:

CREATE TABLE users (
    username text NOT NULL PRIMARY KEY,
    karma numeric NOT NULL
);
ERROR:  blob/text column 'username' used in key specification without a key length (errno 1105) (sqlstate HY000)

Discovered while testing multiple data dumps, including: Hasura, usda-r18, iso-3166

fulghum avatar Oct 02 '24 20:10 fulghum