Search Postgresql Archives

Re: Lookup tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday, February 4, 2025, Ron Johnson <ronljohnsonjr@xxxxxxxxx> wrote:
On Tue, Feb 4, 2025 at 9:28 AM Rich Shepard <rshepard@xxxxxxxxxxxxxxx> wrote:
Should lookup tables have a numeric FK column as well as the description column?

Does your lookup table just have one column?  (That's what your question seems to imply, but that makes no sense, since the whole point of a lookup table is to store some sort of a code in the "child" table instead of the whole text of the description.)

The point of a lookup table is to provide a unique list of authoritative values for some purpose.  Kinda like an enum.  But having the label serve as the unique value is reasonable - we only add surrogates for optimization.

David J.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux