ill be faster like a single function call (just the
max function needs only 141ms) ...
Thanks for your Help
Christian
Original-Nachricht
> Datum: Tue, 22 Jul 2008 11:06:07 +0200
> Von: "A. Kretschmer" <[EMAIL PROTECTED]>
> An: pgsql-sql@postgresql
Hello
Assume I have a table like
create table foo (
id serial,
date foodate,
primary key(id)
);
with 2 tupls
insert into foo(foodate) values('2008-07-07'); --id = 1
insert into foo(foodate) values('2008-07-04'); -- id = 2
What I need is to select the nearest tupl by a given date and I do n
Thanks!
Chris
Original-Nachricht
> Datum: Fri, 9 May 2008 23:14:44 +1000
> Von: imad <[EMAIL PROTECTED]>
> An: "Christian Kindler" <[EMAIL PROTECTED]>
> Betreff: Re: [SQL] execute plpgsl like "normal" sql
> Anonymous blocks are n
Hi
Is there a possibility to execute pl/pgsql syntax like normal sql simmilar to
sql+ from oracle?
The question is: if I want to execute soemthing like this:
--File foo.sql:
begin
for id in select id from mytable loop
update myothertable set payed = true where fk_id = id;
end loop;
end;
Do
hi
in this case you have to use execute:
>> select $1,count(*) from $2 group by $1 order by $1;
execute into myResultSet 'select ' || $1 || ' from ' || $2 || ' group by ' ||
$1 || ' order by ' || $2;
see plpgsql docs for detailed information
christian
On Sun, February 3, 2008 19:5
kind of auditing. Maybe. I
> didn't use it. And I use Postgres five years.
>
> Pavel
>>
>>
>> Pavel Stehule wrote:
>> > Hello
>> >
>> > You cannot to access to values in statement trigger. Postgres doesn't
>> > support it.
>
idn't use it. And I use Postgres five years.
>
> Pavel
>>
>>
>> Pavel Stehule wrote:
>> > Hello
>> >
>> > You cannot to access to values in statement trigger. Postgres doesn't
>> > support it.
>> >
>> > Regar
Hi
Can anyone provide me a simple example of a statement-level trigger? Problem is
I do not know how to access the old.*, new.* values.
Thanks
Chris
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
--
Hi!
not quick mut works
select * from business b1
where b1.version_no = (SELECT max(version_no) FROM business b2.
where b2.idnode = b1.idnode
)
If you want to make this quiry faster du a regular join
select b1.*
from business b1,
(SELECT
Its really slow but what you can do is something like the following:
select count(a.*), b.* from foo.bar a,
(
select price from foo.bar order by time asc limit 1
union
select price from foo.bar order by time desc limit 1
) as b
group by b.price
... just do the "wheres" as you need ...
Chris
Hi!
Do something like this
http://fimi.cvs.sourceforge.net/fimi/database/defaults/indicators/myinttick2bar.sql?revision=1.3&view=markup
and replace the max / min calculation with a count calculation.
Cheers
Chris
On Wed, August 22, 2007 9:25 am, roopa perumalraja wrote:
> Hi all,
>
> I ha
t;Christian Kindler" <[EMAIL PROTECTED]>
CC: pgsql-sql@postgresql.org
Betreff: Re: [SQL] how to moce back in refcursor
> "Christian Kindler" <[EMAIL PROTECTED]> writes:
> >-- move -1 in cur1;
>
> plpgsql supports that in CVS HEAD (8.3-to-be) but not in
Yes and you could make it even more speedy with the use table partitioning.
http://www.postgresql.org/docs/8.1/interactive/ddl-partitioning.html
> select
> t1.domain_id as domain_id,
> t1.mta_id as mta_id,
> t1.run_id as run_id_1,
> t1.attribute1 as attribute1_1,
> t1.attribute
Hi
I have never worked with cursors but for now I have to step back on special
events to calculate a difference. So I have this sample code tested but I can
not "move" in my cursor. I have lokke at docs but this didn't help me. Can you
say how to declare my cursor to step back?
Thank You
Chris
Ohhh Yes!
Thanks al lot. Sometimes you can't see the wood for the trees.
Thanks!
Chris
Original-Nachricht
Datum: Fri, 10 Aug 2007 00:31:03 -0600
Von: Michael Fuhr <[EMAIL PROTECTED]>
An: Christian Kindler <[EMAIL PROTECTED]>
CC: "Penchalaiah P."
Sorry but this didn't help ...
Can not return next ... so I changed the returns as too but same effect as the
first function:
drop table foo;
create table foo(sirname text, name text);
insert into foo values ('Mueller', 'Marcus');
drop function getfoo(char(1));
create or replace function getfoo
Hi!
I have the Problem, that a function returns a refcursor and I am not able to
fetch them. I tried in several ways.
Can you please tell me how to get the cursor data.
Thanks
Chris
PS this is what I have:
create table foo(sirname text, name text);
insert into foo values ('Mueller', 'Marcus
do this via execute in a stored procedure - something like this (written on the
flow - untested!)
returns setof text
declare
my_record record;
my counter as bigint;
begin
for my_record in
select tablename from pg_tables where
schemaname = 'public'
loop
execute into counter
18 matches
Mail list logo