diff --git a/pkg/BUILD.bazel b/pkg/BUILD.bazel index 87a0d82e603a..a2f789b54811 100644 --- a/pkg/BUILD.bazel +++ b/pkg/BUILD.bazel @@ -965,7 +965,6 @@ GO_TARGETS = [ "//pkg/ccl/pgcryptoccl/pgcryptocipherccl:pgcryptocipherccl_test", "//pkg/ccl/pgcryptoccl:pgcryptoccl", "//pkg/ccl/pgcryptoccl:pgcryptoccl_test", - "//pkg/ccl/plpgsqlccl:plpgsqlccl", "//pkg/ccl/revertccl:revertccl", "//pkg/ccl/revertccl:revertccl_test", "//pkg/ccl/schemachangerccl:schemachangerccl", @@ -2089,7 +2088,6 @@ GO_TARGETS = [ "//pkg/sql/plpgsql/parser/lexbase:lexbase", "//pkg/sql/plpgsql/parser:parser_test", "//pkg/sql/plpgsql/parser:plpgparser", - "//pkg/sql/plpgsql:plpgsql", "//pkg/sql/privilege:privilege", "//pkg/sql/privilege:privilege_test", "//pkg/sql/protoreflect/gprototest:gprototest", diff --git a/pkg/ccl/BUILD.bazel b/pkg/ccl/BUILD.bazel index adc08e212c9f..ad4d1856fe7e 100644 --- a/pkg/ccl/BUILD.bazel +++ b/pkg/ccl/BUILD.bazel @@ -26,7 +26,6 @@ go_library( "//pkg/ccl/oidcccl", "//pkg/ccl/partitionccl", "//pkg/ccl/pgcryptoccl", - "//pkg/ccl/plpgsqlccl", "//pkg/ccl/securityccl/fipsccl", "//pkg/ccl/storageccl", "//pkg/ccl/storageccl/engineccl", diff --git a/pkg/ccl/ccl_init.go b/pkg/ccl/ccl_init.go index 265d6029f754..1691718dfe89 100644 --- a/pkg/ccl/ccl_init.go +++ b/pkg/ccl/ccl_init.go @@ -29,7 +29,6 @@ import ( _ "github.com/cockroachdb/cockroach/pkg/ccl/oidcccl" _ "github.com/cockroachdb/cockroach/pkg/ccl/partitionccl" _ "github.com/cockroachdb/cockroach/pkg/ccl/pgcryptoccl" - _ "github.com/cockroachdb/cockroach/pkg/ccl/plpgsqlccl" _ "github.com/cockroachdb/cockroach/pkg/ccl/securityccl/fipsccl" _ "github.com/cockroachdb/cockroach/pkg/ccl/storageccl" _ "github.com/cockroachdb/cockroach/pkg/ccl/storageccl/engineccl" diff --git a/pkg/ccl/plpgsqlccl/BUILD.bazel b/pkg/ccl/plpgsqlccl/BUILD.bazel deleted file mode 100644 index e11964a353eb..000000000000 --- a/pkg/ccl/plpgsqlccl/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "plpgsqlccl", - srcs = ["plpgsql.go"], - importpath = "github.com/cockroachdb/cockroach/pkg/ccl/plpgsqlccl", - visibility = ["//visibility:public"], - deps = [ - "//pkg/ccl/utilccl", - "//pkg/settings/cluster", - "//pkg/sql/plpgsql", - ], -) diff --git a/pkg/ccl/plpgsqlccl/plpgsql.go b/pkg/ccl/plpgsqlccl/plpgsql.go deleted file mode 100644 index 70cd6ac72555..000000000000 --- a/pkg/ccl/plpgsqlccl/plpgsql.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2023 The Cockroach Authors. -// -// Use of this software is governed by the CockroachDB Software License -// included in the /LICENSE file. - -package plpgsqlccl - -import ( - "github.com/cockroachdb/cockroach/pkg/ccl/utilccl" - "github.com/cockroachdb/cockroach/pkg/settings/cluster" - "github.com/cockroachdb/cockroach/pkg/sql/plpgsql" -) - -func init() { - plpgsql.CheckClusterSupportsPLpgSQL = checkClusterSupportsPLpgSQL -} - -func checkClusterSupportsPLpgSQL(settings *cluster.Settings) error { - return utilccl.CheckEnterpriseEnabled(settings, "PL/pgSQL") -} diff --git a/pkg/sql/logictest/testdata/logic_test/plpgsql_license b/pkg/sql/logictest/testdata/logic_test/plpgsql_license deleted file mode 100644 index d1ebe69021d4..000000000000 --- a/pkg/sql/logictest/testdata/logic_test/plpgsql_license +++ /dev/null @@ -1,15 +0,0 @@ -# LogicTest: local - -statement error pgcode XXC01 pq: using PL/pgSQL requires a CCL binary -CREATE OR REPLACE FUNCTION f() RETURNS RECORD AS $$ - BEGIN - RETURN ROW(0); - END -$$ LANGUAGE PLpgSQL; - -statement error pgcode XXC01 pq: using PL/pgSQL requires a CCL binary -CREATE OR REPLACE PROCEDURE p() AS $$ - BEGIN - RAISE NOTICE '1'; - END -$$ LANGUAGE PLpgSQL; diff --git a/pkg/sql/logictest/tests/local/generated_test.go b/pkg/sql/logictest/tests/local/generated_test.go index e603d9f587fe..81ec8ae2a134 100644 --- a/pkg/sql/logictest/tests/local/generated_test.go +++ b/pkg/sql/logictest/tests/local/generated_test.go @@ -1536,13 +1536,6 @@ func TestLogic_plpgsql_builtins( runLogicTest(t, "plpgsql_builtins") } -func TestLogic_plpgsql_license( - t *testing.T, -) { - defer leaktest.AfterTest(t)() - runLogicTest(t, "plpgsql_license") -} - func TestLogic_poison_after_push( t *testing.T, ) { diff --git a/pkg/sql/opt/optbuilder/BUILD.bazel b/pkg/sql/opt/optbuilder/BUILD.bazel index 39baaacbaa11..14eb16e214cf 100644 --- a/pkg/sql/opt/optbuilder/BUILD.bazel +++ b/pkg/sql/opt/optbuilder/BUILD.bazel @@ -80,7 +80,6 @@ go_library( "//pkg/sql/parser/statements", "//pkg/sql/pgwire/pgcode", "//pkg/sql/pgwire/pgerror", - "//pkg/sql/plpgsql", "//pkg/sql/plpgsql/parser:plpgparser", "//pkg/sql/privilege", "//pkg/sql/sem/asof", diff --git a/pkg/sql/opt/optbuilder/create_function.go b/pkg/sql/opt/optbuilder/create_function.go index 62f165e99067..48c4c56d1592 100644 --- a/pkg/sql/opt/optbuilder/create_function.go +++ b/pkg/sql/opt/optbuilder/create_function.go @@ -17,7 +17,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/parser" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" - "github.com/cockroachdb/cockroach/pkg/sql/plpgsql" plpgsqlparser "github.com/cockroachdb/cockroach/pkg/sql/plpgsql/parser" "github.com/cockroachdb/cockroach/pkg/sql/sem/cast" "github.com/cockroachdb/cockroach/pkg/sql/sem/plpgsqltree" @@ -101,11 +100,6 @@ func (b *Builder) buildCreateFunction(cf *tree.CreateRoutine, inScope *scope) (o if !languageFound { panic(pgerror.New(pgcode.InvalidFunctionDefinition, "no language specified")) } - if language == tree.RoutineLangPLpgSQL { - if err := plpgsql.CheckClusterSupportsPLpgSQL(b.evalCtx.Settings); err != nil { - panic(err) - } - } // Track the dependencies in the arguments, return type, and statements in // the function body. diff --git a/pkg/sql/plpgsql/BUILD.bazel b/pkg/sql/plpgsql/BUILD.bazel deleted file mode 100644 index 9a1afe3d71a1..000000000000 --- a/pkg/sql/plpgsql/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "plpgsql", - srcs = ["plpgsql.go"], - importpath = "github.com/cockroachdb/cockroach/pkg/sql/plpgsql", - visibility = ["//visibility:public"], - deps = [ - "//pkg/settings/cluster", - "//pkg/sql/sqlerrors", - "@com_github_cockroachdb_errors//:errors", - ], -) diff --git a/pkg/sql/plpgsql/plpgsql.go b/pkg/sql/plpgsql/plpgsql.go deleted file mode 100644 index 3a43fb0d8a7f..000000000000 --- a/pkg/sql/plpgsql/plpgsql.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2023 The Cockroach Authors. -// -// Use of this software is governed by the CockroachDB Software License -// included in the /LICENSE file. - -package plpgsql - -import ( - "github.com/cockroachdb/cockroach/pkg/settings/cluster" - "github.com/cockroachdb/cockroach/pkg/sql/sqlerrors" - "github.com/cockroachdb/errors" -) - -var CheckClusterSupportsPLpgSQL = func(settings *cluster.Settings) error { - return sqlerrors.NewCCLRequiredError( - errors.New("using PL/pgSQL requires a CCL binary"), - ) -}