[SQL]

2005-11-23 Thread Ken Winter
In PL/pgSQL, is there a way to put a *variable* column-name in a dot notation reference to a RECORD column? For example, suppose I want to write a function like the following, which is to be called by a "BEFORE INSERT" trigger: CREATE OR REPLACE FUNCTION foo ( ) RETURNS TRIGGER AS ' DEC

Re: [SQL] what is going on in the PostgreSQL

2005-11-23 Thread Michael Fuhr
On Wed, Nov 23, 2005 at 02:54:27PM +0300, Eugene E. wrote: > template1=> \set a select > template1=> \set b 1 > template1=> :a :b; > > column > -- > 1 > > hope this is only psql's feathure not the server's one; What about this do you find surprising? Have you read the psql documentation re

Re: [SQL] unplanned sub-select error?

2005-11-23 Thread Tom Lane
Kyle Bateman <[EMAIL PROTECTED]> writes: > Sorry, you're right. I have now confirmed that this only happens when > updating via a view/rule (as you suspected). Attached is a minimalist > sql file that demonstrates the same error message from a blank > database. I'm using 8.1.0. I'm pretty su

Re: [SQL] sysid

2005-11-23 Thread Alvaro Herrera
A. R. Van Hook wrote: > It seems that in 8.1.0 we can no longer set the SYSID when adding users > and groups. > i.e > template1=# create role hooker sysid 1345; > NOTICE: SYSID can no longer be specified > > I have lots of code that depends on the actual group and user number. > Is there a way t

Re: [SQL] sysid

2005-11-23 Thread Jaime Casanova
On 11/23/05, A. R. Van Hook <[EMAIL PROTECTED]> wrote: > It seems that in 8.1.0 we can no longer set the SYSID when adding users > and groups. > i.e > template1=# create role hooker sysid 1345; > NOTICE: SYSID can no longer be specified > > I have lots of code that depends on the actual group and

[SQL] sysid

2005-11-23 Thread A. R. Van Hook
It seems that in 8.1.0 we can no longer set the SYSID when adding users and groups. i.e template1=# create role hooker sysid 1345; NOTICE: SYSID can no longer be specified I have lots of code that depends on the actual group and user number. Is there a way to set the user and group number? tha

[SQL] what is going on in the PostgreSQL

2005-11-23 Thread Eugene E.
Hello all ! look template1=> \set a select template1=> \set b 1 template1=> :a :b; column -- 1 hope this is only psql's feathure not the server's one; ---(end of broadcast)--- TIP 4: Have you searched our list archives? http

Re: [SQL] Default on update

2005-11-23 Thread Richard Huxton
[EMAIL PROTECTED] wrote: I would want to replace "bv" values with FALSE when insert/update NULL value for this field. You could do this by having the application insert to a view with a rule that replaces null bv values before redirecting to the base table. Is more functional to create a Ru

[SQL] OUT OF THIS LIST......

2005-11-23 Thread Fernando Garcia
quiero darme de baja de la lista.mandenme el vinculo para hacerlo.    

Re: [SQL] Default on update

2005-11-23 Thread lucas
Quoting Richard Huxton : [EMAIL PROTECTED] wrote: Hi. Is there a way to create "default" constraint on UPDATE query. It's becouse I have a bool field that may NOT support NULL value, but the Front-End calls null for FALSE values. Sounds like your frontend is broken. Yes, it is. But I have no

Re: [SQL] Default on update

2005-11-23 Thread Richard Huxton
[EMAIL PROTECTED] wrote: Hi. Is there a way to create "default" constraint on UPDATE query. It's becouse I have a bool field that may NOT support NULL value, but the Front-End calls null for FALSE values. Sounds like your frontend is broken. I was thinking something like: create table table1

[SQL] Default on update

2005-11-23 Thread lucas
Hi. Is there a way to create "default" constraint on UPDATE query. It's becouse I have a bool field that may NOT support NULL value, but the Front-End calls null for FALSE values. I was thinking something like: create table table1 ( id serial primary key, bv bool default false not null ); I w