Re: Interface for composite types

[email protected]
Newsgroups gmane.comp.db.postgresql.dbdpg
Message-ID <OF6A5D6FE5.EC0F02F5-ON86257463.005772DB-86257463.0058822D@rrd.com>
> Examples
> of real-life work that is using custom types right now would be
> helpful too. Once we have a semi-working API, you could make
> some tests. More tests are always good. :)

Here's what I've been working toward:

CREATE TYPE ftp_site AS
   (host "text",
    userid "text",
    "password" "text",
    path "text");


CREATE TABLE custom_document_destination
(
  customer_id serial NOT NULL,
  archive_path text NOT NULL,
  doc_site ftp_site NOT NULL,
  route_site ftp_site NOT NULL,
);

The ftp_site structure would then be a parameter to a method along the 
lines of ftp_transfer($site, $file).  Pretty straightforward.  I could 
probably throw together a test case once the API is firm.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.