Re: psql: add \create_function command

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: walther(at)technowledgy(dot)de, 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 20:04:55
Message-ID: 1028690.1706299495@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> but why you need to do in psql? - you can prepare content outside and
> execute just like echo "CREATE FUNCTION ...." | psql

The bit that's probably hard if you're trying to do this in a shell
script is "quote this data as a SQL string literal". psql can get
that right even in the face of encoding considerations,
standard_conforming_strings, etc. Not sure you can build a
fully bulletproof solution outside.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2024-01-26 20:13:39 Re: psql: add \create_function command
Previous Message Fabrízio de Royes Mello 2024-01-26 20:02:59 Re: Add minimal C example and SQL registration example for custom table access methods.