PostgreSQL how to check if table exist?

[quote=436363:@Tim Seyfarth]It works the first time, but not when the second instance of the object is called.

If I run the command in pgAdminIII, it works everytime too. This is why I am wondering if it is something in Xojo or my code elsewhere?

"SELECT 1 FROM information_schema.tables WHERE table_type='BASE TABLE' AND table_schema='public' AND table_catalog='axcys' AND table_name='remotes'

I ran the command in one of my xojo app that edits databases. it’s almost identical to an sqlexecute in xojo.
so I don’t think xojo is the problem.

[quote=436375:@Tim Seyfarth]Hi Rick,

The text was “no such table: information_schema.tables”
Tim[/quote]

Are you SURE you are running all your queries using a PostgreSQLDatabase object? Aren’t you trying it in a wrong Database object like a SQLiteDatabase?

Hi Rick,
Thanks for the tip! It’s been a long time since I looked at this code and so yes, there actually was 2 places where it was looking at a SQLite db, and had not been changed to a PostgreSQL db.

Thank you again!
Tim