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

database already exists #48

Open
jjuu opened this issue Mar 18, 2019 · 1 comment
Open

database already exists #48

jjuu opened this issue Mar 18, 2019 · 1 comment

Comments

@jjuu
Copy link

jjuu commented Mar 18, 2019

I inserted 10000 to the db named fake. Then I want to insert another 10000. But error happened.

fake2db --rows 10000 --db postgresql --name fake --username postgres
2019-03-18 09:55:19,907 www Rows argument : 20000
2019-03-18 09:55:20,036 www database "fake" already exists

Traceback (most recent call last):
File "/home/www/pyenv/aws/bin/fake2db", line 11, in
sys.exit(main())
File "/home/www/pyenv/aws/local/lib/python2.7/site-packages/fake2db/fake2db.py", line 167, in main
number_of_rows=args.rows, name=args.name, custom=custom)
File "/home/www/pyenv/aws/local/lib/python2.7/site-packages/fake2db/postgresql_handler.py", line 18, in fake2db_initiator
cursor, conn = self.database_caller_creator(number_of_rows, **connection_kwargs)
File "/home/www/pyenv/aws/local/lib/python2.7/site-packages/fake2db/postgresql_handler.py", line 46, in database_caller_creator
cur.execute('CREATE DATABASE %s;' % dbname)
psycopg2.ProgrammingError: database "fake" already exists

Thanks for your great work.

@emirozer
Copy link
Owner

ah yes this is a fix that i will apply when i have some time this weekend. thx for reporting

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

2 participants