All Questions
78 questions
0
votes
1
answer
36
views
Execute function from procedure, the name of function stored in table column
Table condition: This table contains function name in the column fn_name
create table condition(id int,name varchar(50),fn_name varchar(50));
Data:
insert into condition values(1,'check id','...
0
votes
1
answer
303
views
PostgreSQL Trigger Procedures Asynchronously From Main Overall Procedure
I am currently working on building a pipeline using a PostgreSQL DB hosted by AWS RDS. In my pipeline, I have a stored procedure in PostgreSQL that is triggered by cron and used to executed other ...
0
votes
1
answer
97
views
Language plpgsql not supported for CREATE FUNCTION
I have created a function in redshift. But it is throwing an error of language plpgsql not supported for create function. How do I resolve this?
Expected other languages but didn't work. Also I tried ...
0
votes
1
answer
351
views
Cannot drop a function in Redshift
For some reason, I cannot drop a function in Redshift via TablePlus.
The function clearly exists which I can see in the UI, I tried both:
manually right clicking the delete on that function
DROP ...
0
votes
1
answer
109
views
How to return a multiple tables result in stored procedure or function in Postgresql?
How to return a multiple tables result in stored procedure or function in PostgreSQL?
I need to return multiple tables result set in PostgreSQL and fetch the details in Nest.JS Application, Can any ...
0
votes
0
answers
19
views
How to use a function as a parameter to a stored procedure in postgres?
I created a function in Postgres that returns a table with a varying number of rows.
NewProducts() is another function.
CREATE FUNCTION RetrieveRebates(customerID INT)
RETURNS TABLE(
...
0
votes
1
answer
288
views
PostgreSQL exponentially weighted moving average
As stated in this blog post,
https://corporatefinanceinstitute.com/resources/knowledge/trading-investing/exponentially-weighted-moving-average-ewma/
It looks like you can calculate a EWMA. Now there ...
-1
votes
1
answer
2k
views
update in a function sql in dbeaver/postgres
I have to update a field in a table with concat() and I'm thinking to use a function with an update sql. I also want to have a rollback if update doesnt' work.
I have this function but it just works ...
0
votes
1
answer
228
views
How do I select the comment on a Postgres stored procedure
Suppose I have a procedure, call it my_procedure:
CREATE OR REPLACE my_procedure(X INT);
Then I write:
COMMENT ON my_procedure IS 'My comment'
How do I then use a SELECT statement to retrieve that ...
0
votes
2
answers
1k
views
Python3 print entire output from 'raise notice' from stored function in Postgres?
I'm trying to generate documentation from database from stored functions from postgres with python - all tables and columns contains comments. To do this I found possibility how to print from function ...
0
votes
2
answers
209
views
Postgres stored procedure(function) confusion
I'm pretty new to Postgres and SQL as a whole and could use a bit of help with a function here.
I have this table:
CREATE TABLE car_rentals(
plate varchar(10) NOT NULL,
start_date date ...
0
votes
1
answer
68
views
whats wrong with this postgresql function
I made this postgresql function but im getting this error:
ERROR: no existe el cursor «cur_1»
CONTEXT: función PL/pgSQL ganancias(text) en la línea 11 en FETCH
SQL state: 34000
CREATE OR REPLACE ...
2
votes
1
answer
1k
views
In Postgres, how do I re-validate ("type-check") functions and procedures after tables are altered?
In Postgres, functions are validated on creation: for instance, accessing a column that doesn't exist results in a helpful error, even before the function is run. But altering a table doesn't verify ...
0
votes
0
answers
22
views
How do I get multiple rows returned to java from a postgresql function,,, NOT mySQL [duplicate]
I am trying to get 3 fields from 1 table using a function:
CREATE OR REPLACE FUNCTION sp_search_test_ui_test_prog_revision(dev TEXT)
RETURNS table (dev_op_test_id BIGINT, test_program_name TEXT, ...
1
vote
1
answer
2k
views
Execute Postgresql Stored Procedure in PySpark
I am working on Pyspark in AWS Glue
I want to execute Stored Procedure/Function on Postgresql Database
Is it possible?
What is the syntax? Is there any special package needed?
Ankur