>
>
> I did it too. It is not too hard - there was not a agreement on syntax.
>
> can be nice some like CTE
>
> WITH PROCEDURE x(a int, b int) AS ... $$ SELECT x(10);
>
I've seen "WITH function" syntax in Oracle (here's an example:
>> What you don't see here is that you're using your psql process's
>> available open file handles as a stack, and when you hit that limit psql
>> will fail. If you remove that limit, then you get a bit further before psql
>> segfaults on you. I think I got ~2700 files deep before that happened.
As of v11, DO blocks can do transactions. I think this will meet your needs.
A loop that starts at point X in the code and terminates at point Y has to
know how to jump back in the file (if there even is a file!) to point X and
re-interpret commands as it makes it's way back through the "file"
>
> It would be about as hard to memorize \describe-schemas as it is to
> memorize \dn:
> You'd have to remember that it is "-" and not "_", that it is "describe",
> not "desc"
> and that it is "schemas", not "schema".
>
You wouldn't memorize them. You'd discover them with tab completion.
Type
> > CREATE ROUTINE MAPPING local_routine_name
> > > FOR (FUNCTION | PROCEDURE) remote_routine_name ( [ [ argmode ] [
> argname ]
> > > argtype [ { DEFAULT | = } default_expr ] [, ...] ] )
> > >[ RETURNS rettype
> > > | RETURNS TABLE ( column_name column_type [, ...] ) ]
> > > SERVER
>
>
>
> It goes on from there, but I think there's a reasonable interpretation
> of this which allows us to use the same syntax as CREATE
> (FUNCTION|PROCEDURE), apart from the body, e.g.:
>
> CREATE ROUTINE MAPPING local_routine_name
> FOR (FUNCTION | PROCEDURE) remote_routine_name ( [ [ argmode
>
> PostgreSQL allows function overloading, which means that there can be
> multiple functions with same name differing in argument types. So, the
> syntax has to include the input parameters or their types at least.
>
"local_routine_name" and "remote_routine_spec" were my own paraphrasings of
A few months ago, I was researching ways for formalizing calling functions
on one postgres instance from another. RPC, basically. In doing so, I
stumbled across an obscure part of the the SQL Standard called ROUTINE
MAPPING, which is exactly what I'm looking for.
The syntax specified is, roughly:
301 - 308 of 308 matches
Mail list logo