Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres TEXT columns are recommended by the the core developers, yet Directus limits text functionality vs varchar #12660

Closed
bamboowonder opened this issue Apr 9, 2022 · 0 comments

Comments

@bamboowonder
Copy link

Describe the Bug

TEXT and VARCHAR are functionally identical in Postgres, and the devs recommend using TEXT.

https://wiki.postgresql.org/wiki/Don't_Do_This#Don.27t_use_varchar.28n.29_by_default

However in Directus, a lot of functionality is limited only to fields recognized as a short string/varchar. text is treated like as a large text field like the mysql paradigm.

If the Postgres database only uses text/citext, instead of varchar, then none of the possible Display/Interface options are available (that string/varchar have).

Additionally there is no way to hint to Directus, or cast a column as another type.

Ideally, it would be possible to override the detected datatype in the schema DataModel screen.

To Reproduce

Create two fields. One varchar, and one text.
Note the difference in Directus for possible Display/Interface options.
The recognized datatype is a read-only field.

Errors Shown

No response

What version of Directus are you using?

9.8.0

What version of Node.js are you using?

16.14.2

What database are you using?

postgres 14

What browser are you using?

chrome

How are you deploying Directus?

CLI npm package

@directus directus locked and limited conversation to collaborators Apr 9, 2022
@benhaynes benhaynes converted this issue into discussion #12661 Apr 9, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant