Skip to main content

Documentation Index

Fetch the complete documentation index at: https://planetscale.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

What this error means

INVALID_TABLE_REFERENCED_IN_VIEW means a view references a table or entity that Vitess cannot resolve in the resulting schema. The error usually includes the view name and the missing referenced table.

Why PlanetScale rejects it

PlanetScale compares the final schema state when building a deploy request. A view must be valid in that final schema. If the referenced table is missing, renamed, dropped, or involved in an unresolved dependency loop, Vitess cannot safely create or preserve the view.

How to fix it

Check the view definition and make sure every referenced table exists after the deploy request is applied. Invalid:
CREATE VIEW active_users AS
SELECT id, email FROM users_old WHERE active = 1;
If users_old no longer exists, update the view:
CREATE VIEW active_users AS
SELECT id, email FROM users WHERE active = 1;
When renaming or replacing a table used by a view, split the work into multiple deploy requests:
  1. Create the replacement table or compatibility view.
  2. Update dependent views to reference the new object.
  3. Drop the old table after no views depend on it.

Need help?

Get help from the PlanetScale Support team, or join our Discord community to see how others are using PlanetScale.