Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V-233576: If not exists #14

Open
karikarshivani opened this issue Dec 29, 2022 · 0 comments
Open

V-233576: If not exists #14

karikarshivani opened this issue Dec 29, 2022 · 0 comments

Comments

@karikarshivani
Copy link
Contributor

Error:

expected "\nNOTICE:  role \"bob\" does not exist, skipping\nERROR:  relation \"test\" already exists\n" to match /CREATE TABLE/
Diff:
@@ -1,2 +1,4 @@
-/CREATE TABLE/
+
+NOTICE:  role "bob" does not exist, skipping
+ERROR:  relation "test" already exists

'DROP ROLE IF EXISTS bob; CREATE ROLE bob; CREATE TABLE test(id INT);'

should be modified to:

'DROP ROLE IF EXISTS bob; CREATE ROLE bob; DROP TABLE IF EXISTS test; CREATE TABLE test(id INT);'


Note: Try using IF NOT EXISTS to be less destructive. Consider using long and specific values for user names and table names - for example: inspec_postgres_test_user, inspec_postgres_test_table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant