Received: from druid.net (root@druid.net [216.126.72.98]) by hub.org (8.9.3/8.9.3) with ESMTP id HAA15634 for ; Tue, 16 May 2000 07:37:23 -0400 (EDT) (envelope-from darcy@druid.net) Received: from localhost (1680 bytes) by druid.net via sendmail with P:stdio/R:bind_hosts/T:inet_zone_bind_smtp (sender: ) (ident using unix) id for ; Tue, 16 May 2000 07:37:22 -0400 (EDT) (Smail-3.2.0.109 1999-Oct-27 #1 built 1999-Dec-25) Message-Id: From: darcy@druid.net (D'Arcy J.M. Cain) Subject: Using substr with user defined types To: pgsql-sql@PostgreSQL.org Date: Tue, 16 May 2000 07:37:22 -0400 (EDT) X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archive-Number: 200005/8 I created a type (for passwords) but I can't seem to use substr. I suppose that's because it is my own type because the errors suggest that there is no substr (actually it says ltrim) function for that type. The type is a password that takes a string on input and stores it as a DES encrypted string. In order for dump and reload to preserve the passwords I did the following. - On output precede the string with a colon, an otherwise invalid character - On input strip the colon if present and store instead of encrypting My problem is that to use this value I need to strip the colon off and I can't figure out how to do that. I even wrote a second output function called chkpass_rout but I can't seem to figure out how to access it. I get this error when I try to use it (after creating the function in SQL. ERROR: typeidTypeRelid: Invalid type - oid = 0 When I try to use substr I get this. ERROR: No such function 'substr' with the specified attributes When I try to cast the field to text I get this. ERROR: No such function 'text' with the specified attributes Can someone please tell me what I am missing here? -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/ | and a sheep voting on +1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.