Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2009
    Posts
    5

    Question Unanswered: out parameter independent of return

    Is it possible to have a function that returns a composite type having also an OUT parameter?

  2. #2
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    There's really no difference so say your composite type is (comp1 int, comp2 int). You could define a function like so.

    Code:
    CREATE OR REPLACE FUNCTION foo(
      p_id      IN  INT,
      comp1   OUT  INT,
      comp2   OUT  INT,
      other     OUT  TEXT
    ) RETURNS RECORD AS...
    Also note that you don't have to define a composite type to return multiple values from a function in Postgres.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •