Re: [GENERAL] pl sql to check if table of table_name exists

2005-03-13 Thread Adam Tomjack
Shaun Clements wrote: 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 -- A list of tables: SELECT schemaname, tablename FROM pg_tables; -- Returns t

Re: [GENERAL] pl sql to check if table of table_name exists

2005-03-10 Thread Shaun Clements
Title: RE: [GENERAL] pl sql to check if table of table_name exists Hi Sim   Thanks for your input.   Kind Regards,Shaun Clements  -Original Message-From: Sim Zacks [mailto:[EMAIL PROTECTED]Sent: 10 March 2005 02:47 PMTo: pgsql-general@postgresql.orgSubject: Re: [GENERAL] pl sql

Re: [GENERAL] pl sql to check if table of table_name exists

2005-03-10 Thread Sim Zacks
Title: RE: [GENERAL] pl sql to check if table of table_name exists I'm glad to hear you got it working. In explanation to my response: the pg_class internal table lists all the relationships in the database. relkind='r' means that the relation you are looking for is a tabl

Re: [GENERAL] pl sql to check if table of table_name exists

2005-03-10 Thread Shaun Clements
Title: RE: [GENERAL] pl sql to check if table of table_name exists Hi Sim   Thanks for your response. I had it working from a previous post by Adam Tomjack. -- A list of tables: SELECT schemaname, tablename FROM pg_tables; -- Returns true if a table exists: SELECT count(*)>0 FROM pg_tab

Re: [GENERAL] pl sql to check if table of table_name exists

2005-03-10 Thread Sim Zacks
Title: RE: [GENERAL] pl sql to check if table of table_name exists i mean select * from pg_class where relkind='r' and relname=your_tablename "Sim Zacks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... select your_tablename from pg

Re: [GENERAL] pl sql to check if table of table_name exists

2005-03-10 Thread Sim Zacks
Title: RE: [GENERAL] pl sql to check if table of table_name exists select your_tablename from pg_class where relkind='r' "Shaun Clements" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... Hi Hate to ask, but it isnt obvious to me from the

Re: [GENERAL] pl sql to check if table of table_name exists

2005-03-10 Thread Chris Travers
Shaun Clements wrote: 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. Check the manual. There are two ways to d othis. You could query the data catalogs directly (something like count(*) fro

Re: [GENERAL] pl sql to check if table of table_name exists

2005-03-10 Thread Shaun Clements
Title: RE: [GENERAL] pl sql to check if table of table_name exists Much appreciated. Thanks Kind Regards, Shaun Clements -Original Message- From: Adam Tomjack [mailto:[EMAIL PROTECTED]] Sent: 10 March 2005 11:04 AM To: Shaun Clements Cc: postgresql Subject: Re: [GENERAL] pl sql to

Re: [GENERAL] pl sql to check if table of table_name exists

2005-03-10 Thread Shaun Clements
Title: RE: [GENERAL] pl sql to check if table of table_name exists 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