pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: SQL SERVER migration to PostgreSql
Date: Thu, 7 Nov 2019 16:17:22 +0100
Message-ID: <53157133-cdcd-08f4-cd04-6b94ac74ab57@gmx.net> (raw)
In-Reply-To: <CALcdmyTQjKcKfQBBrYJgq_2h59BvSTT3yACC-mYMYcbReZ2yHw@mail.gmail.com>
References: <CALcdmyTQjKcKfQBBrYJgq_2h59BvSTT3yACC-mYMYcbReZ2yHw@mail.gmail.com>

İlyas Derse schrieb am 07.11.2019 um 14:28:
> I'm trying to migration to PostgreSql from SQL Server. I have Stored
> Procedures what have output parameters and returning tables.But you
> know what, we can not returning tables in stored procedures in
> PostgreSql and we can not use output parameters in functions in
> PostgreSql.

The correct migration path is to rewrite them to set-returning functions and use them in the FROM clause:

so instead of 

   sp_foobar 42;

use

  select *
  from fn_foobar(42);

Thomas





view thread (4+ messages)  latest in thread

Message-ID: <53157133-cdcd-08f4-cd04-6b94ac74ab57@gmx.net>
Permalink:  ../53157133-cdcd-08f4-cd04-6b94ac74ab57@gmx.net/
Also on:    postgresql.org/message-id/53157133-cdcd-08f4-cd04-6b94ac74ab57@gmx.net

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: spam_eater@gmx.net
  Subject: Re: SQL SERVER migration to PostgreSql
  In-Reply-To: <53157133-cdcd-08f4-cd04-6b94ac74ab57@gmx.net>
  References: <CALcdmyTQjKcKfQBBrYJgq_2h59BvSTT3yACC-mYMYcbReZ2yHw@mail.gmail.com> <53157133-cdcd-08f4-cd04-6b94ac74ab57@gmx.net>

* 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