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
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(id>10));
create view v1 as select * from t1,t2;
insert
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:
--DATE-NAME-LANG
> 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(id>10));
> create view v1 as select * from t1,t2;
This is not an updateable view in a
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
> e
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
> e
[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
hi there
i'd like to add up the "true" values of a comparison like
sum(a>b)
it just doesn't work like this
any workaround
postgres 7.0 on linux
thanks
olaf
--
soli-con Engineering Zanger
Dipl.-Ing. (FH) Olaf Marc Zanger
Lorrainestrasse 23
3013 Bern / Switzerland
Fon: +41-31-332 9782
Mob: +
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)
> "Olaf" == Olaf Zanger <[EMAIL PROTECTED]> writes:
Olaf> hi there i'd like to add up the "true" values of a
Olaf> comparison like
Olaf> sum(a>b)
Olaf> it just doesn't work like this
Olaf> any workaround
Try using a case statement:
select sum(case when a > b then 1 e
On Fri, 23 Feb 2001, Olaf Zanger wrote:
> i'd like to add up the "true" values of a comparison like
>
> sum(a>b)
>
> it just doesn't work like this
Try
sum(case when a>b then 1 else 0 end)
--
Tod McQuillin
Olaf Zanger writes:
> i'd like to add up the "true" values of a comparison like
>
> sum(a>b)
sum(case when a>b then 1 else 0 end)
of maybe even just
select count(*) from table where a>b;
--
Peter Eisentraut [EMAIL PROTECTED] http://yi.org/peter-e/
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
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 PROTECTE
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 l
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
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 e
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 which
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]
www.stber
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-operato
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
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;
' LANGU
> 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 wi
> 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 t
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. Bern
> 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
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 Po
It returns the first five rows it finds. Running the same
query over again if there are no updates is safe, but if the
table is updated there is the possibility it would find a different
five rows. If the query would do a seq scan and you updated
a row, the rows would be in a different order in
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)
otherInfo::text
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 g
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?
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.
jeff
> This doesn't work:
>
> CREATE FUNCTION vuln_port(int4) RETURNS int4 AS 'SELECT port FROM
> i_host_vuln WHERE vuln = $1 GROUP BY port ORDER BY count(port)
hi,
i have a problem. i'm living in poland, which has its national characters. of
course they work great under postgresql, but:
when i use non-C locale all ~ '^xxx' and like 'xxx%' searches are not using
index scan.
this is paintful.
for some of the tables i dont need all national characters. in f
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:
--DATE-NAME-LANG
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 over 6 years so often I
know what it is I wa
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 O
"Joy Chuang" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I tried to use CREATE TABLE AS and ORDER BY. The query is as followed:
>
> create table freshhr21 as
> select e.studentid, u.hoursxfer
> from enrollmentstatus e, undergradclass u
> where e.st
On Wed, 21 Feb 2001, Ken Kline wrote:
> 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
> CREA
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
Ian Lance Taylor <[EMAIL PROTECTED]> writes:
> PL/pgSQL does not support cursors. It also does not support goto.
The context is pretty unclear here, but perhaps he needs ecpg not
plpgsql ... is this to be client- or server-side code?
regards, tom lane
40 matches
Mail list logo