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

opt: confusing error when creating view due to non-existent column #84178

Closed
rytaft opened this issue Jul 11, 2022 · 4 comments
Closed

opt: confusing error when creating view due to non-existent column #84178

rytaft opened this issue Jul 11, 2022 · 4 comments
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. E-quick-win Likely to be a quick win for someone experienced. T-sql-queries SQL Queries Team

Comments

@rytaft
Copy link
Collaborator

rytaft commented Jul 11, 2022

This is a new issue for a problem identified by @simplenotezy in #10028. The original comment is copied below.


Not sure why, but when we're trying to create a view like so:

CREATE OR REPLACE VIEW public. "match" AS
SELECT
	swipe.swiper_id AS user_id,
	swipe.swiped_id AS match_id,
	swipe.swiper_cell AS user_cell,
	swipe.swiped_cell AS match_cell
FROM
	swipe
	JOIN active_users u1 ON u1.id = swipe.swiper_id
	JOIN active_users u2 ON u2.id = swipe.swiped_id
WHERE
	swipe.swiper_like
	AND swipe.swiped_like
	AND swipe.deleted_at IS NULL;

We are getting the same error:

Query 1 ERROR: ERROR:  unimplemented: views do not currently support * expressions
HINT:  You have attempted to use a feature that is not yet implemented.
See: https://go.crdb.dev/issue-v/10028/v22.1

Not sure why, since we're not using SELECT *

Update

Turns out the error was triggered because of the ON statement was pointing to a non-existing column (id - should have been user_id)

Originally posted by @simplenotezy in #10028 (comment)

Jira issue: CRDB-17511

@blathers-crl
Copy link

blathers-crl bot commented Jul 11, 2022

Hi @rytaft, I've guessed the C-ategory of your issue and suitably labeled it. Please re-label if inaccurate.

While you're here, please consider adding an A- label to help keep our repository tidy.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl blathers-crl bot added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Jul 11, 2022
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Jul 11, 2022
@rytaft
Copy link
Collaborator Author

rytaft commented Jul 11, 2022

This is a new issue for a problem identified by @simplenotezy in #10028. For some reason I can't update the issue description to explain this.

@rytaft rytaft added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. and removed C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) labels Jul 11, 2022
@rytaft rytaft added the E-quick-win Likely to be a quick win for someone experienced. label Jul 19, 2022
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!

@rytaft
Copy link
Collaborator Author

rytaft commented Jan 11, 2024

This error doesn't occur anymore -- seems to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. E-quick-win Likely to be a quick win for someone experienced. T-sql-queries SQL Queries Team
Projects
Archived in project
Development

No branches or pull requests

2 participants