Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions schemainspect/pg/obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def __init__(
strictness,
security_type,
identity_arguments,
function_arguments,
result_string,
language,
full_definition,
Expand All @@ -254,6 +255,7 @@ def __init__(
kind,
):
self.identity_arguments = identity_arguments
self.function_arguments = function_arguments
self.result_string = result_string
self.language = language
self.volatility = volatility
Expand All @@ -280,6 +282,10 @@ def returntype_is_table(self):

@property
def signature(self):
return "{}({})".format(self.quoted_full_name, self.function_arguments)

@property
def identity_signature(self):
return "{}({})".format(self.quoted_full_name, self.identity_arguments)

@property
Expand All @@ -304,11 +310,12 @@ def thing(self):

@property
def drop_statement(self):
return "drop {} if exists {};".format(self.thing, self.signature)
return "drop {} if exists {};".format(self.thing, self.identity_signature)

def __eq__(self, other):
return (
self.signature == other.signature
self.identity_signature == other.identity_signature
and self.signature == other.signature
and self.result_string == other.result_string
and self.definition == other.definition
and self.language == other.language
Expand Down Expand Up @@ -1561,6 +1568,7 @@ def load_functions(self):
columns=od((c.name, c) for c in columns),
inputs=plist,
identity_arguments=f.identity_arguments,
function_arguments=f.function_arguments,
result_string=f.result_string,
language=f.language,
definition=f.definition,
Expand Down
1 change: 1 addition & 0 deletions schemainspect/pg/sql/functions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ unnested as (
p.extension_oid as extension_oid,
pg_get_function_result(p.oid) as result_string,
pg_get_function_identity_arguments(p.oid) as identity_arguments,
pg_get_function_arguments(p.oid) as function_arguments,
pg_catalog.obj_description(p.oid) as comment
FROM
unnested p
Expand Down