I've two functions,
I've two functions,
CREATE OR REPLACE FUNCTION function_a(input varchar) RETURNS setof integer AS $$ BEGIN RETURN QUERY SELECT somecolumn FROM some_things WHERE a_column = input; END; $$ LANGUAGE PLpgSQL;
CREATE OR REPLACE FUNCTION function_b(inputs varchar) RETURNS setof integer AS $$ DECLARE input varchar; result integer; BEGIN FOREACH input IN ARRAY inputs LOOP result := result || ARRAY[function_a(input)]; END LOOP; END; $$ LANGUAGE PLpgSQL;
I am running it like,
SELECT function_b(ARRAY['a', 'b']);
ERROR: query "SELECT result || ARRAY[function_a(input)]" returned more than one row CONTEXT: PL/pgSQL function function_b(character varying) line 7 at assignment
All I want to do is to run a function over an array. I've always used scripting languages like Ruby to do this kind of stuff instead of using SQL, but I'm trying to learn SQL as it is much faster to get results on the db console itself. I wish it wasn't so frustrating.
Compare PgBouncer vs. Pgpool-II to see which PostgreSQL connection pooler offers the best features, and analyze throughput (TPS) in a performance benchmark.
PostgreSQL Tutorial - Learn PostgreSQL Database from Scratch. Learn how to use PostgreSQL in this full course. PostgreSQL is a general purpose and object-relational database management system. It is the most advanced open source database system widely used to build back-end systems. What is a Database? What is SQL And Relational Database? What is PostreSQL AKA Postrgres? PostgreSQL Installation. How to Create Database.
In this video, you'll see the difference between postgresql.conf and postgresql.auto.conf
Learning PostgreSQL which is in demand now more than ever will certainly help you climb up the ladder of success. Explore the benefits of attending the PostgreSQL Training program.Now it plays a key role in many integrated data centers across the globe.
ScaleGrid announces support for their fully managed hosting plans on DigitalOcean for MySQL, PostgreSQL and Redis™. See how developers can improve performance. MySQL and PostgreSQL are the top two open source relational databases in the world, and Redis is the top key-value database