pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Taral <taral@cyberjunkie.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-interfaces@hub.org
Subject: RE: [INTERFACES] IDL :)
Date: Sun, 15 Nov 1998 18:01:04 -0600
Message-ID: <000801be10f4$33ea2480$8a14f7d0@taral.dobiecenter.com> (raw)
In-Reply-To: <23346.911172109@sss.pgh.pa.us>

> We need some way of not having to enumerate all the possible field
> datatypes in advance.

[ suggestions snipped ]

d) none of the above

CORBA provides the "any" type, and it turns out that those discriminated
unions are TERRIBLE memory hogs in C++. So see attached.

There are now two files because some ORBs require a special switch to enable
a type to be extracted from/represented by an "any".

So now our user-defined types will have to work via the dynamic
interfaces... someone explain to me how those types work!

Taral

--- cut here: pgsql.idl ---

module PostgreSQL {
    // Discriminated unions removed due to inefficiency in C++
implementation

    typedef any Cell;
    typedef sequence<Cell> Column;

    interface Row {
        typedef sequence<Cell> type;
        attribute type data; // throws BAD_OPERATION on set until BE
supports this
    };

    interface QueryResult {
        typedef sequence<Column> type;
        typedef sequence<string> headerType;

        readonly attribute headerType header;
        attribute type data; // throws BAD_OPERATION on set until
implemented

        Row fetch(in long rownum); // returns nil or BAD_OPERATION until
implemented
        // zero based numbering of rows
    };

    interface Database {
        QueryResult exec(in string query);
        oneway void disconnect();
    };

    interface Server {
        Database connect(in string db, in string user, in string password);
    };
};

--- cut here: pgsql_types.idl ---

// This file compiled for support of any for new types

module PostgreSQL {
    enum celltype {
        int2,
        int4,
        int8

        // more types
    };

    typedef short int2type;
    typedef long int4type;
    struct int8type {
        long lsw;
        long msw;
    };
};




view thread (3+ messages)

Message-ID: <000801be10f4$33ea2480$8a14f7d0@taral.dobiecenter.com>
Permalink:  ../000801be10f4$33ea2480$8a14f7d0@taral.dobiecenter.com/
Also on:    postgresql.org/message-id/000801be10f4$33ea2480$8a14f7d0@taral.dobiecenter.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: taral@cyberjunkie.com, tgl@sss.pgh.pa.us, pgsql-interfaces@hub.org
  Subject: RE: [INTERFACES] IDL :)
  In-Reply-To: <000801be10f4$33ea2480$8a14f7d0@taral.dobiecenter.com>

* 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