title: Postgres sql table return statement
body: <p>I got a question related to an translation from SQL Server to Postgres.</p>
  <p>I got an table return statement and I don't know how to translate this to Postgres.</p>
  <p>my code:</p>
  <pre><code>CREATE FUNCTION [dbo].[GetLastUpdatedFluidTreated](@InjectionPoint_ID UNIQUEIDENTIFIER)  
  RETURNS @Return TABLE (
      [RT_FluidTreated_ID] [uniqueidentifier] NOT NULL,
      [CL_FluidTreatedType_ID] [uniqueidentifier] NOT NULL,
      [Timestamp] [datetime] NULL,
      [Last_Updated_Time] [datetime] NULL,
      [NewOrModified] [bit] NULL,
      [Origin_ID] [uniqueidentifier] NULL,
      [IsNew] [bit] NULL
      )
  AS   
  BEGIN  
      
  
      INSERT INTO @Return
      Select Top 1
          x1.[RT_FluidTreated_ID],
          x1.[CL_FluidTreatedType_ID],
          x1.[Timestamp],
          x1.[Last_Updated_Time],
          x1.[NewOrModified],
          x1.[Origin_ID],
          x1.[IsNew]
      from RT_FluidTreated x1
      WHERE x1.RE_InjectionPoint_ID = @InjectionPoint_ID
      Order by x1.[Last_Updated_Time] desc
      RETURN;
  END
  </code></pre>
  <p>this code above is on sql server.
  Can someone help me? thanks</p>