Skip to content

Optionally prefix computed column procedures with the table name #2507

Answered by wolfgangwalther
TimoStolz asked this question in Q&A
Discussion options

You must be logged in to vote

Hm. That prefix would be quite contrary to our naming conventions.

Maybe you can solve it like this:

  • Create the full_name(...) function only
  • Create an event trigger that reacts on the create statement. When a function is created that matches a few criteria (in the api schema, single table-type argument), you issue another create function statement, similar to this:
CREATE FUNCTION <table_name>_<func_name>(<table_name>) RETURNS <return_type> AS $$
  SELECT <func_name>($1);
$$;

This way you only need to maintain one set of functions, but have both?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by steve-chavez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
idea Needs of discussion to become an enhancement, not ready for implementation
2 participants
Converted from issue

This discussion was converted from issue #2493 on October 11, 2022 02:30.