Subject: string comparison

From: [email-masked] (Sudheer R. Vangati)
Date: Thu, 28 May 92 14:10:24 -0700

Hi!
	Could any one give me some information on string comparison in postgres?
I was hoping to avoid character arrays altogether and instead use string of characters, since postgres does not allow comparisons of character arrays.

eg:

create PROJECT (APPLICATION=char[], TYPE=char[], NO_OF_LICENCES=int4)\g
append PROJECT (APPLICATION="Frame Maker", TYPE="Publishing", 
NO_OF_LICENCES=5)\g

This does not work....

replace PROJECT (NO_OF_LICENCES=9) where PROJECT.APPLICATION="Frame Maker"\g
 
Query sent to backend is "replace PROJECT (NO_OF_LICENCES=9) where PROJECT.APPLICATION="Frame Maker""
WARN:May 28 15:32:32:OperatorDef: no operator =

This works....

replace PROJECT (APPLICATION="Word Perfect") where PROJECT.NO_OF_LICENCES=9\g

Query sent to backend is "replace PROJECT (APPLICATION="Word Perfect") where PROJECT.NO_OF_LICENCES=9"
REPLACE
why is it so?

Is there anyone out there who has already thought of and may be written the type stringcmp??

Any info will be of great help. thanx in advance.

---

From: <[email-masked]>
Date: Thu, 28 May 92 14:26:19 PDT

In message <[email-masked]> you write:
> Hi!
> 	Could any one give me some information on string comparison in postgres
  +?
> I was hoping to avoid character arrays altogether and instead use string of c
  +haracters, since postgres does not allow comparisons of character arrays.
> append PROJECT (APPLICATION="Frame Maker", TYPE="Publishing", 

say

	create foo (a = text)

	append foo (a = "this is a text string")
	retrieve (foo.all) where foo.a = "this is a text string"

see the reference manual if you need more examples.

					mike olson
					postgres research group
					uc berkeley
					[email-masked]