postgresql - Postgres: how to print values in the loop -
I want to print all the tables found from the query, however my code only shows the name of the function.
to remove or replace a # function_assine () # $ $ # DECLARE # Records as line record zero; # Table # schema = 'public' and 'table_name ~' measurement [0- 9] '# loop #right notice' **%, quote_ident (row.table_name) in # line # info_schema.tables for tables_name; # End loop; # End; # $ $ LANGUAGE plpgsql; Choose Create # select_scene () function; Remove_scene -------------- (1 line) #
The reason for this is that you are not seeing anything that your function does not return anything. The text which is "written" will be displayed in the customer using the Raise Notice
if a) supports the client (which does psql) and b) if your session actually returns them You have to use the psql
to be configured for you:
set client_min_messages = notification;
Your current setting is probably alert
and no notice
is displayed for it.
However, doing this is very incompetent in a loop with Ryesy notice
would be better to convert your function into a set return function:
To delete or change function, delete table (table_name text) $$ AS $$ info_schema.tables select table_name WHERE table_schema = 'public' and table_name ~ 'measure [0-9]' $$ LANGUAGE sql;
And then use it like this:
select_scene () to select from *;
Another option would be to keep that selection statement in one view.
Comments
Post a Comment