Subject: outer joins, postquel functions

From: [email-masked]
Date: Fri, 24 Apr 92 10:22:09 -0700

Several questions from a relatively new user (of version 3.1) having read both the 
user and reference manuals:

[1] There are several places where the documentation says that outer join semantics
	are not present for a particular feature, there are also the reserved words
	leftouter and rightouter which are not documented anywhere else - is there
	ANY feature in this version which WILL provide outer join semantics?

[2] The user manual specifies one syntax for defining postquel functions, e.g.,
	
	define function xxx (language = "postquel", returntype = ZZZ)
		arg is (typename) as
		...

     while the reference manual specifies another syntax, e.g., 

	define postquel function xxx(argtype1, argtype2, ...)
		...

Which is right?
If the first is right, how do you specify more than one argument?
If the second is right, how do you specify the return variable?
In either case, how do you specify a function that does a number of operations
	(outside of a list of queries which the docs do say is not supported)?

[3] Using the C interface (libpq) I have found it necessary to always do a setdb
	before doing a query.  If I do not, the query always returns a null result.
	Does anyone else have this problem?

[4] Is there any way to batch a number of commands for a single PQexec as long
	as only one retrieve is present and appropriate begins and ends are present?
	For example, right now I cannot even get the command sequence
		"begin retrieve (xxx.all) end" 
	to work correctly and must instead submit the begin, retrieve, and end 
	commands with separate PQexecs.

Any insight into these problems would be greatly appreciated.

Thx.

David Feldcamp
UBC Computer Science
[email-masked]

---

From: postarch (Postgres Mailing Archive)
Date: Thu, 30 Apr 92 10:57:55 PDT

you write:

>[1] There are several places where the documentation says that outer join sem
 +antics
>	are not present for a particular feature, there are also the reserved w
 +ords
>	leftouter and rightouter which are not documented anywhere else - is th
 +ere
>	ANY feature in this version which WILL provide outer join semantics?

I'm not sure what this is.  Can you point me to specific places in the manual?

>[2] The user manual specifies one syntax for defining postquel functions, e.g
 +.,
>	define postquel function xxx(argtype1, argtype2, ...)

The former of the two choices is the correct one.  This syntax has changed
recently and we didn't properly update the reference.

>If the first is right, how do you specify more than one argument?

Support for postquel functions in 3.1 is anemic at best.  For examples of
supported syntax for these functions the "video" demo is a great place to
start.

>If the second is right, how do you specify the return variable?

Don't believe everything you read in the reference we are way behind in
keeping it up to date.  We apologize profusely, but lack the man power
to keep up.

>[3] Using the C interface (libpq) I have found it necessary to always do a se
 +tdb
>	before doing a query.  If I do not, the query always returns a null res
 +ult.
>	Does anyone else have this problem?

hmmm.... if you don't specify a database it should default to a database
name that matches your login name.  If that database doesn't exist you
should get a FATAL message from the backend.  What exactly do you mean by
"null result"?

>[4] Is there any way to batch a number of commands for a single PQexec as lon
 +g
>	as only one retrieve is present and appropriate begins and ends are pre
 +sent?
>	commands with separate PQexecs.

This is a known problem.  All queries must be submitted on PQexec() at a
time.  The backend goes berzerk otherwise.  This also applies to the terminal
monitor.  You must put a \g after each individual query so that it sends them
one at a time.

Jeff Meredith
[email-masked]