Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 85EEC636936 for ; Thu, 22 Oct 2009 14:46:41 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 52405-05-3 for ; Thu, 22 Oct 2009 17:46:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-px0-f199.google.com (mail-px0-f199.google.com [209.85.216.199]) by mail.postgresql.org (Postfix) with ESMTP id 7EFD46369FF for ; Thu, 22 Oct 2009 14:31:13 -0300 (ADT) Received: by pxi37 with SMTP id 37so830627pxi.15 for ; Thu, 22 Oct 2009 10:31:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=l/OT979F3fEtTodjzr2p8EARHgolmnR7MHh6wDnYcfc=; b=DKbvq4yIfWfSm6dKaeiZanunzllAWHMbg26YLDzHvH+yu4pYO0+4w5k3rDomqp0u5O B+SQcYIvWgFt8DfAL2NAOLJyVMSjKW7gExPUoQpycinLkDSjZgIP7DW0gURBKLpHK6u/ eFCQx/trDVzjQkV6iBBNI2dCn9RqjVwAidFbY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=j6SZVrZFAOJ0YbeltUi64OuC5g3By581ARo5CNBrlwMUPtVfDhTXIQA7tsC+otCEjp Ym1Z55xC6dR7ZgiU1ODqheJBqAqUyEwEBqFm7JougXMJ7CG/DWrEN2YcpaQ/ShnprUBj rLugDH54DHXcaNf3BLGLiN7/OURCrRf+f4lOI= MIME-Version: 1.0 Received: by 10.115.38.39 with SMTP id q39mr14833032waj.27.1256232671680; Thu, 22 Oct 2009 10:31:11 -0700 (PDT) Date: Thu, 22 Oct 2009 13:31:11 -0400 Message-ID: <302670f20910221031v6cc61b5bq27accbf7d928d024@mail.gmail.com> Subject: Assigning Values to Composite Types From: Gary Chambers To: pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200910/111 X-Sequence-Number: 33310 All... Given the following [hopefully] relevant portions of a function: CREATE OR REPLACE FUNCTION solve(FLOAT8, VARCHAR, CHAR) RETURNS SETOF sometype_t AS $solve$ DECLARE data sometype_t; ... BEGIN FOR term_count IN SELECT DISTINCT coord_type AS coord_type, MAX(term) AS maxterms ... LOOP FOR i IN 0 .. term_count.maxterms LOOP SELECT SUM(a + b + c) INTO Q ... S := S + (Q * onevalue * somevalue); END LOOP; -- This is the only means of verifying/viewing the data RAISE NOTICE '% = %', term_count.coord_type, S; /* Here is where I am stuck trying to fill data I've tried: data.term_count.coord_type := S; (data.term_count).coord_type := S; data.(term_count.coord_type) := S; */ S := 0.0; END LOOP; RETURN NEXT vsop87_data; END; $solve$ LANGUAGE plpgsql STRICT IMMUTABLE; Is there a means of filling something.something.something with a value so I can get all the values into a single row? Thanks very much in advance. -- Gary Chambers /* Nothing fancy and nothing Microsoft! */