pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mike Field <mike@fieldco.com>
To: pgsql-sql@postgreSQL.org
Subject: Multiple values for a field
Date: Fri, 13 Aug 1999 11:11:00 -0400
Message-ID: <008701bee59e$0e951f80$0200a8c0@mike> (raw)

Hi-

Does anyone have any ideas on the following?

In my database that categorizes research documents and publications, I have
in some cases more than one author, more  than one region, subject, etc. per
document.  You mentioned yesterday that the best way to handle that is to
have a table for say, authors like this:

docid   |   authorid

and have more than one row for a document if that document has more than one
author.

My problem is that I'm pulling the info out of the database on the web, and
I find that I have to use a loop for the fields that have multiliple
values - and since I have several of those fields, many loops starts to bog
down the processor.  My objective is to try to get all the data out, for all
documents, in one single query - so that I can make a list of all the
documents and their pertinent data.

Do you see any problem if I put the actual names of the authors, comma
separated, in the author field (for example:  Mike Field, Tom Lane, ZZ Top)?
I would do the same for my six fields which may have multiple values
(author, region, subject, related_projects, doc_type, translations) I have
about 550 documents to put into the database.

I know using text fields would take up more space relative to just using a
number to refer to the author... but using a number makes me perform more
loops and thus, more processing time.

Let me know what you think.
Thanks,
Mike

view thread (3+ messages)  latest in thread

Message-ID: <008701bee59e$0e951f80$0200a8c0@mike>
Permalink:  ../008701bee59e$0e951f80$0200a8c0@mike/
Also on:    postgresql.org/message-id/008701bee59e$0e951f80$0200a8c0@mike

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: mike@fieldco.com
  Subject: Re: Multiple values for a field
  In-Reply-To: <008701bee59e$0e951f80$0200a8c0@mike>
  References: <008701bee59e$0e951f80$0200a8c0@mike>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox