Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using if exists with drop/create table statements

Status
Not open for further replies.

tim273

Programmer
Aug 29, 2001
9
0
0
US
Is there a way to do something like this in Postgresql?

if exists(select * from pg_class where relname = 'testTable' and relkind = 'r') --I think that's right
drop table testTable;

create table testTable...;

Thanks a lot for any help!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top