Top "Plpgsql" questions

PL/pgSQL is the default procedural language for PostgreSQL.

PostgreSQL function or stored procedure that outputs multiple columns?

Here is what I ideally want. Imagine that I have a table with the row A. I want to do: …

postgresql stored-procedures plpgsql sql-function
FOR EACH STATEMENT trigger example

I've been looking at the documentation of postgresql triggers, but it seems to only show examples for row-level triggers, but …

postgresql plpgsql triggers
PostgreSQL parameterized Order By / Limit in table function

I have a sql function that does a simple sql select statement: CREATE OR REPLACE FUNCTION getStuff(param character varying) …

sql database postgresql dynamic-sql plpgsql
Return value from anonymous function postgresql

How to? For easy example. I have a simple function: DO LANGUAGE plpgsql $$ DECLARE BEGIN EXECUTE 'SELECT NOW()'; END $$; …

postgresql anonymous-function plpgsql
SELECT INTO with more than one attribution

This instruction works: SELECT INTO unsolvedNodes array_agg(DISTINCT idDestination) FROM road WHERE idOrigin = ANY(solvedNodes) AND NOT (idDestination = ANY(…

sql postgresql variable-assignment plpgsql
How can I execute pl/pgsql code without creating a function?

With SQL Server, I can execute code ad hoc T-SQL code with full procedural logic through SQL Server Management Studio, …

postgresql plpgsql
Return dynamic table with unknown columns from PL/pgSQL function

I need to create a function that checks on a given table if the infowindow field exists. If it exists …

postgresql polymorphism plpgsql dynamic-sql return-type
drop all tables sharing the same prefix in postgres

I would like to delete all tables sharing the same prefix ('supenh_agk') from the same database, using one sql …

sql postgresql plpgsql dynamic-sql
It could refer to either a PL/pgSQL variable or a table column

I have a function in pgsql CREATE OR REPLACE FUNCTION core.date_bs_from_ad(date_in_ad date) RETURNS …

postgresql plpgsql pgadmin
set-valued function called in context that cannot accept a set

I am receiving the error: set-valued function called in context that cannot accept a set when executing this function at …

postgresql plpgsql set-returning-functions