public.post_comments

October 18, 2025 ยท View on GitHub

Description

post and comments View table

Table Definition
CREATE VIEW post_comments AS (
 SELECT c.id,
    p.title,
    u.username AS post_user,
    c.comment,
    u2.username AS comment_user,
    c.created,
    c.updated
   FROM (((posts p
     LEFT JOIN comments c ON ((p.id = c.post_id)))
     LEFT JOIN users u ON ((u.id = p.user_id)))
     LEFT JOIN users u2 ON ((u2.id = c.user_id)))
)

Columns

NameTypeDefaultNullableChildrenParentsComment
idbiginttruecomments.id
titlevarchar(255)trueposts.title
post_uservarchar(50)trueposts.users.username
commenttexttrue
comment_uservarchar(50)truecomments.users.username
createdtimestamp without time zonetruecomments.created
updatedtimestamp without time zonetruecomments.updated

Referenced Tables

NameColumnsCommentType
public.posts8Posts tableBASE TABLE
public.comments7Comments
Multi-line
table
comment
BASE TABLE
public.users6Users tableBASE TABLE

Viewpoints

NameDefinition
postfor post

Relations

er


Generated by tbls