Ruby on Rails Tuesday, July 11, 2017

Let's say I expect to have a billion users in my Postgres users table.

I want to make sure the first user gets to set it's role attribute to enum :admin as the default when the record is created and all other users are enum  :user.

Of course a billion users is ridiculous.  I'm just trying to understand what the, uh, best way to see if a Postgres table is empty without actually having to load it.

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment