sql数据流,amdin业务逻辑接入
This commit is contained in:
45
pages/mall/admin/user/test/check_function_exists.sql
Normal file
45
pages/mall/admin/user/test/check_function_exists.sql
Normal file
@@ -0,0 +1,45 @@
|
||||
-- Check if the function exists and show all overloaded versions
|
||||
SELECT
|
||||
proname as function_name,
|
||||
pg_get_function_arguments(oid) as arguments,
|
||||
pg_get_functiondef(oid) as definition
|
||||
FROM pg_proc
|
||||
WHERE pronamespace = 'public'::regnamespace
|
||||
AND proname = 'rpc_analytics_user_kpis'
|
||||
ORDER BY oid;
|
||||
|
||||
-- Alternative: Check function existence with more details
|
||||
SELECT
|
||||
n.nspname as schema_name,
|
||||
p.proname as function_name,
|
||||
pg_get_function_arguments(p.oid) as arguments,
|
||||
pg_get_function_result(p.oid) as return_type,
|
||||
p.prokind as function_type,
|
||||
CASE p.prokind
|
||||
WHEN 'f' THEN 'Function'
|
||||
WHEN 'p' THEN 'Procedure'
|
||||
WHEN 'a' THEN 'Aggregate'
|
||||
WHEN 'w' THEN 'Window'
|
||||
END as kind
|
||||
FROM pg_proc p
|
||||
JOIN pg_namespace n ON p.pronamespace = n.oid
|
||||
WHERE p.proname = 'rpc_analytics_user_kpis'
|
||||
AND n.nspname = 'public'
|
||||
ORDER BY p.oid;
|
||||
|
||||
-- Check all functions in public schema
|
||||
SELECT
|
||||
proname as function_name,
|
||||
pg_get_function_arguments(oid) as arguments
|
||||
FROM pg_proc
|
||||
WHERE pronamespace = 'public'::regnamespace
|
||||
ORDER BY proname;
|
||||
|
||||
-- Quick existence check
|
||||
SELECT
|
||||
EXISTS(
|
||||
SELECT 1
|
||||
FROM pg_proc
|
||||
WHERE pronamespace = 'public'::regnamespace
|
||||
AND proname = 'rpc_analytics_user_kpis'
|
||||
) as function_exists;
|
||||
Reference in New Issue
Block a user