skip to Main Content

Postgresql – plpgsql does not handle exception

i have a table called stock_holdings which does not have data related to account_id and ticker_cd (actually it is empty): select qty,total_amount from stock_holdings where account_id=1 and ticker_cd='XYZ'; qty | total_amount -----+-------------- (0 rows) however when i run the following…

VIEW QUESTION

Macros/Metaprogramming in postgresql queries

In the case that I have the same example data as in this question and additionally declare the following two functions: CREATE OR REPLACE FUNCTION example.markout_666_example_666_price_table_666_price(_symbol text, _time_of timestamptz, _start interval, _duration interval) RETURNS float8 LANGUAGE sql STABLE STRICT PARALLEL…

VIEW QUESTION

Postgresql – stateless vs stateful queries

I am working in supabase postgres and wrote multiple postgres functions DROP FUNCTION IF EXISTS setup_auth_user; CREATE OR REPLACE FUNCTION setup_auth_user( email_value TEXT, name_value TEXT, password_value TEXT, wallet_address_value TEXT, private_key_value TEXT ) RETURNS user_info AS $$ DECLARE updated_user_info user_info; BEGIN…

VIEW QUESTION
Back To Top
Search