Re: [SQL] Before/After Trigger User Switching

2003-08-20 Thread Aasmund Midttun Godal
iven the current timing this is the behavior I'd expect. regards, tom lane Aasmund Midttun Godal [EMAIL PROTECTED] - http://godal.com +47 40 45 20 46 - Leiv Tronstadsvei 2, NO-7051 Trondheim ---(end of broadcast)--- TIP 7: don't forget t

Re: [SQL] Before/After Trigger User Switching

2003-08-20 Thread Aasmund Midttun Godal
I have upgraded to 7.3.4 and the problem persists. Aasmund Midttun Godal writes: When an operation is done throug a SECURITY DEFINER style function and causes a trigger the current_user depends on whether it is executed BEFORE or AFTER. I currently run 7.3.2. I believe the BEFORE behavior is

[SQL] Before/After Trigger User Switching

2003-08-20 Thread Aasmund Midttun Godal
at_test(); NOTICE: BEFORE Current: godal Session: www NOTICE: AFTER Current: www Session: www at_test --- www/godal (1 row) Aasmund Midttun Godal [EMAIL PROTECTED] - http://godal.com +47 40 45 20 46 - Leiv Tronstadsvei 2, NO-7051 Trondheim ---(end of broadcast)--

[SQL] Suggestion: md5/crypt functions in sql

2002-10-06 Thread Aasmund Midttun Godal
It would be very usefull to have these in sql, so that it is even easier to create tables with encrypted passwords. Regards, Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45 20 46 ---(end of broadcast)--- TIP 4: Don&#

Re: [SQL] transposing data for a view

2001-10-31 Thread Aasmund Midttun Godal
t; (SELECT scanid, volume as B_volume FROM volumes WHERE region = 'B') bv > ON scan.scanid = bv.scanid LEFT OUTER JOIN > (SELECT scanid, volume as C_volume FROM volumes WHERE region = 'C') cv > ON scan.scanid = cv.scanid > ORDER BY scanid; >

Re: [SQL] autoincrement

2001-10-25 Thread Aasmund Midttun Godal
net] > > ---(end of broadcast)--- > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED] Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45 20 46 ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] Error codes as numbers or in other languages etc.

2001-10-23 Thread Aasmund Midttun Godal
ry like: prepare('SELECT * FROM errors WHERE ? ~ errorstring'); #Isn't postgres great? reverse regular expression searches :) my $s = execute($dbh->errstr); then we exploit perl's ability: $dbh->errstr =~ /$s->{'errorstring'}/"$s->{'message'}&

Re: [SQL] PL/pgSQL triggers ON INSERT OR UPDATE

2001-10-23 Thread Aasmund Midttun Godal
er is fired). > > What should I do then ? Is it still possible to use the same function > for UPDATE OR INSERT events ? > > TIA > > --san; > > ---(end of broadcast)--- > TIP 4: Don't '

Re: [SQL] oid's in views.

2001-10-23 Thread Aasmund Midttun Godal
, but that's about it. > > -Josh > > __AGLIO DATABASE SOLUTIONS___ >Josh Berkus > Complete information technology [EMAIL PROTECTED] >and data management solutions (415) 565-7293 > for law firms, small businesses

Re: [SQL] oid's in views.

2001-10-22 Thread Aasmund Midttun Godal
That is what i did... Regards, Aasmund On Sat, 20 Oct 2001 23:34:44 -0400 (EDT), Joel Burton <[EMAIL PROTECTED]> wrote: > On Sun, 21 Oct 2001, Aasmund Midttun Godal wrote: > > > > Aasmund -- > > If your problem is that you want to update VIEWs and aren't su

Re: [SQL] CREATE RULE ON UPDATE/DELETE

2001-10-22 Thread Aasmund Midttun Godal
TED]> writes: > > > Surely you'd need something like > > CREATE RULE dbl_update AS ON UPDATE TO dbl DO INSTEAD UPDATE raw SET > id = NEW.id / 2, name = NEW.name WHERE OLD.id = id * 2; > > (untested...) > > regards, tom lan

Re: [SQL] CREATE RULE ON UPDATE/DELETE

2001-10-22 Thread Aasmund Midttun Godal
TED]> writes: > > > Surely you'd need something like > > CREATE RULE dbl_update AS ON UPDATE TO dbl DO INSTEAD UPDATE raw SET > id = NEW.id / 2, name = NEW.name WHERE OLD.id = id * 2; > > (untested...) > > regards, tom lan

Re: [SQL] oid's in views.

