Tag Info

New answers tagged

3

But why the recompile didn't help? Using OPTION (RECOMPILE) is not magic. It does often produce a better-performing execution plan (at the cost of a full compilation each time) because the query is compiled each time for the specific values of any parameters at the time, and also enables parameter embedding, which may produce further benefits. ...


0

I got these two examples to work from the command line: sqlcmd -S .\sql2014 -E -Q "EXEC tempdb.[dbo].[_testProcedure] $(first_date), $(last_date)" -v first_date = '30/09/2015' last_date = '31/12/2015' GO sqlcmd -S .\sql2014 -E -i "d:\temp\temp.sql" -v first_date = '30/09/2015' last_date = '31/12/2015' If you are using the -Q switch to pass in a query, ...


1

What you see is obviously a display bug in the current pgAdmin 1.20. I could reproduce it. You must be aware that the code you see is re-engineered from system table entries. If you look up your function in the system catalogs directly, you'll find that your the return type has been registered properly (at least it works for me in pg 9.4): SELECT ...


8

According to the docs PL/pgSQL Under the Hood, you can use the configuration parameter plpgsql.variable_conflict, either before creating the function or in the start of the function definition, declaring how you want such conflicts to be resolved (the 3 possible values are error (the default), use_variable and use_column): CREATE OR REPLACE FUNCTION ...



Top 50 recent answers are included