在哪里可以在Postgres中找到我的PLPython函数? [英] Where I can find my PLPython functions in Postgres?

查看:124
本文介绍了在哪里可以在Postgres中找到我的PLPython函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在特定的模式中创建了一些函数,但是函数部分中什么都没有。.

I've created some functions in a specific schema, but the "Functions" section has nothing inside..

我创建了类似于以下示例的函数:

I create functions like this example:

CREATE FUNCTION pymax (a integer, b integer)
  RETURNS integer
AS $$
  if a > b:
  return a
return b
$$ LANGUAGE plpythonu;


推荐答案

如果名称不符合模式,则该函数(就像其他对象一样)是在当前架构中创建的。您的当前架构由的当前设置定义。 search_path

If the name is not schema-qualified, a function (like other objects) is created in your current schema. Your current schema is defined by the current setting of search_path.

查看您当前的 search_path

SHOW search_path;

有很多方法可以设置 search_path ,更多与此相关的答案:

search_path如何影响标识符解析和当前模式

There are a number of ways to set the search_path, more in this related answer:
How does the search_path influence identifier resolution and the "current schema"

查明是否具有数据库中存在一个相似的名称:

To find out whether any function with a similar name exists in your database:

SELECT n.nspname, p.proname, pg_get_function_arguments(p.oid) As args
FROM   pg_proc p
JOIN   pg_namespace n ON n.oid = p.pronamespace
WHERE  p.proname ILIKE '%pymax%';

如果找不到任何内容,则此功能不存在于 this 数据库。也许您是错误地在另一个数据库中创建了它?

If that doesn't find anything, the functions doesn't exist in this database. Maybe you created it in another db by mistake?

这篇关于在哪里可以在Postgres中找到我的PLPython函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