2001-10-20 Thread Aasmund Midttun Godal
Josh Berkus > Complete information technology [EMAIL PROTECTED] >and data management solutions (415) 565-7293 > for law firms, small businessesfax 621-2533 > and non-profit organizations. San Francisco > > > Aasmund Midttun Godal [EMA

[SQL] CREATE RULE ON UPDATE/DELETE

2001-10-20 Thread Aasmund Midttun Godal
| tr 22 | tg 24 | th 25 | tgh (5 rows) envisity=# UPDATE bar SET id = id + 10 where id > 10; UPDATE 0 -- Here it doesn't work. Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45 20 46 ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] oid's in views.

2001-10-19 Thread Aasmund Midttun Godal
fax 621-2533 > and non-profit organizations. San Francisco > > > > > ---(end of broadcast)--- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html Aasmund Midttun Godal [E

Re: [SQL] Need a VIEW without SUB-SELECT

2001-10-19 Thread Aasmund Midttun Godal
t; ---(end of broadcast)------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45 20 46 ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

[SQL] oid's in views.

2001-10-18 Thread Aasmund Midttun Godal
; The oid column will always be blank. The oid column can never be used for anything usefull. There are many workarounds to this problem - and I appreciate that altering this behaviour might be contradictory to some design philosophy you may have. Just my comment that's all! Aasmund Midttu

[SQL] Access to functions

2001-10-18 Thread Aasmund Midttun Godal
' on pg_proc), ?? I looked through the todo, and albeit being a lot of new features in the grant section I cannot find any info regarding these issues. Sincerely, Aasmund. Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45 20 46 ---

[SQL] Variables.

2001-10-16 Thread Aasmund Midttun Godal
there is some sort of SESSION_ID environment variable. Some of the uses: * Store things like personal preferences * Parameters from a webserver * Client application name * etc. Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45 20 46 ---(end

Re: [SQL] Triggers do not fire

2001-10-16 Thread Aasmund Midttun Godal
DATE test SET value = 1000.0 WHERE epoch = '2000-10-11 12:10:00' AND > sensor_id = 1; > UPDATE 0 > > The insert notice can be shown! > The update notice is not there! > > Why? > > > -- > Mit freundlichen Gruessen / With best regards >Reine

Re: [SQL] problem w/plpgsql proc

2001-10-15 Thread Aasmund Midttun Godal
f" > psql:edit_procs.sql:144: ERROR: parser: parse error at or near > "tblemailadd" > psql:edit_procs.sql:146: ERROR: parser: parse error at or near "return" > psql:edit_procs.sql:147: ERROR: parser: parse error at or near "if" > psql:edit_procs

Re: [SQL] Indexes

2001-10-15 Thread Aasmund Midttun Godal
On Sat, 13 Oct 2001 14:17:48 GMT, "Aasmund Midttun Godal" <[EMAIL PROTECTED]> wrote: > On Fri, 12 Oct 2001 19:33:46 -0700 (PDT), Stephan Szabo ><[EMAIL PROTECTED]> wrote: > Well, then another question; will a function be only evaluated once inside a quer

[SQL] Restricting access to Large objects

2001-10-15 Thread Aasmund Midttun Godal
I can't find any docs / mails on this subject. How can I restrict access to large objects. 1.) Based on users. 2.) Rules/triggers? Thanx. Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45 20 46 ---(end of broa

[SQL] Restricting access to Large objects

2001-10-15 Thread Aasmund Midttun Godal
I sent with the wrong email first. sorry. I can't find any docs / mails on this subject. How can I restrict access to large objects. 1.) Based on users. 2.) Rules/triggers? Thanx. Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45 20 46 -- End Forw

[SQL] Indexes

2001-10-12 Thread Aasmund Midttun Godal
source...) I would be glad to know. Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45 20 46 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

[SQL] VARCHAR vs TEXT

2001-10-10 Thread Aasmund Midttun Godal
. Or am I correct to assume that if you need a place to store some text, and you are not sure how much (like an email address or a name) you are best off using text? Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45 20 46 ---(end of broa

[SQL] Restricting access to large objects.

2001-10-10 Thread Aasmund Midttun Godal
I sent with the wrong email first. sorry. I can't find any docs / mails on this subject. How can I restrict access to large objects. 1.) Based on users. 2.) Rules/triggers? Thanx. Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45

[SQL] PlPerl

2001-10-07 Thread Aasmund Midttun Godal
1. Is there a plperlu? ... unsafe version of perl? 2. Is it possible to select which packages the plperl should have access to? 3. What exactly can you and can't you do. Thank you for your attention. Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45