Re: Table as argument in postgres function

2019-05-21 Thread Pavel Stehule
út 21. 5. 2019 v 9:04 odesílatel Corey Huinker napsal: > >>> Is there anything preventing us from having the planner resolve object >>> names from strings? >>> >> >> The basic problem is fact so when you use PREPARE, EXECUTE protocol, you >> has not parameters in planning time. >> > > I agree tha

Re: Table as argument in postgres function

2019-05-21 Thread Corey Huinker
> > >> Is there anything preventing us from having the planner resolve object >> names from strings? >> > > The basic problem is fact so when you use PREPARE, EXECUTE protocol, you > has not parameters in planning time. > I agree that it defeats PREPARE as it is currently implemented with PQprepar

Re: Table as argument in postgres function

2019-05-19 Thread Pavel Stehule
po 20. 5. 2019 v 7:56 odesílatel Corey Huinker napsal: > >> You can pass table name as text or table object id as regclass type. >> >> inside procedure you should to use dynamic sql - execute statement. >> Generally you cannot to use a variable as table or column name ever. >> >> Dynamic SQL is o

Re: Table as argument in postgres function

2019-05-19 Thread Corey Huinker
> > > You can pass table name as text or table object id as regclass type. > > inside procedure you should to use dynamic sql - execute statement. > Generally you cannot to use a variable as table or column name ever. > > Dynamic SQL is other mechanism - attention on SQL injection. > On this note,

Re: Table as argument in postgres function

2019-05-19 Thread Pavel Stehule
Hi ne 19. 5. 2019 v 18:00 odesílatel RAJIN RAJ K napsal: > Hi, > > I'm trying to convert SAP Hana procedures in PG and i'm not able to handle > below scenario in Postgres 11 > > Scenario: I want to pass a table (Multiple rows) to function and use it > inside as a temp table. > > Sample Code: > >

Table as argument in postgres function

2019-05-19 Thread RAJIN RAJ K
Hi, I'm trying to convert SAP Hana procedures in PG and i'm not able to handle below scenario in Postgres 11 Scenario: I want to pass a table (Multiple rows) to function and use it inside as a temp table. Sample Code: create a table tbl_id (id int, name character varying (10)); insert few rows

Table as argument in postgres function

2019-05-17 Thread RAJIN RAJ K
I'm trying to convert SAP Hana procedures in PG and i'm not able to handle below scenario in Postgres 11 Scenario: I want to pass a table (Multiple rows) to function and use it inside as a temp table. Sample Code: create a table tbl_id (id int, name character varying (10)); insert few rows to tb