You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
148616: sql: support referencing a routine from a view query r=rafiss,rytaft,mgartner a=DrewKimball
#### sql,schemachanger: add remaining handling for routine references in views
This commit adds the remaining logic needed to keep track of references
to routines from a view query in the schema changer. The following commit
will resolve these references upon planning the `CREATE VIEW` statement
and pass them to the schema changer.
Informs #146123
Release note: None
#### sql: support referencing a routine from a view query
This commit adds support for invoking a UDF from a view (materialized or
otherwise). This requires resolving routine references while planning the
`CREATE VIEW` statement and passing them to the schema changer.
Fixes#146123
Release note (sql change): Added support for invoking a UDF from a view
query. Renaming or setting the schema on the routine is currently not
allowed if it is referenced by a view.
Co-authored-by: Drew Kimball <[email protected]>
Copy file name to clipboardExpand all lines: pkg/sql/logictest/testdata/logic_test/drop_function
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -301,7 +301,7 @@ CREATE SCHEMA altSchema;
301
301
CREATE FUNCTION altSchema.f_called_by_b() RETURNS INT LANGUAGE SQL AS $$ SELECT 1 $$;
302
302
CREATE TABLE t1_with_b_2_ref(j int default altSchema.f_called_by_b() CHECK (altSchema.f_called_by_b() > 0));
303
303
304
-
statement error pgcode 0A000 cannot set schema for function \"f_called_by_b\" because other functions \(\[test.public.f_called_by_b2\]\) still depend on it
304
+
statement error pgcode 0A000 cannot set schema for function \"f_called_by_b\" because other functions or views \(\[test.public.f_called_by_b2\]\) still depend on it
305
305
ALTER FUNCTION f_called_by_b SET SCHEMA altSchema;
0 commit comments