Co-authored-by: Michael Hoennig <michael@hoennig.de> Reviewed-on: #104 Reviewed-by: Marc Sandlus <marc.sandlus@hostsharing.net>
19 lines
621 B
PL/PgSQL
19 lines
621 B
PL/PgSQL
--liquibase formatted sql
|
|
|
|
|
|
-- ============================================================================
|
|
--changeset michael.hoennig:base-COMBINE-TABLE-SCHEMA-AND-NAME endDelimiter:--//
|
|
-- ----------------------------------------------------------------------------
|
|
|
|
create or replace function base.combine_table_schema_and_name(tableSchema name, tableName name)
|
|
returns text
|
|
language plpgsql as $$
|
|
begin
|
|
if tableSchema is null or tableSchema = 'public' or tableSchema = '' then
|
|
return tableName::text;
|
|
else
|
|
return tableSchema::text || '.' || tableName::text;
|
|
end if;
|
|
end; $$;
|
|
--//
|