Re: [SQL] Altering pg_conndefaults

2001-08-22 Thread Peter Eisentraut

macky writes:

> how do i alter values of pg_conndefaults?

What exactly do you mean by pg_conndefaults?

> example user=user1 to user=user2

The default user is normally the user with the same name as the current
Unix user, or the PGUSER environment variable if set, but the details may
vary from interface to interface.

-- 
Peter Eisentraut   [EMAIL PROTECTED]   http://funkturm.homeip.net/~peter


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [SQL] How to execute a system file in procedure?

2001-08-22 Thread Albert REINER

On Mon, Aug 20, 2001 at 10:08:36AM -0400, Raymond Chui wrote:
> I would like execute a system command or my program or my shell
> script in procedure. How do I do that?

use .

Albert.


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[SQL] just checking

2001-08-22 Thread postgresql

At times things seem just too easy, so I want to confirm that this is the 
correct syntax.

I am looking for the interval (aging) for these invoices. I guess I am 
concerned because I guessed at the syntax. Is there a better way to do 
this?

billdate is type 'date'

SELECT ('now'-billdate) FROM fcinvoiced WHERE client = 'smith';

Ted



---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[SQL] protected ON DELETE CASCADE

2001-08-22 Thread Murray Hobbs


here's my problem

i have tables A, B, C, D

A <- B
A <- C <- D

i want to maintain integrity so that if A is deleted from then so is
anything referencing from B and C - no problem ON DELETE CASCADE

but if there are any D's that point back to A (through composite key in
C) i don't want the delete to go ahead - at all - i want an error
message and condition

can someone who knows the pgsql system well tell me how this is best
done

I've looked at RULE - but how do i delete the old. record (ie confirm
the delete) or conversely prevent the delete?

I've looked at TRIGGER but then i'm writing a function (in SQL?) which
is called by a trigger - again - how do i confirm or reject a delete?

or is it really the case i have to maintain the integrity externally and
write functions that deal with the children and then delete parents -
all in a single transaction - ie not use ON DELETE CASCADE, or rules, or
triggers?

and sorry for cross post but was not sure which was the best list

thanks

murray hobbs
efone.com

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]