[SQL] Re: [GENERAL] protected ON DELETE CASCADE

2001-08-23 Thread Murray Hobbs
cool, thanks yes, i was slack reading th docs m Jan Wieck wrote: > > Murray Hobbs wrote: > > > > i neglected to show it properly > > > > have tables A, B, C, D PLUS a few others > > > > A <- B > > > > F > > | > > v > > A <- C <- D > > ^ > > | > > E > > > > i want

[SQL] Re: [GENERAL] protected ON DELETE CASCADE

2001-08-23 Thread Jan Wieck
Murray Hobbs wrote: > > i neglected to show it properly > > have tables A, B, C, D PLUS a few others > > A <- B > > F > | > v > A <- C <- D > ^ > | > E > > i want to delete from C and cascade any delete to E or F but not if > there are records in D > > what i have don

Re: [SQL] Function returning an array

2001-08-23 Thread Alex Pilosov
On Thu, 23 Aug 2001, Tom Lane wrote: > "Josh Berkus" <[EMAIL PROTECTED]> writes: > >> What's the correct syntax to return two VARCHAR(255)? > > > There isn't one. At this time, functions cannot return arrays. > > Well, they *can*, it's just that there's no syntax to support > constructing an a

[SQL] Re: [GENERAL] protected ON DELETE CASCADE

2001-08-23 Thread Murray Hobbs
i neglected to show it properly have tables A, B, C, D PLUS a few others A <- B F | v A <- C <- D ^ | E i want to delete from C and cascade any delete to E or F but not if there are records in D what i have done is to have ON DELETE CASCADE on C's primary

[SQL] Execute permsissions on fuctions

2001-08-23 Thread Zot O'Connor
Other SQL servers have the concept of stored procedures having different permissions. For instance a procedure that can update a table. Since a web site typically connects as the webuser (or equiv postgres user), I do not want to offer update to the webuser. The way I have done this elsewhere i

Re: [SQL] Function returning an array

2001-08-23 Thread Tom Lane
"Josh Berkus" <[EMAIL PROTECTED]> writes: >> What's the correct syntax to return two VARCHAR(255)? > There isn't one. At this time, functions cannot return arrays. Well, they *can*, it's just that there's no syntax to support constructing an array value in SQL or plpgsql languages. I know that

Re: [SQL] Function returning an array

2001-08-23 Thread Josh Berkus
Ciao Francesco: > What's the correct syntax to return two VARCHAR(255)? There isn't one. At this time, functions cannot return arrays. Look for a fix to this limitation with version 7.2 or later. Jan Wieck and others have been working to extend functions so that they may manipulate and retur

[SQL] Function returning an array

2001-08-23 Thread Francesco Casadei
I want a function to return an array of two VARCHAR(255). This works, but does not return VARCHAR(255): CREATE FUNCTION ins_div(CHAR(8)) RETURNS _varchar AS '...' LANGUAGE 'plpgsql'; These don't work: CREATE FUNCTION ins_div(CHAR(8)) RETURNS _varchar(255) AS '...' LANGUAGE 'plpgsql'; CREATE FUN

[SQL] Re: [GENERAL] protected ON DELETE CASCADE

2001-08-23 Thread Jan Wieck
Murray Hobbs wrote: > > 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 com