pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Shaozhong SHI <shishaozhong@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Can we use sql language to create a function in Postgres?
Date: Wed, 5 Jan 2022 12:12:59 +0100
Message-ID: <20220105111258.GA18163@depesz.com> (raw)
In-Reply-To: <CA+i5JwaqmXc1KWVORo0xpSO0wb8tMfrFEojxV08gnR6Jb5FLyw@mail.gmail.com>
References: <CA+i5JwaqmXc1KWVORo0xpSO0wb8tMfrFEojxV08gnR6Jb5FLyw@mail.gmail.com>

On Wed, Jan 05, 2022 at 11:04:34AM +0000, Shaozhong SHI wrote:
> I was given an Oracle script.  Can we use sql language to create a function
> in Postgres?

Sure:

create function z() returns int4 language sql as $$
select 123;
$$;

depesz





view thread (8+ messages)  latest in thread

Message-ID: <20220105111258.GA18163@depesz.com>
Permalink:  ../20220105111258.GA18163@depesz.com/
Also on:    postgresql.org/message-id/20220105111258.GA18163@depesz.com

 · 

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: depesz@depesz.com, shishaozhong@gmail.com
  Subject: Re: Can we use sql language to create a function in Postgres?
  In-Reply-To: <20220105111258.GA18163@depesz.com>
  References: <CA+i5JwaqmXc1KWVORo0xpSO0wb8tMfrFEojxV08gnR6Jb5FLyw@mail.gmail.com> <20220105111258.GA18163@depesz.com>

* 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