The other option is to have a column on the mailbox table to flag that it is a default_mailbox -- but then I'd have to ensure there's only one column for each "person" flagged that way.
- is_default BOOL column in mailbox table - conditional index : UNIQUE INDEX ON mailboxes( owner ) WHERE is_default = 't'
Second question. So, after a while the obvious problem happens and users have too many mailboxes and they want a way to group them into
Looks like a tree. Why not use a LTREE ? ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match