Skip to content
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

sql: allow "inserting" DEFAULT into a computed column #22434

Open
justinj opened this issue Feb 6, 2018 · 4 comments
Open

sql: allow "inserting" DEFAULT into a computed column #22434

justinj opened this issue Feb 6, 2018 · 4 comments
Labels
A-sql-mutations Mutation statements: UPDATE/INSERT/UPSERT/DELETE. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-queries SQL Queries Team

Comments

@justinj
Copy link
Contributor

justinj commented Feb 6, 2018

The RFC specifies that users should be able to specify a computed column in their list of columns to be inserted into or updated, provided that the insert uses a VALUES clause and every value being inserted into that column is a DEFAULT.

Jira issue: CRDB-5857

@justinj justinj self-assigned this Feb 6, 2018
justinj pushed a commit to justinj/cockroach that referenced this issue Feb 6, 2018
The previous implementation I had of this was incorrect - I think the
correct implementation is a bit involved so I'm putting out a fix for
the immediate issue and I've opened cockroachdb#22434 to track the correct fix.

Release note (bug fix): Disallowed any inserts into computed columns.
justinj pushed a commit to justinj/cockroach that referenced this issue Feb 7, 2018
Fixes cockroachdb#22410.

The previous implementation I had of this was incorrect - I think the
correct implementation is a bit involved so I'm putting out a fix for
the immediate issue and I've opened cockroachdb#22434 to track the correct fix.

Release note (bug fix): Disallowed any inserts into computed columns.
justinj pushed a commit to justinj/cockroach that referenced this issue Feb 8, 2018
Fixes cockroachdb#22410.

The previous implementation I had of this was incorrect - I think the
correct implementation is a bit involved so I'm putting out a fix for
the immediate issue and I've opened cockroachdb#22434 to track the correct fix.

Release note (bug fix): Disallowed any inserts into computed columns.
@knz knz added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-sql-mutations Mutation statements: UPDATE/INSERT/UPSERT/DELETE. labels May 14, 2018
@knz knz added this to Triage in (DEPRECATED) SQL Front-end, Lang & Semantics via automation May 14, 2018
@knz knz moved this from Triage to Feature requests / pie-in-the-skie in (DEPRECATED) SQL Front-end, Lang & Semantics May 14, 2018
@asubiotto asubiotto added this to Triage in BACKLOG, NO NEW ISSUES: SQL Optimizer via automation Apr 2, 2020
@asubiotto
Copy link
Contributor

@RaduBerinde seems like a planning issue, moving over to planning for triage.

@RaduBerinde RaduBerinde moved this from Triage to Lower Priority Backlog in BACKLOG, NO NEW ISSUES: SQL Optimizer Apr 2, 2020
@RaduBerinde RaduBerinde moved this from Lower Priority Backlog to New features in BACKLOG, NO NEW ISSUES: SQL Optimizer Apr 18, 2020
@jlinder jlinder added the T-sql-queries SQL Queries Team label Jun 16, 2021
@rneilson
Copy link

Hey there, I know this is an older issue, but we're currently trying to migrate from Postgres to Cockroach, and this is a blocker. We have a few expression indexes we've moved to indexes on computed columns specifically for Cockroach compatibility, but Cockroach is now choking on the SQL dumps (which have DEFAULT for the computed column values), preventing the migration.

Any ideas, outside of some fiddly sed work?

@jordanlewis
Copy link
Member

Unfortunately, there's no workaround for this problem right now - we'd need to fix the deficiency (which we'd like to do, btw). For now, I think you'll have to do some fiddly sed work - sorry about that.

@jordanlewis jordanlewis added this to Triage in SQL Queries via automation Jul 24, 2021
@jordanlewis jordanlewis moved this from Triage to Backlog in SQL Queries Jul 24, 2021
@mgartner mgartner moved this from Backlog (DO NOT ADD NEW ISSUES) to New Backlog in SQL Queries May 25, 2023
@github-actions
Copy link

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-mutations Mutation statements: UPDATE/INSERT/UPSERT/DELETE. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-queries SQL Queries Team
Projects
Status: Backlog
(DEPRECATED) SQL Front-end, Lang & Se...
  
Feature requests / pie-in-the-skie
SQL Queries
New Backlog
Development

No branches or pull requests

7 participants