[SQL] client for solaris

2002-12-12 Thread Aravind Vinnakota
Hi all, I am looking for a postgreSQL client for installing on a Solaris 8 machine. The basic idea is to use the client and retrive the data from a database running on another machine without actually connecting to the database server. So, I want to know where I can get the client for solaris? I

Re: [SQL] function replace doesnt exist

2002-12-12 Thread Jeff Eckermann
What version are you using? I think "replace" is new for version 7.3. As another poster has pointed out, "translate" works for individual characters. Or you could code up your own replace using the native functionality of pl/perl or pl/tcl or such. Or you could just upgrade to 7.3. --- Andy Mor

Re: [SQL] primary + foreign key

2002-12-12 Thread Bret Hughes
On Thu, 2002-12-12 at 10:27, Roberto Mello wrote: > > Read "An Introduction to Database Systems" by C.J. Date. > Boy that brings back memories. I think I will dig it out of a box since I am doing database coding again after a long hiatus. Seems like I had a couple of Date books on my shelf at

Re: [SQL] ON DELETE CASCADE

2002-12-12 Thread Dan Langille
On 12 Dec 2002 at 11:01, Tim Perdue wrote: > That command works, but now I think I have 2x as many triggers as I > want. How do I get rid of the original triggers? I had to do something similar and documented it at http://www.freebsddiary.org/postgresql-dropping-constraints.php hth -- Dan Lang

Re: [SQL] ON DELETE CASCADE

