Joe Conway <[EMAIL PROTECTED]> writes:
> In 7.4 you could use an array. It would look like this:
Though note that 7.4 doesn't know how to optimize this form:
db=> explain select * from foo where foo_id in (1,2);
QUERY PLAN
Richard Huxton wrote:
On Wednesday 26 November 2003 15:40, Andreas Tille wrote:
I want to write a function of the following type
CREATE FUNCTION test ( )
RETURNS setof MyTable
AS
'SELECT * FROM MyTable WHERE id IN $1'
LANGUAGE 'SQL' ;
Not as you've done it. You c
On Thursday 27 November 2003 16:40, Andreas Tille wrote:
> On Thu, 27 Nov 2003, Joe Conway wrote:
> > Andreas Tille wrote:
> > > test=# select PLpgSQLDepartmentSalaries() ;
> >
> > This should be:
> > regression=# select * from PLpgSQLDepartmentSalaries();
> > departmentid | totalsalary
> > -
On Thu, 27 Nov 2003, Joe Conway wrote:
> Andreas Tille wrote:
> > test=# select PLpgSQLDepartmentSalaries() ;
>
> This should be:
> regression=# select * from PLpgSQLDepartmentSalaries();
> departmentid | totalsalary
> --+-
> 1 | 8
> 2
Andreas Tille wrote:
test=# select PLpgSQLDepartmentSalaries() ;
This should be:
regression=# select * from PLpgSQLDepartmentSalaries();
departmentid | totalsalary
--+-
1 | 8
2 | 6
(2 rows)
HTH,
Joe
---
On Wed, 26 Nov 2003, Richard Huxton wrote:
> Not as you've done it. You could pass in text "(1,2,3)", build your query and
> use EXECUTE to execute it.
This boils down the question to the problem which occured with
your promissing link below, because I need to use PL/pgSQL, right?
> Alternatively
On Wednesday 26 November 2003 15:40, Andreas Tille wrote:
> Hi,
>
> I want to write a function of the following type
>
>CREATE FUNCTION test ( )
> RETURNS setof MyTable
> AS
> 'SELECT * FROM MyTable WHERE id IN $1'
> LANGUAGE 'SQL' ;
Not as you've done it.
Hi,
I want to write a function of the following type
CREATE FUNCTION test ( )
RETURNS setof MyTable
AS
'SELECT * FROM MyTable WHERE id IN $1'
LANGUAGE 'SQL' ;
I was not able to find a reference whether this is possible and if yes
how to specify the argumen