On Wed, Jun 13, 2012 at 12:25 PM, Tom Lane wrote:
> Merlin Moncure writes:
>> The CREATE VIEW statement does not allow parameterized arguments
>> apparently.
>
> Well, no. What would it mean? The view is likely to outlast the
> existence of the function argument.
right -- it's quite sensible e
Merlin Moncure writes:
> The CREATE VIEW statement does not allow parameterized arguments
> apparently.
Well, no. What would it mean? The view is likely to outlast the
existence of the function argument.
regards, tom lane
--
Sent via pgsql-general mailing list (pgsql-
On Wed, Jun 13, 2012 at 12:31 AM, Divyaprakash Y
wrote:
>
> Hi,
>
>
>
> Is the following postgres function correct?
>
>
>
> CREATE OR REPLACE FUNCTION "MyFun"("IdArgs" INTEGER)
>
> RETURNS SETOF "B" AS
>
> $BODY$
>
> CREATE VIEW "A" AS SELECT * FROM "B" WHERE "Id"
rom the named parameter?
>> 2. I am able to use positional parameters in sql functions as in
>> PL/PgSQL function. This is the only case [create view] in which I could
>> not succeed.
>> 3. Which would be faster..temp table or view?
>>
>>
>> -Original Mess
y case [create view] in which I could
> not succeed.
> 3. Which would be faster..temp table or view?
>
>
> -Original Message-
> From: Craig Ringer [mailto:ring...@ringerc.id.au]
> Sent: Wednesday, June 13, 2012 12:39 PM
> To: Divyaprakash Y
> Cc: pgsql-general@postgre
13, 2012 12:39 PM
To: Divyaprakash Y
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Create view is not accepting the parameter in
postgres functions
On 06/13/2012 01:31 PM, Divyaprakash Y wrote:
> CREATE OR REPLACE FUNCTION "MyFun"("IdArgs" INTEGER)
>
Chris Travers, 13.06.2012 09:16:
If this ever changes, I would certainly hope that the SQL language
functions would first be given named argument support.
This is coming in 9.2
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http
On Wed, Jun 13, 2012 at 12:06 AM, Alban Hertroys wrote:
> On 13 Jun 2012, at 7:31, Divyaprakash Y wrote:
>
>> Hi,
>>
>> Is the following postgres function correct?
>>
>> CREATE OR REPLACE FUNCTION "MyFun"("IdArgs" INTEGER)
>
> Named parameters ^^^
>
>
>> CREATE V
On 06/13/2012 03:06 PM, Alban Hertroys wrote:
> Named parameters ^^^
Positional parameters -^^
You can't mix those. I don't think SQL functions support named parameters, so
using positional parameters throughout would be the solut
On 06/13/2012 01:31 PM, Divyaprakash Y wrote:
CREATE OR REPLACE FUNCTION "MyFun"("IdArgs" INTEGER)
RETURNS SETOF "B" AS
$BODY$
CREATE VIEW "A" AS SELECT * FROM "B" WHERE "Id" = $1;
SELECT * FROM "B";
Executing “select * from "MyFun"(1) “ th
On 13 Jun 2012, at 7:31, Divyaprakash Y wrote:
> Hi,
>
> Is the following postgres function correct?
>
> CREATE OR REPLACE FUNCTION "MyFun"("IdArgs" INTEGER)
Named parameters ^^^
>CREATE VIEW "A" AS SELECT * FROM "B" WHERE "Id" = $1;
Positional parameter
Hi,
Is the following postgres function correct?
CREATE OR REPLACE FUNCTION "MyFun"("IdArgs" INTEGER)
RETURNS SETOF "B" AS
$BODY$
CREATE VIEW "A" AS SELECT * FROM "B" WHERE "Id" = $1;
SELECT * FROM "B";
$BODY$
LANGUAGE 'sql' VOLATILE
12 matches
Mail list logo