Re: psql: add \create_function command

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: walther(at)technowledgy(dot)de
Cc: Steve Chavez <steve(at)supabase(dot)io>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql: add \create_function command
Date: 2024-01-26 19:50:22
Message-ID: CAFj8pRAsc000HPXVPozNJSAftMnShG_YwXyvGbEHGRq0RhvZTw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pá 26. 1. 2024 v 20:45 odesílatel <walther(at)technowledgy(dot)de> napsal:

> Pavel Stehule:
> > looks a little bit obscure - why do you need to do it from psql? And how
> > frequently do you do it?
>
> I store all my SQL code in git and use "psql -e" to "bundle" it into an
> extension, which is then deployed to production.
>

this is good way

>
> The code is spread over many files, which include other files via \ir.
> Sometimes you need to include other types of files, though - for example
> code in other languages as Steve mentioned, but I have also had cases
> for yaml files, markdown templates, even binary assets which should
> still be considered "code" and not data.
>
> So anything in that direction would help.
>

but why you need to do in psql? - you can prepare content outside and
execute just like echo "CREATE FUNCTION ...." | psql

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-01-26 19:52:05 Re: psql: add \create_function command
Previous Message David G. Johnston 2024-01-26 19:49:29 Re: psql: add \create_function command