Re: [SQL] What's ETA for read/write Views?

2000-07-31 Thread Tom Lane
Read-write views exist now: you just have to write ON INSERT, ON UPDATE, ON DELETE rules that show what you think should happen. Some people seem to think that the system should try to intuit those rules for them, but I don't believe that's either possible or desirable. The entire point of a vie

[SQL] What's ETA for read/write Views?

2000-07-31 Thread Timothy Covell
I'm working on a project and using postgres 7.0.2 with phpPgAdmin and php3.0.16. Anyhow, the more I learn about relations database systems, the more orthogonal my data becomes. However, I then need to have read/write views so that "ordinary" humans can make sense of the data While, I'm

Re: [SQL] Simple concatenation in select query

2000-07-31 Thread Tom Lane
"Sandis" <[EMAIL PROTECTED]> writes: > Ok, i got it, after all! It took > 30 min to write this query. :( > SELECT textcat(textcat(first_name,text ' '),last_name) from table; It's a lot easier if you use the SQL-standard concatenation operator: regression=# select 'foo' || 'bar'; ?column? -

RE: [SQL] Simple concatenation in select query

2000-07-31 Thread Henry Lafleur
PostgreSQL has a string concatenation operator (see operators in the manual): SELECT last_name||', '||first_name FROM ... Here's a ref: http://www.postgresql.org/docs/user/x2129.htm Henry -Original Message- From: Sandis [mailto:[EMAIL PROTECTED]] Sent: Monday, July 31, 2000 2:48 PM To

[SQL] Simple concatenation in select query

2000-07-31 Thread Sandis
Hello, Sorry for the stupid posting, but.. There was a string concatenation function in MySQL: SELECT CONCAT(first_name, " ", last_name) FROM table; Is there a similar function in Postgres? Certainly, it's possible to live without it, but i'd like to write as above, doing concatenation in place

Re: [SQL] Indices and time spans

2000-07-31 Thread Itai Zukerman
> You need to recast the clause as something like > > WHERE posted >= (CURRENT_TIMESTAMP - '5 minutes'::TIMESPAN) > > Then you still have the problem of persuading Postgres that it should > treat the right side of this as a constant and not something to > re-evaluate at each row. In 7.0 a

[SQL] result in a variable?

2000-07-31 Thread Jerome Raupach
In a program writes in C. I want to store the result, of a count(*), in a variable. can I do, and How ? Thanks.

Re: [SQL] Indices and time spans

2000-07-31 Thread Tom Lane
Itai Zukerman <[EMAIL PROTECTED]> writes: > I have this: > SELECT ... > FROM trade, entry > WHERE AGE( CURRENT_TIMESTAMP, posted ) <= '5 minutes'::TIMESPAN > AND trade.entryId = entry.entryId > That is, fetch all trades executed in the last 5 minutes. > This query seems

[SQL] Indices and time spans

2000-07-31 Thread Itai Zukerman
I have this: SELECT ... FROM trade, entry WHERE AGE( CURRENT_TIMESTAMP, posted ) <= '5 minutes'::TIMESPAN AND trade.entryId = entry.entryId That is, fetch all trades executed in the last 5 minutes. This query seems to run pretty slowly when trade is filled. Putting an