Top "Plpgsql" questions

PL/pgSQL is the default procedural language for PostgreSQL.

plpgsql function returns table(..)

I'm trying to get this plpgsql function to work: CREATE OR REPLACE FUNCTION outofdate(actualdate varchar) RETURNS TABLE(designacion varchar(255),…

postgresql plpgsql
SELECT .. INTO to create a table in PL/pgSQL

I want to use SELECT INTO to make a temporary table in one of my functions. SELECT INTO works in …

postgresql plpgsql postgresql-9.1
How to prevent 'invalid input syntax for type json' in Postgres, when records contain a mix of json or strings

I have a text column that contains JSON and also plan text. I want to convert it to JSON, and …

json postgresql plpgsql
PostgreSQL cannot begin/end transactions in PL/pgSQL

I am seeking clarification of how to ensure an atomic transaction in a plpgsql function, and where the isolation level …

transactions runtime-error plpgsql postgresql-9.2 read-committed
Can I make a plpgsql function return an integer without using a variable?

Something like this: CREATE OR REPLACE FUNCTION get(param_id integer) RETURNS integer AS $BODY$ BEGIN SELECT col1 FROM TABLE …

postgresql function variables parameters plpgsql
SELECT or PERFORM in a PL/pgSQL function

I have this function in my database: CREATE OR REPLACE FUNCTION "insertarNuevoArticulo"(nombrearticulo character varying, descripcion text, idtipo integer, idfamilia …

postgresql function plpgsql select-into
How to perform a select query in a DO block?

I want to port the below SQL code from MS SQL-Server to PostgreSQL. DECLARE @iStartYear integer DECLARE @iStartMonth integer DECLARE @…

sql postgresql plpgsql postgresql-9.1 generate-series
What are '$$' used for in PL/pgSQL

Being completely new to PL/pgSQL , what is the meaning of double dollar signs in this function: CREATE OR REPLACE …

postgresql plpgsql quotes dollar-sign dollar-quoting
Using pg_notify in PostgreSQL trigger function

I am attempting to issue a notification from a PostgreSQL trigger function. I can successfully use the NOTIFY command, but …

database postgresql triggers notifications plpgsql
Hashing a String to a Numeric Value in PostgreSQL

I need to Convert Strings stored in my Database to a Numeric value. Result can be Integer (preferred) or Bigint. …

postgresql plpgsql postgresql-8.4