Subject: ordering of expressions in retrieve command

From: Stan Yates <[email-masked]>
Date: Wed, 3 Jun 92 12:19:17 -0700

I have a file containing structured data.  Two of the structures which
can appear in a record can also be multiply occurring.  I've set up three
classes--one for unstructured attributes which occur singly, and one each
for the two structures.  I've used a record ID common to all three classes
so I can reconstruct a data record.

    Four examples follow.  The first two retrieve one record.  The only
difference between them is the ordering of the expressions in the retrieve
command.  Likewise, examples 3 and 4 are identical except for the ordering
of the expressions.  Example 3 works, but example 4 hangs the system.

    Why is this?  Is there a better way of dealing with structured data
and/or multiply occurring attributes?

    Thanks in advance,
--Stan

Welcome to the C POSTGRES terminal monitor

EXAMPLE 1:

Query sent to backend is "retrieve(b.all, t.all) from t in tapes, b in tapes_bac
k where t.ID="A00245" and b.ID=t.ID   "
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-----------------------------------------------------------------
| ID          | ACCOUNT     | DISK        | DATABASE    | METHOD      | ID
    | DATE_ADDED  | DATE_UPDATED| TAPE_TYPE   | STATUS      | INVOLID     | COPI
ED_TO   | COPY_OF     | COMMENT     | LABEL       | NOTE        |
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-----------------------------------------------------------------
| A00245      | EAIPROD     | 201         | peai        | ddr         | A00245
    | 10/15/91    | 03/11/92    | square      | backup      | A00245      | (nul
l)      | (null)      | (null)      | SL          | tapeset C:4 EAIPROD 201 disk
 ddr dump of cyl. 0-294|
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-----------------------------------------------------------------

EXAMPLE 2:

Query sent to backend is "retrieve(t.all, b.all) from t in tapes, b in tapes_bac
k where t.ID="A00245" and b.ID=t.ID    "
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-----------------------------------------------------------------
| ID          | DATE_ADDED  | DATE_UPDATED| TAPE_TYPE   | STATUS      | INVOLID
    | COPIED_TO   | COPY_OF     | COMMENT     | LABEL       | NOTE        | ID
        | ACCOUNT     | DISK        | DATABASE    | METHOD      |
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-----------------------------------------------------------------
| A00245      | 10/15/91    | 03/11/92    | square      | backup      | A00245
    | (null)      | (null)      | (null)      | SL          | tapeset C:4 EAIPRO
D 201 disk ddr dump of cyl. 0-294| A00245      | EAIPROD     | 201         | pea
i        | ddr         |
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-----------------------------------------------------------------

EXAMPLE 3:

Query sent to backend is "retrieve(u.all, t.all) from t in tapes, u in tapes_use
r where t.ID="A00245" and u.ID=t.ID    "
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
---------------------------------------------------
| ID          | ACCOUNT     | ACCESS      | U_TYPE      | ID          | DATE_ADD
ED  | DATE_UPDATED| TAPE_TYPE   | STATUS      | INVOLID     | COPIED_TO   | COPY
_OF     | COMMENT     | LABEL       | NOTE        |
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
---------------------------------------------------
| A00245      | CRLPROD     | U           | O           | A00245      | 10/15/91
    | 03/11/92    | square      | backup      | A00245      | (null)      | (nul
l)      | (null)      | SL          | tapeset C:4 EAIPROD 201 disk ddr dump of c
yl. 0-294|
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
---------------------------------------------------
| A00245      | EAIPROD     | U           | S           | A00245      | 10/15/91
    | 03/11/92    | square      | backup      | A00245      | (null)      | (nul
l)      | (null)      | SL          | tapeset C:4 EAIPROD 201 disk ddr dump of c
yl. 0-294|
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
---------------------------------------------------
| A00245      | EAIWORK     | U           | S           | A00245      | 10/15/91
    | 03/11/92    | square      | backup      | A00245      | (null)      | (nul
l)      | (null)      | SL          | tapeset C:4 EAIPROD 201 disk ddr dump of c
yl. 0-294|
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
---------------------------------------------------
| A00245      | SBYATES     | U           | S           | A00245      | 10/15/91
    | 03/11/92    | square      | backup      | A00245      | (null)      | (nul
l)      | (null)      | SL          | tapeset C:4 EAIPROD 201 disk ddr dump of c
yl. 0-294|
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
---------------------------------------------------
| A00245      | SBYWORK     | U           | S           | A00245      | 10/15/91
    | 03/11/92    | square      | backup      | A00245      | (null)      | (nul
l)      | (null)      | SL          | tapeset C:4 EAIPROD 201 disk ddr dump of c
yl. 0-294|
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
---------------------------------------------------
| A00245      | CRLWORK     | U           | S           | A00245      | 10/15/91
    | 03/11/92    | square      | backup      | A00245      | (null)      | (nul
l)      | (null)      | SL          | tapeset C:4 EAIPROD 201 disk ddr dump of c
yl. 0-294|
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
---------------------------------------------------
| A00245      | CRLTEST     | U           | S           | A00245      | 10/15/91
    | 03/11/92    | square      | backup      | A00245      | (null)      | (nul
l)      | (null)      | SL          | tapeset C:4 EAIPROD 201 disk ddr dump of c
yl. 0-294|
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
---------------------------------------------------

EXAMPLE 4:

Query sent to backend is "retrieve(t.all, u.all) from t in tapes, u in tapes_use
r where t.ID="A00245" and u.ID=t.ID   "
^CI live to serve you.