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
--- 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
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
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
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
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
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:
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
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
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
> 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)-
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
>
>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
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
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
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
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
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
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
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','
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
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
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'
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
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
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
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
27 matches
Mail list logo