Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
150 views
in Technique[技术] by (71.8m points)

postgresql - How to find number of rows in heroku database

The title pretty much sums up my question, but here are more details:

I'm running a script to import rows into a heroku database. I started getting errors:

<class 'django.db.utils.DatabaseError'> current transaction is aborted, commands ignored until end of transaction block`

The script runs smoothly on my localhost so I'm not looking for problems there. I recently received an email from heroku stating that I'm "Approaching row limit for dev database"

I'm assuming I hit the row limit but I'd like to confirm this before taking further action.

Does anyone know how I can find my current row count for the whole database? (I know I can just do a count on each table but I'm hoping there's a cleaner way)

question from:https://stackoverflow.com/questions/12433036/how-to-find-number-of-rows-in-heroku-database

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you have the heroku cli tool, this will give you, among other things, the number of rows in your database

heroku pg:info -a your_app

Also given are your plan type, the db status, the number of current connections, postgres version, when the db was created, the number of rows in your plan, the data size, the number of tables and if your db has any fork/follow options activated.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...