All Questions
Tagged with postgresql-9.2 functions
5 questions
4
votes
2
answers
10k
views
Function execute query, manipulates result and then return the same result
I need a function that does something like this pseudocode:
function get_data() RETURN SET OF something... as
BEGIN
myResultSet = select id, some_other_column from ...... limit 20000;
update ...
1
vote
1
answer
1k
views
Function quote_nullable(timestamp without time zone) is not unique
When I run this query on "enterprisedb 9.2", it raises an error:
select quote_nullable(to_date('09-02-2014 ','dd-MM-yyyy'))::date;
Error:
LINE 1: select quote_nullable(to_date('09-02-2014 ','dd-MM-...
6
votes
1
answer
299
views
Is Postgres ignoring my function cost annotation?
Why does this:
create or replace function dummy() returns double precision as $$
SELECT random() $$
LANGUAGE SQL
COST 777;
explain select dummy();
return this:
Result (cost=0.00..0.01 rows=1 width=...
15
votes
2
answers
31k
views
Postgresql function to create table
I want to create a function in order to create a table with a specific structure pasing part of the name of the table as an argument so the name of the table is t_ . Similar to this:
CREATE OR ...
2
votes
2
answers
8k
views
Recursive query using plpgsql
I'm trying to write a plpgsql function that recursively returns a set of columns from records in a tree structure.
I have a data table and a table to link the data together:
DATATABLE
-----------
id ...