Re: PL/pgSQL Trigger - Variable for shema? Like TG_RELNAME
| От | Christian Hofmann |
|---|---|
| Тема | Re: PL/pgSQL Trigger - Variable for shema? Like TG_RELNAME |
| Дата | |
| Msg-id | 012901c5de0a$d69efcb0$7b00a8c0@CHRISSI обсуждение исходный текст |
| Ответ на | Re: PL/pgSQL Trigger - Variable for shema? Like TG_RELNAME ("A. Kretschmer" <andreas.kretschmer@schollglas.com>) |
| Ответы |
Re: PL/pgSQL Trigger - Variable for shema? Like TG_RELNAME
|
| Список | pgsql-novice |
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
В списке pgsql-novice по дате отправления: