The DROP statement fails if you always run it first.
Do you have the code that checks to see if a table exists or not? I have tried several things, but the parser doesn't like my if exists statement. I know you can check it by querying pg_tables, but as funny as this sounds, I am struggling with the IF statement syntax and have used examples directly from the PostgreSQL documentation...Thanks in advance for your help...
Main Topics
Browse All Topics





by: gamebitsPosted on 2007-10-12 at 06:17:15ID: 20065059
Using a script you can check if a table exist if so drop it and then make the new one, but if you know you are going to replace it anyway why don't you just run a drop table script and then the create table script?