Let's say that I have table ppl, which includes running id, activity boolean and timestamp defaulting to now.
Then I have another table (=ppl_data) where is also id as serial (only for easier manipulation), ppl_id, key and value and usually timestamp.

I can put anything to that ppl_data-table without altering db-schema, cause it is in key-value-pair.

Cause I use only inserts and fetching only newest data with that key, there is nice history of changes.

Reason to this is, that customer is able to add different fields if needed.
Ofc there is also datatype for that field, so sanity-check and casting is easier.

If needed one can vacuum old data from that ppl_data, if it affects to db-server, but usually there is enough power.
As log as that db-server isn't virtual-server where disk-latency might cause slowing downs eventually.

And when there is also way to do different queries, one can alter or even add features without code-changes.


In reply to Re^4: How to interpolate sql-output by Seq
in thread How to interpolate sql-output by Seq

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.