Hello Anreas,
> You have the TG_RELNAME:
>
> SELECT nspname FROM pg_class c JOIN pg_namespace n ON n.oid =
> c.relnamespace WHERE c.relname = TG_RELNAME;
Thank you. But when I habe more than one table in different shemas with the
same name?
> 11:32 < akretschmer> Hi, i have a table-oid and need to know
> the schema-name. What can i do?
> 11:43 < itsMe_> akretschmer: SELECT nspname FROM pg_class c
> JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relname =
> 'tablename';
Yes, I will take the table-oid to get the shema name. Thats a better idea.
I thought there were a variable the shema is stored in. So I need an extra
query.
But it is ok.
Thank you,
Christian