Subject: Small postquel function is driving me crazy

From: [email-masked] (John Campbell)
Date: Sun, 6 Dec 92 20:24:46 -0800

Hello,

I haven't read any articles in this list yet (I just now subscribed) 
but I'm frustrated enough to post this question before learning if 
there is a FAQ that would answer it.

Can anyone tell me why the following won't work (or any of the 
two dozen variations I've tried)?

    define function ls 
     (language = "postquel", returntype = setof pg_class)
     as "retrieve (pg_class.relname, pg_class.relowner) 
         where pg_class.relname !~ \"pg_.*\" " \g

The command 

    retrieve (pg_class.relname,pg_class.relowner) where
              pg_class.relname !~ "pg_.*" \g

works as I would hope.  However, I don't seem to be able to put the
text string "pg_.*" into the function--despite finding a comment about
string constants in the reference manual stating that \" should work.

(I suppose it would be best to make ``view'' called ``ls'' rather than a 
function--but views are tomorrow's topic.  Putting constant strings into 
functions became today's topic.)

Thanks!

-- 
	John Campbell               [email-masked]
        [email-masked]      [email-masked]

---

From: [email-masked] (Leif Neve)
Date: Mon, 7 Dec 92 09:53:12 -0800

>          where pg_class.relname !~ \"pg_.*\" " \g 

Strange thing is, that command works just fine using the SPOG front
end. Any gurus out there know why spog can handle the `*' and the
monitor can't?

(BTW - Change the command slightly to make the return types match:

      (language = "postquel", returntype = setof pg_class)
      as "retrieve (pg_class.all) 
          where pg_class.relname !~ \"pg_.*\" " \g 
)

Leif Neve