How can I store user generated content in postgresql or rdbms? **In this Image I show My actual problem occurs in usr_post means how I can simplify the database table for user-generated content or how can I design the table for user_generated content, Note I want to store every individual user-generated content **
Note that I am using Django framework and its backend support by PostgreSQL database means I am using PostgreSQL database
One to Many Relation will not work in my case here is a screenshot of unexpected output

here is my model configuration
class User(models.Model):
first_name = models.CharField(max_length=40)
last_name = models.CharField(max_length=40)
usr_name = models.CharField(max_length=40)
status = models.IntegerField(default=00)
verify_type = models.CharField(max_length=10, default='E')
login_value = models.CharField(max_length=50, default='NA')
login_alternate = models.CharField(max_length=15)
country_code = models.CharField(max_length=15)
area_code = models.CharField(max_length=15)
password = models.CharField(max_length=200)
created_at = models.DateTimeField(auto_now=True)
usr_post = models.ForeignKey(UserPost, blank=True, null=True, on_delete=models.SET_NULL)
I can't comment so I'll post here.
If I understood you correctly, you wish to know which posts each user created?
If so.. create another table &quot;user_posts&quot; which will have a foreign key with a user_id and then all your post data, Then if you want to find which posts are associated with each user you can use a JOIN.