Re: [SQL] Trouble with CREATE FUNCTION

2001-02-22 Thread Jie Liang
1.The following command tells the database where to find the shared object for the PL/pgSQL language's call handler function. CREATE FUNCTION plpgsql_call_handler () RETURNS OPAQUE AS '/usr/local/pgsql/lib/plpgsql.so' LANGUAGE 'C'; 2.The command CREATE TRUS

Re: [SQL] insert values

2001-02-22 Thread Tom Lane
[EMAIL PROTECTED] writes: > I have the following type : > ... > How can I insert a value in this table ? INSERT INTO entiers VALUES('1234') should work fine. BTW, change the "malloc" calls to "palloc" if you don't want to suffer from severe memory leakage problems. Otherwise the code seems OK,

Re: [SQL] Can a function return a record set?

2001-02-22 Thread Jie Liang
in plpgsql you've to use select field into a_variable from table where ...(single value return) or for record|row in select fields from table loop ... end loop; Jie LIANG St. Bernard Software Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873

[SQL] Trouble with CREATE FUNCTION

2001-02-22 Thread S Bey
Dear All, I have tried creating a function as follows: CREATE FUNCTION chkTelephone () RETURNS OPAQUE AS ' BEGIN IF EXISTS (SELECT * FROM tenant t WHERE t.areacode = NEW.areacode AND t.telephone = NEW.telphone) THEN RAISE

[SQL] Estimation of SQL statements

2001-02-22 Thread Kevin Quinlan
Are there any good techniques that estimate the time it will take to execute an SQL statement, specifically an INSERT, SELECT, UPDATE, or DELETE? What factors are important to consider when estimating the execution time of these types of SQL statements? Thank you, Kevin

[SQL] Speed of SQL statements

2001-02-22 Thread Kevin Quinlan
Does anyone have any performance numbers regarding SQL statements, specifically SELECT, UPDATE, DELETE, and INSERT? For instance, on average how long does a typical SELECT (UPDATE, DELETE, INSERT) statement take to execute? Thank you, Kevin

[SQL] Can a function return a record set?

2001-02-22 Thread John Taves
Am I correct in concluding that I can't return a record set from a function? For example, in MS SQL I would do: create procedure foo as select * from yada I expected to be able to do the following in postgresql. create function foo (integer) returns (integer) as ' begin select * from yada; end

Re: [SQL] Strange parse error??

2001-02-22 Thread Ross J. Reedstrom
On Thu, Feb 22, 2001 at 11:49:30PM +0100, Bjørn T Johansen wrote: > I am trying to do a simple update (or at least I thought it was > simple), but I just keep getting a parse error, saying: > > Error executing query > > Update "Config" Set "Wave" = 'F:\wav\BTJ.wav',"Answer" = 20, > "Recordwav" =

Re: [SQL] Strange parse error??

2001-02-22 Thread Stephan Szabo
On Thu, 22 Feb 2001, [ISO-8859-1] Bjørn T Johansen wrote: > I am trying to do a simple update (or at least I thought it was > simple), but I just keep getting a parse error, saying: > > Error executing query > > Update "Config" Set "Wave" = 'F:\wav\BTJ.wav',"Answer" = 20, > "Recordwav" ='F:\wav

[SQL] Strange parse error??

2001-02-22 Thread Bjørn T Johansen
I am trying to do a simple update (or at least I thought it was simple), but I just keep getting a parse error, saying: Error executing query Update "Config" Set "Wave" = 'F:\wav\BTJ.wav',"Answer" = 20, "Recordwav" ='F:\wav\',"CalledID" = '12345678' where "Recno" = 1 PostgreSQL error message: E

[SQL] Re: two tables - foreign keys referring to each other...]

2001-02-22 Thread J.H.M. Dassen (Ray)
Josh Berkus <[EMAIL PROTECTED]> wrote: >In fact, if you built your two-way foriegn keys (using ALTER TABLE), I >think you might find that you can't add any records to either table. >Certainly you won't be able to delete any. It can be done: use DEFERRABLE foreign key constraints (see http://www.p

Re: [SQL] problem with dates

2001-02-22 Thread Richard Huxton
From: "postgresql" <[EMAIL PROTECTED]> > This is a rather generic question about "date" and "time". I seem to > be beating my head on the wall. I was trying to use a set up a table > with a 'date' and 'time' field. I wanted to keep the two separate. > > Can someone explain if there is a differen

[SQL] insert values

2001-02-22 Thread Ines . Klimann
Hi, I have the following type : CREATE FUNCTION entier_in(opaque) RETURNS entier AS '/ens/klimann/PostgreSQL/entier.o' LANGUAGE 'c'; CREATE FUNCTION entier_out(opaque) RETURNS opaque AS '/ens/klimann/PostgreSQL/entier.o' LANGUA

[SQL] problem with dates

2001-02-22 Thread postgresql
This is a rather generic question about "date" and "time". I seem to be beating my head on the wall. I was trying to use a set up a table with a 'date' and 'time' field. I wanted to keep the two separate. Can someone explain if there is a difference between a time field and a timestamp. I do

Re: [SQL] logging a psql script

2001-02-22 Thread Christopher Sawtell
On Thu, 22 Feb 2001 10:51, Ken Kline wrote: > Hello, >I would like my psql script to log everything that it does. Issue the command "script" before you start psql. It will record everything you see on you screen provided it is not piped into another program such as "more" or "less". man sc

Re: [SQL] now() with microsecond granulity needed

2001-02-22 Thread Radoslaw Stachowiak
*** Tom Lane <[EMAIL PROTECTED]> [Wednesday, 21.February.2001, 16:55 -0500]: > Hmm, exactly what I was thinking of, except that it returns a text > rather than a timestamp (a strange choice...). But it's implicit casted to timestamp type so i think is good choice to use in DEFAULT clause at this