07-20-2023, 09:07 AM
I'm not sure when it was added, but for the sake of completeness I'd like to point out that in version 9.1 (maybe before) `IF NOT EXISTS` can be used. `IF NOT EXISTS` will only create the table if it doesn't exist already.
Example:
CREATE TABLE IF NOT EXISTS users.vip
(
id integer
)
This will create a table named `vip` in the schema `users` if the table doesn't exist.
[Source][1]
[1]:
Example:
CREATE TABLE IF NOT EXISTS users.vip
(
id integer
)
This will create a table named `vip` in the schema `users` if the table doesn't exist.
[Source][1]
[1]:
[To see links please register here]