Re: [SQL] Reuse previously calculated column in sql query?

2004-10-20 Thread Iain
Using the the sub-select is one way, but there is another way. (B (BIf the function can be declared as strict or immutable the you can call it (Bas many times as you like in a single transaction and it will only be (Bevaluated once. As far as I know this does work as advertised. (B (BCheck

Re: [SQL] time of constraint checking

2004-10-20 Thread Stephan Szabo
On Wed, 20 Oct 2004, Markus Bertheau wrote: > http://www.postgresql.org/docs/current/static/sql-createtable.html says, > down at the explanation of DEFERRABLE, that constraints are checked > after every command. Why does the following not work then: > > CREATE TABLE foo ( > pos INT UNIQUE > );

Re: [SQL] time of constraint checking

2004-10-20 Thread Markus Bertheau
Ð ÐÑÐ, 20.10.2004, Ð 17:58, Markus Bertheau ÐÐÑÐÑ: > I also noticed, that the docs don't state whether INITIALLY IMMEDIATE or > INITIALLY DEFERRED is the default. I just overlooked that, sorry, it is stated. -- Markus Bertheau <[EMAIL PROTECTED]> ---(end of broadcast)-

[SQL] time of constraint checking

2004-10-20 Thread Markus Bertheau
Hi, http://www.postgresql.org/docs/current/static/sql-createtable.html says, down at the explanation of DEFERRABLE, that constraints are checked after every command. Why does the following not work then: CREATE TABLE foo ( pos INT UNIQUE ); INSERT INTO foo (pos) VALUES (1); INSERT INTO foo

Re: [SQL] the problem of createlang!

2004-10-20 Thread Weiping
Fang Genjie wrote: I have installed postgresql (version 7.4.5) on the Redhat linux platform. Now I want to create a database with name BBMF and create pl/pgsql procedure language to the BBMF The problem is listed follow: [EMAIL PROTECTED] postgresql-7.4.5]$ psql -l List of databases D

Re: [SQL] [GENERAL] SQL update function faililed in Webmin Interface

2004-10-20 Thread Scott Marlowe
On Wed, 2004-10-20 at 01:03, Kathiravan Velusamy wrote: > Hello All, >I am a newbie to PostgreSQL. I am using postgreSQL 7.4.5 in > HP-Unix 11.11 PA , and 11.23 PA. > I have a problem with postgreSQL Webmin (Webmin Version > 1.070) testing in update function. > This

Re: [SQL] Reuse previously calculated column in sql query?

2004-10-20 Thread Rod Taylor
On Wed, 2004-10-20 at 08:50, Philippe Lang wrote: > Hello, > > Is it possible to reuse a previously calculated column in a following > column, like: SELECT col1 , col2 , col2 * 0.75 AS col3 FROM (SELECT foo.val1 AS col1 , long_calculation(foo.val1) AS col2 FROM

[SQL] Reuse previously calculated column in sql query?

2004-10-20 Thread Philippe Lang
Hello, Is it possible to reuse a previously calculated column in a following column, like: SELECT foo.val1 AS col1, long_calculation(foo.val1) AS col2, COL2 * 0.75 AS col3 FROM foo; instead of writing: SELECT foo.val1 AS col1, long_calculation(foo.val1) AS col2, long_calculation(foo.val1) * 0.7

Re: [SQL] SQL update function faililed in Webmin Interface

2004-10-20 Thread Richard Huxton
Kathiravan Velusamy wrote: I created database called "test" and created table name called "one" for that DB, which contains filed name "Name" with varchar(10) as a type and allows Null values. The issue here is that you have created a column "Name" with quotes, which means it is case-sensitive. "SQ

[SQL] SQL update function faililed in Webmin Interface

2004-10-20 Thread Kathiravan Velusamy
Hello All,    I am a newbie to PostgreSQL. I am using postgreSQL 7.4.5 in HP-Unix 11.11 PA , and 11.23 PA.   I have a problem with postgreSQL Webmin (Webmin Version 1.070) testing in update function.   This problem exists only when i create a new data base through we