[SQL] passing parameters between forms

2001-04-02 Thread Sharmad Naik
Hi, I have created a database with following structure CREATE TABLE member( mem_id INT, name TEXT, age INT); the first page is as follows : This is the first page

Re: [SQL] Trigger Function and Html Output

2001-04-02 Thread Richard Huxton
From: "Stef Telford" <[EMAIL PROTECTED]> > Richard Huxton wrote: > > Each select works on a view, rather than hardcode the view into the > perl CGI, i would rather have the table header/column titles returned > as the first item as text/html (i know about the func procedure to get the > table_att

[SQL] Calling functions inside a function: behavior

2001-04-02 Thread Edipo Elder Fernandes de Melo
Hi all, I wrote a function that call another functions, like this: FUNCTION (...) AS '(...)BEGIN PERFORM FUNCTION1(); PERFORM FUNCTION2(); (...) END;' LANGUAGE 'PLPGSQL'; The problem is that takes a long time to execute (I stoped after three days executing). To see

Re: [SQL] passing parameters between forms

2001-04-02 Thread Richard Huxton
From: "Sharmad Naik" <[EMAIL PROTECTED]> > Hi, > I have created a database with following structure > > CREATE TABLE member( > mem_id INT, > name TEXT, > age INT); > > the first page is as foll

Re: Calling Java from psql (was Re: [SQL] requesting help)

2001-04-02 Thread Peter T Mount
Quoting A James Lewis <[EMAIL PROTECTED]>: > > Before I go investigating this, is it possible to trigger an arbitrary > program from the SQL, say a shell script? In theory yes, but I'd suspect not a good idea. Even more so with java, as the JVM's startup time is pretty big. Having it talk to

[SQL] Error:TypeCreate: type links already defined

2001-04-02 Thread Najm Hashmi
Hi all, I have posted my question since last Thurday and noone has answered it yet. My problems is that I droped a table using pgaccess from pg_class. Now If I try to create that table I get the following error: TypeCreate: type links already defined. Could some one help me out here. Regards

Re: [SQL] Calling functions inside a function: behavior

2001-04-02 Thread Roberto Mello
On Mon, Apr 02, 2001 at 08:50:32AM -0300, Edipo Elder Fernandes de Melo wrote: > > and, for my surprise, it take minutes to run. I read the documentation > and I didn't found any coment abou this behavior. Can anyone explain this? Cool, one more Brazilian in the list :) I

Re: [SQL] Error:TypeCreate: type links already defined

2001-04-02 Thread Richard Huxton
From: "Najm Hashmi" <[EMAIL PROTECTED]> > Hi all, I have posted my question since last Thurday and noone has answered it > yet. My problems is that I droped a table using pgaccess from pg_class. Now > If I try to create that table I get the following error: TypeCreate: type > links already def

Fwd: [SQL] Calling functions inside a function: behavior

2001-04-02 Thread Josh Berkus
Edipo, > FUNCTION (...) AS '(...)BEGIN > PERFORM FUNCTION1(); > PERFORM FUNCTION2(); > (...) > END;' LANGUAGE 'PLPGSQL'; I'm not sure about that syntax (PERFORM). I ususally set my functions equal to a value ('remote_result := Function1(paramater)'). This has the added advantage of lett

[SQL] very very slow .....

2001-04-02 Thread J.Fernando Moyano
I have a system called "eisenor" running in 6.5 and it runs very well. I'have installed 7.0.2 at home and i'm working with it and "eisenor". Tables are created without problems, and functions too (except some minor changes related to date/time). Very complex queries execute without error ... b

Re: Fwd: [SQL] Calling functions inside a function: behavior

2001-04-02 Thread edipoelder
Em 02 Apr 2001, Josh Berkus escreveu: >BEGIN WORK; >COMMIT WORK; In time... I think that could be great if postgresql implement a commit inside functions. Abracos, Edipo Elder [[EMAIL PROTECTED]] _ Oi! VocĂȘ quer u

[SQL] using for rec inside a function: behavior very slow

2001-04-02 Thread Jie Liang
I have a function: CREATE FUNCTION hasdup(text) RETURNS int4 AS ' declare v_id int4; rat1 text; rat2 text; v_urltext; rec record; begin select id into v_id from urlinfo where url = $1; if NOT FOUND then return -1; end

[SQL] select statement inside a function: behavior bad

2001-04-02 Thread Jie Liang
I tested select statement inside sql and plpgsql function, very slow CREATE FUNCTION geturllike(text) RETURNS SETOF text AS ' SELECT url as url FROM urlinfo WHERE url LIKE $1; 'LANGUAGE 'sql'; CREATE FUNCTION hasdup(text) RETURNS int4 AS ' declare v_id int4; rat1 text;

Re: [SQL] using for rec inside a function: behavior very slow

2001-04-02 Thread Tom Lane
Jie Liang <[EMAIL PROTECTED]> writes: > v_url:= $1||''%''; > for rec in select id,url from urlinfo where url like v_url order by > url loop [ is slow ] LIKE index optimization doesn't happen if the LIKE pattern is a variable when the plan is created. In 7.1 you can wor

Re: [SQL] very very slow .....

2001-04-02 Thread Tom Lane
"J.Fernando Moyano" <[EMAIL PROTECTED]> writes: > The execution time of certain queries is 20 or 30 times longer in 7.0.2 that > 6.5. (20 or 30 seconds where before it was 1 or 2 seconds !!!) Have you done a VACUUM ANALYZE? Other than that, there's no generic advice. You'll need to provide som

[SQL] Appropriate indices to create for these queries

2001-04-02 Thread Gerald Gutierrez
I've been looking into indices and which ones to create and I'm getting myself a little confused. The "PostgreSQL Introduction and Concepts" book didn't help very much. I wonder if a kind soul can give me some tips. SELECT * FROM T1 WHERE a=1 and b='hello'; Is the appropriate index for this que

[SQL] passing null parameter to plpgsq functions

2001-04-02 Thread Picard, Cyril
Hello I wrote a plpgsql function with few parameters ; when I call the function, some of the parameters can be null. In this case, all the parameters are considered as null in the function's body ! is it a feature ? how can I work around this ? Example : CREATE FUNCTION foo(text, text) RETURNS b