Ruben Gouveia escribió:
> No matter how many times i try, i can't seem to get the write amount of '
> marks around the date parameters in my v_where declaration. What am i doing
> wrong here?
Apparently you're not aware that you can nest the $$ quote marks. You
could just use $a$ to assign to the
No matter how many times i try, i can't seem to get the write amount of '
marks around the date parameters in my v_where declaration. What am i doing
wrong here?
v_stmt should look like this if done correctly:
select count(distinct m.id)
from (select id, greatest(max(last_p),max(last_b)) as date_
Emi Lu написа:
> Good morning,
>
> Is there a way that I can pass "pwd" to pg_dump command please?
>
>
> I tried to pg_dump in java, but do not know how to pass password.
Recommended method -
http://www.postgresql.org/docs/current/static/libpq-pgpass.html
Not recommended method -
http://www.p
Good morning,
Is there a way that I can pass "pwd" to pg_dump command please?
I tried to pg_dump in java, but do not know how to pass password.
Thanks a lot!
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpre
It appears there is already a greatest() and least() function available...so
no need for creating this function.
On Tue, Sep 9, 2008 at 11:16 AM, Ruben Gouveia <[EMAIL PROTECTED]> wrote:
> thanks pavel...that worked! I like the simplicity of your first suggestion.
>
>
> On Tue, Sep 9, 2008 at 11:
thanks pavel...that worked! I like the simplicity of your first suggestion.
On Tue, Sep 9, 2008 at 11:05 AM, Pavel Stehule <[EMAIL PROTECTED]>wrote:
> try
>
> create or replace function fcn_max_dt(p_dt timestamp without time zone,
> p_dt2 timestamp without ti
Scott Marlowe wrote:
> On Tue, Sep 9, 2008 at 11:55 AM, Ruben Gouveia <[EMAIL PROTECTED]> wrote:
>> Does this syntax look correct? Can anyone think of a better way to write
>> this?
>>
>> This function will accept two timestamp parameters and determine the highest
>> of the two?
[snip]
> It certain
That's not what I copied and pasted in. Leave out the
v_dt := p_dt;
> v_dt2 := p_dt2;
lines and turn the v into p in the rest of the function.
On Tue, Sep 9, 2008 at 12:11 PM, Ruben Gouveia <[EMAIL PROTECTED]> wrote:
> When i tried that, i got the following error:
>
> create or replace fu
try
create or replace function fcn_max_dt(p_dt timestamp without time zone,
p_dt2 timestamp without time zone)
returns imestamp without time zone as $$
select greatest($1,$2);
$$ language sql;
or
begin
return greatest(p_dt, p_dt2);
end;
$$ language plpgsq
When i tried that, i got the following error:
create or replace function fcn_max_dt(p_dt timestamp without time zone,
p_dt2 timestamp without time zone)
returns timestamp without time zone as $$
BEGIN
v_dt := p_dt;
v_dt2 := p_dt2;
if v_dt >= v_
On Tue, Sep 9, 2008 at 11:55 AM, Ruben Gouveia <[EMAIL PROTECTED]> wrote:
> Does this syntax look correct? Can anyone think of a better way to write
> this?
>
> This function will accept two timestamp parameters and determine the highest
> of the two?
>
> create or replace function fcn_max_dt(p_dt
Does this syntax look correct? Can anyone think of a better way to write
this?
This function will accept two timestamp parameters and determine the highest
of the two?
create or replace function fcn_max_dt(p_dt timestamp without time zone,
p_dt2 timestamp wit
--- On Mon, 9/8/08, Ruben Gouveia <[EMAIL PROTECTED]> wrote:
> From: Ruben Gouveia <[EMAIL PROTECTED]>
> Subject: [SQL] PL/pgSQL function syntax question?
> To: "pgsql-sql"
> Date: Monday, September 8, 2008, 9:40 PM
> i get the following error when i try and create the
> following function:
>
13 matches
Mail list logo