Re: [SQL] insert values

2001-02-23 Thread Ines . Klimann
On Thu, Feb 22, 2001 at 11:01:11PM -0500, Tom Lane wrote: [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. I have tried and I have this message : ex1=# insert into entiers

[HACKERS] ask for help !!! (emergency case)

2001-02-23 Thread Jaruwan Laongmal
dear all I hava 2 problems about view 1. i can't insert into view 2. i can't create view with union I try to insert into view as following create table t1 (id int,name varchar(12) check(id=10)); create table t2 (id int,name varchar(12) check(id10)); create view v1 as select * from t1,t2; insert

[ADMIN]

2001-02-23 Thread Jaume Teixi
Hi, I cannot use any kind of odbc because my customers have his local m$ access db's locally then export them on .txt with tab or | separated, then put on my server trought ftp. and is working ok except that the customers are on spanish databases then a data like:

AW: [HACKERS] ask for help !!! (emergency case)

2001-02-23 Thread Zeugswetter Andreas SB
I hava 2 problems about view 1. i can't insert into view I try to insert into view as following create table t1 (id int,name varchar(12) check(id=10)); create table t2 (id int,name varchar(12) check(id10)); create view v1 as select * from t1,t2; This is not an updateable view in any

Re: [SQL] Speed of SQL statements

2001-02-23 Thread Mathijs Brands
On Sun, Feb 18, 2001 at 03:42:43PM -0500, Kevin Quinlan allegedly wrote: 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

Re: [SQL] Speed of SQL statements

2001-02-23 Thread Mathijs Brands
On Sun, Feb 18, 2001 at 03:42:43PM -0500, Kevin Quinlan allegedly wrote: 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

Re: [SQL] insert values

2001-02-23 Thread Tom Lane
[EMAIL PROTECTED] writes: ERROR: Load of file /ens/klimann/PostgreSQL/entier.o failed: Exec format error .o? Did you convert this file into a shared library? I'd expect .so or .sl depending on platform... regards, tom lane

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

2001-02-23 Thread Josh Berkus
Mr. 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 '

Re: [SQL] sum(bool)?

2001-02-23 Thread Tod McQuillin
On Fri, 23 Feb 2001, Olaf Zanger wrote: i'd like to add up the "true" values of a comparison like sum(ab) it just doesn't work like this Try sum(case when ab then 1 else 0 end) -- Tod McQuillin

Re: [SQL] sum(bool)?

2001-02-23 Thread Peter Eisentraut
Olaf Zanger writes: i'd like to add up the "true" values of a comparison like sum(ab) sum(case when ab then 1 else 0 end) of maybe even just select count(*) from table where ab; -- Peter Eisentraut [EMAIL PROTECTED] http://yi.org/peter-e/

Re: [SQL] sum(bool)?

2001-02-23 Thread Olaf Zanger
hi there, s cool, this works streight away and took 5 min. waiting for a answer :-) thanks very much to you tod personal and the mailing list for existence. Olaf Tod McQuillin schrieb: On Fri, 23 Feb 2001, Olaf Zanger wrote: i'd like to add up the "true" values of a comparison

Re: [SQL] sum(bool)?

2001-02-23 Thread Andrew Perrin
Or how about just: SELECT count(*) FROM tablename WHERE a b; -- Andrew J Perrin - Ph.D. Candidate, UC Berkeley, Dept. of Sociology Chapel Hill, North Carolina, USA - http://demog.berkeley.edu/~aperrin [EMAIL

Re: AW: [HACKERS] ask for help !!! (emergency case)

2001-02-23 Thread Tom Lane
Zeugswetter Andreas SB [EMAIL PROTECTED] writes: You probably wanted: create view v1 as select * from t1 union all select * from t2; Probably, but we don't support UNION in views before 7.1 :-( I'm not real clear on why t1 and t2 are separate tables at all in this example. Seems like

[SQL] How can i escape a '+' or a '+' in a regexp ?

2001-02-23 Thread Gabriel Fernandez
Hi fellows, I'm trying to the following query: select * from areas where titulo ~ '+' or titulo ~ '*' and the answer is: ERROR: regcomp failed with error repetition-operator operand invalid I have tried to escape the '+' and the '*' with a backslash, as follows: select * from areas where

Re: [SQL] How can i escape a '+' or a '+' in a regexp ?

2001-02-23 Thread Stephan Szabo
I believe you'll need two \ characters to escape the + or *. titulo ~ '\\+' On Fri, 23 Feb 2001, Gabriel Fernandez wrote: Hi fellows, I'm trying to the following query: select * from areas where titulo ~ '+' or titulo ~ '*' and the answer is: ERROR: regcomp failed with error

[SQL] Need your help

2001-02-23 Thread Jyotsna Kypa
Hi, I need your help on something. I have to write a trigger (in sybase) that does this: Everytime a record gets updated it should update a column in that record with the current date/time. I am able to do it for the whole table, but how do I make sure the update happens only for that record

