Re: [GENERAL] how to pass tablename to a function

2014-09-05 Thread Igor Neyman
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of alecinvan Sent: Thursday, September 04, 2014 6:28 PM To: pgsql-general@postgresql.org Subject: [GENERAL] how to pass tablename to a function Hi, All I like to pass

[GENERAL] how to pass tablename to a function

2014-09-04 Thread A L .
Hi, All I like to pass the tablename to function but not using execute clause, here is my script CREATE OR REPLACE FUNCTION functions.pgsql_event_unpack_batch(IN _tbl text, IN jobid bigint, IN jobtime timestamp with time zone, IN startid bigint, IN stopid bigint) RETURNS TABLE(events

Re: [GENERAL] how to pass tablename to a function

2014-09-04 Thread Adrian Klaver
On 09/04/2014 04:42 PM, A L. wrote: Hi, All I like to pass the tablename to function but not using execute clause, here is my script CREATE OR REPLACE FUNCTION functions.pgsql_event_unpack_batch(IN _tbl text, IN jobid bigint, IN jobtime timestamp with time zone, IN startid bigint, IN stopid

Re: [GENERAL] how to pass tablename to a function

2014-09-04 Thread David G Johnston
alecinvan wrote I like to pass the tablename to function but not using execute clause, here is my script [...] I want to pass the _tbl to the select query integrated in the unpacking(), how can I make it? There is no way to perform a query with an unknown, at design time, identifier

[GENERAL] how to pass tablename to a function

2014-09-04 Thread alecinvan
Hi, All I like to pass the tablename to function but not using execute clause, here is my script CREATE OR REPLACE FUNCTION functions.pgsql_event_unpack_batch(IN _tbl text, IN jobid bigint, IN jobtime timestamp with time zone, IN startid bigint, IN stopid bigint) RETURNS TABLE(events bigint,