question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generated tsvector breaks table editor

See original GitHub issue

Bug report

Describe the bug

Creating a generated column of type tsvector breaks insert row of table editor on https://app.supabase.io/.

To Reproduce

  1. Create table
  2. Create a generated column like so:
ALTER TABLE tablename
    ADD COLUMN fts tsvector
               GENERATED ALWAYS AS (to_tsvector('english', "columnname")) STORED;
  1. Go to table editor on https://app.supabase.io/ and try to insert new row.
  2. Error message: cannot insert into column "fts"

Table editor shows: to_tsvector('english'::regconfig, fts) as default value. Removing it results in same error message as above.

Expected behavior

No default value is show in tsvecor generated column. Insert works leaving column fts empty.

System information

  • OS: macOS
  • Browser: Chrome

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kiwicopplecommented, Sep 27, 2022

(Note to FE team): This is now fixed in pg-meta, so we just need to make the relevant changes to the Grid to solve this

1reaction
saenducommented, Nov 19, 2021

Hey @phamhieu. I’ve just noticed, that when you try to update a row using direct edit in the table view (not detail view of an item). I still get an error message caused by the tsvector column.

{"error":{"code":400,"message":"column \"fts_ingredients\" can only be updated to DEFAULT","requestId":"b87f26b3-6b9e-4d46-893b-adc78b59ba85"}}

When I edit the row in the detail view (update form) it works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generated tsvector breaks table editor · Issue #7155
Creating a generated column of type tsvector breaks insert row of table editor ... Go to table editor on https://app.supabase.io/ and try to...
Read more >
Documentation: 15: 12.3. Controlling Text Search
To implement full text searching there must be a function to create a tsvector from a document and a tsquery from a user...
Read more >
Understanding Postgres Full Text Search: 10 Critical Aspects
This blog explains the PostgreSQL Full Text Search Technique along with the Phrased Search and Vector Search methods. Read along to master ...
Read more >
PostgreSQL: Is it possible to build tsvector value manually?
You can make tsvectors by hand. But as far as I know you can only assign 4 different weights, A, B, C, or...
Read more >
PostgreSQL® Full-Text Search
For the example queries below, the following table definition and data was ... By skipping them, the generated tsvector will be smaller, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found