Re: [SQL] How can i escape a '+' or a '+' in a regexp ?

2001-02-23 Thread Jie Liang
select field from table where field like '%\\%%' or field like '%*%'; select field from table where field ~ '.*\\*.*' or ~ '.*%.*'; Jie LIANG St. Bernard Software Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 [EMAIL PROTECTED]

Re: [SQL] How can i escape a '+' or a '+' in a regexp ?

2001-02-23 Thread [EMAIL PROTECTED]
Gabriel, Two backslashes. select * from areas where titulo ~ '\\+' or titulo ~ '\\*' Troy Hi fellows, I'm trying to the following query: select * from areas where titulo ~ '+' or titulo ~ '*' and the answer is: ERROR: regcomp failed with error repetition-operator operand

[SQL] Controlling Reuslts with Limit

2001-02-23 Thread Najm Hashmi
Hi, I was reading through Bruce's on line . I found follwing bit unclear... "Notice that each query uses ORDER BY . Although this clause is not required, LIMIT without ORDER BY returns random rows from the query, which would be useless. " When I run a query several time I get the same results

Re: [SQL] Need your help

2001-02-23 Thread Jie Liang
e.g. Try: CREATE TABLE emp ( id int4 primary key, empname text, salary int4, last_date datetime, last_user name); CREATE FUNCTION emp_stamp () RETURNS OPAQUE AS BEGIN update emp set last_date=''now''::timestamp where id=NEW.id; RETURN NEW; END; '

Re: [SQL] Controlling Reuslts with Limit

2001-02-23 Thread Bruce Momjian
Hi, I was reading through Bruce's on line . I found follwing bit unclear... "Notice that each query uses ORDER BY . Although this clause is not required, LIMIT without ORDER BY returns random rows from the query, which would be useless. " It means there is no guarantee which rows will be

Re: [SQL] Controlling Reuslts with Limit

2001-02-23 Thread Jie Liang
My understanding: because you return a subset instead of a single value, so between 2 select ... limit ... queries. if you delete a record(say song_id=947) then insert it again. then results are different. So for a multiple users db, you should use oder by when you use limit. Jie LIANG St.

Re: [SQL] Controlling Reuslts with Limit

2001-02-23 Thread Bruce Momjian
I don't think it is actually random. It just that the order is not defined and other events may change the order. I believe that without an ORDER BY or other clauses that cause an index to be used that the database tends to return rows in the order stored on disk. This order tends to be

Re: [SQL] Controlling Reuslts with Limit

2001-02-23 Thread Tom Lane
Najm Hashmi [EMAIL PROTECTED] writes: I just want to know what exatly --"LIMIT without ORDER BY returns random rows from the query" --means It means the results aren't guaranteed. It doesn't mean that the exact same query run under the exact same conditions by the exact same version of

[SQL] Recursive Query (need of PL/pgSQL?)

2001-02-23 Thread Stephan Richter
Hello everyone, I have a system (simplified for this example) with the following two tables: TABLE1 id::int8 containerId::int8 containerType::varchar(100) moreInfo::text TABLE2 id::int8 containerId::int8 containerType::varchar(100)

[SQL] syntax prob

2001-02-23 Thread postgresql
I am away from my server for the weekend and I need a little help. when doing updates of multiple fields there commas between the elements? I mean update table set cname = 'Bill', caddress = '2nd floor' where acode = 'AVAN'; I refer to the space between 'Bill' and caddress. if I could

[SQL] logging a script

2001-02-23 Thread Ken Kline
Hello, I would like my psql script to log everything that it does. I set the following \set ECHO all \o foo.txt \qecho some sql, some ddl, etc... \o But foo.txt only contains DROP DROP DROP CREATE CREATE CREATE I want it to contain everything that I see on the screen, what am I missing?

[SQL] HELP: m$ access - psql howto ?

2001-02-23 Thread Jaume Teixi
Hi, I cannot use any kind of odbc because my customers have his local m$ access db's locally then export them on .txt with tab or | separated, then put on my server trought ftp. and is working ok except that the customers are on spanish databases then a data like:

Re: [SQL] bug.. ?

2001-02-23 Thread Tom Lane
Jeff MacDonald [EMAIL PROTECTED] writes: A person recent pointed this out to me.. seems a bit funny, because limit 1 pretty much say's it't not gonna return multiple values. CREATE FUNCTION vuln_port(int4) RETURNS int4 AS 'SELECT port FROM i_host_vuln WHERE vuln = $1 GROUP BY port ORDER BY

Re: [SQL] greetings

2001-02-23 Thread Ian Lance Taylor
Ken Kline [EMAIL PROTECTED] writes: I have just joined the list a few days ago and am trying quite hard to come up to speed with pgsql but i find documentaion frustratiing. I think maybe it;s just a matter of finding things that are of the correct scope. I've been an Oracle developer for