Re: pl sql to check if table of table_name exists
От | Shaun Clements |
---|---|
Тема | Re: pl sql to check if table of table_name exists |
Дата | |
Msg-id | 100F78F2B203444BB161BBA7077FF6131CD89E@srldbexc003.relyant.co.za обсуждение исходный текст |
Список | pgsql-general |
Hi Sim
Thanks for your response. I had it working from a previous post by Adam Tomjack.
<snip>
-- A list of tables:
SELECT schemaname, tablename FROM pg_tables;
-- Returns true if a table exists:
SELECT count(*)>0 FROM pg_tables
WHERE schemaname='...' AND tablename='...'
</snip>
Your response does not work for me. Perhaps you can explain the posted command
<snip>
* from pg_class where relkind='r' and relname=your_tablename
</snip>
Shaun Clements
-----Original Message-----
From: Sim Zacks [mailto:sim@compulab.co.il]
Sent: 10 March 2005 01:24 PM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] pl sql to check if table of table_name exists
From: Sim Zacks [mailto:sim@compulab.co.il]
Sent: 10 March 2005 01:24 PM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] pl sql to check if table of table_name exists
i meanselect * from pg_class where relkind='r' and relname=your_tablename"Sim Zacks" <sim@compulab.co.il> wrote in message news:d0pamh$2l83$1@news.hub.org...select your_tablename from pg_class where relkind='r'"Shaun Clements" <ShaunC@relyant.co.za> wrote in message news:100F78F2B203444BB161BBA7077FF6131CD89C@srldbexc003.relyant.co.za...Hi
Hate to ask, but it isnt obvious to me from the documentation.
How do I perform a query in pgplsql, to check it a table exists of a particular name.Thanks in advance
Kind Regards,
Shaun Clements
В списке pgsql-general по дате отправления: