Re: [SQL] Few Queries

2002-08-14 Thread Sugandha Shah
Hi , No luck . Even with Select Into . Please if any body has faced similar problem and knows a solution. CREATE FUNCTION del_old_history() RETURNS int4 AS 'declare var_history_age_limit int4; set_time datetime; BEGIN select into var_history_age_limit history_age_limit from

Re: [SQL] Need Help for select

2002-08-14 Thread Masaru Sugawara
On Wed, 14 Aug 2002 09:10:53 +0200 Andre Schubert [EMAIL PROTECTED] wrote: The ride side as follows. Table d contains information about subitems. Table c holds information about subitems and items of type bar. Each subitem can have 0..n items bar selected. What i want is that a subitem is

Re: [SQL] parser: parse error at or near $1

2002-08-14 Thread Oliver Elphick
On Wed, 2002-08-14 at 13:26, Sugandha Shah wrote: Hi , I'm getting this error : Error occurred while executing PL/pgSQL function ins_schedule_status line 42 at SQL statement parser: parse error at or near $1 Unable to locate the cause. Please any hint or clue will be of great help.

Re: [SQL] Few Queries

2002-08-14 Thread Oliver Elphick
On Wed, 2002-08-14 at 13:29, Sugandha Shah wrote: Hi , No luck . Even with Select Into . Please if any body has faced similar problem and knows a solution. CREATE FUNCTION del_old_history() RETURNS int4 AS ' ^ declare

Re: [SQL] parser: parse error at or near $1

2002-08-14 Thread Masaru Sugawara
On Wed, 14 Aug 2002 17:56:16 +0530 Sugandha Shah [EMAIL PROTECTED] wrote: -- check for the exact same status string reported -- previously and skip it if found select into last_status top 1 status, last_code status_code from status_log where schedule_id

Re: [SQL] Few Queries

2002-08-14 Thread Richard Huxton
On Wednesday 14 Aug 2002 1:29 pm, Sugandha Shah wrote: Hi , No luck . Even with Select Into . Please if any body has faced similar problem and knows a solution. You don't need select into here - the sample below deletes everything older than one day. You should be able to adapt it to your

Re: [SQL] Need Help for select

2002-08-14 Thread Andre Schubert
On Wed, 14 Aug 2002 21:57:02 +0900 Masaru Sugawara [EMAIL PROTECTED] wrote: On Wed, 14 Aug 2002 09:10:53 +0200 Andre Schubert [EMAIL PROTECTED] wrote: The ride side as follows. Table d contains information about subitems. Table c holds information about subitems and items of type bar.

Re: [SQL] concurrent connections is worse than serialization?

2002-08-14 Thread Wei Weng
On Wed, 2002-08-14 at 05:18, Richard Huxton wrote: On Tuesday 13 Aug 2002 9:39 pm, Wei Weng wrote: I have a testing program that uses 30 concurrent connections (max_connections = 32 in my postgresql.conf) and each does 100 insertions to a simple table with index. It took me

Re: [SQL] Few Queries

2002-08-14 Thread Tom Lane
Sugandha Shah [EMAIL PROTECTED] writes: CREATE FUNCTION del_old_history() RETURNS bool AS ' declare var_history_age_limit int4; set_timedatetime; BEGIN select into var_history_age_limit history_age_limit from database_info; IF (var_history_age_limit is not null) THEN

Re: [SQL] pgsql-sql@postgresql.org

2002-08-14 Thread Stephan Szabo
On Wed, 14 Aug 2002, philip johnson wrote: I've a stored procedure I'd like to migrate from MS SqlServer to Postgresql 7.2.1. How can I do ? here is the stored procedure CREATE PROCEDURE ws_doc_tree_new @parent_node_id int, @label varchar(50), @publication varchar(32) Here, you'll

Re: [SQL] pgsql-sql@postgresql.org

2002-08-14 Thread philip johnson
thanks very much -Message d'origine- De : Stephan Szabo [mailto:[EMAIL PROTECTED]] Envoye : mercredi 14 aout 2002 16:36 A : philip johnson Cc : [EMAIL PROTECTED] Objet : Re: [SQL] [EMAIL PROTECTED] On Wed, 14 Aug 2002, philip johnson wrote: I've a stored procedure I'd like to migrate

Re: [SQL] concurrent connections is worse than serialization?

2002-08-14 Thread Richard Huxton
On Wednesday 14 Aug 2002 3:20 pm, Wei Weng wrote: On Wed, 2002-08-14 at 05:18, Richard Huxton wrote: On Tuesday 13 Aug 2002 9:39 pm, Wei Weng wrote: [30 connections is much slower than 1 connection 30 times] What was the limiting factor during the test? Was the CPU maxed, memory, disk

Re: [SQL] Explicite typecasting of functions

2002-08-14 Thread Tom Lane
Richard Huxton [EMAIL PROTECTED] writes: On Wednesday 14 Aug 2002 10:30 am, Andreas Tille wrote: Any hint to solve this kind of chicken-egg-problem? Your solution is not safe anyway - you could end up with two processes trying to insert the next value. I concur with Richard that Andreas

Re: [SQL] concurrent connections is worse than serialization?

2002-08-14 Thread Wei Weng
On Wed, 2002-08-14 at 10:49, Richard Huxton wrote: On Wednesday 14 Aug 2002 3:20 pm, Wei Weng wrote: On Wed, 2002-08-14 at 05:18, Richard Huxton wrote: On Tuesday 13 Aug 2002 9:39 pm, Wei Weng wrote: [30 connections is much slower than 1 connection 30 times] Yeah, but the problem is,

[SQL] sql function examples requested (! select)

2002-08-14 Thread Sue Humphrey
I would like examples of functions using update, insert and delete, where LANGUAGE 'SQL', both how to write them and how to use them. I've got examples of functions as selects coming out of my ears, and PL/pgsql examples of more complex needs, but I just need to run a simple UPDATE. And I

Re: [SQL] concurrent connections is worse than serialization?

2002-08-14 Thread Tom Lane
Wei Weng [EMAIL PROTECTED] writes: On Wed, 2002-08-14 at 10:49, Richard Huxton wrote: If it's not CPU, is the system going into swap or are you seeing a lot of disk activity? I did hear a lot of disk noise when I ran the test. How do I tell if the system is going into swap? Try running

Re: [SQL] sql function examples requested (! select)

2002-08-14 Thread Tom Lane
Sue Humphrey [EMAIL PROTECTED] writes: I would like examples of functions using update, insert and delete, where LANGUAGE 'SQL', both how to write them and how to use them. Have you read the documentation? http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/xfunc-sql.html The first

Re: [SQL] concurrent connections is worse than serialization?

2002-08-14 Thread Richard Huxton
On Wednesday 14 Aug 2002 4:29 pm, Wei Weng wrote: [30 connections is much slower than 1 connection 30 times] Yeah, but the problem is, say I have 20 users using select on the database at the same time, and each select takes 10 seconds to finish. I really can't queue them up (or the last

Re: [SQL] Need Help for select

2002-08-14 Thread Masaru Sugawara
On Wed, 14 Aug 2002 16:04:21 +0200 Andre Schubert [EMAIL PROTECTED] wrote: If this mention implies that the tuple of (1, 1) in the c is supposed ^^ b to take