2002-12-12 Thread Marie G. Tuite
Here is a function that I use to list fk(triggers) on a table. Execute the function to get the trigger name and then - drop trigger "trigger_name" on table_name; hth -- Version 1.0, June 2002 -- Marie G. Tuite -- Function lists FK by table. -- To execute: -- begin;select fn_list_fk('table_name'

Re: [SQL] ON DELETE CASCADE

2002-12-12 Thread Stephan Szabo
On Thu, 12 Dec 2002, Tim Perdue wrote: > I'm trying to comb through my database and add ON DELETE CASCADE to a > number of tables where I already have fkeys in place, but I'm having a > hard time. > > ALTER TABLE project_task DROP CONSTRAINT > "project_task_group_project_id_f" RESTRICT; > > ERROR

[SQL] ON DELETE CASCADE

2002-12-12 Thread Tim Perdue
I'm trying to comb through my database and add ON DELETE CASCADE to a number of tables where I already have fkeys in place, but I'm having a hard time. ALTER TABLE project_task DROP CONSTRAINT "project_task_group_project_id_f" RESTRICT; ERROR: ALTER TABLE / DROP CONSTRAINT: project_task_group

Re: [SQL] function replace doesnt exist

2002-12-12 Thread Jean-Luc Lachance
If you want character translation like the tr command under unix, use TRANSLATE. Andy Morrow wrote: > > Hi > > im trying to execute an update command on a postgresql DB table using > pgAdmin II > > im using the following statement > > UPDATE commandlist SET command = REPLACE (command,'A','

[SQL] function replace doesnt exist

2002-12-12 Thread Andy Morrow
Hi im trying to execute an update command on a postgresql DB table using pgAdmin II im using the following statement UPDATE commandlist SET command = REPLACE (command,'A','B') commandlist is the table name command is the column and i want to change the value A to B but it's giving me the fol

Re: [SQL] Stored Procedure Problem

2002-12-12 Thread Roberto Mello
On Thu, Dec 12, 2002 at 08:13:22PM +0530, Atul wrote: > Hi, > How to return multiple columns through stored procedure. > But This Gives Error(For Multiple column , not for single column) > Please Let me know. You didn't say which version of PostgreSQL you are using. In PG 7.2 you can re

Re: [SQL] primary + foreign key

2002-12-12 Thread Roberto Mello
On Thu, Dec 12, 2002 at 10:54:21AM +0100, Huub wrote: > Thanks for pointing out. I'm not that experienced in SQL yet; so detail > could as well be some extra instruction and I've never seen 'references > master' before. But I think I'll manage now. Thanks Read "An Introduction to Database System

[SQL] Performance Problems

2002-12-12 Thread Héctor Iturre
Hi, Thanks, i fix the problem, it was the linux configuration. Ahora podés usar Yahoo! Messenger desde tu celular. Aprendé cómo hacerlo en Yahoo! Móvil: http://ar.mobile.yahoo.com/sms.html ---(end of broadcast)--- TIP 2: you can get off all lis

Re: [SQL] Stored Procedure Problem

2002-12-12 Thread Tomasz Myrta
Atul wrote: CREATE FUNCTION b_function() RETURNS varchar AS ' DECLARE an_integer int4; an_namevarchar; BEGIN select into an_integer emp_id,an_name emp_name from employee; return an_integer,an_name; END; ' First: select into an_integer,an_name emp_id,emp_name... S

Re: [SQL] Stored Procedure Problem

2002-12-12 Thread Atul
Hi,   How to return multiple columns through stored procedure.   Consider EX.   CREATE FUNCTION b_function() RETURNS varchar AS '  DECLARE     an_integer int4;     an_name    varchar;  BEGIN     select into an_integer emp_id,an_name emp_name from employee;     return an_integ

Re: [SQL] Performance Problems

2002-12-12 Thread Christoph Haller
> >I have performance problems with a huge database > (there a 2 tables with 40 millions of records) and > many users doing updates and queries on it. I 've > perform severals VACUMM on the database with poor > results. >Each table have an unique index and I added other > indexes to improve

Re: [SQL] Performance Problems

2002-12-12 Thread Philip Warner
At 09:56 AM 12/12/2002 -0300, Héctor Iturre wrote: I 've perform severals VACUMM on the database with poor results. Have you done an ANALYZE? Which version of PG are you using? Can you send output from VACUUM VERBOSE ? Philip

Re: [SQL] Stored Procedure Problem

2002-12-12 Thread Héctor Iturre
Hi, use this CREATE FUNCTION b_function() RETURNS int4 AS ' DECLARE an_integer int4; BEGIN select into an_integer emp_id from employee; return an_integer; END; ' LANGUAGE 'plpgsql'; --- Atul <[EMAIL PROTECTED]> escribió: > Hello, > > Atul Here, I have one

Re: [SQL] Stored Procedure Problem

2002-12-12 Thread Christoph Haller
> CREATE FUNCTION b_function() RETURNS int4 AS ' > DECLARE >an_integer int4; > BEGIN >select emp_id from employee; >return an_integer; > END; > ' > LANGUAGE 'plpgsql'; > Try SELECT INTO an_integer emp_id from employee; Regards, Christoph ---(end of broadcast)-

[SQL] Stored Procedure Problem

2002-12-12 Thread Atul
Hello,       Atul Here, I have one problem while accessing Database Records Or Recordset from stored procedure. Procedure is like this,   CREATE FUNCTION b_function() RETURNS int4 AS ' DECLARE    an_integer int4; BEGIN    select emp_id from employee;    return an_intege

[SQL] Performance Problems

2002-12-12 Thread Héctor Iturre
Hi, I have performance problems with a huge database (there a 2 tables with 40 millions of records) and many users doing updates and queries on it. I 've perform severals VACUMM on the database with poor results. Each table have an unique index and I added other indexes to improve the perfor

Re: [SQL] primary + foreign key

2002-12-12 Thread Huub
Thanks for pointing out. I'm not that experienced in SQL yet; so detail could as well be some extra instruction and I've never seen 'references master' before. But I think I'll manage now. Thanks Tomasz Myrta wrote: Huub wrote: Hi, I suppose 'detail' is the table name? And what is master? T

Re: [SQL] primary + foreign key

2002-12-12 Thread Tomasz Myrta
Huub wrote: Hi, I suppose 'detail' is the table name? And what is master? Thanks Huub You should know that. Detail is a table you want to create and master is a table where foreign key points to. Tomasz Myrta ---(end of broadcast)--- TIP 4:

Re: [SQL] primary + foreign key

2002-12-12 Thread Huub
Hi, I suppose 'detail' is the table name? And what is master? Thanks Huub create table detail ( id1 integer, id2 integer, CONSTRAINT c1 PRIMARY KEY(id1,id2), CONSTRAINT c2 FOREIGN KEY(id1,id2) REFERENCES master ); Do you really need such detail table? You can just add columns to ma

Re: [SQL] primary + foreign key

2002-12-12 Thread Tomasz Myrta
Huub wrote: Hi, I want to create a table where the 2 columns are both primary as well as foreign key. What is the correct syntax for that? Thanks Huub create table detail ( id1 integer, id2 integer, CONSTRAINT c1 PRIMARY KEY(id1,id2), CONSTRAINT c2 FOREIGN KEY(id1,id2) REFERENCES mas

Re: [SQL] Getting the latest unique items

2002-12-12 Thread Tomasz Myrta
A.M. wrote: When I try to run the following query: select distinct on(student_gradedmaterial.id) student_gradedmaterial.id from coursesection_student,student_gradedmaterial WHERE gradedmaterialid=1 AND coursesection_student.studentid=student_gradedmaterial.studentid AND coursesectionid=1 and sco

[SQL] primary + foreign key

2002-12-12 Thread Huub
Hi, I want to create a table where the 2 columns are both primary as well as foreign key. What is the correct syntax for that? Thanks Huub ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-no

Re: [SQL] Primary Key Help !

2002-12-12 Thread Ludwig Lim
--- Waheed Rahuman <[EMAIL PROTECTED]> wrote: > Hi Greetings > My question is How many primary key i can assign in > a PostGresql Table > > Rowid| Parent1 | Parent2 > | Parent3 | Parent4 | > Parent5 | Parent6 | Parent7