Re: [GENERAL] Cast SRF returning record to a table type?

2015-04-20 Thread Merlin Moncure
On Sat, Apr 18, 2015 at 5:37 PM, Jim Nasby jim.na...@bluetreble.com wrote: On 4/18/15 12:47 AM, David G. Johnston wrote: If you could find a way to pass a value of type some_table into the function - instead of the name/text 'some_table‘ - you could possibly use polymorphic

Re: [GENERAL] Cast SRF returning record to a table type?

2015-04-20 Thread David G. Johnston
On Mon, Apr 20, 2015 at 7:57 AM, Merlin Moncure mmonc...@gmail.com wrote: On Sat, Apr 18, 2015 at 5:37 PM, Jim Nasby jim.na...@bluetreble.com wrote: On 4/18/15 12:47 AM, David G. Johnston wrote: If you could find a way to pass a value of type some_table into the function - instead of

Re: [GENERAL] Cast SRF returning record to a table type?

2015-04-20 Thread David G. Johnston
On Mon, Apr 20, 2015 at 9:40 AM, David G. Johnston david.g.johns...@gmail.com wrote: On Mon, Apr 20, 2015 at 7:57 AM, Merlin Moncure mmonc...@gmail.com wrote: On Sat, Apr 18, 2015 at 5:37 PM, Jim Nasby jim.na...@bluetreble.com wrote: On 4/18/15 12:47 AM, David G. Johnston wrote: If

Re: [GENERAL] Cast SRF returning record to a table type?

2015-04-20 Thread Merlin Moncure
On Mon, Apr 20, 2015 at 11:40 AM, David G. Johnston david.g.johns...@gmail.com wrote: On Mon, Apr 20, 2015 at 7:57 AM, Merlin Moncure mmonc...@gmail.com wrote: On Sat, Apr 18, 2015 at 5:37 PM, Jim Nasby jim.na...@bluetreble.com wrote: On 4/18/15 12:47 AM, David G. Johnston wrote: If you

Re: [GENERAL] Cast SRF returning record to a table type?

2015-04-18 Thread Jim Nasby
On 4/18/15 12:47 AM, David G. Johnston wrote: If you could find a way to pass a value of type some_table into the function - instead of the name/text 'some_table‘ - you could possibly use polymorphic pseudotypes...just imagining here... Oh, I didn't think about that. Maybe I'll try it. What

Re: [GENERAL] Cast SRF returning record to a table type?

2015-04-17 Thread Jim Nasby
On 4/17/15 7:39 PM, David G. Johnston wrote: On Friday, April 17, 2015, Jim Nasby jim.na...@bluetreble.com mailto:jim.na...@bluetreble.com wrote: I'm working on a function that will return a set of test data, for unit testing database stuff. It does a few things, but ultimately

Re: [GENERAL] Cast SRF returning record to a table type?

2015-04-17 Thread David G. Johnston
On Friday, April 17, 2015, Jim Nasby jim.na...@bluetreble.com wrote: On 4/17/15 7:39 PM, David G. Johnston wrote: On Friday, April 17, 2015, Jim Nasby jim.na...@bluetreble.com mailto:jim.na...@bluetreble.com wrote: I'm working on a function that will return a set of test data, for

[GENERAL] Cast SRF returning record to a table type?

2015-04-17 Thread Jim Nasby
I'm working on a function that will return a set of test data, for unit testing database stuff. It does a few things, but ultimately returns SETOF record that's essentially: RETURN QUERY EXECUTE 'SELECT * FROM ' || table_name; Because it's always going to return a real relation, I'd like to

Re: [GENERAL] Cast SRF returning record to a table type?

2015-04-17 Thread David G. Johnston
On Friday, April 17, 2015, Jim Nasby jim.na...@bluetreble.com wrote: I'm working on a function that will return a set of test data, for unit testing database stuff. It does a few things, but ultimately returns SETOF record that's essentially: RETURN QUERY EXECUTE 'SELECT * FROM ' ||