How to add a current string into an already existing list

Chris Angelico rosuav at gmail.com
Sat Nov 2 18:13:01 EDT 2013


On Sun, Nov 3, 2013 at 9:00 AM, Roy Smith <roy at panix.com> wrote:
> In article <mailman.1959.1383429046.18130.python-list at python.org>,
>  Chris Angelico <rosuav at gmail.com> wrote:
>
>> On Sun, Nov 3, 2013 at 5:30 AM, Jussi Piitulainen
>> <jpiitula at ling.helsinki.fi> wrote:
>> > Suppose a database allowed structured values like lists of strings,
>> > lists of numbers, or even lists of such lists and more. Then it would
>> > actually be a Python issue how best to support that database.
>>
>> PostgreSQL supports some higher-level structures like arrays.
>> Personally, though, I think the most general representation of a
>> Python list in a database is either a varchar field with some form of
>> structure (eg the repr of a list), or a separate table with a foreign
>> key back to this one.
>
> When you say "database" here, you're really talking about relational
> databases.  There are other kinds.

Quite right, my apologies. I'm talking about the classic relational
database accessed by SQL, which is what the OP's currently working
with (MySQL). I've worked with other types of database, but was trying
to stick as closely as possible to the question. But yes, the
clarification is important here.

ChrisA



More information about the Python-list mailing list