packages feed

hssqlppp 0.0.10 → 0.1.0

raw patch · 76 files changed

+55111/−14710 lines, 76 filesdep +Pipedep +cmdargsdep +filepathdep ~base

Dependencies added: Pipe, cmdargs, filepath, haskell-src-exts, pretty-show, process, template-haskell, uniplate

Dependency ranges changed: base

Files

Database/HsSqlPpp/Ast/Annotation.lhs view
@@ -11,12 +11,7 @@ >      -- * Annotation data types >      Annotation >     ,AnnotationElement(..)->      -- * Statement info->      -- | This is the main annotation attached to each statement. Early days at the moment->      -- but will be expanded to provide any type errors lurking inside a statement, any useful->      -- types, e.g. the types of each select and subselect/sub query in a statement,->      -- any changes to the catalog the statement makes, and possibly much more information.->     ,StatementInfo(..)+>     ,StatementType(..) >     ,stripAnnotations >     ,updateAnnotation >     ,getAnnotation
− Database/HsSqlPpp/Ast/Annotator.lhs
@@ -1,44 +0,0 @@-Copyright 2009 Jake Wheat--This is the public module for the type checking functionality.--> {- | Contains the data types and functions for annotating->  an ast and working with annotated trees, including the->  representations of SQL data types.->-> Annotations:->-> * are attached to some of the ast node data types, but not quite all of them;->-> * types annotations are attached to most nodes during type checking;->-> * type errors are attached to the lowest down node that the type error is detected at;->-> * nodes who fail the type check or whose type depends on a node with a type error are->   given the type 'TypeCheckFailed';->-> * each statement has an additional 'StatementInfo' annotation attached to it;->-> * the parser fills in the source position annotation in every annotatable ast node.->-> -}-> module Database.HsSqlPpp.Ast.Annotator->     (->      -- * Annotation functions->      annotateAst->     ,annotateAstEnv->     ,annotateExpression->     ,annotateAstsEnv->     ,annotateAstEnvEnv->      -- * Annotated tree utils->     ,getTopLevelTypes->     ,getTopLevelInfos->     ,getTopLevelEnvUpdates->     ,getTypeErrors->     ,getStatementAnnotations->     ) where--> import Database.HsSqlPpp.AstInternals.AstInternal-> import Database.HsSqlPpp.AstInternals.AstAnnotation-> import Database.HsSqlPpp.AstInternals.AnnotationUtils-
Database/HsSqlPpp/Ast/Ast.lhs view
@@ -5,10 +5,12 @@ > {- | This module contains the ast node data types. They are very >      permissive, in that they allow a lot of invalid SQL to be >      represented. The type checking process should catch all invalid->      trees, but doesn't quite manage at the moment. Sorry about all+>      trees, but doesn't quite manage at the moment.  Sorry about all >      the seemingly pointless type synonyms below, they are an->      artefact of using UUAGC.->  -}+>      artefact of using UUAGC. You can see labels for the fields by+>      looking at the ag source here:+>      <http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head:/Database/HsSqlPpp/AstInternals/AstInternal.ag>+>      -}  > module Database.HsSqlPpp.Ast.Ast >     (@@ -22,6 +24,7 @@ >     ,SelectList (..) >     ,SelectItem (..) >     ,TableRef (..)+>     ,TableAlias(..) >     ,JoinExpression (..) >     ,JoinType (..) >     ,Natural (..)@@ -29,6 +32,8 @@ >     ,Direction (..) >     ,Distinct (..) >     ,InList (..)+>     ,LiftFlavour (..)+>     ,FrameClause(..) >      -- ** dml >     ,SetClause (..) >     ,CopySource (..)@@ -37,11 +42,15 @@ >     ,AttributeDef (..) >     ,RowConstraint (..) >     ,Constraint (..)+>     ,AlterTableAction(..) >     ,TypeAttributeDef (..) >     ,TypeName (..) >     ,DropType (..) >     ,IfExists (..) >     ,Cascade (..)+>     ,TriggerWhen(..)+>     ,TriggerEvent(..)+>     ,TriggerFire(..) >      -- ** functions >     ,FnBody (..) >     ,ParamDef (..)@@ -49,17 +58,21 @@ >     ,RaiseType (..) >     ,Volatility (..) >     ,Language (..)+>      -- ** misc+>      ,SetValue(..) >      -- ** typedefs >     ,ExpressionListStatementListPairList >     ,ExpressionListStatementListPair >     ,ExpressionList+>     ,MaybeSelectList >     ,StringList >     ,ParamDefList >     ,AttributeDefList >     ,ConstraintList >     ,TypeAttributeDefList->     ,StringStringListPairList->     ,StringStringListPair+>     ,TypeNameList+>     ,StringTypeNameListPair+>     ,StringTypeNameListPairList >     ,ExpressionStatementListPairList >     ,SetClauseList >     ,CaseExpressionListExpressionPairList
Database/HsSqlPpp/Ast/Environment.lhs view
@@ -4,22 +4,16 @@ the public part of EnvironmentInternal, which is the module used by the type checking code. -> {- | This module contains the environment data types and a helper functions.->    You almost certainly will never have to do anything with Environments apart->    from read them from a database to supply to the annotation function. If you->    only need to type check against the default template1 catalog, then you->    don't even need to do this - is you use the annotation function with->    no Environment parameter, it uses the default template1 catalog.+> {- | This module contains the database catalog data types and helper functions. >->    The environment data type serves the following purposes:+>  The environment data type (which should really be called catalog)+>  serves the following purposes: > >  * Contains all the catalog information needed to type check against >     an existing database. > >  * A copy of the catalog information from a default template1->    database is included - 'defaultTemplate1Environment', at some->    point this might be used to allow typechecking sql code against->    this catalog without having an available PostGreSQL install.+>    database is included - 'defaultTemplate1Environment'. > >  * It is used internally to keep track of updates to the catalog >     whilst running an annotation process (e.g. so that a select can@@ -30,6 +24,7 @@ > >  You can see what kind of stuff is contained in the Environment type >  by looking at the 'EnvironmentUpdate' type.+> > -}  > module Database.HsSqlPpp.Ast.Environment@@ -38,8 +33,8 @@ >      Environment >      -- ** Updates >     ,EnvironmentUpdate(..)+>     ,ppEnvUpdate >      -- ** bits and pieces->     ,QualifiedIDs >     ,CastContext(..) >     ,CompositeFlavour(..) >     ,CompositeDef@@ -53,13 +48,13 @@ >      -- * Functions >     ,readEnvironmentFromDatabase >     ,updateEnvironment->     --,destructEnvironment+>     ,deconstructEnvironment >      -- * operator utils >     ,OperatorType(..) >     ,getOperatorType >     ,isOperatorName >     ) where -> import Database.HsSqlPpp.AstInternals.EnvironmentInternal-> import Database.HsSqlPpp.AstInternals.EnvironmentReader-> import Database.HsSqlPpp.AstInternals.DefaultTemplate1Environment+> import Database.HsSqlPpp.AstInternals.Environment.EnvironmentInternal+> import Database.HsSqlPpp.AstInternals.Environment.EnvironmentReader+> import Database.HsSqlPpp.AstInternals.Environment.DefaultTemplate1Environment
+ Database/HsSqlPpp/Ast/TypeChecker.lhs view
@@ -0,0 +1,42 @@+Copyright 2009 Jake Wheat++This is the public module for the type checking functionality.++> {- | Contains the data types and functions for annotating+>  an ast and working with annotated trees, including the+>  representations of SQL data types.+>+> Annotations:+>+> * are attached to most of the ast node data types, but not quite all of them;+>+> * types annotations are attached to most nodes during type checking;+>+> * type errors are attached to the lowest down node that the type error is detected at;+>+> * nodes who fail the type check or whose type depends on a node with a type error are+>   given the type 'TypeCheckFailed';+>+> * each statement has an additional 'StatementInfo' annotation attached to it;+>+> * the parser fills in the source position annotation in every annotatable ast node.+>+> -}+> module Database.HsSqlPpp.Ast.TypeChecker+>     (+>      -- * typechecking/ annotation functions+>       typeCheck+>      ,typeCheckPS+>      ,typeCheckExpression+>      -- * Annotated tree utils+>     ,getTopLevelTypes+>     ,getTopLevelInfos+>     ,getTopLevelEnvUpdates+>     ,getTypeErrors+>     ,getStatementAnnotations+>     ) where++> import Database.HsSqlPpp.AstInternals.AstInternal+> import Database.HsSqlPpp.AstInternals.AstAnnotation+> import Database.HsSqlPpp.AstInternals.AnnotationUtils+
Database/HsSqlPpp/AstInternals/AnnotationUtils.lhs view
@@ -23,3 +23,5 @@ >     where >       ga :: Statement -> [Annotation] >       ga s = [getAnnotation s]++
Database/HsSqlPpp/AstInternals/AstAnnotation.lhs view
@@ -23,12 +23,13 @@ >     ,getTypeAnnotation >     ,getTypeErrors >     ,stripAnnotations+>     ,filterAnnotations >     ,updateAnnotation >     ,getAnnotation >     ,getAnnotations >     --,getTypeErrors >     --,pack->     ,StatementInfo(..)+>     ,StatementType(..) >     ,getSIAnnotation >     ) where @@ -37,7 +38,7 @@ > import Control.Arrow  > import Database.HsSqlPpp.AstInternals.TypeType-> import Database.HsSqlPpp.AstInternals.EnvironmentInternal+> import Database.HsSqlPpp.AstInternals.Environment.EnvironmentInternal  > -- | Annotation type - one of these is attached to most of the > -- data types used in the ast.@@ -48,7 +49,7 @@ > data AnnotationElement = SourcePos String Int Int >                        | TypeAnnotation Type >                        | TypeErrorA TypeError->                        | StatementInfoA StatementInfo+>                        | StatementTypeA StatementType >                        | EnvUpdates [EnvironmentUpdate] >                          deriving (Eq, Show,Typeable,Data) @@ -106,9 +107,9 @@ > everythingOne k f x >  = foldl k (f x) (gmapQ (everythingZero k f) x) -> getSIAnnotation :: Annotation -> [Maybe StatementInfo]+> getSIAnnotation :: Annotation -> [Maybe StatementType] > getSIAnnotation (x:xs) = case x of->                                 StatementInfoA t -> [Just t]+>                                 StatementTypeA t -> [Just t] >                                 _ -> getSIAnnotation xs > getSIAnnotation []  = [Nothing] @@ -119,23 +120,19 @@ > getEuAnnotation [] = []  -> -- | Run through the ast given and return a list of statementinfos+> -- | Run through the ast given and return a list of statementtypes > -- from the top level items.-> getTopLevelInfos :: Data a => [a] -> [Maybe StatementInfo]+> getTopLevelInfos :: Data a => [a] -> [Maybe StatementType] > getTopLevelInfos = getTopLevelXs getSIAnnotation  > getTopLevelEnvUpdates ::  Data a => [a] -> [[EnvironmentUpdate]] > getTopLevelEnvUpdates = getTopLevelXs getEuAnnotation -> data StatementInfo = DefaultStatementInfo Type->                    | SelectInfo Type->                    | InsertInfo String Type->                    | UpdateInfo String Type->                    | DeleteInfo String+> data StatementType = StatementType [Type] [(String,Type)] >                      deriving (Eq,Show,Typeable,Data)  todo:-add environment deltas to statementinfo+add environment deltas to statementtype (??)  question: if a node has no source position e.g. the all in select all or select@@ -154,12 +151,22 @@ > -- | strip all the annotations from a tree. E.g. can be used to compare > -- two asts are the same, ignoring any source position annotation differences. > stripAnnotations :: (Data a) => a -> a-> stripAnnotations = everywhere (mkT stripAn)->                    where->                      stripAn :: [AnnotationElement] -> [AnnotationElement]->                      stripAn _ = []+> stripAnnotations = filterAnnotations (const False) + >>                    everywhere (mkT stripAn)+ >                    where+ >                      stripAn :: [AnnotationElement] -> [AnnotationElement]+ >                      stripAn _ = [] ++> filterAnnotations :: (Data a) => (AnnotationElement -> Bool) -> a -> a+> filterAnnotations f =+>     everywhere (mkT filterAnn)+>     where+>       filterAnn :: [AnnotationElement] -> [AnnotationElement]+>       filterAnn = filter f++ > -- | runs through the ast given and returns a list of all the type errors > -- in the ast. Recurses into all ast nodes to find type errors. > -- This is the function to use to see if an ast has passed the type checking process.@@ -181,6 +188,7 @@   +> -- | Update all the annotations in a tree using the function supplied > updateAnnotation :: forall a.(Data a) => >                   (Annotation -> Annotation) -> a -> a > updateAnnotation f = oneLevel (mkT f)@@ -189,6 +197,7 @@ >          -> (forall a.Data a => a -> a) > oneLevel f = gmapT f +> -- | get the annotation for the root of the tree passed > getAnnotation :: forall a.(Data a) => a -> Annotation > getAnnotation a = >   case oneLevelQ (mkQ [] f) a of
Database/HsSqlPpp/AstInternals/AstInternal.ag view
@@ -44,6 +44,7 @@    ,FnBody (..)    ,SetClause (..)    ,TableRef (..)+   ,TableAlias(..)    ,JoinExpression (..)    ,JoinType (..)    ,SelectList (..)@@ -51,6 +52,7 @@    ,CopySource (..)    ,AttributeDef (..)    ,RowConstraint (..)+   ,AlterTableAction(..)    ,Constraint (..)    ,TypeAttributeDef (..)    ,ParamDef (..)@@ -68,7 +70,12 @@    ,IfExists (..)    ,RestartIdentity (..)    ,Expression (..)+   ,FrameClause(..)    ,InList (..)+   ,LiftFlavour(..)+   ,TriggerWhen(..)+   ,TriggerEvent(..)+   ,TriggerFire(..)    ,StatementList    ,ExpressionListStatementListPairList    ,ExpressionListStatementListPair@@ -78,8 +85,9 @@    ,AttributeDefList    ,ConstraintList    ,TypeAttributeDefList-   ,StringStringListPairList-   ,StringStringListPair+   ,TypeNameList+   ,StringTypeNameListPair+   ,StringTypeNameListPairList    ,ExpressionStatementListPairList    ,SetClauseList    ,CaseExpressionListExpressionPairList@@ -96,12 +104,12 @@    ,ExpressionDirectionPair    ,ExpressionDirectionPairList    ,MaybeBoolExpression-   -- annotations-   ,annotateAst-   ,annotateAstEnv-   ,annotateExpression-   ,annotateAstsEnv-   ,annotateAstEnvEnv+   ,MaybeSelectList+   ,SetValue(..)+   -- typechecking+   ,typeCheck+   ,typeCheckPS+   ,typeCheckExpression }  {@@ -113,14 +121,18 @@ import Data.Either import Control.Applicative import Data.Generics+import Data.Char  import Database.HsSqlPpp.AstInternals.TypeType-import Database.HsSqlPpp.AstInternals.TypeConversion-import Database.HsSqlPpp.AstInternals.TypeCheckingH+import Database.HsSqlPpp.AstInternals.TypeChecking.TypeConversion+import Database.HsSqlPpp.AstInternals.TypeChecking.ErrorUtils import Database.HsSqlPpp.AstInternals.AstAnnotation-import Database.HsSqlPpp.AstInternals.EnvironmentInternal-import Database.HsSqlPpp.AstInternals.DefaultTemplate1Environment+import Database.HsSqlPpp.AstInternals.Environment.EnvironmentInternal+import Database.HsSqlPpp.AstInternals.Environment.LocalIdentifierBindings+import Database.HsSqlPpp.AstInternals.Environment.DefaultTemplate1Environment import Database.HsSqlPpp.Utils+import Data.Generics.PlateData+ }  {-@@ -145,18 +157,18 @@              table : String              targetCols : StringList              insData : SelectExpression-             returning : (Maybe SelectList)+             returning : MaybeSelectList     --tablename setitems where returning     | Update ann:Annotation              table : String              assigns : SetClauseList              whr : MaybeBoolExpression-             returning : (Maybe SelectList)+             returning : MaybeSelectList     --tablename, where, returning     | Delete ann:Annotation              table : String              whr : MaybeBoolExpression-             returning : (Maybe SelectList)+             returning : MaybeSelectList     --tablename column names, from     | Copy ann:Annotation            table : String@@ -175,6 +187,19 @@                   name : String                   atts : AttributeDefList                   cons : ConstraintList+    | AlterTable ann:Annotation+                 name : String+                 actions : {[AlterTableAction]}+    | CreateSequence ann:Annotation+                     name:String+                     incr:Integer+                     min:Integer+                     max:Integer+                     start:Integer+                     cache:Integer+    | AlterSequence ann:Annotation+                    name:String+                    ownedBy: String     | CreateTableAs ann:Annotation                     name : String                     expr : SelectExpression@@ -186,10 +211,10 @@                  atts : TypeAttributeDefList     -- language name args rettype bodyquoteused body vol     | CreateFunction ann:Annotation-                     lang : Language                      name : String                      params : ParamDefList                      rettype : TypeName+                     lang : Language                      bodyQuote : String                      body : FnBody                      vol : Volatility@@ -197,11 +222,22 @@     | CreateDomain ann:Annotation                    name : String                    typ : TypeName+                   checkName: String                    check : MaybeBoolExpression+    | CreateLanguage ann:Annotation+                     name:String+    | CreateTrigger ann:Annotation+                    name:String+                    wh : TriggerWhen+                    events: {[TriggerEvent]}+                    tbl : String+                    firing : TriggerFire+                    fnName : String+                    fnArgs : {[Expression]}     -- ifexists (name,argtypes)* cascadeorrestrict     | DropFunction ann:Annotation                    ifE : IfExists-                   sigs : StringStringListPairList+                   sigs : StringTypeNameListPairList                    cascade : Cascade     -- ifexists names cascadeorrestrict     | DropSomething ann:Annotation@@ -255,6 +291,11 @@          cases : ExpressionStatementListPairList          els : StatementList +--misc++    | Set ann:Annotation name:String values:{[SetValue]}+    | Notify ann:Annotation name:String+ -- =============================================================================  --Statement components@@ -290,24 +331,25 @@  DATA TableRef | Tref ann:Annotation                      tbl:String-              | TrefAlias ann:Annotation-                          tbl : String-                          alias : String+                     alias : TableAlias               | JoinedTref ann:Annotation                            tbl : TableRef                            nat : Natural                            joinType : JoinType                            tbl1 : TableRef                            onExpr : OnExpr+                           alias : TableAlias               | SubTref ann:Annotation                         sel : SelectExpression-                        alias : String+                        alias : TableAlias               | TrefFun ann:Annotation                         fn:Expression-              | TrefFunAlias ann:Annotation-                             fn:Expression-                             alias:String+                        alias : TableAlias +DATA TableAlias | NoAlias+                | TableAlias alias:String+                | FullAlias alias:String cols:{[String]}+ TYPE OnExpr = MAYBE JoinExpression  DATA JoinExpression | JoinOn ann:Annotation Expression@@ -317,8 +359,11 @@  -- select columns, into columns -DATA SelectList | SelectList ann:Annotation items:SelectItemList StringList+DATA SelectList | SelectList ann:Annotation items:SelectItemList into:StringList ++TYPE MaybeSelectList = MAYBE SelectList+ DATA SelectItem | SelExp ann:Annotation ex:Expression                 | SelectItem ann:Annotation ex:Expression name:String @@ -335,12 +380,12 @@  --Constraints which appear attached to an individual field -DATA RowConstraint | NullConstraint ann:Annotation-                   | NotNullConstraint ann:Annotation-                   | RowCheckConstraint ann:Annotation Expression-                   | RowUniqueConstraint ann:Annotation-                   | RowPrimaryKeyConstraint ann:Annotation-                   | RowReferenceConstraint ann:Annotation+DATA RowConstraint | NullConstraint ann:Annotation name:String+                   | NotNullConstraint ann:Annotation name:String+                   | RowCheckConstraint ann:Annotation name:String Expression+                   | RowUniqueConstraint ann:Annotation name:String+                   | RowPrimaryKeyConstraint ann:Annotation name:String+                   | RowReferenceConstraint ann:Annotation name:String                                             table : String                                             att : (Maybe String)                                             onUpdate : Cascade@@ -348,11 +393,12 @@  --constraints which appear on a separate row in the create table -DATA Constraint | UniqueConstraint ann:Annotation StringList-                | PrimaryKeyConstraint ann:Annotation StringList-                | CheckConstraint ann:Annotation Expression+DATA Constraint | UniqueConstraint ann:Annotation name:String StringList+                | PrimaryKeyConstraint ann:Annotation name:String StringList+                | CheckConstraint ann:Annotation name:String Expression                   -- sourcecols targettable targetcols ondelete onupdate                 | ReferenceConstraint ann:Annotation+                                      name:String                                       atts : StringList                                       table : String                                       tableAtts : StringList@@ -363,6 +409,20 @@                                    name : String                                    typ : TypeName +DATA AlterTableAction | AlterColumnDefault ann:Annotation+                                           nm : String+                                           def : Expression+                      | AddConstraint ann:Annotation+                                      con: Constraint+DATA SetValue+    | SetStr ann:Annotation String+    | SetId ann:Annotation String+    | SetNum ann:Annotation Double++DATA TriggerWhen | TriggerBefore | TriggerAfter+DATA TriggerEvent | TInsert| TUpdate | TDelete+DATA TriggerFire | EachRow | EachStatement+ DATA ParamDef | ParamDef ann:Annotation name:String typ:TypeName               | ParamDefTp ann:Annotation typ:TypeName @@ -420,6 +480,7 @@                 | NullLit ann:Annotation                 | BooleanLit ann:Annotation b:Bool                 | PositionalArg ann:Annotation p:Integer+                | Placeholder ann:Annotation -- represents a '?'                 | Cast ann:Annotation                        expr:Expression                        tn:TypeName@@ -441,19 +502,29 @@                               expr:Expression                               i:Bool                               list:InList-                  -- windowfn selectitem partitionby orderby orderbyasc?                 | WindowFn ann:Annotation                            fn : Expression                            partitionBy : ExpressionList                            orderBy : ExpressionList                            dir : Direction+                           frm : FrameClause                 | ScalarSubQuery ann:Annotation                                  sel : SelectExpression+                | LiftOperator ann:Annotation+                               oper:String+                               flav:LiftFlavour+                               args:ExpressionList +DATA LiftFlavour | LiftAny | LiftAll++--todo: use liftoperator to implement inlist? DATA InList | InList ann:Annotation exprs : ExpressionList             | InSelect ann:Annotation sel : SelectExpression  +DATA FrameClause | FrameUnboundedPreceding+                 | FrameUnboundedFull+                 | FrameRowsUnboundedPreceding {-  list of expression flavours from postgresql with the equivalents in this ast@@ -525,8 +596,9 @@ TYPE ConstraintList = [Constraint] TYPE TypeAttributeDefList = [TypeAttributeDef] TYPE ParamDefList = [ParamDef]-TYPE StringStringListPair = (String,StringList)-TYPE StringStringListPairList = [StringStringListPair]+TYPE TypeNameList = [TypeName]+TYPE StringTypeNameListPair = (String, TypeNameList)+TYPE StringTypeNameListPairList = [StringTypeNameListPair] TYPE ExpressionListStatementListPair = (ExpressionList,StatementList) TYPE ExpressionListStatementListPairList = [ExpressionListStatementListPair] TYPE ExpressionStatementListPair = (Expression, StatementList)@@ -571,19 +643,23 @@                Expression InList MaybeExpression MaybeBoolExpression                ExpressionList ExpressionListList StringList SetClauseList                AttributeDefList ConstraintList TypeAttributeDefList-               ParamDefList StringStringListPair StringStringListPairList+               ParamDefList TypeNameList StringTypeNameListPair+               StringTypeNameListPairList                StatementList ExpressionListStatementListPair                ExpressionListStatementListPairList ExpressionStatementListPair                ExpressionStatementListPairList VarDefList SelectItemList                RowConstraintList CaseExpressionListExpressionPair                CaseExpressionListExpressionPairList CaseExpressionList-               TableRefList TableRef OnExpr ExpressionDirectionPair+               TableRefList TableRef OnExpr LiftFlavour MaybeSelectList+               SetValue TableAlias FrameClause AlterTableAction+               TriggerWhen TriggerEvent TriggerFire ExpressionDirectionPair                ExpressionDirectionPairList + DERIVING AllNodes: Show,Eq,Typeable,Data  -INCLUDE "TypeChecking.ag"+INCLUDE "TypeChecking/TypeChecking.ag"  {- @@ -605,55 +681,89 @@  -} {--- | Takes an ast, and adds annotations, including types, type errors,--- and statement info. Type checks against defaultEnv.-annotateAst :: StatementList -> StatementList-annotateAst = annotateAstEnv defaultTemplate1Environment----- | As annotateAst but you supply an environment to check--- against. See Environment module for how to read an Environment from--- an existing database so you can type check against it.-annotateAstEnv :: Environment -> StatementList -> StatementList-annotateAstEnv env sts =-    let t = sem_Root (Root sts)-        ta = wrap_Root t Inh_Root {env_Inh_Root = env}-        tl = annotatedTree_Syn_Root ta-   in case tl of-         Root r -> r---- | Type check multiple asts, allowing type checking references in later---   files to definitions in earlier files.-annotateAstsEnv :: Environment -> [StatementList] -> [StatementList]-annotateAstsEnv env sts =+{-+-- | Type check multiple asts, allowing type checking references in+--   later files to definitions in earlier files. This is probably+--   more straightforward if you parse the files then concatenate the+--   statementlists together before type checking rather than using+--   this function+typeCheckMany :: Environment -> [StatementList] -> [StatementList]+typeCheckMany env sts =     annInt env sts []     where       annInt e (s:ss) ress =-          let (e1,res) = annotateAstEnvEnv e s+          let (e1,res) = typeCheck e s           in annInt e1 ss (res:ress)       annInt _ [] ress = reverse ress+-} --- | Type check an ast, and return the resultant Environment as well---   as the annotated ast.-annotateAstEnvEnv :: Environment -> StatementList -> (Environment,StatementList)-annotateAstEnvEnv env sts =-    let t = sem_Root (Root sts)-        ta = wrap_Root t Inh_Root {env_Inh_Root = env}+-- | Takes an ast, checks against catalog passed, and adds+--   annotations, including types, type errors, and statement info.+--   Returns the updated catalog as well as the annotated ast.+typeCheck :: Environment -> StatementList -> (Environment,StatementList)+typeCheck env sts =+    let t = sem_Root (Root (fixupImplicitJoins sts))+        ta = wrap_Root t Inh_Root {env_Inh_Root = env+                                  ,lib_Inh_Root = emptyBindings}         tl = annotatedTree_Syn_Root ta         env1 = producedEnv_Syn_Root ta    in case tl of          Root r -> (env1,r) +-- | Unfinished version of type check which can type check an+-- individual statement with ? or positional arg placeholders in+-- it. Will error if the statement isn't select, update, insert or+-- delete. For use in type checking embedded parameterized+-- statements. Does all typechecking and annotation that the regular+-- typecheck does.+typeCheckPS :: Environment -> Statement -> Either String Statement+typeCheckPS env st =+    case st of+      SelectStatement _ _ -> tc+      Insert _ _ _ _ _ -> tc+      Update _ _ _ _ _ -> tc+      Delete _ _ _ _ -> tc+      _ -> Left "requires select, update, insert or delete statement"+    where+      tc = let t = sem_Root (Root (fixupImplicitJoins [st]))+               ta = wrap_Root t Inh_Root {env_Inh_Root = env+                                         ,lib_Inh_Root = emptyBindings}+               tl = annotatedTree_Syn_Root ta+               env1 = producedEnv_Syn_Root ta+           in case tl of+                Root [st1] -> Right st1+                _ -> error "impossible happened in typeCheckPS!"++ -- | Testing utility, mainly used to check an expression for type errors -- or to get its type.-annotateExpression :: Environment -> Expression -> Expression-annotateExpression env ex =-    let t = sem_ExpressionRoot (ExpressionRoot ex)+typeCheckExpression :: Environment -> Expression -> Expression+typeCheckExpression env ex =+    let t = sem_ExpressionRoot (ExpressionRoot (fixupImplicitJoins ex))         rt = (annotatedTree_Syn_ExpressionRoot-              (wrap_ExpressionRoot t Inh_ExpressionRoot {env_Inh_ExpressionRoot = env}))+              (wrap_ExpressionRoot t Inh_ExpressionRoot {env_Inh_ExpressionRoot = env+                                                        ,lib_Inh_ExpressionRoot = emptyBindings}))     in case rt of          ExpressionRoot e -> e +{-+bit of a hack, to avoid rewriting the tableref type checking to be+able to do implicit joins, we just convert them in to the equivalent+explicit join+-}++fixupImplicitJoins :: Data a => a -> a+fixupImplicitJoins =+    transformBi $ \x ->+            case x of+              -- alter asts to change implicit joins into explicit joins+              Select an dis sl trs@(_:_:_) whr grp hav ord lim off+                  -> Select an dis sl [convTrefs trs] whr grp hav ord lim off+              x1 -> x1+    where+      convTrefs (tr:tr1:trs) = JoinedTref [] tr Unnatural Cross (convTrefs (tr1:trs)) Nothing NoAlias+      convTrefs (tr:[]) = tr+      convTrefs _ = error "failed doing implicit join fixup hack" }  {-
Database/HsSqlPpp/AstInternals/AstInternal.hs view
@@ -1,9201 +1,15988 @@-{-# OPTIONS_HADDOCK hide  #-}---- UUAGC 0.9.11 (AstInternal.ag)-module Database.HsSqlPpp.AstInternals.AstInternal(-    -- {-# LANGUAGE DeriveDataTypeable,RankNTypes,ScopedTypeVariables #-}-    -- {-# OPTIONS_HADDOCK hide  #-}-    --from the ag files:-    --ast nodes-    Statement (..)-   ,SelectExpression (..)-   ,FnBody (..)-   ,SetClause (..)-   ,TableRef (..)-   ,JoinExpression (..)-   ,JoinType (..)-   ,SelectList (..)-   ,SelectItem (..)-   ,CopySource (..)-   ,AttributeDef (..)-   ,RowConstraint (..)-   ,Constraint (..)-   ,TypeAttributeDef (..)-   ,ParamDef (..)-   ,VarDef (..)-   ,RaiseType (..)-   ,CombineType (..)-   ,Volatility (..)-   ,Language (..)-   ,TypeName (..)-   ,DropType (..)-   ,Cascade (..)-   ,Direction (..)-   ,Distinct (..)-   ,Natural (..)-   ,IfExists (..)-   ,RestartIdentity (..)-   ,Expression (..)-   ,InList (..)-   ,StatementList-   ,ExpressionListStatementListPairList-   ,ExpressionListStatementListPair-   ,ExpressionList-   ,StringList-   ,ParamDefList-   ,AttributeDefList-   ,ConstraintList-   ,TypeAttributeDefList-   ,StringStringListPairList-   ,StringStringListPair-   ,ExpressionStatementListPairList-   ,SetClauseList-   ,CaseExpressionListExpressionPairList-   ,MaybeExpression-   ,TableRefList-   ,ExpressionListList-   ,SelectItemList-   ,OnExpr-   ,RowConstraintList-   ,VarDefList-   ,ExpressionStatementListPair-   ,CaseExpressionListExpressionPair-   ,CaseExpressionList-   ,ExpressionDirectionPair-   ,ExpressionDirectionPairList-   ,MaybeBoolExpression-   -- annotations-   ,annotateAst-   ,annotateAstEnv-   ,annotateExpression-   ,annotateAstsEnv-   ,annotateAstEnvEnv-) where--import Data.Maybe-import Data.List-import Debug.Trace-import Control.Monad.Error-import Control.Arrow-import Data.Either-import Control.Applicative-import Data.Generics--import Database.HsSqlPpp.AstInternals.TypeType-import Database.HsSqlPpp.AstInternals.TypeConversion-import Database.HsSqlPpp.AstInternals.TypeCheckingH-import Database.HsSqlPpp.AstInternals.AstAnnotation-import Database.HsSqlPpp.AstInternals.EnvironmentInternal-import Database.HsSqlPpp.AstInternals.DefaultTemplate1Environment-import Database.HsSqlPpp.Utils--{-# LINE 607 "AstInternal.ag" #-}---- | Takes an ast, and adds annotations, including types, type errors,--- and statement info. Type checks against defaultEnv.-annotateAst :: StatementList -> StatementList-annotateAst = annotateAstEnv defaultTemplate1Environment----- | As annotateAst but you supply an environment to check--- against. See Environment module for how to read an Environment from--- an existing database so you can type check against it.-annotateAstEnv :: Environment -> StatementList -> StatementList-annotateAstEnv env sts =-    let t = sem_Root (Root sts)-        ta = wrap_Root t Inh_Root {env_Inh_Root = env}-        tl = annotatedTree_Syn_Root ta-   in case tl of-         Root r -> r---- | Type check multiple asts, allowing type checking references in later---   files to definitions in earlier files.-annotateAstsEnv :: Environment -> [StatementList] -> [StatementList]-annotateAstsEnv env sts =-    annInt env sts []-    where-      annInt e (s:ss) ress =-          let (e1,res) = annotateAstEnvEnv e s-          in annInt e1 ss (res:ress)-      annInt _ [] ress = reverse ress---- | Type check an ast, and return the resultant Environment as well---   as the annotated ast.-annotateAstEnvEnv :: Environment -> StatementList -> (Environment,StatementList)-annotateAstEnvEnv env sts =-    let t = sem_Root (Root sts)-        ta = wrap_Root t Inh_Root {env_Inh_Root = env}-        tl = annotatedTree_Syn_Root ta-        env1 = producedEnv_Syn_Root ta-   in case tl of-         Root r -> (env1,r)---- | Testing utility, mainly used to check an expression for type errors--- or to get its type.-annotateExpression :: Environment -> Expression -> Expression-annotateExpression env ex =-    let t = sem_ExpressionRoot (ExpressionRoot ex)-        rt = (annotatedTree_Syn_ExpressionRoot-              (wrap_ExpressionRoot t Inh_ExpressionRoot {env_Inh_ExpressionRoot = env}))-    in case rt of-         ExpressionRoot e -> e--{-# LINE 143 "AstInternal.hs" #-}--{-# LINE 68 "./TypeChecking.ag" #-}--annTypesAndErrors :: Data a => a -> Type -> [TypeError]-                  -> Maybe [AnnotationElement] -> a-annTypesAndErrors item nt errs add =-    updateAnnotation modifier item-    where-      modifier = (([TypeAnnotation nt] ++ fromMaybe [] add ++-       map TypeErrorA errs) ++)--{-# LINE 155 "AstInternal.hs" #-}--{-# LINE 424 "./TypeChecking.ag" #-}--getTbCols c = unwrapSetOfComposite (getTypeAnnotation c)-{-# LINE 160 "AstInternal.hs" #-}--{-# LINE 499 "./TypeChecking.ag" #-}---getFnType :: Environment -> String -> Expression -> Either [TypeError] Type-getFnType env alias =-    either Left (Right . snd) . getFunIdens env alias--getFunIdens :: Environment -> String -> Expression -> Either [TypeError] (String,Type)-getFunIdens env alias fnVal =-   case fnVal of-       FunCall _ f _ ->-           let correlationName = if alias /= ""-                                   then alias-                                   else f-           in Right (correlationName, case getTypeAnnotation fnVal of-                SetOfType (CompositeType t) -> getCompositeType t-                SetOfType x -> UnnamedCompositeType [(correlationName,x)]-                y -> UnnamedCompositeType [(correlationName,y)])-       x -> Left [ContextError "FunCall"]-   where-     getCompositeType t =-                    case getAttrs env [Composite-                                      ,TableComposite-                                      ,ViewComposite] t of-                      Just (_,_,a@(UnnamedCompositeType _), _) -> a-                      _ -> UnnamedCompositeType []-{-# LINE 188 "AstInternal.hs" #-}--{-# LINE 552 "./TypeChecking.ag" #-}---fixStar :: Expression -> Expression-fixStar =-    everywhere (mkT fixStar')-    where-      fixStar' :: Annotation -> Annotation-      fixStar' a =-          if TypeAnnotation TypeCheckFailed `elem` a-              && any (\an ->-                       case an of-                         TypeErrorA (UnrecognisedIdentifier x) |-                           let (_,iden) = splitIdentifier x-                           in iden == "*" -> True-                         _ -> False) a-             then filter (\an -> case an of-                                   TypeAnnotation TypeCheckFailed -> False-                                   TypeErrorA (UnrecognisedIdentifier _) -> False-                                   _ -> True) a-             else a-{-# LINE 211 "AstInternal.hs" #-}--{-# LINE 638 "./TypeChecking.ag" #-}--fixedValue :: a -> a -> a -> a-fixedValue a _ _ = a-{-# LINE 217 "AstInternal.hs" #-}--{-# LINE 672 "./TypeChecking.ag" #-}--getCAtts t =-    case t of-      SetOfType (UnnamedCompositeType t) -> t-      _ -> []-{-# LINE 225 "AstInternal.hs" #-}--{-# LINE 751 "./TypeChecking.ag" #-}--getRowTypes :: [Type] -> [Type]-getRowTypes [RowCtor ts] = ts-getRowTypes ts = ts-{-# LINE 232 "AstInternal.hs" #-}--- AttributeDef -------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         attrName             : String-         namedType            : Type-   alternatives:-      alternative AttributeDef:-         child ann            : {Annotation}-         child name           : {String}-         child typ            : TypeName -         child def            : MaybeExpression -         child cons           : RowConstraintList -         visit 0:-            local annotatedTree : _--}-data AttributeDef  = AttributeDef (Annotation) (String) (TypeName) (MaybeExpression) (RowConstraintList) -                   deriving ( Data,Eq,Show,Typeable)--- cata-sem_AttributeDef :: AttributeDef  ->-                    T_AttributeDef -sem_AttributeDef (AttributeDef _ann _name _typ _def _cons )  =-    (sem_AttributeDef_AttributeDef _ann _name (sem_TypeName _typ ) (sem_MaybeExpression _def ) (sem_RowConstraintList _cons ) )--- semantic domain-type T_AttributeDef  = Environment ->-                       ( AttributeDef,String,Type)-data Inh_AttributeDef  = Inh_AttributeDef {env_Inh_AttributeDef :: Environment}-data Syn_AttributeDef  = Syn_AttributeDef {annotatedTree_Syn_AttributeDef :: AttributeDef,attrName_Syn_AttributeDef :: String,namedType_Syn_AttributeDef :: Type}-wrap_AttributeDef :: T_AttributeDef  ->-                     Inh_AttributeDef  ->-                     Syn_AttributeDef -wrap_AttributeDef sem (Inh_AttributeDef _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOattrName,_lhsOnamedType) =-             (sem _lhsIenv )-     in  (Syn_AttributeDef _lhsOannotatedTree _lhsOattrName _lhsOnamedType ))-sem_AttributeDef_AttributeDef :: Annotation ->-                                 String ->-                                 T_TypeName  ->-                                 T_MaybeExpression  ->-                                 T_RowConstraintList  ->-                                 T_AttributeDef -sem_AttributeDef_AttributeDef ann_ name_ typ_ def_ cons_  =-    (\ _lhsIenv ->-         (let _lhsOattrName :: String-              _lhsOnamedType :: Type-              _lhsOannotatedTree :: AttributeDef-              _typOenv :: Environment-              _defOenv :: Environment-              _consOenv :: Environment-              _typIannotatedTree :: TypeName-              _typInamedType :: Type-              _defIannotatedTree :: MaybeExpression-              _defIexprType :: (Maybe Type)-              _consIannotatedTree :: RowConstraintList-              -- "./TypeChecking.ag"(line 789, column 7)-              _lhsOattrName =-                  {-# LINE 789 "./TypeChecking.ag" #-}-                  name_-                  {-# LINE 294 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 790, column 7)-              _lhsOnamedType =-                  {-# LINE 790 "./TypeChecking.ag" #-}-                  _typInamedType-                  {-# LINE 299 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  AttributeDef ann_ name_ _typIannotatedTree _defIannotatedTree _consIannotatedTree-                  {-# LINE 304 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 309 "AstInternal.hs" #-}-              -- copy rule (down)-              _typOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 314 "AstInternal.hs" #-}-              -- copy rule (down)-              _defOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 319 "AstInternal.hs" #-}-              -- copy rule (down)-              _consOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 324 "AstInternal.hs" #-}-              ( _typIannotatedTree,_typInamedType) =-                  (typ_ _typOenv )-              ( _defIannotatedTree,_defIexprType) =-                  (def_ _defOenv )-              ( _consIannotatedTree) =-                  (cons_ _consOenv )-          in  ( _lhsOannotatedTree,_lhsOattrName,_lhsOnamedType)))--- AttributeDefList ---------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         attrs                : [(String, Type)]-   alternatives:-      alternative Cons:-         child hd             : AttributeDef -         child tl             : AttributeDefList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type AttributeDefList  = [(AttributeDef)]--- cata-sem_AttributeDefList :: AttributeDefList  ->-                        T_AttributeDefList -sem_AttributeDefList list  =-    (Prelude.foldr sem_AttributeDefList_Cons sem_AttributeDefList_Nil (Prelude.map sem_AttributeDef list) )--- semantic domain-type T_AttributeDefList  = Environment ->-                           ( AttributeDefList,([(String, Type)]))-data Inh_AttributeDefList  = Inh_AttributeDefList {env_Inh_AttributeDefList :: Environment}-data Syn_AttributeDefList  = Syn_AttributeDefList {annotatedTree_Syn_AttributeDefList :: AttributeDefList,attrs_Syn_AttributeDefList :: [(String, Type)]}-wrap_AttributeDefList :: T_AttributeDefList  ->-                         Inh_AttributeDefList  ->-                         Syn_AttributeDefList -wrap_AttributeDefList sem (Inh_AttributeDefList _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOattrs) =-             (sem _lhsIenv )-     in  (Syn_AttributeDefList _lhsOannotatedTree _lhsOattrs ))-sem_AttributeDefList_Cons :: T_AttributeDef  ->-                             T_AttributeDefList  ->-                             T_AttributeDefList -sem_AttributeDefList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOattrs :: ([(String, Type)])-              _lhsOannotatedTree :: AttributeDefList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: AttributeDef-              _hdIattrName :: String-              _hdInamedType :: Type-              _tlIannotatedTree :: AttributeDefList-              _tlIattrs :: ([(String, Type)])-              -- "./TypeChecking.ag"(line 795, column 12)-              _lhsOattrs =-                  {-# LINE 795 "./TypeChecking.ag" #-}-                  (_hdIattrName, _hdInamedType) : _tlIattrs-                  {-# LINE 386 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 391 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 396 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 401 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 406 "AstInternal.hs" #-}-              ( _hdIannotatedTree,_hdIattrName,_hdInamedType) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree,_tlIattrs) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree,_lhsOattrs)))-sem_AttributeDefList_Nil :: T_AttributeDefList -sem_AttributeDefList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOattrs :: ([(String, Type)])-              _lhsOannotatedTree :: AttributeDefList-              -- "./TypeChecking.ag"(line 796, column 11)-              _lhsOattrs =-                  {-# LINE 796 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 421 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 426 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 431 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOattrs)))--- Cascade ------------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Cascade:-         visit 0:-            local annotatedTree : _-      alternative Restrict:-         visit 0:-            local annotatedTree : _--}-data Cascade  = Cascade -              | Restrict -              deriving ( Data,Eq,Show,Typeable)--- cata-sem_Cascade :: Cascade  ->-               T_Cascade -sem_Cascade (Cascade )  =-    (sem_Cascade_Cascade )-sem_Cascade (Restrict )  =-    (sem_Cascade_Restrict )--- semantic domain-type T_Cascade  = Environment ->-                  ( Cascade)-data Inh_Cascade  = Inh_Cascade {env_Inh_Cascade :: Environment}-data Syn_Cascade  = Syn_Cascade {annotatedTree_Syn_Cascade :: Cascade}-wrap_Cascade :: T_Cascade  ->-                Inh_Cascade  ->-                Syn_Cascade -wrap_Cascade sem (Inh_Cascade _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_Cascade _lhsOannotatedTree ))-sem_Cascade_Cascade :: T_Cascade -sem_Cascade_Cascade  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Cascade-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Cascade-                  {-# LINE 478 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 483 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_Cascade_Restrict :: T_Cascade -sem_Cascade_Restrict  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Cascade-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Restrict-                  {-# LINE 493 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 498 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- CaseExpressionList -------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Cons:-         child hd             : Expression -         child tl             : CaseExpressionList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type CaseExpressionList  = [(Expression)]--- cata-sem_CaseExpressionList :: CaseExpressionList  ->-                          T_CaseExpressionList -sem_CaseExpressionList list  =-    (Prelude.foldr sem_CaseExpressionList_Cons sem_CaseExpressionList_Nil (Prelude.map sem_Expression list) )--- semantic domain-type T_CaseExpressionList  = Environment ->-                             ( CaseExpressionList)-data Inh_CaseExpressionList  = Inh_CaseExpressionList {env_Inh_CaseExpressionList :: Environment}-data Syn_CaseExpressionList  = Syn_CaseExpressionList {annotatedTree_Syn_CaseExpressionList :: CaseExpressionList}-wrap_CaseExpressionList :: T_CaseExpressionList  ->-                           Inh_CaseExpressionList  ->-                           Syn_CaseExpressionList -wrap_CaseExpressionList sem (Inh_CaseExpressionList _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_CaseExpressionList _lhsOannotatedTree ))-sem_CaseExpressionList_Cons :: T_Expression  ->-                               T_CaseExpressionList  ->-                               T_CaseExpressionList -sem_CaseExpressionList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: CaseExpressionList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: Expression-              _hdIliftedColumnName :: String-              _tlIannotatedTree :: CaseExpressionList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 550 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 555 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 560 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 565 "AstInternal.hs" #-}-              ( _hdIannotatedTree,_hdIliftedColumnName) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree)))-sem_CaseExpressionList_Nil :: T_CaseExpressionList -sem_CaseExpressionList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: CaseExpressionList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 579 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 584 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- CaseExpressionListExpressionPair -----------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Tuple:-         child x1             : CaseExpressionList -         child x2             : Expression -         visit 0:-            local annotatedTree : _--}-type CaseExpressionListExpressionPair  = ( (CaseExpressionList),(Expression))--- cata-sem_CaseExpressionListExpressionPair :: CaseExpressionListExpressionPair  ->-                                        T_CaseExpressionListExpressionPair -sem_CaseExpressionListExpressionPair ( x1,x2)  =-    (sem_CaseExpressionListExpressionPair_Tuple (sem_CaseExpressionList x1 ) (sem_Expression x2 ) )--- semantic domain-type T_CaseExpressionListExpressionPair  = Environment ->-                                           ( CaseExpressionListExpressionPair)-data Inh_CaseExpressionListExpressionPair  = Inh_CaseExpressionListExpressionPair {env_Inh_CaseExpressionListExpressionPair :: Environment}-data Syn_CaseExpressionListExpressionPair  = Syn_CaseExpressionListExpressionPair {annotatedTree_Syn_CaseExpressionListExpressionPair :: CaseExpressionListExpressionPair}-wrap_CaseExpressionListExpressionPair :: T_CaseExpressionListExpressionPair  ->-                                         Inh_CaseExpressionListExpressionPair  ->-                                         Syn_CaseExpressionListExpressionPair -wrap_CaseExpressionListExpressionPair sem (Inh_CaseExpressionListExpressionPair _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_CaseExpressionListExpressionPair _lhsOannotatedTree ))-sem_CaseExpressionListExpressionPair_Tuple :: T_CaseExpressionList  ->-                                              T_Expression  ->-                                              T_CaseExpressionListExpressionPair -sem_CaseExpressionListExpressionPair_Tuple x1_ x2_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: CaseExpressionListExpressionPair-              _x1Oenv :: Environment-              _x2Oenv :: Environment-              _x1IannotatedTree :: CaseExpressionList-              _x2IannotatedTree :: Expression-              _x2IliftedColumnName :: String-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (_x1IannotatedTree,_x2IannotatedTree)-                  {-# LINE 633 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 638 "AstInternal.hs" #-}-              -- copy rule (down)-              _x1Oenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 643 "AstInternal.hs" #-}-              -- copy rule (down)-              _x2Oenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 648 "AstInternal.hs" #-}-              ( _x1IannotatedTree) =-                  (x1_ _x1Oenv )-              ( _x2IannotatedTree,_x2IliftedColumnName) =-                  (x2_ _x2Oenv )-          in  ( _lhsOannotatedTree)))--- CaseExpressionListExpressionPairList -------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Cons:-         child hd             : CaseExpressionListExpressionPair -         child tl             : CaseExpressionListExpressionPairList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type CaseExpressionListExpressionPairList  = [(CaseExpressionListExpressionPair)]--- cata-sem_CaseExpressionListExpressionPairList :: CaseExpressionListExpressionPairList  ->-                                            T_CaseExpressionListExpressionPairList -sem_CaseExpressionListExpressionPairList list  =-    (Prelude.foldr sem_CaseExpressionListExpressionPairList_Cons sem_CaseExpressionListExpressionPairList_Nil (Prelude.map sem_CaseExpressionListExpressionPair list) )--- semantic domain-type T_CaseExpressionListExpressionPairList  = Environment ->-                                               ( CaseExpressionListExpressionPairList)-data Inh_CaseExpressionListExpressionPairList  = Inh_CaseExpressionListExpressionPairList {env_Inh_CaseExpressionListExpressionPairList :: Environment}-data Syn_CaseExpressionListExpressionPairList  = Syn_CaseExpressionListExpressionPairList {annotatedTree_Syn_CaseExpressionListExpressionPairList :: CaseExpressionListExpressionPairList}-wrap_CaseExpressionListExpressionPairList :: T_CaseExpressionListExpressionPairList  ->-                                             Inh_CaseExpressionListExpressionPairList  ->-                                             Syn_CaseExpressionListExpressionPairList -wrap_CaseExpressionListExpressionPairList sem (Inh_CaseExpressionListExpressionPairList _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_CaseExpressionListExpressionPairList _lhsOannotatedTree ))-sem_CaseExpressionListExpressionPairList_Cons :: T_CaseExpressionListExpressionPair  ->-                                                 T_CaseExpressionListExpressionPairList  ->-                                                 T_CaseExpressionListExpressionPairList -sem_CaseExpressionListExpressionPairList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: CaseExpressionListExpressionPairList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: CaseExpressionListExpressionPair-              _tlIannotatedTree :: CaseExpressionListExpressionPairList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 703 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 708 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 713 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 718 "AstInternal.hs" #-}-              ( _hdIannotatedTree) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree)))-sem_CaseExpressionListExpressionPairList_Nil :: T_CaseExpressionListExpressionPairList -sem_CaseExpressionListExpressionPairList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: CaseExpressionListExpressionPairList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 732 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 737 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- CombineType --------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Except:-         visit 0:-            local annotatedTree : _-      alternative Intersect:-         visit 0:-            local annotatedTree : _-      alternative Union:-         visit 0:-            local annotatedTree : _-      alternative UnionAll:-         visit 0:-            local annotatedTree : _--}-data CombineType  = Except -                  | Intersect -                  | Union -                  | UnionAll -                  deriving ( Data,Eq,Show,Typeable)--- cata-sem_CombineType :: CombineType  ->-                   T_CombineType -sem_CombineType (Except )  =-    (sem_CombineType_Except )-sem_CombineType (Intersect )  =-    (sem_CombineType_Intersect )-sem_CombineType (Union )  =-    (sem_CombineType_Union )-sem_CombineType (UnionAll )  =-    (sem_CombineType_UnionAll )--- semantic domain-type T_CombineType  = Environment ->-                      ( CombineType)-data Inh_CombineType  = Inh_CombineType {env_Inh_CombineType :: Environment}-data Syn_CombineType  = Syn_CombineType {annotatedTree_Syn_CombineType :: CombineType}-wrap_CombineType :: T_CombineType  ->-                    Inh_CombineType  ->-                    Syn_CombineType -wrap_CombineType sem (Inh_CombineType _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_CombineType _lhsOannotatedTree ))-sem_CombineType_Except :: T_CombineType -sem_CombineType_Except  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: CombineType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Except-                  {-# LINE 796 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 801 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_CombineType_Intersect :: T_CombineType -sem_CombineType_Intersect  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: CombineType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Intersect-                  {-# LINE 811 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 816 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_CombineType_Union :: T_CombineType -sem_CombineType_Union  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: CombineType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Union-                  {-# LINE 826 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 831 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_CombineType_UnionAll :: T_CombineType -sem_CombineType_UnionAll  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: CombineType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  UnionAll-                  {-# LINE 841 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 846 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- Constraint ---------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative CheckConstraint:-         child ann            : {Annotation}-         child expression     : Expression -         visit 0:-            local annotatedTree : _-      alternative PrimaryKeyConstraint:-         child ann            : {Annotation}-         child stringList     : StringList -         visit 0:-            local annotatedTree : _-      alternative ReferenceConstraint:-         child ann            : {Annotation}-         child atts           : StringList -         child table          : {String}-         child tableAtts      : StringList -         child onUpdate       : Cascade -         child onDelete       : Cascade -         visit 0:-            local annotatedTree : _-      alternative UniqueConstraint:-         child ann            : {Annotation}-         child stringList     : StringList -         visit 0:-            local annotatedTree : _--}-data Constraint  = CheckConstraint (Annotation) (Expression) -                 | PrimaryKeyConstraint (Annotation) (StringList) -                 | ReferenceConstraint (Annotation) (StringList) (String) (StringList) (Cascade) (Cascade) -                 | UniqueConstraint (Annotation) (StringList) -                 deriving ( Data,Eq,Show,Typeable)--- cata-sem_Constraint :: Constraint  ->-                  T_Constraint -sem_Constraint (CheckConstraint _ann _expression )  =-    (sem_Constraint_CheckConstraint _ann (sem_Expression _expression ) )-sem_Constraint (PrimaryKeyConstraint _ann _stringList )  =-    (sem_Constraint_PrimaryKeyConstraint _ann (sem_StringList _stringList ) )-sem_Constraint (ReferenceConstraint _ann _atts _table _tableAtts _onUpdate _onDelete )  =-    (sem_Constraint_ReferenceConstraint _ann (sem_StringList _atts ) _table (sem_StringList _tableAtts ) (sem_Cascade _onUpdate ) (sem_Cascade _onDelete ) )-sem_Constraint (UniqueConstraint _ann _stringList )  =-    (sem_Constraint_UniqueConstraint _ann (sem_StringList _stringList ) )--- semantic domain-type T_Constraint  = Environment ->-                     ( Constraint)-data Inh_Constraint  = Inh_Constraint {env_Inh_Constraint :: Environment}-data Syn_Constraint  = Syn_Constraint {annotatedTree_Syn_Constraint :: Constraint}-wrap_Constraint :: T_Constraint  ->-                   Inh_Constraint  ->-                   Syn_Constraint -wrap_Constraint sem (Inh_Constraint _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_Constraint _lhsOannotatedTree ))-sem_Constraint_CheckConstraint :: Annotation ->-                                  T_Expression  ->-                                  T_Constraint -sem_Constraint_CheckConstraint ann_ expression_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Constraint-              _expressionOenv :: Environment-              _expressionIannotatedTree :: Expression-              _expressionIliftedColumnName :: String-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  CheckConstraint ann_ _expressionIannotatedTree-                  {-# LINE 922 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 927 "AstInternal.hs" #-}-              -- copy rule (down)-              _expressionOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 932 "AstInternal.hs" #-}-              ( _expressionIannotatedTree,_expressionIliftedColumnName) =-                  (expression_ _expressionOenv )-          in  ( _lhsOannotatedTree)))-sem_Constraint_PrimaryKeyConstraint :: Annotation ->-                                       T_StringList  ->-                                       T_Constraint -sem_Constraint_PrimaryKeyConstraint ann_ stringList_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Constraint-              _stringListOenv :: Environment-              _stringListIannotatedTree :: StringList-              _stringListIstrings :: ([String])-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  PrimaryKeyConstraint ann_ _stringListIannotatedTree-                  {-# LINE 949 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 954 "AstInternal.hs" #-}-              -- copy rule (down)-              _stringListOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 959 "AstInternal.hs" #-}-              ( _stringListIannotatedTree,_stringListIstrings) =-                  (stringList_ _stringListOenv )-          in  ( _lhsOannotatedTree)))-sem_Constraint_ReferenceConstraint :: Annotation ->-                                      T_StringList  ->-                                      String ->-                                      T_StringList  ->-                                      T_Cascade  ->-                                      T_Cascade  ->-                                      T_Constraint -sem_Constraint_ReferenceConstraint ann_ atts_ table_ tableAtts_ onUpdate_ onDelete_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Constraint-              _attsOenv :: Environment-              _tableAttsOenv :: Environment-              _onUpdateOenv :: Environment-              _onDeleteOenv :: Environment-              _attsIannotatedTree :: StringList-              _attsIstrings :: ([String])-              _tableAttsIannotatedTree :: StringList-              _tableAttsIstrings :: ([String])-              _onUpdateIannotatedTree :: Cascade-              _onDeleteIannotatedTree :: Cascade-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  ReferenceConstraint ann_ _attsIannotatedTree table_ _tableAttsIannotatedTree _onUpdateIannotatedTree _onDeleteIannotatedTree-                  {-# LINE 987 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 992 "AstInternal.hs" #-}-              -- copy rule (down)-              _attsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 997 "AstInternal.hs" #-}-              -- copy rule (down)-              _tableAttsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1002 "AstInternal.hs" #-}-              -- copy rule (down)-              _onUpdateOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1007 "AstInternal.hs" #-}-              -- copy rule (down)-              _onDeleteOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1012 "AstInternal.hs" #-}-              ( _attsIannotatedTree,_attsIstrings) =-                  (atts_ _attsOenv )-              ( _tableAttsIannotatedTree,_tableAttsIstrings) =-                  (tableAtts_ _tableAttsOenv )-              ( _onUpdateIannotatedTree) =-                  (onUpdate_ _onUpdateOenv )-              ( _onDeleteIannotatedTree) =-                  (onDelete_ _onDeleteOenv )-          in  ( _lhsOannotatedTree)))-sem_Constraint_UniqueConstraint :: Annotation ->-                                   T_StringList  ->-                                   T_Constraint -sem_Constraint_UniqueConstraint ann_ stringList_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Constraint-              _stringListOenv :: Environment-              _stringListIannotatedTree :: StringList-              _stringListIstrings :: ([String])-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  UniqueConstraint ann_ _stringListIannotatedTree-                  {-# LINE 1035 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 1040 "AstInternal.hs" #-}-              -- copy rule (down)-              _stringListOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1045 "AstInternal.hs" #-}-              ( _stringListIannotatedTree,_stringListIstrings) =-                  (stringList_ _stringListOenv )-          in  ( _lhsOannotatedTree)))--- ConstraintList -----------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Cons:-         child hd             : Constraint -         child tl             : ConstraintList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type ConstraintList  = [(Constraint)]--- cata-sem_ConstraintList :: ConstraintList  ->-                      T_ConstraintList -sem_ConstraintList list  =-    (Prelude.foldr sem_ConstraintList_Cons sem_ConstraintList_Nil (Prelude.map sem_Constraint list) )--- semantic domain-type T_ConstraintList  = Environment ->-                         ( ConstraintList)-data Inh_ConstraintList  = Inh_ConstraintList {env_Inh_ConstraintList :: Environment}-data Syn_ConstraintList  = Syn_ConstraintList {annotatedTree_Syn_ConstraintList :: ConstraintList}-wrap_ConstraintList :: T_ConstraintList  ->-                       Inh_ConstraintList  ->-                       Syn_ConstraintList -wrap_ConstraintList sem (Inh_ConstraintList _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_ConstraintList _lhsOannotatedTree ))-sem_ConstraintList_Cons :: T_Constraint  ->-                           T_ConstraintList  ->-                           T_ConstraintList -sem_ConstraintList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: ConstraintList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: Constraint-              _tlIannotatedTree :: ConstraintList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 1098 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 1103 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1108 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1113 "AstInternal.hs" #-}-              ( _hdIannotatedTree) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree)))-sem_ConstraintList_Nil :: T_ConstraintList -sem_ConstraintList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: ConstraintList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 1127 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 1132 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- CopySource ---------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative CopyFilename:-         child string         : {String}-         visit 0:-            local annotatedTree : _-      alternative Stdin:-         visit 0:-            local annotatedTree : _--}-data CopySource  = CopyFilename (String) -                 | Stdin -                 deriving ( Data,Eq,Show,Typeable)--- cata-sem_CopySource :: CopySource  ->-                  T_CopySource -sem_CopySource (CopyFilename _string )  =-    (sem_CopySource_CopyFilename _string )-sem_CopySource (Stdin )  =-    (sem_CopySource_Stdin )--- semantic domain-type T_CopySource  = Environment ->-                     ( CopySource)-data Inh_CopySource  = Inh_CopySource {env_Inh_CopySource :: Environment}-data Syn_CopySource  = Syn_CopySource {annotatedTree_Syn_CopySource :: CopySource}-wrap_CopySource :: T_CopySource  ->-                   Inh_CopySource  ->-                   Syn_CopySource -wrap_CopySource sem (Inh_CopySource _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_CopySource _lhsOannotatedTree ))-sem_CopySource_CopyFilename :: String ->-                               T_CopySource -sem_CopySource_CopyFilename string_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: CopySource-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  CopyFilename string_-                  {-# LINE 1181 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 1186 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_CopySource_Stdin :: T_CopySource -sem_CopySource_Stdin  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: CopySource-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Stdin-                  {-# LINE 1196 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 1201 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- Direction ----------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Asc:-         visit 0:-            local annotatedTree : _-      alternative Desc:-         visit 0:-            local annotatedTree : _--}-data Direction  = Asc -                | Desc -                deriving ( Data,Eq,Show,Typeable)--- cata-sem_Direction :: Direction  ->-                 T_Direction -sem_Direction (Asc )  =-    (sem_Direction_Asc )-sem_Direction (Desc )  =-    (sem_Direction_Desc )--- semantic domain-type T_Direction  = Environment ->-                    ( Direction)-data Inh_Direction  = Inh_Direction {env_Inh_Direction :: Environment}-data Syn_Direction  = Syn_Direction {annotatedTree_Syn_Direction :: Direction}-wrap_Direction :: T_Direction  ->-                  Inh_Direction  ->-                  Syn_Direction -wrap_Direction sem (Inh_Direction _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_Direction _lhsOannotatedTree ))-sem_Direction_Asc :: T_Direction -sem_Direction_Asc  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Direction-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Asc-                  {-# LINE 1248 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 1253 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_Direction_Desc :: T_Direction -sem_Direction_Desc  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Direction-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Desc-                  {-# LINE 1263 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 1268 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- Distinct -----------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Distinct:-         visit 0:-            local annotatedTree : _-      alternative Dupes:-         visit 0:-            local annotatedTree : _--}-data Distinct  = Distinct -               | Dupes -               deriving ( Data,Eq,Show,Typeable)--- cata-sem_Distinct :: Distinct  ->-                T_Distinct -sem_Distinct (Distinct )  =-    (sem_Distinct_Distinct )-sem_Distinct (Dupes )  =-    (sem_Distinct_Dupes )--- semantic domain-type T_Distinct  = Environment ->-                   ( Distinct)-data Inh_Distinct  = Inh_Distinct {env_Inh_Distinct :: Environment}-data Syn_Distinct  = Syn_Distinct {annotatedTree_Syn_Distinct :: Distinct}-wrap_Distinct :: T_Distinct  ->-                 Inh_Distinct  ->-                 Syn_Distinct -wrap_Distinct sem (Inh_Distinct _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_Distinct _lhsOannotatedTree ))-sem_Distinct_Distinct :: T_Distinct -sem_Distinct_Distinct  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Distinct-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Distinct-                  {-# LINE 1315 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 1320 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_Distinct_Dupes :: T_Distinct -sem_Distinct_Dupes  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Distinct-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Dupes-                  {-# LINE 1330 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 1335 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- DropType -----------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Domain:-         visit 0:-            local annotatedTree : _-      alternative Table:-         visit 0:-            local annotatedTree : _-      alternative Type:-         visit 0:-            local annotatedTree : _-      alternative View:-         visit 0:-            local annotatedTree : _--}-data DropType  = Domain -               | Table -               | Type -               | View -               deriving ( Data,Eq,Show,Typeable)--- cata-sem_DropType :: DropType  ->-                T_DropType -sem_DropType (Domain )  =-    (sem_DropType_Domain )-sem_DropType (Table )  =-    (sem_DropType_Table )-sem_DropType (Type )  =-    (sem_DropType_Type )-sem_DropType (View )  =-    (sem_DropType_View )--- semantic domain-type T_DropType  = Environment ->-                   ( DropType)-data Inh_DropType  = Inh_DropType {env_Inh_DropType :: Environment}-data Syn_DropType  = Syn_DropType {annotatedTree_Syn_DropType :: DropType}-wrap_DropType :: T_DropType  ->-                 Inh_DropType  ->-                 Syn_DropType -wrap_DropType sem (Inh_DropType _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_DropType _lhsOannotatedTree ))-sem_DropType_Domain :: T_DropType -sem_DropType_Domain  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: DropType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Domain-                  {-# LINE 1394 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 1399 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_DropType_Table :: T_DropType -sem_DropType_Table  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: DropType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Table-                  {-# LINE 1409 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 1414 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_DropType_Type :: T_DropType -sem_DropType_Type  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: DropType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Type-                  {-# LINE 1424 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 1429 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_DropType_View :: T_DropType -sem_DropType_View  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: DropType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  View-                  {-# LINE 1439 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 1444 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- Expression ---------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         liftedColumnName     : String-   alternatives:-      alternative BooleanLit:-         child ann            : {Annotation}-         child b              : {Bool}-         visit 0:-            local backTree    : _-            local tpe         : _-            local annotatedTree : _-      alternative Case:-         child ann            : {Annotation}-         child cases          : CaseExpressionListExpressionPairList -         child els            : MaybeExpression -         visit 0:-            local whenTypes   : _-            local thenTypes   : _-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative CaseSimple:-         child ann            : {Annotation}-         child value          : Expression -         child cases          : CaseExpressionListExpressionPairList -         child els            : MaybeExpression -         visit 0:-            local whenTypes   : _-            local thenTypes   : _-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative Cast:-         child ann            : {Annotation}-         child expr           : Expression -         child tn             : TypeName -         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative Exists:-         child ann            : {Annotation}-         child sel            : SelectExpression -         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative FloatLit:-         child ann            : {Annotation}-         child d              : {Double}-         visit 0:-            local backTree    : _-            local tpe         : _-            local annotatedTree : _-      alternative FunCall:-         child ann            : {Annotation}-         child funName        : {String}-         child args           : ExpressionList -         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative Identifier:-         child ann            : {Annotation}-         child i              : {String}-         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative InPredicate:-         child ann            : {Annotation}-         child expr           : Expression -         child i              : {Bool}-         child list           : InList -         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative IntegerLit:-         child ann            : {Annotation}-         child i              : {Integer}-         visit 0:-            local backTree    : _-            local tpe         : _-            local annotatedTree : _-      alternative NullLit:-         child ann            : {Annotation}-         visit 0:-            local backTree    : _-            local tpe         : _-            local annotatedTree : _-      alternative PositionalArg:-         child ann            : {Annotation}-         child p              : {Integer}-         visit 0:-            local annotatedTree : _-      alternative ScalarSubQuery:-         child ann            : {Annotation}-         child sel            : SelectExpression -         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative StringLit:-         child ann            : {Annotation}-         child quote          : {String}-         child value          : {String}-         visit 0:-            local backTree    : _-            local tpe         : _-            local annotatedTree : _-      alternative WindowFn:-         child ann            : {Annotation}-         child fn             : Expression -         child partitionBy    : ExpressionList -         child orderBy        : ExpressionList -         child dir            : Direction -         visit 0:-            local annotatedTree : _--}-data Expression  = BooleanLit (Annotation) (Bool) -                 | Case (Annotation) (CaseExpressionListExpressionPairList) (MaybeExpression) -                 | CaseSimple (Annotation) (Expression) (CaseExpressionListExpressionPairList) (MaybeExpression) -                 | Cast (Annotation) (Expression) (TypeName) -                 | Exists (Annotation) (SelectExpression) -                 | FloatLit (Annotation) (Double) -                 | FunCall (Annotation) (String) (ExpressionList) -                 | Identifier (Annotation) (String) -                 | InPredicate (Annotation) (Expression) (Bool) (InList) -                 | IntegerLit (Annotation) (Integer) -                 | NullLit (Annotation) -                 | PositionalArg (Annotation) (Integer) -                 | ScalarSubQuery (Annotation) (SelectExpression) -                 | StringLit (Annotation) (String) (String) -                 | WindowFn (Annotation) (Expression) (ExpressionList) (ExpressionList) (Direction) -                 deriving ( Data,Eq,Show,Typeable)--- cata-sem_Expression :: Expression  ->-                  T_Expression -sem_Expression (BooleanLit _ann _b )  =-    (sem_Expression_BooleanLit _ann _b )-sem_Expression (Case _ann _cases _els )  =-    (sem_Expression_Case _ann (sem_CaseExpressionListExpressionPairList _cases ) (sem_MaybeExpression _els ) )-sem_Expression (CaseSimple _ann _value _cases _els )  =-    (sem_Expression_CaseSimple _ann (sem_Expression _value ) (sem_CaseExpressionListExpressionPairList _cases ) (sem_MaybeExpression _els ) )-sem_Expression (Cast _ann _expr _tn )  =-    (sem_Expression_Cast _ann (sem_Expression _expr ) (sem_TypeName _tn ) )-sem_Expression (Exists _ann _sel )  =-    (sem_Expression_Exists _ann (sem_SelectExpression _sel ) )-sem_Expression (FloatLit _ann _d )  =-    (sem_Expression_FloatLit _ann _d )-sem_Expression (FunCall _ann _funName _args )  =-    (sem_Expression_FunCall _ann _funName (sem_ExpressionList _args ) )-sem_Expression (Identifier _ann _i )  =-    (sem_Expression_Identifier _ann _i )-sem_Expression (InPredicate _ann _expr _i _list )  =-    (sem_Expression_InPredicate _ann (sem_Expression _expr ) _i (sem_InList _list ) )-sem_Expression (IntegerLit _ann _i )  =-    (sem_Expression_IntegerLit _ann _i )-sem_Expression (NullLit _ann )  =-    (sem_Expression_NullLit _ann )-sem_Expression (PositionalArg _ann _p )  =-    (sem_Expression_PositionalArg _ann _p )-sem_Expression (ScalarSubQuery _ann _sel )  =-    (sem_Expression_ScalarSubQuery _ann (sem_SelectExpression _sel ) )-sem_Expression (StringLit _ann _quote _value )  =-    (sem_Expression_StringLit _ann _quote _value )-sem_Expression (WindowFn _ann _fn _partitionBy _orderBy _dir )  =-    (sem_Expression_WindowFn _ann (sem_Expression _fn ) (sem_ExpressionList _partitionBy ) (sem_ExpressionList _orderBy ) (sem_Direction _dir ) )--- semantic domain-type T_Expression  = Environment ->-                     ( Expression,String)-data Inh_Expression  = Inh_Expression {env_Inh_Expression :: Environment}-data Syn_Expression  = Syn_Expression {annotatedTree_Syn_Expression :: Expression,liftedColumnName_Syn_Expression :: String}-wrap_Expression :: T_Expression  ->-                   Inh_Expression  ->-                   Syn_Expression -wrap_Expression sem (Inh_Expression _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOliftedColumnName) =-             (sem _lhsIenv )-     in  (Syn_Expression _lhsOannotatedTree _lhsOliftedColumnName ))-sem_Expression_BooleanLit :: Annotation ->-                             Bool ->-                             T_Expression -sem_Expression_BooleanLit ann_ b_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Expression-              _lhsOliftedColumnName :: String-              -- "./TypeChecking.ag"(line 83, column 9)-              _lhsOannotatedTree =-                  {-# LINE 83 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 1646 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 100, column 9)-              _backTree =-                  {-# LINE 100 "./TypeChecking.ag" #-}-                  BooleanLit ann_ b_-                  {-# LINE 1651 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 108, column 19)-              _tpe =-                  {-# LINE 108 "./TypeChecking.ag" #-}-                  Right typeBool-                  {-# LINE 1656 "AstInternal.hs" #-}-              -- use rule "./TypeChecking.ag"(line 636, column 37)-              _lhsOliftedColumnName =-                  {-# LINE 636 "./TypeChecking.ag" #-}-                  ""-                  {-# LINE 1661 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  BooleanLit ann_ b_-                  {-# LINE 1666 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_Case :: Annotation ->-                       T_CaseExpressionListExpressionPairList  ->-                       T_MaybeExpression  ->-                       T_Expression -sem_Expression_Case ann_ cases_ els_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Expression-              _lhsOliftedColumnName :: String-              _casesOenv :: Environment-              _elsOenv :: Environment-              _casesIannotatedTree :: CaseExpressionListExpressionPairList-              _elsIannotatedTree :: MaybeExpression-              _elsIexprType :: (Maybe Type)-              -- "./TypeChecking.ag"(line 83, column 9)-              _lhsOannotatedTree =-                  {-# LINE 83 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 1688 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 182, column 9)-              _whenTypes =-                  {-# LINE 182 "./TypeChecking.ag" #-}-                  map getTypeAnnotation $ concatMap fst $-                  _casesIannotatedTree-                  {-# LINE 1694 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 184, column 9)-              _thenTypes =-                  {-# LINE 184 "./TypeChecking.ag" #-}-                  map getTypeAnnotation $-                      (map snd $ _casesIannotatedTree) ++-                        maybeToList _elsIannotatedTree-                  {-# LINE 1701 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 190, column 9)-              _tpe =-                  {-# LINE 190 "./TypeChecking.ag" #-}-                  chainTypeCheckFailed _whenTypes     $ do-                     when (any (/= typeBool) _whenTypes    ) $-                       Left [WrongTypes typeBool _whenTypes    ]-                     chainTypeCheckFailed _thenTypes     $-                              resolveResultSetType-                                _lhsIenv-                                _thenTypes-                  {-# LINE 1712 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 198, column 9)-              _backTree =-                  {-# LINE 198 "./TypeChecking.ag" #-}-                  Case ann_ _casesIannotatedTree _elsIannotatedTree-                  {-# LINE 1717 "AstInternal.hs" #-}-              -- use rule "./TypeChecking.ag"(line 636, column 37)-              _lhsOliftedColumnName =-                  {-# LINE 636 "./TypeChecking.ag" #-}-                  ""-                  {-# LINE 1722 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Case ann_ _casesIannotatedTree _elsIannotatedTree-                  {-# LINE 1727 "AstInternal.hs" #-}-              -- copy rule (down)-              _casesOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1732 "AstInternal.hs" #-}-              -- copy rule (down)-              _elsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1737 "AstInternal.hs" #-}-              ( _casesIannotatedTree) =-                  (cases_ _casesOenv )-              ( _elsIannotatedTree,_elsIexprType) =-                  (els_ _elsOenv )-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_CaseSimple :: Annotation ->-                             T_Expression  ->-                             T_CaseExpressionListExpressionPairList  ->-                             T_MaybeExpression  ->-                             T_Expression -sem_Expression_CaseSimple ann_ value_ cases_ els_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Expression-              _lhsOliftedColumnName :: String-              _valueOenv :: Environment-              _casesOenv :: Environment-              _elsOenv :: Environment-              _valueIannotatedTree :: Expression-              _valueIliftedColumnName :: String-              _casesIannotatedTree :: CaseExpressionListExpressionPairList-              _elsIannotatedTree :: MaybeExpression-              _elsIexprType :: (Maybe Type)-              -- "./TypeChecking.ag"(line 83, column 9)-              _lhsOannotatedTree =-                  {-# LINE 83 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 1767 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 182, column 9)-              _whenTypes =-                  {-# LINE 182 "./TypeChecking.ag" #-}-                  map getTypeAnnotation $ concatMap fst $-                  _casesIannotatedTree-                  {-# LINE 1773 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 184, column 9)-              _thenTypes =-                  {-# LINE 184 "./TypeChecking.ag" #-}-                  map getTypeAnnotation $-                      (map snd $ _casesIannotatedTree) ++-                        maybeToList _elsIannotatedTree-                  {-# LINE 1780 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 203, column 9)-              _tpe =-                  {-# LINE 203 "./TypeChecking.ag" #-}-                  chainTypeCheckFailed _whenTypes     $ do-                  checkWhenTypes <- resolveResultSetType-                                         _lhsIenv-                                         (getTypeAnnotation _valueIannotatedTree: _whenTypes    )-                  chainTypeCheckFailed _thenTypes     $-                             resolveResultSetType-                                      _lhsIenv-                                      _thenTypes-                  {-# LINE 1792 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 212, column 9)-              _backTree =-                  {-# LINE 212 "./TypeChecking.ag" #-}-                  CaseSimple ann_ _valueIannotatedTree _casesIannotatedTree _elsIannotatedTree-                  {-# LINE 1797 "AstInternal.hs" #-}-              -- use rule "./TypeChecking.ag"(line 636, column 37)-              _lhsOliftedColumnName =-                  {-# LINE 636 "./TypeChecking.ag" #-}-                  _valueIliftedColumnName-                  {-# LINE 1802 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  CaseSimple ann_ _valueIannotatedTree _casesIannotatedTree _elsIannotatedTree-                  {-# LINE 1807 "AstInternal.hs" #-}-              -- copy rule (down)-              _valueOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1812 "AstInternal.hs" #-}-              -- copy rule (down)-              _casesOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1817 "AstInternal.hs" #-}-              -- copy rule (down)-              _elsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1822 "AstInternal.hs" #-}-              ( _valueIannotatedTree,_valueIliftedColumnName) =-                  (value_ _valueOenv )-              ( _casesIannotatedTree) =-                  (cases_ _casesOenv )-              ( _elsIannotatedTree,_elsIexprType) =-                  (els_ _elsOenv )-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_Cast :: Annotation ->-                       T_Expression  ->-                       T_TypeName  ->-                       T_Expression -sem_Expression_Cast ann_ expr_ tn_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Expression-              _lhsOliftedColumnName :: String-              _exprOenv :: Environment-              _tnOenv :: Environment-              _exprIannotatedTree :: Expression-              _exprIliftedColumnName :: String-              _tnIannotatedTree :: TypeName-              _tnInamedType :: Type-              -- "./TypeChecking.ag"(line 83, column 9)-              _lhsOannotatedTree =-                  {-# LINE 83 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 1851 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 120, column 12)-              _tpe =-                  {-# LINE 120 "./TypeChecking.ag" #-}-                  Right $ _tnInamedType-                  {-# LINE 1856 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 121, column 12)-              _backTree =-                  {-# LINE 121 "./TypeChecking.ag" #-}-                  Cast ann_ _exprIannotatedTree _tnIannotatedTree-                  {-# LINE 1861 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 654, column 10)-              _lhsOliftedColumnName =-                  {-# LINE 654 "./TypeChecking.ag" #-}-                  case _tnIannotatedTree of-                    SimpleTypeName _ tn -> tn-                    _ -> ""-                  {-# LINE 1868 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Cast ann_ _exprIannotatedTree _tnIannotatedTree-                  {-# LINE 1873 "AstInternal.hs" #-}-              -- copy rule (down)-              _exprOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1878 "AstInternal.hs" #-}-              -- copy rule (down)-              _tnOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1883 "AstInternal.hs" #-}-              ( _exprIannotatedTree,_exprIliftedColumnName) =-                  (expr_ _exprOenv )-              ( _tnIannotatedTree,_tnInamedType) =-                  (tn_ _tnOenv )-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_Exists :: Annotation ->-                         T_SelectExpression  ->-                         T_Expression -sem_Expression_Exists ann_ sel_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Expression-              _lhsOliftedColumnName :: String-              _selOenv :: Environment-              _selIannotatedTree :: SelectExpression-              -- "./TypeChecking.ag"(line 83, column 9)-              _lhsOannotatedTree =-                  {-# LINE 83 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 1905 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 228, column 9)-              _tpe =-                  {-# LINE 228 "./TypeChecking.ag" #-}-                  Right typeBool-                  {-# LINE 1910 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 229, column 9)-              _backTree =-                  {-# LINE 229 "./TypeChecking.ag" #-}-                  Exists ann_ _selIannotatedTree-                  {-# LINE 1915 "AstInternal.hs" #-}-              -- use rule "./TypeChecking.ag"(line 636, column 37)-              _lhsOliftedColumnName =-                  {-# LINE 636 "./TypeChecking.ag" #-}-                  ""-                  {-# LINE 1920 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Exists ann_ _selIannotatedTree-                  {-# LINE 1925 "AstInternal.hs" #-}-              -- copy rule (down)-              _selOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 1930 "AstInternal.hs" #-}-              ( _selIannotatedTree) =-                  (sel_ _selOenv )-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_FloatLit :: Annotation ->-                           Double ->-                           T_Expression -sem_Expression_FloatLit ann_ d_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Expression-              _lhsOliftedColumnName :: String-              -- "./TypeChecking.ag"(line 83, column 9)-              _lhsOannotatedTree =-                  {-# LINE 83 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 1948 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 98, column 9)-              _backTree =-                  {-# LINE 98 "./TypeChecking.ag" #-}-                  FloatLit ann_ d_-                  {-# LINE 1953 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 107, column 17)-              _tpe =-                  {-# LINE 107 "./TypeChecking.ag" #-}-                  Right typeNumeric-                  {-# LINE 1958 "AstInternal.hs" #-}-              -- use rule "./TypeChecking.ag"(line 636, column 37)-              _lhsOliftedColumnName =-                  {-# LINE 636 "./TypeChecking.ag" #-}-                  ""-                  {-# LINE 1963 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  FloatLit ann_ d_-                  {-# LINE 1968 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_FunCall :: Annotation ->-                          String ->-                          T_ExpressionList  ->-                          T_Expression -sem_Expression_FunCall ann_ funName_ args_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Expression-              _lhsOliftedColumnName :: String-              _argsOenv :: Environment-              _argsIannotatedTree :: ExpressionList-              _argsItypeList :: ([Type])-              -- "./TypeChecking.ag"(line 83, column 9)-              _lhsOannotatedTree =-                  {-# LINE 83 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 1988 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 161, column 9)-              _tpe =-                  {-# LINE 161 "./TypeChecking.ag" #-}-                  chainTypeCheckFailed _argsItypeList $-                    typeCheckFunCall-                      _lhsIenv-                      funName_-                      _argsItypeList-                  {-# LINE 1997 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 166, column 9)-              _backTree =-                  {-# LINE 166 "./TypeChecking.ag" #-}-                  FunCall ann_ funName_ _argsIannotatedTree-                  {-# LINE 2002 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 650, column 13)-              _lhsOliftedColumnName =-                  {-# LINE 650 "./TypeChecking.ag" #-}-                  if isOperatorName funName_-                     then ""-                     else funName_-                  {-# LINE 2009 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  FunCall ann_ funName_ _argsIannotatedTree-                  {-# LINE 2014 "AstInternal.hs" #-}-              -- copy rule (down)-              _argsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2019 "AstInternal.hs" #-}-              ( _argsIannotatedTree,_argsItypeList) =-                  (args_ _argsOenv )-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_Identifier :: Annotation ->-                             String ->-                             T_Expression -sem_Expression_Identifier ann_ i_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Expression-              _lhsOliftedColumnName :: String-              -- "./TypeChecking.ag"(line 83, column 9)-              _lhsOannotatedTree =-                  {-# LINE 83 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 2037 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 222, column 9)-              _tpe =-                  {-# LINE 222 "./TypeChecking.ag" #-}-                  let (correlationName,iden) = splitIdentifier i_-                  in envLookupID _lhsIenv correlationName iden-                  {-# LINE 2043 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 224, column 9)-              _backTree =-                  {-# LINE 224 "./TypeChecking.ag" #-}-                  Identifier ann_ i_-                  {-# LINE 2048 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 649, column 16)-              _lhsOliftedColumnName =-                  {-# LINE 649 "./TypeChecking.ag" #-}-                  i_-                  {-# LINE 2053 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Identifier ann_ i_-                  {-# LINE 2058 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_InPredicate :: Annotation ->-                              T_Expression  ->-                              Bool ->-                              T_InList  ->-                              T_Expression -sem_Expression_InPredicate ann_ expr_ i_ list_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Expression-              _lhsOliftedColumnName :: String-              _exprOenv :: Environment-              _listOenv :: Environment-              _exprIannotatedTree :: Expression-              _exprIliftedColumnName :: String-              _listIannotatedTree :: InList-              _listIlistType :: (Either [TypeError] Type)-              -- "./TypeChecking.ag"(line 83, column 9)-              _lhsOannotatedTree =-                  {-# LINE 83 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 2082 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 256, column 9)-              _tpe =-                  {-# LINE 256 "./TypeChecking.ag" #-}-                  do-                    lt <- _listIlistType-                    ty <- resolveResultSetType-                            _lhsIenv-                            [getTypeAnnotation _exprIannotatedTree, lt]-                    return typeBool-                  {-# LINE 2092 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 262, column 9)-              _backTree =-                  {-# LINE 262 "./TypeChecking.ag" #-}-                  InPredicate ann_ _exprIannotatedTree i_ _listIannotatedTree-                  {-# LINE 2097 "AstInternal.hs" #-}-              -- use rule "./TypeChecking.ag"(line 636, column 37)-              _lhsOliftedColumnName =-                  {-# LINE 636 "./TypeChecking.ag" #-}-                  _exprIliftedColumnName-                  {-# LINE 2102 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  InPredicate ann_ _exprIannotatedTree i_ _listIannotatedTree-                  {-# LINE 2107 "AstInternal.hs" #-}-              -- copy rule (down)-              _exprOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2112 "AstInternal.hs" #-}-              -- copy rule (down)-              _listOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2117 "AstInternal.hs" #-}-              ( _exprIannotatedTree,_exprIliftedColumnName) =-                  (expr_ _exprOenv )-              ( _listIannotatedTree,_listIlistType) =-                  (list_ _listOenv )-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_IntegerLit :: Annotation ->-                             Integer ->-                             T_Expression -sem_Expression_IntegerLit ann_ i_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Expression-              _lhsOliftedColumnName :: String-              -- "./TypeChecking.ag"(line 83, column 9)-              _lhsOannotatedTree =-                  {-# LINE 83 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 2137 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 94, column 9)-              _backTree =-                  {-# LINE 94 "./TypeChecking.ag" #-}-                  IntegerLit ann_ i_-                  {-# LINE 2142 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 105, column 19)-              _tpe =-                  {-# LINE 105 "./TypeChecking.ag" #-}-                  Right typeInt-                  {-# LINE 2147 "AstInternal.hs" #-}-              -- use rule "./TypeChecking.ag"(line 636, column 37)-              _lhsOliftedColumnName =-                  {-# LINE 636 "./TypeChecking.ag" #-}-                  ""-                  {-# LINE 2152 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  IntegerLit ann_ i_-                  {-# LINE 2157 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_NullLit :: Annotation ->-                          T_Expression -sem_Expression_NullLit ann_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Expression-              _lhsOliftedColumnName :: String-              -- "./TypeChecking.ag"(line 83, column 9)-              _lhsOannotatedTree =-                  {-# LINE 83 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 2172 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 102, column 9)-              _backTree =-                  {-# LINE 102 "./TypeChecking.ag" #-}-                  NullLit ann_-                  {-# LINE 2177 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 110, column 16)-              _tpe =-                  {-# LINE 110 "./TypeChecking.ag" #-}-                  Right UnknownStringLit-                  {-# LINE 2182 "AstInternal.hs" #-}-              -- use rule "./TypeChecking.ag"(line 636, column 37)-              _lhsOliftedColumnName =-                  {-# LINE 636 "./TypeChecking.ag" #-}-                  ""-                  {-# LINE 2187 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  NullLit ann_-                  {-# LINE 2192 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_PositionalArg :: Annotation ->-                                Integer ->-                                T_Expression -sem_Expression_PositionalArg ann_ p_  =-    (\ _lhsIenv ->-         (let _lhsOliftedColumnName :: String-              _lhsOannotatedTree :: Expression-              -- use rule "./TypeChecking.ag"(line 636, column 37)-              _lhsOliftedColumnName =-                  {-# LINE 636 "./TypeChecking.ag" #-}-                  ""-                  {-# LINE 2205 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  PositionalArg ann_ p_-                  {-# LINE 2210 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 2215 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_ScalarSubQuery :: Annotation ->-                                 T_SelectExpression  ->-                                 T_Expression -sem_Expression_ScalarSubQuery ann_ sel_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Expression-              _lhsOliftedColumnName :: String-              _selOenv :: Environment-              _selIannotatedTree :: SelectExpression-              -- "./TypeChecking.ag"(line 83, column 9)-              _lhsOannotatedTree =-                  {-# LINE 83 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 2233 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 240, column 9)-              _tpe =-                  {-# LINE 240 "./TypeChecking.ag" #-}-                  let selType = getTypeAnnotation _selIannotatedTree-                  in chainTypeCheckFailed [selType]-                       $ do-                         f <- map snd <$> unwrapSetOfComposite selType-                         case length f of-                              0 -> Left [InternalError "no columns in scalar subquery?"]-                              1 -> Right $ head f-                              _ -> Right $ RowCtor f-                  {-# LINE 2245 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 249, column 9)-              _backTree =-                  {-# LINE 249 "./TypeChecking.ag" #-}-                  ScalarSubQuery ann_ _selIannotatedTree-                  {-# LINE 2250 "AstInternal.hs" #-}-              -- use rule "./TypeChecking.ag"(line 636, column 37)-              _lhsOliftedColumnName =-                  {-# LINE 636 "./TypeChecking.ag" #-}-                  ""-                  {-# LINE 2255 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  ScalarSubQuery ann_ _selIannotatedTree-                  {-# LINE 2260 "AstInternal.hs" #-}-              -- copy rule (down)-              _selOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2265 "AstInternal.hs" #-}-              ( _selIannotatedTree) =-                  (sel_ _selOenv )-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_StringLit :: Annotation ->-                            String ->-                            String ->-                            T_Expression -sem_Expression_StringLit ann_ quote_ value_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Expression-              _lhsOliftedColumnName :: String-              -- "./TypeChecking.ag"(line 83, column 9)-              _lhsOannotatedTree =-                  {-# LINE 83 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 2284 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 96, column 9)-              _backTree =-                  {-# LINE 96 "./TypeChecking.ag" #-}-                  StringLit ann_ quote_ value_-                  {-# LINE 2289 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 106, column 18)-              _tpe =-                  {-# LINE 106 "./TypeChecking.ag" #-}-                  Right UnknownStringLit-                  {-# LINE 2294 "AstInternal.hs" #-}-              -- use rule "./TypeChecking.ag"(line 636, column 37)-              _lhsOliftedColumnName =-                  {-# LINE 636 "./TypeChecking.ag" #-}-                  ""-                  {-# LINE 2299 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  StringLit ann_ quote_ value_-                  {-# LINE 2304 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))-sem_Expression_WindowFn :: Annotation ->-                           T_Expression  ->-                           T_ExpressionList  ->-                           T_ExpressionList  ->-                           T_Direction  ->-                           T_Expression -sem_Expression_WindowFn ann_ fn_ partitionBy_ orderBy_ dir_  =-    (\ _lhsIenv ->-         (let _lhsOliftedColumnName :: String-              _lhsOannotatedTree :: Expression-              _fnOenv :: Environment-              _partitionByOenv :: Environment-              _orderByOenv :: Environment-              _dirOenv :: Environment-              _fnIannotatedTree :: Expression-              _fnIliftedColumnName :: String-              _partitionByIannotatedTree :: ExpressionList-              _partitionByItypeList :: ([Type])-              _orderByIannotatedTree :: ExpressionList-              _orderByItypeList :: ([Type])-              _dirIannotatedTree :: Direction-              -- use rule "./TypeChecking.ag"(line 636, column 37)-              _lhsOliftedColumnName =-                  {-# LINE 636 "./TypeChecking.ag" #-}-                  _fnIliftedColumnName-                  {-# LINE 2331 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  WindowFn ann_ _fnIannotatedTree _partitionByIannotatedTree _orderByIannotatedTree _dirIannotatedTree-                  {-# LINE 2336 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 2341 "AstInternal.hs" #-}-              -- copy rule (down)-              _fnOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2346 "AstInternal.hs" #-}-              -- copy rule (down)-              _partitionByOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2351 "AstInternal.hs" #-}-              -- copy rule (down)-              _orderByOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2356 "AstInternal.hs" #-}-              -- copy rule (down)-              _dirOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2361 "AstInternal.hs" #-}-              ( _fnIannotatedTree,_fnIliftedColumnName) =-                  (fn_ _fnOenv )-              ( _partitionByIannotatedTree,_partitionByItypeList) =-                  (partitionBy_ _partitionByOenv )-              ( _orderByIannotatedTree,_orderByItypeList) =-                  (orderBy_ _orderByOenv )-              ( _dirIannotatedTree) =-                  (dir_ _dirOenv )-          in  ( _lhsOannotatedTree,_lhsOliftedColumnName)))--- ExpressionDirectionPair --------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Tuple:-         child x1             : Expression -         child x2             : Direction -         visit 0:-            local annotatedTree : _--}-type ExpressionDirectionPair  = ( (Expression),(Direction))--- cata-sem_ExpressionDirectionPair :: ExpressionDirectionPair  ->-                               T_ExpressionDirectionPair -sem_ExpressionDirectionPair ( x1,x2)  =-    (sem_ExpressionDirectionPair_Tuple (sem_Expression x1 ) (sem_Direction x2 ) )--- semantic domain-type T_ExpressionDirectionPair  = Environment ->-                                  ( ExpressionDirectionPair)-data Inh_ExpressionDirectionPair  = Inh_ExpressionDirectionPair {env_Inh_ExpressionDirectionPair :: Environment}-data Syn_ExpressionDirectionPair  = Syn_ExpressionDirectionPair {annotatedTree_Syn_ExpressionDirectionPair :: ExpressionDirectionPair}-wrap_ExpressionDirectionPair :: T_ExpressionDirectionPair  ->-                                Inh_ExpressionDirectionPair  ->-                                Syn_ExpressionDirectionPair -wrap_ExpressionDirectionPair sem (Inh_ExpressionDirectionPair _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_ExpressionDirectionPair _lhsOannotatedTree ))-sem_ExpressionDirectionPair_Tuple :: T_Expression  ->-                                     T_Direction  ->-                                     T_ExpressionDirectionPair -sem_ExpressionDirectionPair_Tuple x1_ x2_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: ExpressionDirectionPair-              _x1Oenv :: Environment-              _x2Oenv :: Environment-              _x1IannotatedTree :: Expression-              _x1IliftedColumnName :: String-              _x2IannotatedTree :: Direction-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (_x1IannotatedTree,_x2IannotatedTree)-                  {-# LINE 2418 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 2423 "AstInternal.hs" #-}-              -- copy rule (down)-              _x1Oenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2428 "AstInternal.hs" #-}-              -- copy rule (down)-              _x2Oenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2433 "AstInternal.hs" #-}-              ( _x1IannotatedTree,_x1IliftedColumnName) =-                  (x1_ _x1Oenv )-              ( _x2IannotatedTree) =-                  (x2_ _x2Oenv )-          in  ( _lhsOannotatedTree)))--- ExpressionDirectionPairList ----------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Cons:-         child hd             : ExpressionDirectionPair -         child tl             : ExpressionDirectionPairList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type ExpressionDirectionPairList  = [(ExpressionDirectionPair)]--- cata-sem_ExpressionDirectionPairList :: ExpressionDirectionPairList  ->-                                   T_ExpressionDirectionPairList -sem_ExpressionDirectionPairList list  =-    (Prelude.foldr sem_ExpressionDirectionPairList_Cons sem_ExpressionDirectionPairList_Nil (Prelude.map sem_ExpressionDirectionPair list) )--- semantic domain-type T_ExpressionDirectionPairList  = Environment ->-                                      ( ExpressionDirectionPairList)-data Inh_ExpressionDirectionPairList  = Inh_ExpressionDirectionPairList {env_Inh_ExpressionDirectionPairList :: Environment}-data Syn_ExpressionDirectionPairList  = Syn_ExpressionDirectionPairList {annotatedTree_Syn_ExpressionDirectionPairList :: ExpressionDirectionPairList}-wrap_ExpressionDirectionPairList :: T_ExpressionDirectionPairList  ->-                                    Inh_ExpressionDirectionPairList  ->-                                    Syn_ExpressionDirectionPairList -wrap_ExpressionDirectionPairList sem (Inh_ExpressionDirectionPairList _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_ExpressionDirectionPairList _lhsOannotatedTree ))-sem_ExpressionDirectionPairList_Cons :: T_ExpressionDirectionPair  ->-                                        T_ExpressionDirectionPairList  ->-                                        T_ExpressionDirectionPairList -sem_ExpressionDirectionPairList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: ExpressionDirectionPairList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: ExpressionDirectionPair-              _tlIannotatedTree :: ExpressionDirectionPairList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 2488 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 2493 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2498 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2503 "AstInternal.hs" #-}-              ( _hdIannotatedTree) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree)))-sem_ExpressionDirectionPairList_Nil :: T_ExpressionDirectionPairList -sem_ExpressionDirectionPairList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: ExpressionDirectionPairList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 2517 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 2522 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- ExpressionList -----------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         typeList             : [Type]-   alternatives:-      alternative Cons:-         child hd             : Expression -         child tl             : ExpressionList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type ExpressionList  = [(Expression)]--- cata-sem_ExpressionList :: ExpressionList  ->-                      T_ExpressionList -sem_ExpressionList list  =-    (Prelude.foldr sem_ExpressionList_Cons sem_ExpressionList_Nil (Prelude.map sem_Expression list) )--- semantic domain-type T_ExpressionList  = Environment ->-                         ( ExpressionList,([Type]))-data Inh_ExpressionList  = Inh_ExpressionList {env_Inh_ExpressionList :: Environment}-data Syn_ExpressionList  = Syn_ExpressionList {annotatedTree_Syn_ExpressionList :: ExpressionList,typeList_Syn_ExpressionList :: [Type]}-wrap_ExpressionList :: T_ExpressionList  ->-                       Inh_ExpressionList  ->-                       Syn_ExpressionList -wrap_ExpressionList sem (Inh_ExpressionList _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOtypeList) =-             (sem _lhsIenv )-     in  (Syn_ExpressionList _lhsOannotatedTree _lhsOtypeList ))-sem_ExpressionList_Cons :: T_Expression  ->-                           T_ExpressionList  ->-                           T_ExpressionList -sem_ExpressionList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOtypeList :: ([Type])-              _lhsOannotatedTree :: ExpressionList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: Expression-              _hdIliftedColumnName :: String-              _tlIannotatedTree :: ExpressionList-              _tlItypeList :: ([Type])-              -- "./TypeChecking.ag"(line 289, column 12)-              _lhsOtypeList =-                  {-# LINE 289 "./TypeChecking.ag" #-}-                  getTypeAnnotation _hdIannotatedTree : _tlItypeList-                  {-# LINE 2577 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 2582 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 2587 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2592 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2597 "AstInternal.hs" #-}-              ( _hdIannotatedTree,_hdIliftedColumnName) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree,_tlItypeList) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree,_lhsOtypeList)))-sem_ExpressionList_Nil :: T_ExpressionList -sem_ExpressionList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOtypeList :: ([Type])-              _lhsOannotatedTree :: ExpressionList-              -- "./TypeChecking.ag"(line 290, column 11)-              _lhsOtypeList =-                  {-# LINE 290 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 2612 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 2617 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 2622 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOtypeList)))--- ExpressionListList -------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         typeListList         : [[Type]]-   alternatives:-      alternative Cons:-         child hd             : ExpressionList -         child tl             : ExpressionListList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type ExpressionListList  = [(ExpressionList)]--- cata-sem_ExpressionListList :: ExpressionListList  ->-                          T_ExpressionListList -sem_ExpressionListList list  =-    (Prelude.foldr sem_ExpressionListList_Cons sem_ExpressionListList_Nil (Prelude.map sem_ExpressionList list) )--- semantic domain-type T_ExpressionListList  = Environment ->-                             ( ExpressionListList,([[Type]]))-data Inh_ExpressionListList  = Inh_ExpressionListList {env_Inh_ExpressionListList :: Environment}-data Syn_ExpressionListList  = Syn_ExpressionListList {annotatedTree_Syn_ExpressionListList :: ExpressionListList,typeListList_Syn_ExpressionListList :: [[Type]]}-wrap_ExpressionListList :: T_ExpressionListList  ->-                           Inh_ExpressionListList  ->-                           Syn_ExpressionListList -wrap_ExpressionListList sem (Inh_ExpressionListList _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOtypeListList) =-             (sem _lhsIenv )-     in  (Syn_ExpressionListList _lhsOannotatedTree _lhsOtypeListList ))-sem_ExpressionListList_Cons :: T_ExpressionList  ->-                               T_ExpressionListList  ->-                               T_ExpressionListList -sem_ExpressionListList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOtypeListList :: ([[Type]])-              _lhsOannotatedTree :: ExpressionListList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: ExpressionList-              _hdItypeList :: ([Type])-              _tlIannotatedTree :: ExpressionListList-              _tlItypeListList :: ([[Type]])-              -- "./TypeChecking.ag"(line 296, column 12)-              _lhsOtypeListList =-                  {-# LINE 296 "./TypeChecking.ag" #-}-                  _hdItypeList : _tlItypeListList-                  {-# LINE 2677 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 2682 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 2687 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2692 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2697 "AstInternal.hs" #-}-              ( _hdIannotatedTree,_hdItypeList) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree,_tlItypeListList) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree,_lhsOtypeListList)))-sem_ExpressionListList_Nil :: T_ExpressionListList -sem_ExpressionListList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOtypeListList :: ([[Type]])-              _lhsOannotatedTree :: ExpressionListList-              -- "./TypeChecking.ag"(line 297, column 11)-              _lhsOtypeListList =-                  {-# LINE 297 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 2712 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 2717 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 2722 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOtypeListList)))--- ExpressionListStatementListPair ------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Tuple:-         child x1             : ExpressionList -         child x2             : StatementList -         visit 0:-            local annotatedTree : _--}-type ExpressionListStatementListPair  = ( (ExpressionList),(StatementList))--- cata-sem_ExpressionListStatementListPair :: ExpressionListStatementListPair  ->-                                       T_ExpressionListStatementListPair -sem_ExpressionListStatementListPair ( x1,x2)  =-    (sem_ExpressionListStatementListPair_Tuple (sem_ExpressionList x1 ) (sem_StatementList x2 ) )--- semantic domain-type T_ExpressionListStatementListPair  = Environment ->-                                          ( ExpressionListStatementListPair)-data Inh_ExpressionListStatementListPair  = Inh_ExpressionListStatementListPair {env_Inh_ExpressionListStatementListPair :: Environment}-data Syn_ExpressionListStatementListPair  = Syn_ExpressionListStatementListPair {annotatedTree_Syn_ExpressionListStatementListPair :: ExpressionListStatementListPair}-wrap_ExpressionListStatementListPair :: T_ExpressionListStatementListPair  ->-                                        Inh_ExpressionListStatementListPair  ->-                                        Syn_ExpressionListStatementListPair -wrap_ExpressionListStatementListPair sem (Inh_ExpressionListStatementListPair _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_ExpressionListStatementListPair _lhsOannotatedTree ))-sem_ExpressionListStatementListPair_Tuple :: T_ExpressionList  ->-                                             T_StatementList  ->-                                             T_ExpressionListStatementListPair -sem_ExpressionListStatementListPair_Tuple x1_ x2_  =-    (\ _lhsIenv ->-         (let _x2OenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: ExpressionListStatementListPair-              _x1Oenv :: Environment-              _x2Oenv :: Environment-              _x1IannotatedTree :: ExpressionList-              _x1ItypeList :: ([Type])-              _x2IannotatedTree :: StatementList-              _x2IproducedEnv :: Environment-              -- "./TypeChecking.ag"(line 346, column 13)-              _x2OenvUpdates =-                  {-# LINE 346 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 2773 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (_x1IannotatedTree,_x2IannotatedTree)-                  {-# LINE 2778 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 2783 "AstInternal.hs" #-}-              -- copy rule (down)-              _x1Oenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2788 "AstInternal.hs" #-}-              -- copy rule (down)-              _x2Oenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2793 "AstInternal.hs" #-}-              ( _x1IannotatedTree,_x1ItypeList) =-                  (x1_ _x1Oenv )-              ( _x2IannotatedTree,_x2IproducedEnv) =-                  (x2_ _x2Oenv _x2OenvUpdates )-          in  ( _lhsOannotatedTree)))--- ExpressionListStatementListPairList --------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Cons:-         child hd             : ExpressionListStatementListPair -         child tl             : ExpressionListStatementListPairList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type ExpressionListStatementListPairList  = [(ExpressionListStatementListPair)]--- cata-sem_ExpressionListStatementListPairList :: ExpressionListStatementListPairList  ->-                                           T_ExpressionListStatementListPairList -sem_ExpressionListStatementListPairList list  =-    (Prelude.foldr sem_ExpressionListStatementListPairList_Cons sem_ExpressionListStatementListPairList_Nil (Prelude.map sem_ExpressionListStatementListPair list) )--- semantic domain-type T_ExpressionListStatementListPairList  = Environment ->-                                              ( ExpressionListStatementListPairList)-data Inh_ExpressionListStatementListPairList  = Inh_ExpressionListStatementListPairList {env_Inh_ExpressionListStatementListPairList :: Environment}-data Syn_ExpressionListStatementListPairList  = Syn_ExpressionListStatementListPairList {annotatedTree_Syn_ExpressionListStatementListPairList :: ExpressionListStatementListPairList}-wrap_ExpressionListStatementListPairList :: T_ExpressionListStatementListPairList  ->-                                            Inh_ExpressionListStatementListPairList  ->-                                            Syn_ExpressionListStatementListPairList -wrap_ExpressionListStatementListPairList sem (Inh_ExpressionListStatementListPairList _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_ExpressionListStatementListPairList _lhsOannotatedTree ))-sem_ExpressionListStatementListPairList_Cons :: T_ExpressionListStatementListPair  ->-                                                T_ExpressionListStatementListPairList  ->-                                                T_ExpressionListStatementListPairList -sem_ExpressionListStatementListPairList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: ExpressionListStatementListPairList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: ExpressionListStatementListPair-              _tlIannotatedTree :: ExpressionListStatementListPairList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 2848 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 2853 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2858 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2863 "AstInternal.hs" #-}-              ( _hdIannotatedTree) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree)))-sem_ExpressionListStatementListPairList_Nil :: T_ExpressionListStatementListPairList -sem_ExpressionListStatementListPairList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: ExpressionListStatementListPairList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 2877 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 2882 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- ExpressionRoot -----------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative ExpressionRoot:-         child expr           : Expression -         visit 0:-            local annotatedTree : _--}-data ExpressionRoot  = ExpressionRoot (Expression) -                     deriving ( Show)--- cata-sem_ExpressionRoot :: ExpressionRoot  ->-                      T_ExpressionRoot -sem_ExpressionRoot (ExpressionRoot _expr )  =-    (sem_ExpressionRoot_ExpressionRoot (sem_Expression _expr ) )--- semantic domain-type T_ExpressionRoot  = Environment ->-                         ( ExpressionRoot)-data Inh_ExpressionRoot  = Inh_ExpressionRoot {env_Inh_ExpressionRoot :: Environment}-data Syn_ExpressionRoot  = Syn_ExpressionRoot {annotatedTree_Syn_ExpressionRoot :: ExpressionRoot}-wrap_ExpressionRoot :: T_ExpressionRoot  ->-                       Inh_ExpressionRoot  ->-                       Syn_ExpressionRoot -wrap_ExpressionRoot sem (Inh_ExpressionRoot _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_ExpressionRoot _lhsOannotatedTree ))-sem_ExpressionRoot_ExpressionRoot :: T_Expression  ->-                                     T_ExpressionRoot -sem_ExpressionRoot_ExpressionRoot expr_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: ExpressionRoot-              _exprOenv :: Environment-              _exprIannotatedTree :: Expression-              _exprIliftedColumnName :: String-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  ExpressionRoot _exprIannotatedTree-                  {-# LINE 2928 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 2933 "AstInternal.hs" #-}-              -- copy rule (down)-              _exprOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 2938 "AstInternal.hs" #-}-              ( _exprIannotatedTree,_exprIliftedColumnName) =-                  (expr_ _exprOenv )-          in  ( _lhsOannotatedTree)))--- ExpressionStatementListPair ----------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Tuple:-         child x1             : Expression -         child x2             : StatementList -         visit 0:-            local annotatedTree : _--}-type ExpressionStatementListPair  = ( (Expression),(StatementList))--- cata-sem_ExpressionStatementListPair :: ExpressionStatementListPair  ->-                                   T_ExpressionStatementListPair -sem_ExpressionStatementListPair ( x1,x2)  =-    (sem_ExpressionStatementListPair_Tuple (sem_Expression x1 ) (sem_StatementList x2 ) )--- semantic domain-type T_ExpressionStatementListPair  = Environment ->-                                      ( ExpressionStatementListPair)-data Inh_ExpressionStatementListPair  = Inh_ExpressionStatementListPair {env_Inh_ExpressionStatementListPair :: Environment}-data Syn_ExpressionStatementListPair  = Syn_ExpressionStatementListPair {annotatedTree_Syn_ExpressionStatementListPair :: ExpressionStatementListPair}-wrap_ExpressionStatementListPair :: T_ExpressionStatementListPair  ->-                                    Inh_ExpressionStatementListPair  ->-                                    Syn_ExpressionStatementListPair -wrap_ExpressionStatementListPair sem (Inh_ExpressionStatementListPair _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_ExpressionStatementListPair _lhsOannotatedTree ))-sem_ExpressionStatementListPair_Tuple :: T_Expression  ->-                                         T_StatementList  ->-                                         T_ExpressionStatementListPair -sem_ExpressionStatementListPair_Tuple x1_ x2_  =-    (\ _lhsIenv ->-         (let _x2OenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: ExpressionStatementListPair-              _x1Oenv :: Environment-              _x2Oenv :: Environment-              _x1IannotatedTree :: Expression-              _x1IliftedColumnName :: String-              _x2IannotatedTree :: StatementList-              _x2IproducedEnv :: Environment-              -- "./TypeChecking.ag"(line 348, column 13)-              _x2OenvUpdates =-                  {-# LINE 348 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 2991 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (_x1IannotatedTree,_x2IannotatedTree)-                  {-# LINE 2996 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3001 "AstInternal.hs" #-}-              -- copy rule (down)-              _x1Oenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 3006 "AstInternal.hs" #-}-              -- copy rule (down)-              _x2Oenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 3011 "AstInternal.hs" #-}-              ( _x1IannotatedTree,_x1IliftedColumnName) =-                  (x1_ _x1Oenv )-              ( _x2IannotatedTree,_x2IproducedEnv) =-                  (x2_ _x2Oenv _x2OenvUpdates )-          in  ( _lhsOannotatedTree)))--- ExpressionStatementListPairList ------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Cons:-         child hd             : ExpressionStatementListPair -         child tl             : ExpressionStatementListPairList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type ExpressionStatementListPairList  = [(ExpressionStatementListPair)]--- cata-sem_ExpressionStatementListPairList :: ExpressionStatementListPairList  ->-                                       T_ExpressionStatementListPairList -sem_ExpressionStatementListPairList list  =-    (Prelude.foldr sem_ExpressionStatementListPairList_Cons sem_ExpressionStatementListPairList_Nil (Prelude.map sem_ExpressionStatementListPair list) )--- semantic domain-type T_ExpressionStatementListPairList  = Environment ->-                                          ( ExpressionStatementListPairList)-data Inh_ExpressionStatementListPairList  = Inh_ExpressionStatementListPairList {env_Inh_ExpressionStatementListPairList :: Environment}-data Syn_ExpressionStatementListPairList  = Syn_ExpressionStatementListPairList {annotatedTree_Syn_ExpressionStatementListPairList :: ExpressionStatementListPairList}-wrap_ExpressionStatementListPairList :: T_ExpressionStatementListPairList  ->-                                        Inh_ExpressionStatementListPairList  ->-                                        Syn_ExpressionStatementListPairList -wrap_ExpressionStatementListPairList sem (Inh_ExpressionStatementListPairList _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_ExpressionStatementListPairList _lhsOannotatedTree ))-sem_ExpressionStatementListPairList_Cons :: T_ExpressionStatementListPair  ->-                                            T_ExpressionStatementListPairList  ->-                                            T_ExpressionStatementListPairList -sem_ExpressionStatementListPairList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: ExpressionStatementListPairList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: ExpressionStatementListPair-              _tlIannotatedTree :: ExpressionStatementListPairList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 3066 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3071 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 3076 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 3081 "AstInternal.hs" #-}-              ( _hdIannotatedTree) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree)))-sem_ExpressionStatementListPairList_Nil :: T_ExpressionStatementListPairList -sem_ExpressionStatementListPairList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: ExpressionStatementListPairList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 3095 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3100 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- FnBody -------------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative PlpgsqlFnBody:-         child ann            : {Annotation}-         child vars           : VarDefList -         child sts            : StatementList -         visit 0:-            local annotatedTree : _-      alternative SqlFnBody:-         child ann            : {Annotation}-         child sts            : StatementList -         visit 0:-            local annotatedTree : _--}-data FnBody  = PlpgsqlFnBody (Annotation) (VarDefList) (StatementList) -             | SqlFnBody (Annotation) (StatementList) -             deriving ( Data,Eq,Show,Typeable)--- cata-sem_FnBody :: FnBody  ->-              T_FnBody -sem_FnBody (PlpgsqlFnBody _ann _vars _sts )  =-    (sem_FnBody_PlpgsqlFnBody _ann (sem_VarDefList _vars ) (sem_StatementList _sts ) )-sem_FnBody (SqlFnBody _ann _sts )  =-    (sem_FnBody_SqlFnBody _ann (sem_StatementList _sts ) )--- semantic domain-type T_FnBody  = Environment ->-                 ( FnBody)-data Inh_FnBody  = Inh_FnBody {env_Inh_FnBody :: Environment}-data Syn_FnBody  = Syn_FnBody {annotatedTree_Syn_FnBody :: FnBody}-wrap_FnBody :: T_FnBody  ->-               Inh_FnBody  ->-               Syn_FnBody -wrap_FnBody sem (Inh_FnBody _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_FnBody _lhsOannotatedTree ))-sem_FnBody_PlpgsqlFnBody :: Annotation ->-                            T_VarDefList  ->-                            T_StatementList  ->-                            T_FnBody -sem_FnBody_PlpgsqlFnBody ann_ vars_ sts_  =-    (\ _lhsIenv ->-         (let _stsOenvUpdates :: ([EnvironmentUpdate])-              _stsOenv :: Environment-              _lhsOannotatedTree :: FnBody-              _varsOenv :: Environment-              _varsIannotatedTree :: VarDefList-              _varsIdefs :: ([(String,Type)])-              _stsIannotatedTree :: StatementList-              _stsIproducedEnv :: Environment-              -- "./TypeChecking.ag"(line 350, column 31)-              _stsOenvUpdates =-                  {-# LINE 350 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 3162 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 943, column 9)-              _stsOenv =-                  {-# LINE 943 "./TypeChecking.ag" #-}-                  fromRight _lhsIenv $ updateEnvironment _lhsIenv [EnvStackIDs [("", _varsIdefs)]]-                  {-# LINE 3167 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  PlpgsqlFnBody ann_ _varsIannotatedTree _stsIannotatedTree-                  {-# LINE 3172 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3177 "AstInternal.hs" #-}-              -- copy rule (down)-              _varsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 3182 "AstInternal.hs" #-}-              ( _varsIannotatedTree,_varsIdefs) =-                  (vars_ _varsOenv )-              ( _stsIannotatedTree,_stsIproducedEnv) =-                  (sts_ _stsOenv _stsOenvUpdates )-          in  ( _lhsOannotatedTree)))-sem_FnBody_SqlFnBody :: Annotation ->-                        T_StatementList  ->-                        T_FnBody -sem_FnBody_SqlFnBody ann_ sts_  =-    (\ _lhsIenv ->-         (let _stsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: FnBody-              _stsOenv :: Environment-              _stsIannotatedTree :: StatementList-              _stsIproducedEnv :: Environment-              -- "./TypeChecking.ag"(line 350, column 31)-              _stsOenvUpdates =-                  {-# LINE 350 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 3202 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  SqlFnBody ann_ _stsIannotatedTree-                  {-# LINE 3207 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3212 "AstInternal.hs" #-}-              -- copy rule (down)-              _stsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 3217 "AstInternal.hs" #-}-              ( _stsIannotatedTree,_stsIproducedEnv) =-                  (sts_ _stsOenv _stsOenvUpdates )-          in  ( _lhsOannotatedTree)))--- IfExists -----------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative IfExists:-         visit 0:-            local annotatedTree : _-      alternative Require:-         visit 0:-            local annotatedTree : _--}-data IfExists  = IfExists -               | Require -               deriving ( Data,Eq,Show,Typeable)--- cata-sem_IfExists :: IfExists  ->-                T_IfExists -sem_IfExists (IfExists )  =-    (sem_IfExists_IfExists )-sem_IfExists (Require )  =-    (sem_IfExists_Require )--- semantic domain-type T_IfExists  = Environment ->-                   ( IfExists)-data Inh_IfExists  = Inh_IfExists {env_Inh_IfExists :: Environment}-data Syn_IfExists  = Syn_IfExists {annotatedTree_Syn_IfExists :: IfExists}-wrap_IfExists :: T_IfExists  ->-                 Inh_IfExists  ->-                 Syn_IfExists -wrap_IfExists sem (Inh_IfExists _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_IfExists _lhsOannotatedTree ))-sem_IfExists_IfExists :: T_IfExists -sem_IfExists_IfExists  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: IfExists-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  IfExists-                  {-# LINE 3266 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3271 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_IfExists_Require :: T_IfExists -sem_IfExists_Require  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: IfExists-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Require-                  {-# LINE 3281 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3286 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- InList -------------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         listType             : Either [TypeError] Type-   alternatives:-      alternative InList:-         child ann            : {Annotation}-         child exprs          : ExpressionList -         visit 0:-            local annotatedTree : _-      alternative InSelect:-         child ann            : {Annotation}-         child sel            : SelectExpression -         visit 0:-            local annotatedTree : _--}-data InList  = InList (Annotation) (ExpressionList) -             | InSelect (Annotation) (SelectExpression) -             deriving ( Data,Eq,Show,Typeable)--- cata-sem_InList :: InList  ->-              T_InList -sem_InList (InList _ann _exprs )  =-    (sem_InList_InList _ann (sem_ExpressionList _exprs ) )-sem_InList (InSelect _ann _sel )  =-    (sem_InList_InSelect _ann (sem_SelectExpression _sel ) )--- semantic domain-type T_InList  = Environment ->-                 ( InList,(Either [TypeError] Type))-data Inh_InList  = Inh_InList {env_Inh_InList :: Environment}-data Syn_InList  = Syn_InList {annotatedTree_Syn_InList :: InList,listType_Syn_InList :: Either [TypeError] Type}-wrap_InList :: T_InList  ->-               Inh_InList  ->-               Syn_InList -wrap_InList sem (Inh_InList _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOlistType) =-             (sem _lhsIenv )-     in  (Syn_InList _lhsOannotatedTree _lhsOlistType ))-sem_InList_InList :: Annotation ->-                     T_ExpressionList  ->-                     T_InList -sem_InList_InList ann_ exprs_  =-    (\ _lhsIenv ->-         (let _lhsOlistType :: (Either [TypeError] Type)-              _lhsOannotatedTree :: InList-              _exprsOenv :: Environment-              _exprsIannotatedTree :: ExpressionList-              _exprsItypeList :: ([Type])-              -- "./TypeChecking.ag"(line 269, column 9)-              _lhsOlistType =-                  {-# LINE 269 "./TypeChecking.ag" #-}-                  resolveResultSetType-                    _lhsIenv-                    _exprsItypeList-                  {-# LINE 3346 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  InList ann_ _exprsIannotatedTree-                  {-# LINE 3351 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3356 "AstInternal.hs" #-}-              -- copy rule (down)-              _exprsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 3361 "AstInternal.hs" #-}-              ( _exprsIannotatedTree,_exprsItypeList) =-                  (exprs_ _exprsOenv )-          in  ( _lhsOannotatedTree,_lhsOlistType)))-sem_InList_InSelect :: Annotation ->-                       T_SelectExpression  ->-                       T_InList -sem_InList_InSelect ann_ sel_  =-    (\ _lhsIenv ->-         (let _lhsOlistType :: (Either [TypeError] Type)-              _lhsOannotatedTree :: InList-              _selOenv :: Environment-              _selIannotatedTree :: SelectExpression-              -- "./TypeChecking.ag"(line 273, column 9)-              _lhsOlistType =-                  {-# LINE 273 "./TypeChecking.ag" #-}-                  do-                    attrs <-  map snd <$> (unwrapSetOfComposite $-                                let a = getTypeAnnotation _selIannotatedTree-                                in                                      a)-                    typ <- case length attrs of-                                 0 -> Left [InternalError "got subquery with no columns? in inselect"]-                                 1 -> Right $ head attrs-                                 _ -> Right $ RowCtor attrs-                    chainTypeCheckFailed attrs $ Right typ-                  {-# LINE 3386 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  InSelect ann_ _selIannotatedTree-                  {-# LINE 3391 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3396 "AstInternal.hs" #-}-              -- copy rule (down)-              _selOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 3401 "AstInternal.hs" #-}-              ( _selIannotatedTree) =-                  (sel_ _selOenv )-          in  ( _lhsOannotatedTree,_lhsOlistType)))--- JoinExpression -----------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative JoinOn:-         child ann            : {Annotation}-         child expression     : Expression -         visit 0:-            local annotatedTree : _-      alternative JoinUsing:-         child ann            : {Annotation}-         child stringList     : StringList -         visit 0:-            local annotatedTree : _--}-data JoinExpression  = JoinOn (Annotation) (Expression) -                     | JoinUsing (Annotation) (StringList) -                     deriving ( Data,Eq,Show,Typeable)--- cata-sem_JoinExpression :: JoinExpression  ->-                      T_JoinExpression -sem_JoinExpression (JoinOn _ann _expression )  =-    (sem_JoinExpression_JoinOn _ann (sem_Expression _expression ) )-sem_JoinExpression (JoinUsing _ann _stringList )  =-    (sem_JoinExpression_JoinUsing _ann (sem_StringList _stringList ) )--- semantic domain-type T_JoinExpression  = Environment ->-                         ( JoinExpression)-data Inh_JoinExpression  = Inh_JoinExpression {env_Inh_JoinExpression :: Environment}-data Syn_JoinExpression  = Syn_JoinExpression {annotatedTree_Syn_JoinExpression :: JoinExpression}-wrap_JoinExpression :: T_JoinExpression  ->-                       Inh_JoinExpression  ->-                       Syn_JoinExpression -wrap_JoinExpression sem (Inh_JoinExpression _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_JoinExpression _lhsOannotatedTree ))-sem_JoinExpression_JoinOn :: Annotation ->-                             T_Expression  ->-                             T_JoinExpression -sem_JoinExpression_JoinOn ann_ expression_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: JoinExpression-              _expressionOenv :: Environment-              _expressionIannotatedTree :: Expression-              _expressionIliftedColumnName :: String-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  JoinOn ann_ _expressionIannotatedTree-                  {-# LINE 3459 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3464 "AstInternal.hs" #-}-              -- copy rule (down)-              _expressionOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 3469 "AstInternal.hs" #-}-              ( _expressionIannotatedTree,_expressionIliftedColumnName) =-                  (expression_ _expressionOenv )-          in  ( _lhsOannotatedTree)))-sem_JoinExpression_JoinUsing :: Annotation ->-                                T_StringList  ->-                                T_JoinExpression -sem_JoinExpression_JoinUsing ann_ stringList_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: JoinExpression-              _stringListOenv :: Environment-              _stringListIannotatedTree :: StringList-              _stringListIstrings :: ([String])-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  JoinUsing ann_ _stringListIannotatedTree-                  {-# LINE 3486 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3491 "AstInternal.hs" #-}-              -- copy rule (down)-              _stringListOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 3496 "AstInternal.hs" #-}-              ( _stringListIannotatedTree,_stringListIstrings) =-                  (stringList_ _stringListOenv )-          in  ( _lhsOannotatedTree)))--- JoinType -----------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Cross:-         visit 0:-            local annotatedTree : _-      alternative FullOuter:-         visit 0:-            local annotatedTree : _-      alternative Inner:-         visit 0:-            local annotatedTree : _-      alternative LeftOuter:-         visit 0:-            local annotatedTree : _-      alternative RightOuter:-         visit 0:-            local annotatedTree : _--}-data JoinType  = Cross -               | FullOuter -               | Inner -               | LeftOuter -               | RightOuter -               deriving ( Data,Eq,Show,Typeable)--- cata-sem_JoinType :: JoinType  ->-                T_JoinType -sem_JoinType (Cross )  =-    (sem_JoinType_Cross )-sem_JoinType (FullOuter )  =-    (sem_JoinType_FullOuter )-sem_JoinType (Inner )  =-    (sem_JoinType_Inner )-sem_JoinType (LeftOuter )  =-    (sem_JoinType_LeftOuter )-sem_JoinType (RightOuter )  =-    (sem_JoinType_RightOuter )--- semantic domain-type T_JoinType  = Environment ->-                   ( JoinType)-data Inh_JoinType  = Inh_JoinType {env_Inh_JoinType :: Environment}-data Syn_JoinType  = Syn_JoinType {annotatedTree_Syn_JoinType :: JoinType}-wrap_JoinType :: T_JoinType  ->-                 Inh_JoinType  ->-                 Syn_JoinType -wrap_JoinType sem (Inh_JoinType _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_JoinType _lhsOannotatedTree ))-sem_JoinType_Cross :: T_JoinType -sem_JoinType_Cross  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: JoinType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Cross-                  {-# LINE 3563 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3568 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_JoinType_FullOuter :: T_JoinType -sem_JoinType_FullOuter  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: JoinType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  FullOuter-                  {-# LINE 3578 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3583 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_JoinType_Inner :: T_JoinType -sem_JoinType_Inner  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: JoinType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Inner-                  {-# LINE 3593 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3598 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_JoinType_LeftOuter :: T_JoinType -sem_JoinType_LeftOuter  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: JoinType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  LeftOuter-                  {-# LINE 3608 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3613 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_JoinType_RightOuter :: T_JoinType -sem_JoinType_RightOuter  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: JoinType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  RightOuter-                  {-# LINE 3623 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3628 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- Language -----------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Plpgsql:-         visit 0:-            local annotatedTree : _-      alternative Sql:-         visit 0:-            local annotatedTree : _--}-data Language  = Plpgsql -               | Sql -               deriving ( Data,Eq,Show,Typeable)--- cata-sem_Language :: Language  ->-                T_Language -sem_Language (Plpgsql )  =-    (sem_Language_Plpgsql )-sem_Language (Sql )  =-    (sem_Language_Sql )--- semantic domain-type T_Language  = Environment ->-                   ( Language)-data Inh_Language  = Inh_Language {env_Inh_Language :: Environment}-data Syn_Language  = Syn_Language {annotatedTree_Syn_Language :: Language}-wrap_Language :: T_Language  ->-                 Inh_Language  ->-                 Syn_Language -wrap_Language sem (Inh_Language _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_Language _lhsOannotatedTree ))-sem_Language_Plpgsql :: T_Language -sem_Language_Plpgsql  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Language-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Plpgsql-                  {-# LINE 3675 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3680 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_Language_Sql :: T_Language -sem_Language_Sql  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Language-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Sql-                  {-# LINE 3690 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3695 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- MaybeBoolExpression ------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Just:-         child just           : Expression -         visit 0:-            local annotatedTree : _-      alternative Nothing:-         visit 0:-            local annotatedTree : _--}-type MaybeBoolExpression  = (Maybe (Expression))--- cata-sem_MaybeBoolExpression :: MaybeBoolExpression  ->-                           T_MaybeBoolExpression -sem_MaybeBoolExpression (Prelude.Just x )  =-    (sem_MaybeBoolExpression_Just (sem_Expression x ) )-sem_MaybeBoolExpression Prelude.Nothing  =-    sem_MaybeBoolExpression_Nothing--- semantic domain-type T_MaybeBoolExpression  = Environment ->-                              ( MaybeBoolExpression)-data Inh_MaybeBoolExpression  = Inh_MaybeBoolExpression {env_Inh_MaybeBoolExpression :: Environment}-data Syn_MaybeBoolExpression  = Syn_MaybeBoolExpression {annotatedTree_Syn_MaybeBoolExpression :: MaybeBoolExpression}-wrap_MaybeBoolExpression :: T_MaybeBoolExpression  ->-                            Inh_MaybeBoolExpression  ->-                            Syn_MaybeBoolExpression -wrap_MaybeBoolExpression sem (Inh_MaybeBoolExpression _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_MaybeBoolExpression _lhsOannotatedTree ))-sem_MaybeBoolExpression_Just :: T_Expression  ->-                                T_MaybeBoolExpression -sem_MaybeBoolExpression_Just just_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: MaybeBoolExpression-              _justOenv :: Environment-              _justIannotatedTree :: Expression-              _justIliftedColumnName :: String-              -- "./TypeChecking.ag"(line 965, column 9)-              _lhsOannotatedTree =-                  {-# LINE 965 "./TypeChecking.ag" #-}-                  if getTypeAnnotation _justIannotatedTree `notElem` [typeBool, TypeCheckFailed]-                    then Just $ updateAnnotation ((TypeErrorA ExpressionMustBeBool) :)-                                  _justIannotatedTree-                    else Just $ _justIannotatedTree-                  {-# LINE 3748 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Just _justIannotatedTree-                  {-# LINE 3753 "AstInternal.hs" #-}-              -- copy rule (down)-              _justOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 3758 "AstInternal.hs" #-}-              ( _justIannotatedTree,_justIliftedColumnName) =-                  (just_ _justOenv )-          in  ( _lhsOannotatedTree)))-sem_MaybeBoolExpression_Nothing :: T_MaybeBoolExpression -sem_MaybeBoolExpression_Nothing  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: MaybeBoolExpression-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Nothing-                  {-# LINE 3770 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3775 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- MaybeExpression ----------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         exprType             : Maybe Type-   alternatives:-      alternative Just:-         child just           : Expression -         visit 0:-            local annotatedTree : _-      alternative Nothing:-         visit 0:-            local annotatedTree : _--}-type MaybeExpression  = (Maybe (Expression))--- cata-sem_MaybeExpression :: MaybeExpression  ->-                       T_MaybeExpression -sem_MaybeExpression (Prelude.Just x )  =-    (sem_MaybeExpression_Just (sem_Expression x ) )-sem_MaybeExpression Prelude.Nothing  =-    sem_MaybeExpression_Nothing--- semantic domain-type T_MaybeExpression  = Environment ->-                          ( MaybeExpression,(Maybe Type))-data Inh_MaybeExpression  = Inh_MaybeExpression {env_Inh_MaybeExpression :: Environment}-data Syn_MaybeExpression  = Syn_MaybeExpression {annotatedTree_Syn_MaybeExpression :: MaybeExpression,exprType_Syn_MaybeExpression :: Maybe Type}-wrap_MaybeExpression :: T_MaybeExpression  ->-                        Inh_MaybeExpression  ->-                        Syn_MaybeExpression -wrap_MaybeExpression sem (Inh_MaybeExpression _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOexprType) =-             (sem _lhsIenv )-     in  (Syn_MaybeExpression _lhsOannotatedTree _lhsOexprType ))-sem_MaybeExpression_Just :: T_Expression  ->-                            T_MaybeExpression -sem_MaybeExpression_Just just_  =-    (\ _lhsIenv ->-         (let _lhsOexprType :: (Maybe Type)-              _lhsOannotatedTree :: MaybeExpression-              _justOenv :: Environment-              _justIannotatedTree :: Expression-              _justIliftedColumnName :: String-              -- "./TypeChecking.ag"(line 974, column 12)-              _lhsOexprType =-                  {-# LINE 974 "./TypeChecking.ag" #-}-                  Just $ getTypeAnnotation _justIannotatedTree-                  {-# LINE 3827 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Just _justIannotatedTree-                  {-# LINE 3832 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3837 "AstInternal.hs" #-}-              -- copy rule (down)-              _justOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 3842 "AstInternal.hs" #-}-              ( _justIannotatedTree,_justIliftedColumnName) =-                  (just_ _justOenv )-          in  ( _lhsOannotatedTree,_lhsOexprType)))-sem_MaybeExpression_Nothing :: T_MaybeExpression -sem_MaybeExpression_Nothing  =-    (\ _lhsIenv ->-         (let _lhsOexprType :: (Maybe Type)-              _lhsOannotatedTree :: MaybeExpression-              -- "./TypeChecking.ag"(line 975, column 15)-              _lhsOexprType =-                  {-# LINE 975 "./TypeChecking.ag" #-}-                  Nothing-                  {-# LINE 3855 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Nothing-                  {-# LINE 3860 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3865 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOexprType)))--- Natural ------------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Natural:-         visit 0:-            local annotatedTree : _-      alternative Unnatural:-         visit 0:-            local annotatedTree : _--}-data Natural  = Natural -              | Unnatural -              deriving ( Data,Eq,Show,Typeable)--- cata-sem_Natural :: Natural  ->-               T_Natural -sem_Natural (Natural )  =-    (sem_Natural_Natural )-sem_Natural (Unnatural )  =-    (sem_Natural_Unnatural )--- semantic domain-type T_Natural  = Environment ->-                  ( Natural)-data Inh_Natural  = Inh_Natural {env_Inh_Natural :: Environment}-data Syn_Natural  = Syn_Natural {annotatedTree_Syn_Natural :: Natural}-wrap_Natural :: T_Natural  ->-                Inh_Natural  ->-                Syn_Natural -wrap_Natural sem (Inh_Natural _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_Natural _lhsOannotatedTree ))-sem_Natural_Natural :: T_Natural -sem_Natural_Natural  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Natural-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Natural-                  {-# LINE 3912 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3917 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_Natural_Unnatural :: T_Natural -sem_Natural_Unnatural  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Natural-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Unnatural-                  {-# LINE 3927 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3932 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- OnExpr -------------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Just:-         child just           : JoinExpression -         visit 0:-            local annotatedTree : _-      alternative Nothing:-         visit 0:-            local annotatedTree : _--}-type OnExpr  = (Maybe (JoinExpression))--- cata-sem_OnExpr :: OnExpr  ->-              T_OnExpr -sem_OnExpr (Prelude.Just x )  =-    (sem_OnExpr_Just (sem_JoinExpression x ) )-sem_OnExpr Prelude.Nothing  =-    sem_OnExpr_Nothing--- semantic domain-type T_OnExpr  = Environment ->-                 ( OnExpr)-data Inh_OnExpr  = Inh_OnExpr {env_Inh_OnExpr :: Environment}-data Syn_OnExpr  = Syn_OnExpr {annotatedTree_Syn_OnExpr :: OnExpr}-wrap_OnExpr :: T_OnExpr  ->-               Inh_OnExpr  ->-               Syn_OnExpr -wrap_OnExpr sem (Inh_OnExpr _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_OnExpr _lhsOannotatedTree ))-sem_OnExpr_Just :: T_JoinExpression  ->-                   T_OnExpr -sem_OnExpr_Just just_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: OnExpr-              _justOenv :: Environment-              _justIannotatedTree :: JoinExpression-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Just _justIannotatedTree-                  {-# LINE 3981 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 3986 "AstInternal.hs" #-}-              -- copy rule (down)-              _justOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 3991 "AstInternal.hs" #-}-              ( _justIannotatedTree) =-                  (just_ _justOenv )-          in  ( _lhsOannotatedTree)))-sem_OnExpr_Nothing :: T_OnExpr -sem_OnExpr_Nothing  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: OnExpr-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Nothing-                  {-# LINE 4003 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4008 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- ParamDef -----------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         namedType            : Type-         paramName            : String-   alternatives:-      alternative ParamDef:-         child ann            : {Annotation}-         child name           : {String}-         child typ            : TypeName -         visit 0:-            local annotatedTree : _-      alternative ParamDefTp:-         child ann            : {Annotation}-         child typ            : TypeName -         visit 0:-            local annotatedTree : _--}-data ParamDef  = ParamDef (Annotation) (String) (TypeName) -               | ParamDefTp (Annotation) (TypeName) -               deriving ( Data,Eq,Show,Typeable)--- cata-sem_ParamDef :: ParamDef  ->-                T_ParamDef -sem_ParamDef (ParamDef _ann _name _typ )  =-    (sem_ParamDef_ParamDef _ann _name (sem_TypeName _typ ) )-sem_ParamDef (ParamDefTp _ann _typ )  =-    (sem_ParamDef_ParamDefTp _ann (sem_TypeName _typ ) )--- semantic domain-type T_ParamDef  = Environment ->-                   ( ParamDef,Type,String)-data Inh_ParamDef  = Inh_ParamDef {env_Inh_ParamDef :: Environment}-data Syn_ParamDef  = Syn_ParamDef {annotatedTree_Syn_ParamDef :: ParamDef,namedType_Syn_ParamDef :: Type,paramName_Syn_ParamDef :: String}-wrap_ParamDef :: T_ParamDef  ->-                 Inh_ParamDef  ->-                 Syn_ParamDef -wrap_ParamDef sem (Inh_ParamDef _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOnamedType,_lhsOparamName) =-             (sem _lhsIenv )-     in  (Syn_ParamDef _lhsOannotatedTree _lhsOnamedType _lhsOparamName ))-sem_ParamDef_ParamDef :: Annotation ->-                         String ->-                         T_TypeName  ->-                         T_ParamDef -sem_ParamDef_ParamDef ann_ name_ typ_  =-    (\ _lhsIenv ->-         (let _lhsOnamedType :: Type-              _lhsOparamName :: String-              _lhsOannotatedTree :: ParamDef-              _typOenv :: Environment-              _typIannotatedTree :: TypeName-              _typInamedType :: Type-              -- "./TypeChecking.ag"(line 913, column 9)-              _lhsOnamedType =-                  {-# LINE 913 "./TypeChecking.ag" #-}-                  _typInamedType-                  {-# LINE 4070 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 915, column 9)-              _lhsOparamName =-                  {-# LINE 915 "./TypeChecking.ag" #-}-                  name_-                  {-# LINE 4075 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  ParamDef ann_ name_ _typIannotatedTree-                  {-# LINE 4080 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4085 "AstInternal.hs" #-}-              -- copy rule (down)-              _typOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4090 "AstInternal.hs" #-}-              ( _typIannotatedTree,_typInamedType) =-                  (typ_ _typOenv )-          in  ( _lhsOannotatedTree,_lhsOnamedType,_lhsOparamName)))-sem_ParamDef_ParamDefTp :: Annotation ->-                           T_TypeName  ->-                           T_ParamDef -sem_ParamDef_ParamDefTp ann_ typ_  =-    (\ _lhsIenv ->-         (let _lhsOnamedType :: Type-              _lhsOparamName :: String-              _lhsOannotatedTree :: ParamDef-              _typOenv :: Environment-              _typIannotatedTree :: TypeName-              _typInamedType :: Type-              -- "./TypeChecking.ag"(line 913, column 9)-              _lhsOnamedType =-                  {-# LINE 913 "./TypeChecking.ag" #-}-                  _typInamedType-                  {-# LINE 4109 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 917, column 9)-              _lhsOparamName =-                  {-# LINE 917 "./TypeChecking.ag" #-}-                  ""-                  {-# LINE 4114 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  ParamDefTp ann_ _typIannotatedTree-                  {-# LINE 4119 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4124 "AstInternal.hs" #-}-              -- copy rule (down)-              _typOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4129 "AstInternal.hs" #-}-              ( _typIannotatedTree,_typInamedType) =-                  (typ_ _typOenv )-          in  ( _lhsOannotatedTree,_lhsOnamedType,_lhsOparamName)))--- ParamDefList -------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         params               : [(String, Type)]-   alternatives:-      alternative Cons:-         child hd             : ParamDef -         child tl             : ParamDefList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type ParamDefList  = [(ParamDef)]--- cata-sem_ParamDefList :: ParamDefList  ->-                    T_ParamDefList -sem_ParamDefList list  =-    (Prelude.foldr sem_ParamDefList_Cons sem_ParamDefList_Nil (Prelude.map sem_ParamDef list) )--- semantic domain-type T_ParamDefList  = Environment ->-                       ( ParamDefList,([(String, Type)]))-data Inh_ParamDefList  = Inh_ParamDefList {env_Inh_ParamDefList :: Environment}-data Syn_ParamDefList  = Syn_ParamDefList {annotatedTree_Syn_ParamDefList :: ParamDefList,params_Syn_ParamDefList :: [(String, Type)]}-wrap_ParamDefList :: T_ParamDefList  ->-                     Inh_ParamDefList  ->-                     Syn_ParamDefList -wrap_ParamDefList sem (Inh_ParamDefList _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOparams) =-             (sem _lhsIenv )-     in  (Syn_ParamDefList _lhsOannotatedTree _lhsOparams ))-sem_ParamDefList_Cons :: T_ParamDef  ->-                         T_ParamDefList  ->-                         T_ParamDefList -sem_ParamDefList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOparams :: ([(String, Type)])-              _lhsOannotatedTree :: ParamDefList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: ParamDef-              _hdInamedType :: Type-              _hdIparamName :: String-              _tlIannotatedTree :: ParamDefList-              _tlIparams :: ([(String, Type)])-              -- "./TypeChecking.ag"(line 921, column 13)-              _lhsOparams =-                  {-# LINE 921 "./TypeChecking.ag" #-}-                  ((_hdIparamName, _hdInamedType) : _tlIparams)-                  {-# LINE 4187 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 4192 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4197 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4202 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4207 "AstInternal.hs" #-}-              ( _hdIannotatedTree,_hdInamedType,_hdIparamName) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree,_tlIparams) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree,_lhsOparams)))-sem_ParamDefList_Nil :: T_ParamDefList -sem_ParamDefList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOparams :: ([(String, Type)])-              _lhsOannotatedTree :: ParamDefList-              -- "./TypeChecking.ag"(line 920, column 12)-              _lhsOparams =-                  {-# LINE 920 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 4222 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 4227 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4232 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOparams)))--- RaiseType ----------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative RError:-         visit 0:-            local annotatedTree : _-      alternative RException:-         visit 0:-            local annotatedTree : _-      alternative RNotice:-         visit 0:-            local annotatedTree : _--}-data RaiseType  = RError -                | RException -                | RNotice -                deriving ( Data,Eq,Show,Typeable)--- cata-sem_RaiseType :: RaiseType  ->-                 T_RaiseType -sem_RaiseType (RError )  =-    (sem_RaiseType_RError )-sem_RaiseType (RException )  =-    (sem_RaiseType_RException )-sem_RaiseType (RNotice )  =-    (sem_RaiseType_RNotice )--- semantic domain-type T_RaiseType  = Environment ->-                    ( RaiseType)-data Inh_RaiseType  = Inh_RaiseType {env_Inh_RaiseType :: Environment}-data Syn_RaiseType  = Syn_RaiseType {annotatedTree_Syn_RaiseType :: RaiseType}-wrap_RaiseType :: T_RaiseType  ->-                  Inh_RaiseType  ->-                  Syn_RaiseType -wrap_RaiseType sem (Inh_RaiseType _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_RaiseType _lhsOannotatedTree ))-sem_RaiseType_RError :: T_RaiseType -sem_RaiseType_RError  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: RaiseType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  RError-                  {-# LINE 4285 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4290 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_RaiseType_RException :: T_RaiseType -sem_RaiseType_RException  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: RaiseType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  RException-                  {-# LINE 4300 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4305 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_RaiseType_RNotice :: T_RaiseType -sem_RaiseType_RNotice  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: RaiseType-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  RNotice-                  {-# LINE 4315 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4320 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- RestartIdentity ----------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative ContinueIdentity:-         visit 0:-            local annotatedTree : _-      alternative RestartIdentity:-         visit 0:-            local annotatedTree : _--}-data RestartIdentity  = ContinueIdentity -                      | RestartIdentity -                      deriving ( Data,Eq,Show,Typeable)--- cata-sem_RestartIdentity :: RestartIdentity  ->-                       T_RestartIdentity -sem_RestartIdentity (ContinueIdentity )  =-    (sem_RestartIdentity_ContinueIdentity )-sem_RestartIdentity (RestartIdentity )  =-    (sem_RestartIdentity_RestartIdentity )--- semantic domain-type T_RestartIdentity  = Environment ->-                          ( RestartIdentity)-data Inh_RestartIdentity  = Inh_RestartIdentity {env_Inh_RestartIdentity :: Environment}-data Syn_RestartIdentity  = Syn_RestartIdentity {annotatedTree_Syn_RestartIdentity :: RestartIdentity}-wrap_RestartIdentity :: T_RestartIdentity  ->-                        Inh_RestartIdentity  ->-                        Syn_RestartIdentity -wrap_RestartIdentity sem (Inh_RestartIdentity _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_RestartIdentity _lhsOannotatedTree ))-sem_RestartIdentity_ContinueIdentity :: T_RestartIdentity -sem_RestartIdentity_ContinueIdentity  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: RestartIdentity-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  ContinueIdentity-                  {-# LINE 4367 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4372 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_RestartIdentity_RestartIdentity :: T_RestartIdentity -sem_RestartIdentity_RestartIdentity  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: RestartIdentity-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  RestartIdentity-                  {-# LINE 4382 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4387 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- Root ---------------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         producedEnv          : Environment-   alternatives:-      alternative Root:-         child statements     : StatementList -         visit 0:-            local annotatedTree : _--}-data Root  = Root (StatementList) -           deriving ( Show)--- cata-sem_Root :: Root  ->-            T_Root -sem_Root (Root _statements )  =-    (sem_Root_Root (sem_StatementList _statements ) )--- semantic domain-type T_Root  = Environment ->-               ( Root,Environment)-data Inh_Root  = Inh_Root {env_Inh_Root :: Environment}-data Syn_Root  = Syn_Root {annotatedTree_Syn_Root :: Root,producedEnv_Syn_Root :: Environment}-wrap_Root :: T_Root  ->-             Inh_Root  ->-             Syn_Root -wrap_Root sem (Inh_Root _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOproducedEnv) =-             (sem _lhsIenv )-     in  (Syn_Root _lhsOannotatedTree _lhsOproducedEnv ))-sem_Root_Root :: T_StatementList  ->-                 T_Root -sem_Root_Root statements_  =-    (\ _lhsIenv ->-         (let _statementsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Root-              _lhsOproducedEnv :: Environment-              _statementsOenv :: Environment-              _statementsIannotatedTree :: StatementList-              _statementsIproducedEnv :: Environment-              -- "./TypeChecking.ag"(line 330, column 12)-              _statementsOenvUpdates =-                  {-# LINE 330 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 4436 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Root _statementsIannotatedTree-                  {-# LINE 4441 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4446 "AstInternal.hs" #-}-              -- copy rule (up)-              _lhsOproducedEnv =-                  {-# LINE 59 "./TypeChecking.ag" #-}-                  _statementsIproducedEnv-                  {-# LINE 4451 "AstInternal.hs" #-}-              -- copy rule (down)-              _statementsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4456 "AstInternal.hs" #-}-              ( _statementsIannotatedTree,_statementsIproducedEnv) =-                  (statements_ _statementsOenv _statementsOenvUpdates )-          in  ( _lhsOannotatedTree,_lhsOproducedEnv)))--- RowConstraint ------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative NotNullConstraint:-         child ann            : {Annotation}-         visit 0:-            local annotatedTree : _-      alternative NullConstraint:-         child ann            : {Annotation}-         visit 0:-            local annotatedTree : _-      alternative RowCheckConstraint:-         child ann            : {Annotation}-         child expression     : Expression -         visit 0:-            local annotatedTree : _-      alternative RowPrimaryKeyConstraint:-         child ann            : {Annotation}-         visit 0:-            local annotatedTree : _-      alternative RowReferenceConstraint:-         child ann            : {Annotation}-         child table          : {String}-         child att            : {Maybe String}-         child onUpdate       : Cascade -         child onDelete       : Cascade -         visit 0:-            local annotatedTree : _-      alternative RowUniqueConstraint:-         child ann            : {Annotation}-         visit 0:-            local annotatedTree : _--}-data RowConstraint  = NotNullConstraint (Annotation) -                    | NullConstraint (Annotation) -                    | RowCheckConstraint (Annotation) (Expression) -                    | RowPrimaryKeyConstraint (Annotation) -                    | RowReferenceConstraint (Annotation) (String) (Maybe String) (Cascade) (Cascade) -                    | RowUniqueConstraint (Annotation) -                    deriving ( Data,Eq,Show,Typeable)--- cata-sem_RowConstraint :: RowConstraint  ->-                     T_RowConstraint -sem_RowConstraint (NotNullConstraint _ann )  =-    (sem_RowConstraint_NotNullConstraint _ann )-sem_RowConstraint (NullConstraint _ann )  =-    (sem_RowConstraint_NullConstraint _ann )-sem_RowConstraint (RowCheckConstraint _ann _expression )  =-    (sem_RowConstraint_RowCheckConstraint _ann (sem_Expression _expression ) )-sem_RowConstraint (RowPrimaryKeyConstraint _ann )  =-    (sem_RowConstraint_RowPrimaryKeyConstraint _ann )-sem_RowConstraint (RowReferenceConstraint _ann _table _att _onUpdate _onDelete )  =-    (sem_RowConstraint_RowReferenceConstraint _ann _table _att (sem_Cascade _onUpdate ) (sem_Cascade _onDelete ) )-sem_RowConstraint (RowUniqueConstraint _ann )  =-    (sem_RowConstraint_RowUniqueConstraint _ann )--- semantic domain-type T_RowConstraint  = Environment ->-                        ( RowConstraint)-data Inh_RowConstraint  = Inh_RowConstraint {env_Inh_RowConstraint :: Environment}-data Syn_RowConstraint  = Syn_RowConstraint {annotatedTree_Syn_RowConstraint :: RowConstraint}-wrap_RowConstraint :: T_RowConstraint  ->-                      Inh_RowConstraint  ->-                      Syn_RowConstraint -wrap_RowConstraint sem (Inh_RowConstraint _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_RowConstraint _lhsOannotatedTree ))-sem_RowConstraint_NotNullConstraint :: Annotation ->-                                       T_RowConstraint -sem_RowConstraint_NotNullConstraint ann_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: RowConstraint-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  NotNullConstraint ann_-                  {-# LINE 4541 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4546 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_RowConstraint_NullConstraint :: Annotation ->-                                    T_RowConstraint -sem_RowConstraint_NullConstraint ann_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: RowConstraint-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  NullConstraint ann_-                  {-# LINE 4557 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4562 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_RowConstraint_RowCheckConstraint :: Annotation ->-                                        T_Expression  ->-                                        T_RowConstraint -sem_RowConstraint_RowCheckConstraint ann_ expression_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: RowConstraint-              _expressionOenv :: Environment-              _expressionIannotatedTree :: Expression-              _expressionIliftedColumnName :: String-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  RowCheckConstraint ann_ _expressionIannotatedTree-                  {-# LINE 4577 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4582 "AstInternal.hs" #-}-              -- copy rule (down)-              _expressionOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4587 "AstInternal.hs" #-}-              ( _expressionIannotatedTree,_expressionIliftedColumnName) =-                  (expression_ _expressionOenv )-          in  ( _lhsOannotatedTree)))-sem_RowConstraint_RowPrimaryKeyConstraint :: Annotation ->-                                             T_RowConstraint -sem_RowConstraint_RowPrimaryKeyConstraint ann_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: RowConstraint-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  RowPrimaryKeyConstraint ann_-                  {-# LINE 4600 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4605 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_RowConstraint_RowReferenceConstraint :: Annotation ->-                                            String ->-                                            (Maybe String) ->-                                            T_Cascade  ->-                                            T_Cascade  ->-                                            T_RowConstraint -sem_RowConstraint_RowReferenceConstraint ann_ table_ att_ onUpdate_ onDelete_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: RowConstraint-              _onUpdateOenv :: Environment-              _onDeleteOenv :: Environment-              _onUpdateIannotatedTree :: Cascade-              _onDeleteIannotatedTree :: Cascade-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  RowReferenceConstraint ann_ table_ att_ _onUpdateIannotatedTree _onDeleteIannotatedTree-                  {-# LINE 4624 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4629 "AstInternal.hs" #-}-              -- copy rule (down)-              _onUpdateOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4634 "AstInternal.hs" #-}-              -- copy rule (down)-              _onDeleteOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4639 "AstInternal.hs" #-}-              ( _onUpdateIannotatedTree) =-                  (onUpdate_ _onUpdateOenv )-              ( _onDeleteIannotatedTree) =-                  (onDelete_ _onDeleteOenv )-          in  ( _lhsOannotatedTree)))-sem_RowConstraint_RowUniqueConstraint :: Annotation ->-                                         T_RowConstraint -sem_RowConstraint_RowUniqueConstraint ann_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: RowConstraint-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  RowUniqueConstraint ann_-                  {-# LINE 4654 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4659 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- RowConstraintList --------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Cons:-         child hd             : RowConstraint -         child tl             : RowConstraintList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type RowConstraintList  = [(RowConstraint)]--- cata-sem_RowConstraintList :: RowConstraintList  ->-                         T_RowConstraintList -sem_RowConstraintList list  =-    (Prelude.foldr sem_RowConstraintList_Cons sem_RowConstraintList_Nil (Prelude.map sem_RowConstraint list) )--- semantic domain-type T_RowConstraintList  = Environment ->-                            ( RowConstraintList)-data Inh_RowConstraintList  = Inh_RowConstraintList {env_Inh_RowConstraintList :: Environment}-data Syn_RowConstraintList  = Syn_RowConstraintList {annotatedTree_Syn_RowConstraintList :: RowConstraintList}-wrap_RowConstraintList :: T_RowConstraintList  ->-                          Inh_RowConstraintList  ->-                          Syn_RowConstraintList -wrap_RowConstraintList sem (Inh_RowConstraintList _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_RowConstraintList _lhsOannotatedTree ))-sem_RowConstraintList_Cons :: T_RowConstraint  ->-                              T_RowConstraintList  ->-                              T_RowConstraintList -sem_RowConstraintList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: RowConstraintList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: RowConstraint-              _tlIannotatedTree :: RowConstraintList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 4710 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4715 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4720 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4725 "AstInternal.hs" #-}-              ( _hdIannotatedTree) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree)))-sem_RowConstraintList_Nil :: T_RowConstraintList -sem_RowConstraintList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: RowConstraintList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 4739 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 4744 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- SelectExpression ---------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative CombineSelect:-         child ann            : {Annotation}-         child ctype          : CombineType -         child sel1           : SelectExpression -         child sel2           : SelectExpression -         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative Select:-         child ann            : {Annotation}-         child selDistinct    : Distinct -         child selSelectList  : SelectList -         child selTref        : TableRefList -         child selWhere       : MaybeBoolExpression -         child selGroupBy     : ExpressionList -         child selHaving      : MaybeBoolExpression -         child selOrderBy     : ExpressionDirectionPairList -         child selLimit       : MaybeExpression -         child selOffset      : MaybeExpression -         visit 0:-            local tpe         : _-            local backTree    : _-            local newEnv      : _-            local annotatedTree : _-      alternative Values:-         child ann            : {Annotation}-         child vll            : ExpressionListList -         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _--}-data SelectExpression  = CombineSelect (Annotation) (CombineType) (SelectExpression) (SelectExpression) -                       | Select (Annotation) (Distinct) (SelectList) (TableRefList) (MaybeBoolExpression) (ExpressionList) (MaybeBoolExpression) (ExpressionDirectionPairList) (MaybeExpression) (MaybeExpression) -                       | Values (Annotation) (ExpressionListList) -                       deriving ( Data,Eq,Show,Typeable)--- cata-sem_SelectExpression :: SelectExpression  ->-                        T_SelectExpression -sem_SelectExpression (CombineSelect _ann _ctype _sel1 _sel2 )  =-    (sem_SelectExpression_CombineSelect _ann (sem_CombineType _ctype ) (sem_SelectExpression _sel1 ) (sem_SelectExpression _sel2 ) )-sem_SelectExpression (Select _ann _selDistinct _selSelectList _selTref _selWhere _selGroupBy _selHaving _selOrderBy _selLimit _selOffset )  =-    (sem_SelectExpression_Select _ann (sem_Distinct _selDistinct ) (sem_SelectList _selSelectList ) (sem_TableRefList _selTref ) (sem_MaybeBoolExpression _selWhere ) (sem_ExpressionList _selGroupBy ) (sem_MaybeBoolExpression _selHaving ) (sem_ExpressionDirectionPairList _selOrderBy ) (sem_MaybeExpression _selLimit ) (sem_MaybeExpression _selOffset ) )-sem_SelectExpression (Values _ann _vll )  =-    (sem_SelectExpression_Values _ann (sem_ExpressionListList _vll ) )--- semantic domain-type T_SelectExpression  = Environment ->-                           ( SelectExpression)-data Inh_SelectExpression  = Inh_SelectExpression {env_Inh_SelectExpression :: Environment}-data Syn_SelectExpression  = Syn_SelectExpression {annotatedTree_Syn_SelectExpression :: SelectExpression}-wrap_SelectExpression :: T_SelectExpression  ->-                         Inh_SelectExpression  ->-                         Syn_SelectExpression -wrap_SelectExpression sem (Inh_SelectExpression _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_SelectExpression _lhsOannotatedTree ))-sem_SelectExpression_CombineSelect :: Annotation ->-                                      T_CombineType  ->-                                      T_SelectExpression  ->-                                      T_SelectExpression  ->-                                      T_SelectExpression -sem_SelectExpression_CombineSelect ann_ ctype_ sel1_ sel2_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: SelectExpression-              _ctypeOenv :: Environment-              _sel1Oenv :: Environment-              _sel2Oenv :: Environment-              _ctypeIannotatedTree :: CombineType-              _sel1IannotatedTree :: SelectExpression-              _sel2IannotatedTree :: SelectExpression-              -- "./TypeChecking.ag"(line 379, column 9)-              _lhsOannotatedTree =-                  {-# LINE 379 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 4833 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 415, column 9)-              _tpe =-                  {-# LINE 415 "./TypeChecking.ag" #-}-                  let sel1t = getTypeAnnotation _sel1IannotatedTree-                      sel2t = getTypeAnnotation _sel2IannotatedTree-                  in chainTypeCheckFailed [sel1t, sel2t] $-                        typeCheckCombineSelect _lhsIenv sel1t sel2t-                  {-# LINE 4841 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 420, column 9)-              _backTree =-                  {-# LINE 420 "./TypeChecking.ag" #-}-                  CombineSelect ann_ _ctypeIannotatedTree-                                _sel1IannotatedTree-                                _sel2IannotatedTree-                  {-# LINE 4848 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  CombineSelect ann_ _ctypeIannotatedTree _sel1IannotatedTree _sel2IannotatedTree-                  {-# LINE 4853 "AstInternal.hs" #-}-              -- copy rule (down)-              _ctypeOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4858 "AstInternal.hs" #-}-              -- copy rule (down)-              _sel1Oenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4863 "AstInternal.hs" #-}-              -- copy rule (down)-              _sel2Oenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4868 "AstInternal.hs" #-}-              ( _ctypeIannotatedTree) =-                  (ctype_ _ctypeOenv )-              ( _sel1IannotatedTree) =-                  (sel1_ _sel1Oenv )-              ( _sel2IannotatedTree) =-                  (sel2_ _sel2Oenv )-          in  ( _lhsOannotatedTree)))-sem_SelectExpression_Select :: Annotation ->-                               T_Distinct  ->-                               T_SelectList  ->-                               T_TableRefList  ->-                               T_MaybeBoolExpression  ->-                               T_ExpressionList  ->-                               T_MaybeBoolExpression  ->-                               T_ExpressionDirectionPairList  ->-                               T_MaybeExpression  ->-                               T_MaybeExpression  ->-                               T_SelectExpression -sem_SelectExpression_Select ann_ selDistinct_ selSelectList_ selTref_ selWhere_ selGroupBy_ selHaving_ selOrderBy_ selLimit_ selOffset_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: SelectExpression-              _selSelectListOenv :: Environment-              _selWhereOenv :: Environment-              _selDistinctOenv :: Environment-              _selTrefOenv :: Environment-              _selGroupByOenv :: Environment-              _selHavingOenv :: Environment-              _selOrderByOenv :: Environment-              _selLimitOenv :: Environment-              _selOffsetOenv :: Environment-              _selDistinctIannotatedTree :: Distinct-              _selSelectListIannotatedTree :: SelectList-              _selSelectListIlistType :: Type-              _selTrefIannotatedTree :: TableRefList-              _selTrefIidens :: ([(String,([(String,Type)],[(String,Type)]))])-              _selTrefIjoinIdens :: ([String])-              _selWhereIannotatedTree :: MaybeBoolExpression-              _selGroupByIannotatedTree :: ExpressionList-              _selGroupByItypeList :: ([Type])-              _selHavingIannotatedTree :: MaybeBoolExpression-              _selOrderByIannotatedTree :: ExpressionDirectionPairList-              _selLimitIannotatedTree :: MaybeExpression-              _selLimitIexprType :: (Maybe Type)-              _selOffsetIannotatedTree :: MaybeExpression-              _selOffsetIexprType :: (Maybe Type)-              -- "./TypeChecking.ag"(line 379, column 9)-              _lhsOannotatedTree =-                  {-# LINE 379 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 4921 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 391, column 9)-              _tpe =-                  {-# LINE 391 "./TypeChecking.ag" #-}-                  do-                  let trefType = let ts = _selTrefIannotatedTree-                                 in case null ts of-                                      True -> typeBool-                                      _ -> getTypeAnnotation $ head ts-                      slType = _selSelectListIlistType-                  chainTypeCheckFailed [trefType, slType] $-                    Right $ case slType of-                              UnnamedCompositeType [(_,Pseudo Void)] -> Pseudo Void-                              _ -> SetOfType slType-                  {-# LINE 4935 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 404, column 9)-              _backTree =-                  {-# LINE 404 "./TypeChecking.ag" #-}-                  Select ann_-                         _selDistinctIannotatedTree-                         _selSelectListIannotatedTree-                         _selTrefIannotatedTree-                         _selWhereIannotatedTree-                         _selGroupByIannotatedTree-                         _selHavingIannotatedTree-                         _selOrderByIannotatedTree-                         _selLimitIannotatedTree-                         _selOffsetIannotatedTree-                  {-# LINE 4949 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 602, column 10)-              _newEnv =-                  {-# LINE 602 "./TypeChecking.ag" #-}-                  case updateEnvironment _lhsIenv-                        (convertToNewStyleUpdates _selTrefIidens _selTrefIjoinIdens) of-                    Left x -> error $ show x-                    Right e -> e-                  {-# LINE 4957 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 606, column 10)-              _selSelectListOenv =-                  {-# LINE 606 "./TypeChecking.ag" #-}-                  _newEnv-                  {-# LINE 4962 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 607, column 10)-              _selWhereOenv =-                  {-# LINE 607 "./TypeChecking.ag" #-}-                  _newEnv-                  {-# LINE 4967 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Select ann_ _selDistinctIannotatedTree _selSelectListIannotatedTree _selTrefIannotatedTree _selWhereIannotatedTree _selGroupByIannotatedTree _selHavingIannotatedTree _selOrderByIannotatedTree _selLimitIannotatedTree _selOffsetIannotatedTree-                  {-# LINE 4972 "AstInternal.hs" #-}-              -- copy rule (down)-              _selDistinctOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4977 "AstInternal.hs" #-}-              -- copy rule (down)-              _selTrefOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4982 "AstInternal.hs" #-}-              -- copy rule (down)-              _selGroupByOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4987 "AstInternal.hs" #-}-              -- copy rule (down)-              _selHavingOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4992 "AstInternal.hs" #-}-              -- copy rule (down)-              _selOrderByOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 4997 "AstInternal.hs" #-}-              -- copy rule (down)-              _selLimitOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5002 "AstInternal.hs" #-}-              -- copy rule (down)-              _selOffsetOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5007 "AstInternal.hs" #-}-              ( _selDistinctIannotatedTree) =-                  (selDistinct_ _selDistinctOenv )-              ( _selSelectListIannotatedTree,_selSelectListIlistType) =-                  (selSelectList_ _selSelectListOenv )-              ( _selTrefIannotatedTree,_selTrefIidens,_selTrefIjoinIdens) =-                  (selTref_ _selTrefOenv )-              ( _selWhereIannotatedTree) =-                  (selWhere_ _selWhereOenv )-              ( _selGroupByIannotatedTree,_selGroupByItypeList) =-                  (selGroupBy_ _selGroupByOenv )-              ( _selHavingIannotatedTree) =-                  (selHaving_ _selHavingOenv )-              ( _selOrderByIannotatedTree) =-                  (selOrderBy_ _selOrderByOenv )-              ( _selLimitIannotatedTree,_selLimitIexprType) =-                  (selLimit_ _selLimitOenv )-              ( _selOffsetIannotatedTree,_selOffsetIexprType) =-                  (selOffset_ _selOffsetOenv )-          in  ( _lhsOannotatedTree)))-sem_SelectExpression_Values :: Annotation ->-                               T_ExpressionListList  ->-                               T_SelectExpression -sem_SelectExpression_Values ann_ vll_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: SelectExpression-              _vllOenv :: Environment-              _vllIannotatedTree :: ExpressionListList-              _vllItypeListList :: ([[Type]])-              -- "./TypeChecking.ag"(line 379, column 9)-              _lhsOannotatedTree =-                  {-# LINE 379 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 5043 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 386, column 9)-              _tpe =-                  {-# LINE 386 "./TypeChecking.ag" #-}-                  typeCheckValuesExpr-                              _lhsIenv-                              _vllItypeListList-                  {-# LINE 5050 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 389, column 9)-              _backTree =-                  {-# LINE 389 "./TypeChecking.ag" #-}-                  Values ann_ _vllIannotatedTree-                  {-# LINE 5055 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Values ann_ _vllIannotatedTree-                  {-# LINE 5060 "AstInternal.hs" #-}-              -- copy rule (down)-              _vllOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5065 "AstInternal.hs" #-}-              ( _vllIannotatedTree,_vllItypeListList) =-                  (vll_ _vllOenv )-          in  ( _lhsOannotatedTree)))--- SelectItem ---------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         columnName           : String-         itemType             : Type-   alternatives:-      alternative SelExp:-         child ann            : {Annotation}-         child ex             : Expression -         visit 0:-            local annotatedTree : _-      alternative SelectItem:-         child ann            : {Annotation}-         child ex             : Expression -         child name           : {String}-         visit 0:-            local backTree    : _-            local annotatedTree : _--}-data SelectItem  = SelExp (Annotation) (Expression) -                 | SelectItem (Annotation) (Expression) (String) -                 deriving ( Data,Eq,Show,Typeable)--- cata-sem_SelectItem :: SelectItem  ->-                  T_SelectItem -sem_SelectItem (SelExp _ann _ex )  =-    (sem_SelectItem_SelExp _ann (sem_Expression _ex ) )-sem_SelectItem (SelectItem _ann _ex _name )  =-    (sem_SelectItem_SelectItem _ann (sem_Expression _ex ) _name )--- semantic domain-type T_SelectItem  = Environment ->-                     ( SelectItem,String,Type)-data Inh_SelectItem  = Inh_SelectItem {env_Inh_SelectItem :: Environment}-data Syn_SelectItem  = Syn_SelectItem {annotatedTree_Syn_SelectItem :: SelectItem,columnName_Syn_SelectItem :: String,itemType_Syn_SelectItem :: Type}-wrap_SelectItem :: T_SelectItem  ->-                   Inh_SelectItem  ->-                   Syn_SelectItem -wrap_SelectItem sem (Inh_SelectItem _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOcolumnName,_lhsOitemType) =-             (sem _lhsIenv )-     in  (Syn_SelectItem _lhsOannotatedTree _lhsOcolumnName _lhsOitemType ))-sem_SelectItem_SelExp :: Annotation ->-                         T_Expression  ->-                         T_SelectItem -sem_SelectItem_SelExp ann_ ex_  =-    (\ _lhsIenv ->-         (let _lhsOitemType :: Type-              _lhsOcolumnName :: String-              _lhsOannotatedTree :: SelectItem-              _exOenv :: Environment-              _exIannotatedTree :: Expression-              _exIliftedColumnName :: String-              -- "./TypeChecking.ag"(line 543, column 9)-              _lhsOitemType =-                  {-# LINE 543 "./TypeChecking.ag" #-}-                  getTypeAnnotation _exIannotatedTree-                  {-# LINE 5129 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 548, column 9)-              _annotatedTree =-                  {-# LINE 548 "./TypeChecking.ag" #-}-                  SelExp ann_ $ fixStar _exIannotatedTree-                  {-# LINE 5134 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 660, column 14)-              _lhsOcolumnName =-                  {-# LINE 660 "./TypeChecking.ag" #-}-                  case _exIliftedColumnName of-                    "" -> "?column?"-                    s -> s-                  {-# LINE 5141 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 5146 "AstInternal.hs" #-}-              -- copy rule (down)-              _exOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5151 "AstInternal.hs" #-}-              ( _exIannotatedTree,_exIliftedColumnName) =-                  (ex_ _exOenv )-          in  ( _lhsOannotatedTree,_lhsOcolumnName,_lhsOitemType)))-sem_SelectItem_SelectItem :: Annotation ->-                             T_Expression  ->-                             String ->-                             T_SelectItem -sem_SelectItem_SelectItem ann_ ex_ name_  =-    (\ _lhsIenv ->-         (let _lhsOitemType :: Type-              _lhsOcolumnName :: String-              _lhsOannotatedTree :: SelectItem-              _exOenv :: Environment-              _exIannotatedTree :: Expression-              _exIliftedColumnName :: String-              -- "./TypeChecking.ag"(line 543, column 9)-              _lhsOitemType =-                  {-# LINE 543 "./TypeChecking.ag" #-}-                  getTypeAnnotation _exIannotatedTree-                  {-# LINE 5171 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 550, column 9)-              _backTree =-                  {-# LINE 550 "./TypeChecking.ag" #-}-                  SelectItem ann_ (fixStar _exIannotatedTree) name_-                  {-# LINE 5176 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 663, column 18)-              _lhsOcolumnName =-                  {-# LINE 663 "./TypeChecking.ag" #-}-                  name_-                  {-# LINE 5181 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  SelectItem ann_ _exIannotatedTree name_-                  {-# LINE 5186 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 5191 "AstInternal.hs" #-}-              -- copy rule (down)-              _exOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5196 "AstInternal.hs" #-}-              ( _exIannotatedTree,_exIliftedColumnName) =-                  (ex_ _exOenv )-          in  ( _lhsOannotatedTree,_lhsOcolumnName,_lhsOitemType)))--- SelectItemList -----------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         listType             : Type-   alternatives:-      alternative Cons:-         child hd             : SelectItem -         child tl             : SelectItemList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type SelectItemList  = [(SelectItem)]--- cata-sem_SelectItemList :: SelectItemList  ->-                      T_SelectItemList -sem_SelectItemList list  =-    (Prelude.foldr sem_SelectItemList_Cons sem_SelectItemList_Nil (Prelude.map sem_SelectItem list) )--- semantic domain-type T_SelectItemList  = Environment ->-                         ( SelectItemList,Type)-data Inh_SelectItemList  = Inh_SelectItemList {env_Inh_SelectItemList :: Environment}-data Syn_SelectItemList  = Syn_SelectItemList {annotatedTree_Syn_SelectItemList :: SelectItemList,listType_Syn_SelectItemList :: Type}-wrap_SelectItemList :: T_SelectItemList  ->-                       Inh_SelectItemList  ->-                       Syn_SelectItemList -wrap_SelectItemList sem (Inh_SelectItemList _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOlistType) =-             (sem _lhsIenv )-     in  (Syn_SelectItemList _lhsOannotatedTree _lhsOlistType ))-sem_SelectItemList_Cons :: T_SelectItem  ->-                           T_SelectItemList  ->-                           T_SelectItemList -sem_SelectItemList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOlistType :: Type-              _lhsOannotatedTree :: SelectItemList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: SelectItem-              _hdIcolumnName :: String-              _hdIitemType :: Type-              _tlIannotatedTree :: SelectItemList-              _tlIlistType :: Type-              -- "./TypeChecking.ag"(line 536, column 12)-              _lhsOlistType =-                  {-# LINE 536 "./TypeChecking.ag" #-}-                  doSelectItemListTpe _lhsIenv _hdIcolumnName _hdIitemType _tlIlistType-                  {-# LINE 5254 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 5259 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 5264 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5269 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5274 "AstInternal.hs" #-}-              ( _hdIannotatedTree,_hdIcolumnName,_hdIitemType) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree,_tlIlistType) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree,_lhsOlistType)))-sem_SelectItemList_Nil :: T_SelectItemList -sem_SelectItemList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOlistType :: Type-              _lhsOannotatedTree :: SelectItemList-              -- "./TypeChecking.ag"(line 537, column 11)-              _lhsOlistType =-                  {-# LINE 537 "./TypeChecking.ag" #-}-                  UnnamedCompositeType []-                  {-# LINE 5289 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 5294 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 5299 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOlistType)))--- SelectList ---------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         listType             : Type-   alternatives:-      alternative SelectList:-         child ann            : {Annotation}-         child items          : SelectItemList -         child stringList     : StringList -         visit 0:-            local annotatedTree : _--}-data SelectList  = SelectList (Annotation) (SelectItemList) (StringList) -                 deriving ( Data,Eq,Show,Typeable)--- cata-sem_SelectList :: SelectList  ->-                  T_SelectList -sem_SelectList (SelectList _ann _items _stringList )  =-    (sem_SelectList_SelectList _ann (sem_SelectItemList _items ) (sem_StringList _stringList ) )--- semantic domain-type T_SelectList  = Environment ->-                     ( SelectList,Type)-data Inh_SelectList  = Inh_SelectList {env_Inh_SelectList :: Environment}-data Syn_SelectList  = Syn_SelectList {annotatedTree_Syn_SelectList :: SelectList,listType_Syn_SelectList :: Type}-wrap_SelectList :: T_SelectList  ->-                   Inh_SelectList  ->-                   Syn_SelectList -wrap_SelectList sem (Inh_SelectList _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOlistType) =-             (sem _lhsIenv )-     in  (Syn_SelectList _lhsOannotatedTree _lhsOlistType ))-sem_SelectList_SelectList :: Annotation ->-                             T_SelectItemList  ->-                             T_StringList  ->-                             T_SelectList -sem_SelectList_SelectList ann_ items_ stringList_  =-    (\ _lhsIenv ->-         (let _lhsOlistType :: Type-              _lhsOannotatedTree :: SelectList-              _itemsOenv :: Environment-              _stringListOenv :: Environment-              _itemsIannotatedTree :: SelectItemList-              _itemsIlistType :: Type-              _stringListIannotatedTree :: StringList-              _stringListIstrings :: ([String])-              -- "./TypeChecking.ag"(line 576, column 9)-              _lhsOlistType =-                  {-# LINE 576 "./TypeChecking.ag" #-}-                  _itemsIlistType-                  {-# LINE 5354 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  SelectList ann_ _itemsIannotatedTree _stringListIannotatedTree-                  {-# LINE 5359 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 5364 "AstInternal.hs" #-}-              -- copy rule (down)-              _itemsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5369 "AstInternal.hs" #-}-              -- copy rule (down)-              _stringListOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5374 "AstInternal.hs" #-}-              ( _itemsIannotatedTree,_itemsIlistType) =-                  (items_ _itemsOenv )-              ( _stringListIannotatedTree,_stringListIstrings) =-                  (stringList_ _stringListOenv )-          in  ( _lhsOannotatedTree,_lhsOlistType)))--- SetClause ----------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         pairs                : [(String,Type)]-         rowSetError          : Maybe TypeError-   alternatives:-      alternative RowSetClause:-         child ann            : {Annotation}-         child atts           : StringList -         child vals           : ExpressionList -         visit 0:-            local rowSetError : _-            local annotatedTree : _-      alternative SetClause:-         child ann            : {Annotation}-         child att            : {String}-         child val            : Expression -         visit 0:-            local annotatedTree : _--}-data SetClause  = RowSetClause (Annotation) (StringList) (ExpressionList) -                | SetClause (Annotation) (String) (Expression) -                deriving ( Data,Eq,Show,Typeable)--- cata-sem_SetClause :: SetClause  ->-                 T_SetClause -sem_SetClause (RowSetClause _ann _atts _vals )  =-    (sem_SetClause_RowSetClause _ann (sem_StringList _atts ) (sem_ExpressionList _vals ) )-sem_SetClause (SetClause _ann _att _val )  =-    (sem_SetClause_SetClause _ann _att (sem_Expression _val ) )--- semantic domain-type T_SetClause  = Environment ->-                    ( SetClause,([(String,Type)]),(Maybe TypeError))-data Inh_SetClause  = Inh_SetClause {env_Inh_SetClause :: Environment}-data Syn_SetClause  = Syn_SetClause {annotatedTree_Syn_SetClause :: SetClause,pairs_Syn_SetClause :: [(String,Type)],rowSetError_Syn_SetClause :: Maybe TypeError}-wrap_SetClause :: T_SetClause  ->-                  Inh_SetClause  ->-                  Syn_SetClause -wrap_SetClause sem (Inh_SetClause _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOpairs,_lhsOrowSetError) =-             (sem _lhsIenv )-     in  (Syn_SetClause _lhsOannotatedTree _lhsOpairs _lhsOrowSetError ))-sem_SetClause_RowSetClause :: Annotation ->-                              T_StringList  ->-                              T_ExpressionList  ->-                              T_SetClause -sem_SetClause_RowSetClause ann_ atts_ vals_  =-    (\ _lhsIenv ->-         (let _lhsOpairs :: ([(String,Type)])-              _lhsOannotatedTree :: SetClause-              _lhsOrowSetError :: (Maybe TypeError)-              _attsOenv :: Environment-              _valsOenv :: Environment-              _attsIannotatedTree :: StringList-              _attsIstrings :: ([String])-              _valsIannotatedTree :: ExpressionList-              _valsItypeList :: ([Type])-              -- "./TypeChecking.ag"(line 743, column 9)-              _rowSetError =-                  {-# LINE 743 "./TypeChecking.ag" #-}-                  let atts = _attsIstrings-                      types = getRowTypes _valsItypeList-                  in if length atts /= length types-                       then Just WrongNumberOfColumns-                       else Nothing-                  {-# LINE 5449 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 749, column 9)-              _lhsOpairs =-                  {-# LINE 749 "./TypeChecking.ag" #-}-                  zip _attsIstrings $ getRowTypes _valsItypeList-                  {-# LINE 5454 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  RowSetClause ann_ _attsIannotatedTree _valsIannotatedTree-                  {-# LINE 5459 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 5464 "AstInternal.hs" #-}-              -- copy rule (from local)-              _lhsOrowSetError =-                  {-# LINE 736 "./TypeChecking.ag" #-}-                  _rowSetError-                  {-# LINE 5469 "AstInternal.hs" #-}-              -- copy rule (down)-              _attsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5474 "AstInternal.hs" #-}-              -- copy rule (down)-              _valsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5479 "AstInternal.hs" #-}-              ( _attsIannotatedTree,_attsIstrings) =-                  (atts_ _attsOenv )-              ( _valsIannotatedTree,_valsItypeList) =-                  (vals_ _valsOenv )-          in  ( _lhsOannotatedTree,_lhsOpairs,_lhsOrowSetError)))-sem_SetClause_SetClause :: Annotation ->-                           String ->-                           T_Expression  ->-                           T_SetClause -sem_SetClause_SetClause ann_ att_ val_  =-    (\ _lhsIenv ->-         (let _lhsOpairs :: ([(String,Type)])-              _lhsOrowSetError :: (Maybe TypeError)-              _lhsOannotatedTree :: SetClause-              _valOenv :: Environment-              _valIannotatedTree :: Expression-              _valIliftedColumnName :: String-              -- "./TypeChecking.ag"(line 740, column 9)-              _lhsOpairs =-                  {-# LINE 740 "./TypeChecking.ag" #-}-                  [(att_, getTypeAnnotation _valIannotatedTree)]-                  {-# LINE 5501 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 741, column 9)-              _lhsOrowSetError =-                  {-# LINE 741 "./TypeChecking.ag" #-}-                  Nothing-                  {-# LINE 5506 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  SetClause ann_ att_ _valIannotatedTree-                  {-# LINE 5511 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 5516 "AstInternal.hs" #-}-              -- copy rule (down)-              _valOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5521 "AstInternal.hs" #-}-              ( _valIannotatedTree,_valIliftedColumnName) =-                  (val_ _valOenv )-          in  ( _lhsOannotatedTree,_lhsOpairs,_lhsOrowSetError)))--- SetClauseList ------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         pairs                : [(String,Type)]-         rowSetErrors         : [TypeError]-   alternatives:-      alternative Cons:-         child hd             : SetClause -         child tl             : SetClauseList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type SetClauseList  = [(SetClause)]--- cata-sem_SetClauseList :: SetClauseList  ->-                     T_SetClauseList -sem_SetClauseList list  =-    (Prelude.foldr sem_SetClauseList_Cons sem_SetClauseList_Nil (Prelude.map sem_SetClause list) )--- semantic domain-type T_SetClauseList  = Environment ->-                        ( SetClauseList,([(String,Type)]),([TypeError]))-data Inh_SetClauseList  = Inh_SetClauseList {env_Inh_SetClauseList :: Environment}-data Syn_SetClauseList  = Syn_SetClauseList {annotatedTree_Syn_SetClauseList :: SetClauseList,pairs_Syn_SetClauseList :: [(String,Type)],rowSetErrors_Syn_SetClauseList :: [TypeError]}-wrap_SetClauseList :: T_SetClauseList  ->-                      Inh_SetClauseList  ->-                      Syn_SetClauseList -wrap_SetClauseList sem (Inh_SetClauseList _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOpairs,_lhsOrowSetErrors) =-             (sem _lhsIenv )-     in  (Syn_SetClauseList _lhsOannotatedTree _lhsOpairs _lhsOrowSetErrors ))-sem_SetClauseList_Cons :: T_SetClause  ->-                          T_SetClauseList  ->-                          T_SetClauseList -sem_SetClauseList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOpairs :: ([(String,Type)])-              _lhsOrowSetErrors :: ([TypeError])-              _lhsOannotatedTree :: SetClauseList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: SetClause-              _hdIpairs :: ([(String,Type)])-              _hdIrowSetError :: (Maybe TypeError)-              _tlIannotatedTree :: SetClauseList-              _tlIpairs :: ([(String,Type)])-              _tlIrowSetErrors :: ([TypeError])-              -- "./TypeChecking.ag"(line 730, column 10)-              _lhsOpairs =-                  {-# LINE 730 "./TypeChecking.ag" #-}-                  _hdIpairs ++ _tlIpairs-                  {-# LINE 5582 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 731, column 10)-              _lhsOrowSetErrors =-                  {-# LINE 731 "./TypeChecking.ag" #-}-                  maybeToList _hdIrowSetError ++ _tlIrowSetErrors-                  {-# LINE 5587 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 5592 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 5597 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5602 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 5607 "AstInternal.hs" #-}-              ( _hdIannotatedTree,_hdIpairs,_hdIrowSetError) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree,_tlIpairs,_tlIrowSetErrors) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree,_lhsOpairs,_lhsOrowSetErrors)))-sem_SetClauseList_Nil :: T_SetClauseList -sem_SetClauseList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOpairs :: ([(String,Type)])-              _lhsOrowSetErrors :: ([TypeError])-              _lhsOannotatedTree :: SetClauseList-              -- "./TypeChecking.ag"(line 732, column 9)-              _lhsOpairs =-                  {-# LINE 732 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 5623 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 733, column 9)-              _lhsOrowSetErrors =-                  {-# LINE 733 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 5628 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 5633 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 5638 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOpairs,_lhsOrowSetErrors)))--- Statement ----------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         envUpdates           : [EnvironmentUpdate]-   alternatives:-      alternative Assignment:-         child ann            : {Annotation}-         child target         : {String}-         child value          : Expression -         visit 0:-            local annotatedTree : _-      alternative CaseStatement:-         child ann            : {Annotation}-         child val            : Expression -         child cases          : ExpressionListStatementListPairList -         child els            : StatementList -         visit 0:-            local annotatedTree : _-      alternative ContinueStatement:-         child ann            : {Annotation}-         visit 0:-            local annotatedTree : _-      alternative Copy:-         child ann            : {Annotation}-         child table          : {String}-         child targetCols     : StringList -         child source         : CopySource -         visit 0:-            local annotatedTree : _-      alternative CopyData:-         child ann            : {Annotation}-         child insData        : {String}-         visit 0:-            local annotatedTree : _-      alternative CreateDomain:-         child ann            : {Annotation}-         child name           : {String}-         child typ            : TypeName -         child check          : MaybeBoolExpression -         visit 0:-            local tpe         : _-            local backTree    : _-            local statementInfo : _-            local envUpdates  : _-            local annotatedTree : _-      alternative CreateFunction:-         child ann            : {Annotation}-         child lang           : Language -         child name           : {String}-         child params         : ParamDefList -         child rettype        : TypeName -         child bodyQuote      : {String}-         child body           : FnBody -         child vol            : Volatility -         visit 0:-            local tpe         : _-            local backTree    : _-            local statementInfo : _-            local envUpdates  : _-            local annotatedTree : _-      alternative CreateTable:-         child ann            : {Annotation}-         child name           : {String}-         child atts           : AttributeDefList -         child cons           : ConstraintList -         visit 0:-            local attrTypes   : _-            local tpe         : _-            local backTree    : _-            local statementInfo : _-            local envUpdates  : _-            local annotatedTree : _-      alternative CreateTableAs:-         child ann            : {Annotation}-         child name           : {String}-         child expr           : SelectExpression -         visit 0:-            local selType     : _-            local tpe         : _-            local backTree    : _-            local statementInfo : _-            local attrs       : _-            local envUpdates  : _-            local annotatedTree : _-      alternative CreateType:-         child ann            : {Annotation}-         child name           : {String}-         child atts           : TypeAttributeDefList -         visit 0:-            local tpe         : _-            local backTree    : _-            local statementInfo : _-            local envUpdates  : _-            local annotatedTree : _-      alternative CreateView:-         child ann            : {Annotation}-         child name           : {String}-         child expr           : SelectExpression -         visit 0:-            local tpe         : _-            local backTree    : _-            local statementInfo : _-            local attrs       : _-            local envUpdates  : _-            local annotatedTree : _-      alternative Delete:-         child ann            : {Annotation}-         child table          : {String}-         child whr            : MaybeBoolExpression -         child returning      : {Maybe SelectList}-         visit 0:-            local tpe         : _-            local statementInfo : _-            local backTree    : _-            local envUpdates  : _-            local annotatedTree : _-      alternative DropFunction:-         child ann            : {Annotation}-         child ifE            : IfExists -         child sigs           : StringStringListPairList -         child cascade        : Cascade -         visit 0:-            local annotatedTree : _-      alternative DropSomething:-         child ann            : {Annotation}-         child dropType       : DropType -         child ifE            : IfExists -         child names          : StringList -         child cascade        : Cascade -         visit 0:-            local annotatedTree : _-      alternative Execute:-         child ann            : {Annotation}-         child expr           : Expression -         visit 0:-            local annotatedTree : _-      alternative ExecuteInto:-         child ann            : {Annotation}-         child expr           : Expression -         child targets        : StringList -         visit 0:-            local annotatedTree : _-      alternative ForIntegerStatement:-         child ann            : {Annotation}-         child var            : {String}-         child from           : Expression -         child to             : Expression -         child sts            : StatementList -         visit 0:-            local annotatedTree : _-      alternative ForSelectStatement:-         child ann            : {Annotation}-         child var            : {String}-         child sel            : SelectExpression -         child sts            : StatementList -         visit 0:-            local annotatedTree : _-      alternative If:-         child ann            : {Annotation}-         child cases          : ExpressionStatementListPairList -         child els            : StatementList -         visit 0:-            local annotatedTree : _-      alternative Insert:-         child ann            : {Annotation}-         child table          : {String}-         child targetCols     : StringList -         child insData        : SelectExpression -         child returning      : {Maybe SelectList}-         visit 0:-            local columnStuff : _-            local tpe         : _-            local statementInfo : _-            local backTree    : _-            local envUpdates  : _-            local annotatedTree : _-      alternative NullStatement:-         child ann            : {Annotation}-         visit 0:-            local annotatedTree : _-      alternative Perform:-         child ann            : {Annotation}-         child expr           : Expression -         visit 0:-            local annotatedTree : _-      alternative Raise:-         child ann            : {Annotation}-         child level          : RaiseType -         child message        : {String}-         child args           : ExpressionList -         visit 0:-            local annotatedTree : _-      alternative Return:-         child ann            : {Annotation}-         child value          : MaybeExpression -         visit 0:-            local tpe         : _-            local backTree    : _-            local envUpdates  : _-            local statementInfo : _-            local annotatedTree : _-      alternative ReturnNext:-         child ann            : {Annotation}-         child expr           : Expression -         visit 0:-            local annotatedTree : _-      alternative ReturnQuery:-         child ann            : {Annotation}-         child sel            : SelectExpression -         visit 0:-            local annotatedTree : _-      alternative SelectStatement:-         child ann            : {Annotation}-         child ex             : SelectExpression -         visit 0:-            local tpe         : _-            local statementInfo : _-            local backTree    : _-            local envUpdates  : _-            local annotatedTree : _-      alternative Truncate:-         child ann            : {Annotation}-         child tables         : StringList -         child restartIdentity : RestartIdentity -         child cascade        : Cascade -         visit 0:-            local annotatedTree : _-      alternative Update:-         child ann            : {Annotation}-         child table          : {String}-         child assigns        : SetClauseList -         child whr            : MaybeBoolExpression -         child returning      : {Maybe SelectList}-         visit 0:-            local tpe         : _-            local columnsConsistent : _-            local statementInfo : _-            local backTree    : _-            local envUpdates  : _-            local annotatedTree : _-      alternative WhileStatement:-         child ann            : {Annotation}-         child expr           : Expression -         child sts            : StatementList -         visit 0:-            local annotatedTree : _--}-data Statement  = Assignment (Annotation) (String) (Expression) -                | CaseStatement (Annotation) (Expression) (ExpressionListStatementListPairList) (StatementList) -                | ContinueStatement (Annotation) -                | Copy (Annotation) (String) (StringList) (CopySource) -                | CopyData (Annotation) (String) -                | CreateDomain (Annotation) (String) (TypeName) (MaybeBoolExpression) -                | CreateFunction (Annotation) (Language) (String) (ParamDefList) (TypeName) (String) (FnBody) (Volatility) -                | CreateTable (Annotation) (String) (AttributeDefList) (ConstraintList) -                | CreateTableAs (Annotation) (String) (SelectExpression) -                | CreateType (Annotation) (String) (TypeAttributeDefList) -                | CreateView (Annotation) (String) (SelectExpression) -                | Delete (Annotation) (String) (MaybeBoolExpression) (Maybe SelectList) -                | DropFunction (Annotation) (IfExists) (StringStringListPairList) (Cascade) -                | DropSomething (Annotation) (DropType) (IfExists) (StringList) (Cascade) -                | Execute (Annotation) (Expression) -                | ExecuteInto (Annotation) (Expression) (StringList) -                | ForIntegerStatement (Annotation) (String) (Expression) (Expression) (StatementList) -                | ForSelectStatement (Annotation) (String) (SelectExpression) (StatementList) -                | If (Annotation) (ExpressionStatementListPairList) (StatementList) -                | Insert (Annotation) (String) (StringList) (SelectExpression) (Maybe SelectList) -                | NullStatement (Annotation) -                | Perform (Annotation) (Expression) -                | Raise (Annotation) (RaiseType) (String) (ExpressionList) -                | Return (Annotation) (MaybeExpression) -                | ReturnNext (Annotation) (Expression) -                | ReturnQuery (Annotation) (SelectExpression) -                | SelectStatement (Annotation) (SelectExpression) -                | Truncate (Annotation) (StringList) (RestartIdentity) (Cascade) -                | Update (Annotation) (String) (SetClauseList) (MaybeBoolExpression) (Maybe SelectList) -                | WhileStatement (Annotation) (Expression) (StatementList) -                deriving ( Data,Eq,Show,Typeable)--- cata-sem_Statement :: Statement  ->-                 T_Statement -sem_Statement (Assignment _ann _target _value )  =-    (sem_Statement_Assignment _ann _target (sem_Expression _value ) )-sem_Statement (CaseStatement _ann _val _cases _els )  =-    (sem_Statement_CaseStatement _ann (sem_Expression _val ) (sem_ExpressionListStatementListPairList _cases ) (sem_StatementList _els ) )-sem_Statement (ContinueStatement _ann )  =-    (sem_Statement_ContinueStatement _ann )-sem_Statement (Copy _ann _table _targetCols _source )  =-    (sem_Statement_Copy _ann _table (sem_StringList _targetCols ) (sem_CopySource _source ) )-sem_Statement (CopyData _ann _insData )  =-    (sem_Statement_CopyData _ann _insData )-sem_Statement (CreateDomain _ann _name _typ _check )  =-    (sem_Statement_CreateDomain _ann _name (sem_TypeName _typ ) (sem_MaybeBoolExpression _check ) )-sem_Statement (CreateFunction _ann _lang _name _params _rettype _bodyQuote _body _vol )  =-    (sem_Statement_CreateFunction _ann (sem_Language _lang ) _name (sem_ParamDefList _params ) (sem_TypeName _rettype ) _bodyQuote (sem_FnBody _body ) (sem_Volatility _vol ) )-sem_Statement (CreateTable _ann _name _atts _cons )  =-    (sem_Statement_CreateTable _ann _name (sem_AttributeDefList _atts ) (sem_ConstraintList _cons ) )-sem_Statement (CreateTableAs _ann _name _expr )  =-    (sem_Statement_CreateTableAs _ann _name (sem_SelectExpression _expr ) )-sem_Statement (CreateType _ann _name _atts )  =-    (sem_Statement_CreateType _ann _name (sem_TypeAttributeDefList _atts ) )-sem_Statement (CreateView _ann _name _expr )  =-    (sem_Statement_CreateView _ann _name (sem_SelectExpression _expr ) )-sem_Statement (Delete _ann _table _whr _returning )  =-    (sem_Statement_Delete _ann _table (sem_MaybeBoolExpression _whr ) _returning )-sem_Statement (DropFunction _ann _ifE _sigs _cascade )  =-    (sem_Statement_DropFunction _ann (sem_IfExists _ifE ) (sem_StringStringListPairList _sigs ) (sem_Cascade _cascade ) )-sem_Statement (DropSomething _ann _dropType _ifE _names _cascade )  =-    (sem_Statement_DropSomething _ann (sem_DropType _dropType ) (sem_IfExists _ifE ) (sem_StringList _names ) (sem_Cascade _cascade ) )-sem_Statement (Execute _ann _expr )  =-    (sem_Statement_Execute _ann (sem_Expression _expr ) )-sem_Statement (ExecuteInto _ann _expr _targets )  =-    (sem_Statement_ExecuteInto _ann (sem_Expression _expr ) (sem_StringList _targets ) )-sem_Statement (ForIntegerStatement _ann _var _from _to _sts )  =-    (sem_Statement_ForIntegerStatement _ann _var (sem_Expression _from ) (sem_Expression _to ) (sem_StatementList _sts ) )-sem_Statement (ForSelectStatement _ann _var _sel _sts )  =-    (sem_Statement_ForSelectStatement _ann _var (sem_SelectExpression _sel ) (sem_StatementList _sts ) )-sem_Statement (If _ann _cases _els )  =-    (sem_Statement_If _ann (sem_ExpressionStatementListPairList _cases ) (sem_StatementList _els ) )-sem_Statement (Insert _ann _table _targetCols _insData _returning )  =-    (sem_Statement_Insert _ann _table (sem_StringList _targetCols ) (sem_SelectExpression _insData ) _returning )-sem_Statement (NullStatement _ann )  =-    (sem_Statement_NullStatement _ann )-sem_Statement (Perform _ann _expr )  =-    (sem_Statement_Perform _ann (sem_Expression _expr ) )-sem_Statement (Raise _ann _level _message _args )  =-    (sem_Statement_Raise _ann (sem_RaiseType _level ) _message (sem_ExpressionList _args ) )-sem_Statement (Return _ann _value )  =-    (sem_Statement_Return _ann (sem_MaybeExpression _value ) )-sem_Statement (ReturnNext _ann _expr )  =-    (sem_Statement_ReturnNext _ann (sem_Expression _expr ) )-sem_Statement (ReturnQuery _ann _sel )  =-    (sem_Statement_ReturnQuery _ann (sem_SelectExpression _sel ) )-sem_Statement (SelectStatement _ann _ex )  =-    (sem_Statement_SelectStatement _ann (sem_SelectExpression _ex ) )-sem_Statement (Truncate _ann _tables _restartIdentity _cascade )  =-    (sem_Statement_Truncate _ann (sem_StringList _tables ) (sem_RestartIdentity _restartIdentity ) (sem_Cascade _cascade ) )-sem_Statement (Update _ann _table _assigns _whr _returning )  =-    (sem_Statement_Update _ann _table (sem_SetClauseList _assigns ) (sem_MaybeBoolExpression _whr ) _returning )-sem_Statement (WhileStatement _ann _expr _sts )  =-    (sem_Statement_WhileStatement _ann (sem_Expression _expr ) (sem_StatementList _sts ) )--- semantic domain-type T_Statement  = Environment ->-                    ( Statement,([EnvironmentUpdate]))-data Inh_Statement  = Inh_Statement {env_Inh_Statement :: Environment}-data Syn_Statement  = Syn_Statement {annotatedTree_Syn_Statement :: Statement,envUpdates_Syn_Statement :: [EnvironmentUpdate]}-wrap_Statement :: T_Statement  ->-                  Inh_Statement  ->-                  Syn_Statement -wrap_Statement sem (Inh_Statement _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOenvUpdates) =-             (sem _lhsIenv )-     in  (Syn_Statement _lhsOannotatedTree _lhsOenvUpdates ))-sem_Statement_Assignment :: Annotation ->-                            String ->-                            T_Expression  ->-                            T_Statement -sem_Statement_Assignment ann_ target_ value_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _valueOenv :: Environment-              _valueIannotatedTree :: Expression-              _valueIliftedColumnName :: String-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6012 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Assignment ann_ target_ _valueIannotatedTree-                  {-# LINE 6017 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 6022 "AstInternal.hs" #-}-              -- copy rule (down)-              _valueOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6027 "AstInternal.hs" #-}-              ( _valueIannotatedTree,_valueIliftedColumnName) =-                  (value_ _valueOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_CaseStatement :: Annotation ->-                               T_Expression  ->-                               T_ExpressionListStatementListPairList  ->-                               T_StatementList  ->-                               T_Statement -sem_Statement_CaseStatement ann_ val_ cases_ els_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _elsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _valOenv :: Environment-              _casesOenv :: Environment-              _elsOenv :: Environment-              _valIannotatedTree :: Expression-              _valIliftedColumnName :: String-              _casesIannotatedTree :: ExpressionListStatementListPairList-              _elsIannotatedTree :: StatementList-              _elsIproducedEnv :: Environment-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6053 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 352, column 24)-              _elsOenvUpdates =-                  {-# LINE 352 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6058 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  CaseStatement ann_ _valIannotatedTree _casesIannotatedTree _elsIannotatedTree-                  {-# LINE 6063 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 6068 "AstInternal.hs" #-}-              -- copy rule (down)-              _valOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6073 "AstInternal.hs" #-}-              -- copy rule (down)-              _casesOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6078 "AstInternal.hs" #-}-              -- copy rule (down)-              _elsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6083 "AstInternal.hs" #-}-              ( _valIannotatedTree,_valIliftedColumnName) =-                  (val_ _valOenv )-              ( _casesIannotatedTree) =-                  (cases_ _casesOenv )-              ( _elsIannotatedTree,_elsIproducedEnv) =-                  (els_ _elsOenv _elsOenvUpdates )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_ContinueStatement :: Annotation ->-                                   T_Statement -sem_Statement_ContinueStatement ann_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6101 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  ContinueStatement ann_-                  {-# LINE 6106 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 6111 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_Copy :: Annotation ->-                      String ->-                      T_StringList  ->-                      T_CopySource  ->-                      T_Statement -sem_Statement_Copy ann_ table_ targetCols_ source_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _targetColsOenv :: Environment-              _sourceOenv :: Environment-              _targetColsIannotatedTree :: StringList-              _targetColsIstrings :: ([String])-              _sourceIannotatedTree :: CopySource-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6131 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Copy ann_ table_ _targetColsIannotatedTree _sourceIannotatedTree-                  {-# LINE 6136 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 6141 "AstInternal.hs" #-}-              -- copy rule (down)-              _targetColsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6146 "AstInternal.hs" #-}-              -- copy rule (down)-              _sourceOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6151 "AstInternal.hs" #-}-              ( _targetColsIannotatedTree,_targetColsIstrings) =-                  (targetCols_ _targetColsOenv )-              ( _sourceIannotatedTree) =-                  (source_ _sourceOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_CopyData :: Annotation ->-                          String ->-                          T_Statement -sem_Statement_CopyData ann_ insData_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6168 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  CopyData ann_ insData_-                  {-# LINE 6173 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 6178 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_CreateDomain :: Annotation ->-                              String ->-                              T_TypeName  ->-                              T_MaybeBoolExpression  ->-                              T_Statement -sem_Statement_CreateDomain ann_ name_ typ_ check_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Statement-              _lhsOenvUpdates :: ([EnvironmentUpdate])-              _typOenv :: Environment-              _checkOenv :: Environment-              _typIannotatedTree :: TypeName-              _typInamedType :: Type-              _checkIannotatedTree :: MaybeBoolExpression-              -- "./TypeChecking.ag"(line 310, column 9)-              _lhsOannotatedTree =-                  {-# LINE 310 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    $ Just (map StatementInfoA _statementInfo     ++-                            [EnvUpdates _envUpdates    ])-                  {-# LINE 6202 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 315, column 9)-              _lhsOenvUpdates =-                  {-# LINE 315 "./TypeChecking.ag" #-}-                  _envUpdates-                  {-# LINE 6207 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 872, column 9)-              _tpe =-                  {-# LINE 872 "./TypeChecking.ag" #-}-                  Right $ Pseudo Void-                  {-# LINE 6212 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 873, column 9)-              _backTree =-                  {-# LINE 873 "./TypeChecking.ag" #-}-                  CreateDomain ann_ name_ _typIannotatedTree _checkIannotatedTree-                  {-# LINE 6217 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 874, column 9)-              _statementInfo =-                  {-# LINE 874 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6222 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 875, column 9)-              _envUpdates =-                  {-# LINE 875 "./TypeChecking.ag" #-}-                  [EnvCreateDomain (ScalarType name_) _typInamedType]-                  {-# LINE 6227 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  CreateDomain ann_ name_ _typIannotatedTree _checkIannotatedTree-                  {-# LINE 6232 "AstInternal.hs" #-}-              -- copy rule (down)-              _typOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6237 "AstInternal.hs" #-}-              -- copy rule (down)-              _checkOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6242 "AstInternal.hs" #-}-              ( _typIannotatedTree,_typInamedType) =-                  (typ_ _typOenv )-              ( _checkIannotatedTree) =-                  (check_ _checkOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_CreateFunction :: Annotation ->-                                T_Language  ->-                                String ->-                                T_ParamDefList  ->-                                T_TypeName  ->-                                String ->-                                T_FnBody  ->-                                T_Volatility  ->-                                T_Statement -sem_Statement_CreateFunction ann_ lang_ name_ params_ rettype_ bodyQuote_ body_ vol_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Statement-              _lhsOenvUpdates :: ([EnvironmentUpdate])-              _bodyOenv :: Environment-              _langOenv :: Environment-              _paramsOenv :: Environment-              _rettypeOenv :: Environment-              _volOenv :: Environment-              _langIannotatedTree :: Language-              _paramsIannotatedTree :: ParamDefList-              _paramsIparams :: ([(String, Type)])-              _rettypeIannotatedTree :: TypeName-              _rettypeInamedType :: Type-              _bodyIannotatedTree :: FnBody-              _volIannotatedTree :: Volatility-              -- "./TypeChecking.ag"(line 310, column 9)-              _lhsOannotatedTree =-                  {-# LINE 310 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    $ Just (map StatementInfoA _statementInfo     ++-                            [EnvUpdates _envUpdates    ])-                  {-# LINE 6281 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 315, column 9)-              _lhsOenvUpdates =-                  {-# LINE 315 "./TypeChecking.ag" #-}-                  _envUpdates-                  {-# LINE 6286 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 925, column 9)-              _tpe =-                  {-# LINE 925 "./TypeChecking.ag" #-}-                  Right $ Pseudo Void-                  {-# LINE 6291 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 926, column 9)-              _backTree =-                  {-# LINE 926 "./TypeChecking.ag" #-}-                  CreateFunction ann_-                                 _langIannotatedTree-                                 name_-                                 _paramsIannotatedTree-                                 _rettypeIannotatedTree-                                 bodyQuote_-                                 _bodyIannotatedTree-                                 _volIannotatedTree-                  {-# LINE 6303 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 934, column 9)-              _statementInfo =-                  {-# LINE 934 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6308 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 935, column 9)-              _envUpdates =-                  {-# LINE 935 "./TypeChecking.ag" #-}-                  [EnvCreateFunction FunName name_ (map snd _paramsIparams) _rettypeInamedType]-                  {-# LINE 6313 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 937, column 9)-              _bodyOenv =-                  {-# LINE 937 "./TypeChecking.ag" #-}-                  fromRight _lhsIenv $-                  updateEnvironment _lhsIenv [EnvStackIDs [("", _paramsIparams)-                                                          ,(name_, _paramsIparams)]]-                  {-# LINE 6320 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  CreateFunction ann_ _langIannotatedTree name_ _paramsIannotatedTree _rettypeIannotatedTree bodyQuote_ _bodyIannotatedTree _volIannotatedTree-                  {-# LINE 6325 "AstInternal.hs" #-}-              -- copy rule (down)-              _langOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6330 "AstInternal.hs" #-}-              -- copy rule (down)-              _paramsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6335 "AstInternal.hs" #-}-              -- copy rule (down)-              _rettypeOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6340 "AstInternal.hs" #-}-              -- copy rule (down)-              _volOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6345 "AstInternal.hs" #-}-              ( _langIannotatedTree) =-                  (lang_ _langOenv )-              ( _paramsIannotatedTree,_paramsIparams) =-                  (params_ _paramsOenv )-              ( _rettypeIannotatedTree,_rettypeInamedType) =-                  (rettype_ _rettypeOenv )-              ( _bodyIannotatedTree) =-                  (body_ _bodyOenv )-              ( _volIannotatedTree) =-                  (vol_ _volOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_CreateTable :: Annotation ->-                             String ->-                             T_AttributeDefList  ->-                             T_ConstraintList  ->-                             T_Statement -sem_Statement_CreateTable ann_ name_ atts_ cons_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Statement-              _lhsOenvUpdates :: ([EnvironmentUpdate])-              _attsOenv :: Environment-              _consOenv :: Environment-              _attsIannotatedTree :: AttributeDefList-              _attsIattrs :: ([(String, Type)])-              _consIannotatedTree :: ConstraintList-              -- "./TypeChecking.ag"(line 310, column 9)-              _lhsOannotatedTree =-                  {-# LINE 310 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    $ Just (map StatementInfoA _statementInfo     ++-                            [EnvUpdates _envUpdates    ])-                  {-# LINE 6379 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 315, column 9)-              _lhsOenvUpdates =-                  {-# LINE 315 "./TypeChecking.ag" #-}-                  _envUpdates-                  {-# LINE 6384 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 800, column 9)-              _attrTypes =-                  {-# LINE 800 "./TypeChecking.ag" #-}-                  map snd _attsIattrs-                  {-# LINE 6389 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 801, column 9)-              _tpe =-                  {-# LINE 801 "./TypeChecking.ag" #-}-                  Right $ Pseudo Void-                  {-# LINE 6394 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 802, column 9)-              _backTree =-                  {-# LINE 802 "./TypeChecking.ag" #-}-                  CreateTable ann_ name_ _attsIannotatedTree _consIannotatedTree-                  {-# LINE 6399 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 803, column 9)-              _statementInfo =-                  {-# LINE 803 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6404 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 804, column 9)-              _envUpdates =-                  {-# LINE 804 "./TypeChecking.ag" #-}-                  [EnvCreateTable name_ _attsIattrs []]-                  {-# LINE 6409 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  CreateTable ann_ name_ _attsIannotatedTree _consIannotatedTree-                  {-# LINE 6414 "AstInternal.hs" #-}-              -- copy rule (down)-              _attsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6419 "AstInternal.hs" #-}-              -- copy rule (down)-              _consOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6424 "AstInternal.hs" #-}-              ( _attsIannotatedTree,_attsIattrs) =-                  (atts_ _attsOenv )-              ( _consIannotatedTree) =-                  (cons_ _consOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_CreateTableAs :: Annotation ->-                               String ->-                               T_SelectExpression  ->-                               T_Statement -sem_Statement_CreateTableAs ann_ name_ expr_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Statement-              _lhsOenvUpdates :: ([EnvironmentUpdate])-              _exprOenv :: Environment-              _exprIannotatedTree :: SelectExpression-              -- "./TypeChecking.ag"(line 808, column 9)-              _selType =-                  {-# LINE 808 "./TypeChecking.ag" #-}-                  getTypeAnnotation _exprIannotatedTree-                  {-# LINE 6444 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 809, column 9)-              _tpe =-                  {-# LINE 809 "./TypeChecking.ag" #-}-                  Right _selType-                  {-# LINE 6449 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 810, column 9)-              _backTree =-                  {-# LINE 810 "./TypeChecking.ag" #-}-                  CreateTableAs ann_ name_ _exprIannotatedTree-                  {-# LINE 6454 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 811, column 9)-              _statementInfo =-                  {-# LINE 811 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6459 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 812, column 9)-              _attrs =-                  {-# LINE 812 "./TypeChecking.ag" #-}-                  case _selType     of-                    UnnamedCompositeType c -> c-                    _-> []-                  {-# LINE 6466 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 815, column 9)-              _envUpdates =-                  {-# LINE 815 "./TypeChecking.ag" #-}-                  [EnvCreateTable name_ _attrs     []]-                  {-# LINE 6471 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  CreateTableAs ann_ name_ _exprIannotatedTree-                  {-# LINE 6476 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 6481 "AstInternal.hs" #-}-              -- copy rule (from local)-              _lhsOenvUpdates =-                  {-# LINE 317 "./TypeChecking.ag" #-}-                  _envUpdates-                  {-# LINE 6486 "AstInternal.hs" #-}-              -- copy rule (down)-              _exprOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6491 "AstInternal.hs" #-}-              ( _exprIannotatedTree) =-                  (expr_ _exprOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_CreateType :: Annotation ->-                            String ->-                            T_TypeAttributeDefList  ->-                            T_Statement -sem_Statement_CreateType ann_ name_ atts_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Statement-              _lhsOenvUpdates :: ([EnvironmentUpdate])-              _attsOenv :: Environment-              _attsIannotatedTree :: TypeAttributeDefList-              _attsIattrs :: ([(String, Type)])-              -- "./TypeChecking.ag"(line 310, column 9)-              _lhsOannotatedTree =-                  {-# LINE 310 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    $ Just (map StatementInfoA _statementInfo     ++-                            [EnvUpdates _envUpdates    ])-                  {-# LINE 6514 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 315, column 9)-              _lhsOenvUpdates =-                  {-# LINE 315 "./TypeChecking.ag" #-}-                  _envUpdates-                  {-# LINE 6519 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 857, column 9)-              _tpe =-                  {-# LINE 857 "./TypeChecking.ag" #-}-                  Right $ Pseudo Void-                  {-# LINE 6524 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 858, column 9)-              _backTree =-                  {-# LINE 858 "./TypeChecking.ag" #-}-                  CreateType ann_ name_ _attsIannotatedTree-                  {-# LINE 6529 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 859, column 9)-              _statementInfo =-                  {-# LINE 859 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6534 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 860, column 9)-              _envUpdates =-                  {-# LINE 860 "./TypeChecking.ag" #-}-                  [EnvCreateComposite name_ _attsIattrs]-                  {-# LINE 6539 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  CreateType ann_ name_ _attsIannotatedTree-                  {-# LINE 6544 "AstInternal.hs" #-}-              -- copy rule (down)-              _attsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6549 "AstInternal.hs" #-}-              ( _attsIannotatedTree,_attsIattrs) =-                  (atts_ _attsOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_CreateView :: Annotation ->-                            String ->-                            T_SelectExpression  ->-                            T_Statement -sem_Statement_CreateView ann_ name_ expr_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Statement-              _lhsOenvUpdates :: ([EnvironmentUpdate])-              _exprOenv :: Environment-              _exprIannotatedTree :: SelectExpression-              -- "./TypeChecking.ag"(line 310, column 9)-              _lhsOannotatedTree =-                  {-# LINE 310 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    $ Just (map StatementInfoA _statementInfo     ++-                            [EnvUpdates _envUpdates    ])-                  {-# LINE 6571 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 315, column 9)-              _lhsOenvUpdates =-                  {-# LINE 315 "./TypeChecking.ag" #-}-                  _envUpdates-                  {-# LINE 6576 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 825, column 9)-              _tpe =-                  {-# LINE 825 "./TypeChecking.ag" #-}-                  chainTypeCheckFailed [getTypeAnnotation _exprIannotatedTree] $ Right $ Pseudo Void-                  {-# LINE 6581 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 826, column 9)-              _backTree =-                  {-# LINE 826 "./TypeChecking.ag" #-}-                  CreateView ann_ name_ _exprIannotatedTree-                  {-# LINE 6586 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 827, column 9)-              _statementInfo =-                  {-# LINE 827 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6591 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 828, column 9)-              _attrs =-                  {-# LINE 828 "./TypeChecking.ag" #-}-                  case getTypeAnnotation _exprIannotatedTree of-                    SetOfType (UnnamedCompositeType c) -> c-                    _ -> []-                  {-# LINE 6598 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 831, column 9)-              _envUpdates =-                  {-# LINE 831 "./TypeChecking.ag" #-}-                  [EnvCreateView name_ _attrs    ]-                  {-# LINE 6603 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  CreateView ann_ name_ _exprIannotatedTree-                  {-# LINE 6608 "AstInternal.hs" #-}-              -- copy rule (down)-              _exprOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6613 "AstInternal.hs" #-}-              ( _exprIannotatedTree) =-                  (expr_ _exprOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_Delete :: Annotation ->-                        String ->-                        T_MaybeBoolExpression  ->-                        (Maybe SelectList) ->-                        T_Statement -sem_Statement_Delete ann_ table_ whr_ returning_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Statement-              _lhsOenvUpdates :: ([EnvironmentUpdate])-              _whrOenv :: Environment-              _whrIannotatedTree :: MaybeBoolExpression-              -- "./TypeChecking.ag"(line 310, column 9)-              _lhsOannotatedTree =-                  {-# LINE 310 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    $ Just (map StatementInfoA _statementInfo     ++-                            [EnvUpdates _envUpdates    ])-                  {-# LINE 6636 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 315, column 9)-              _lhsOenvUpdates =-                  {-# LINE 315 "./TypeChecking.ag" #-}-                  _envUpdates-                  {-# LINE 6641 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 765, column 9)-              _tpe =-                  {-# LINE 765 "./TypeChecking.ag" #-}-                  case checkRelationExists _lhsIenv table_ of-                    Just e -> Left [e]-                    Nothing -> Right $ Pseudo Void-                  {-# LINE 6648 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 769, column 9)-              _statementInfo =-                  {-# LINE 769 "./TypeChecking.ag" #-}-                  [DeleteInfo table_]-                  {-# LINE 6653 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 770, column 9)-              _backTree =-                  {-# LINE 770 "./TypeChecking.ag" #-}-                  Delete ann_ table_ _whrIannotatedTree returning_-                  {-# LINE 6658 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 771, column 9)-              _envUpdates =-                  {-# LINE 771 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6663 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Delete ann_ table_ _whrIannotatedTree returning_-                  {-# LINE 6668 "AstInternal.hs" #-}-              -- copy rule (down)-              _whrOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6673 "AstInternal.hs" #-}-              ( _whrIannotatedTree) =-                  (whr_ _whrOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_DropFunction :: Annotation ->-                              T_IfExists  ->-                              T_StringStringListPairList  ->-                              T_Cascade  ->-                              T_Statement -sem_Statement_DropFunction ann_ ifE_ sigs_ cascade_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _ifEOenv :: Environment-              _sigsOenv :: Environment-              _cascadeOenv :: Environment-              _ifEIannotatedTree :: IfExists-              _sigsIannotatedTree :: StringStringListPairList-              _cascadeIannotatedTree :: Cascade-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6696 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  DropFunction ann_ _ifEIannotatedTree _sigsIannotatedTree _cascadeIannotatedTree-                  {-# LINE 6701 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 6706 "AstInternal.hs" #-}-              -- copy rule (down)-              _ifEOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6711 "AstInternal.hs" #-}-              -- copy rule (down)-              _sigsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6716 "AstInternal.hs" #-}-              -- copy rule (down)-              _cascadeOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6721 "AstInternal.hs" #-}-              ( _ifEIannotatedTree) =-                  (ifE_ _ifEOenv )-              ( _sigsIannotatedTree) =-                  (sigs_ _sigsOenv )-              ( _cascadeIannotatedTree) =-                  (cascade_ _cascadeOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_DropSomething :: Annotation ->-                               T_DropType  ->-                               T_IfExists  ->-                               T_StringList  ->-                               T_Cascade  ->-                               T_Statement -sem_Statement_DropSomething ann_ dropType_ ifE_ names_ cascade_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _dropTypeOenv :: Environment-              _ifEOenv :: Environment-              _namesOenv :: Environment-              _cascadeOenv :: Environment-              _dropTypeIannotatedTree :: DropType-              _ifEIannotatedTree :: IfExists-              _namesIannotatedTree :: StringList-              _namesIstrings :: ([String])-              _cascadeIannotatedTree :: Cascade-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6752 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  DropSomething ann_ _dropTypeIannotatedTree _ifEIannotatedTree _namesIannotatedTree _cascadeIannotatedTree-                  {-# LINE 6757 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 6762 "AstInternal.hs" #-}-              -- copy rule (down)-              _dropTypeOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6767 "AstInternal.hs" #-}-              -- copy rule (down)-              _ifEOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6772 "AstInternal.hs" #-}-              -- copy rule (down)-              _namesOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6777 "AstInternal.hs" #-}-              -- copy rule (down)-              _cascadeOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6782 "AstInternal.hs" #-}-              ( _dropTypeIannotatedTree) =-                  (dropType_ _dropTypeOenv )-              ( _ifEIannotatedTree) =-                  (ifE_ _ifEOenv )-              ( _namesIannotatedTree,_namesIstrings) =-                  (names_ _namesOenv )-              ( _cascadeIannotatedTree) =-                  (cascade_ _cascadeOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_Execute :: Annotation ->-                         T_Expression  ->-                         T_Statement -sem_Statement_Execute ann_ expr_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _exprOenv :: Environment-              _exprIannotatedTree :: Expression-              _exprIliftedColumnName :: String-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6806 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Execute ann_ _exprIannotatedTree-                  {-# LINE 6811 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 6816 "AstInternal.hs" #-}-              -- copy rule (down)-              _exprOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6821 "AstInternal.hs" #-}-              ( _exprIannotatedTree,_exprIliftedColumnName) =-                  (expr_ _exprOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_ExecuteInto :: Annotation ->-                             T_Expression  ->-                             T_StringList  ->-                             T_Statement -sem_Statement_ExecuteInto ann_ expr_ targets_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _exprOenv :: Environment-              _targetsOenv :: Environment-              _exprIannotatedTree :: Expression-              _exprIliftedColumnName :: String-              _targetsIannotatedTree :: StringList-              _targetsIstrings :: ([String])-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6843 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  ExecuteInto ann_ _exprIannotatedTree _targetsIannotatedTree-                  {-# LINE 6848 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 6853 "AstInternal.hs" #-}-              -- copy rule (down)-              _exprOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6858 "AstInternal.hs" #-}-              -- copy rule (down)-              _targetsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6863 "AstInternal.hs" #-}-              ( _exprIannotatedTree,_exprIliftedColumnName) =-                  (expr_ _exprOenv )-              ( _targetsIannotatedTree,_targetsIstrings) =-                  (targets_ _targetsOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_ForIntegerStatement :: Annotation ->-                                     String ->-                                     T_Expression  ->-                                     T_Expression  ->-                                     T_StatementList  ->-                                     T_Statement -sem_Statement_ForIntegerStatement ann_ var_ from_ to_ sts_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _stsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _fromOenv :: Environment-              _toOenv :: Environment-              _stsOenv :: Environment-              _fromIannotatedTree :: Expression-              _fromIliftedColumnName :: String-              _toIannotatedTree :: Expression-              _toIliftedColumnName :: String-              _stsIannotatedTree :: StatementList-              _stsIproducedEnv :: Environment-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6893 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 355, column 10)-              _stsOenvUpdates =-                  {-# LINE 355 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6898 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  ForIntegerStatement ann_ var_ _fromIannotatedTree _toIannotatedTree _stsIannotatedTree-                  {-# LINE 6903 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 6908 "AstInternal.hs" #-}-              -- copy rule (down)-              _fromOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6913 "AstInternal.hs" #-}-              -- copy rule (down)-              _toOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6918 "AstInternal.hs" #-}-              -- copy rule (down)-              _stsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6923 "AstInternal.hs" #-}-              ( _fromIannotatedTree,_fromIliftedColumnName) =-                  (from_ _fromOenv )-              ( _toIannotatedTree,_toIliftedColumnName) =-                  (to_ _toOenv )-              ( _stsIannotatedTree,_stsIproducedEnv) =-                  (sts_ _stsOenv _stsOenvUpdates )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_ForSelectStatement :: Annotation ->-                                    String ->-                                    T_SelectExpression  ->-                                    T_StatementList  ->-                                    T_Statement -sem_Statement_ForSelectStatement ann_ var_ sel_ sts_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _stsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _selOenv :: Environment-              _stsOenv :: Environment-              _selIannotatedTree :: SelectExpression-              _stsIannotatedTree :: StatementList-              _stsIproducedEnv :: Environment-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6950 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 355, column 10)-              _stsOenvUpdates =-                  {-# LINE 355 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6955 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  ForSelectStatement ann_ var_ _selIannotatedTree _stsIannotatedTree-                  {-# LINE 6960 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 6965 "AstInternal.hs" #-}-              -- copy rule (down)-              _selOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6970 "AstInternal.hs" #-}-              -- copy rule (down)-              _stsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 6975 "AstInternal.hs" #-}-              ( _selIannotatedTree) =-                  (sel_ _selOenv )-              ( _stsIannotatedTree,_stsIproducedEnv) =-                  (sts_ _stsOenv _stsOenvUpdates )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_If :: Annotation ->-                    T_ExpressionStatementListPairList  ->-                    T_StatementList  ->-                    T_Statement -sem_Statement_If ann_ cases_ els_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _elsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _casesOenv :: Environment-              _elsOenv :: Environment-              _casesIannotatedTree :: ExpressionStatementListPairList-              _elsIannotatedTree :: StatementList-              _elsIproducedEnv :: Environment-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 6999 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 352, column 24)-              _elsOenvUpdates =-                  {-# LINE 352 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7004 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  If ann_ _casesIannotatedTree _elsIannotatedTree-                  {-# LINE 7009 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7014 "AstInternal.hs" #-}-              -- copy rule (down)-              _casesOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7019 "AstInternal.hs" #-}-              -- copy rule (down)-              _elsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7024 "AstInternal.hs" #-}-              ( _casesIannotatedTree) =-                  (cases_ _casesOenv )-              ( _elsIannotatedTree,_elsIproducedEnv) =-                  (els_ _elsOenv _elsOenvUpdates )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_Insert :: Annotation ->-                        String ->-                        T_StringList  ->-                        T_SelectExpression  ->-                        (Maybe SelectList) ->-                        T_Statement -sem_Statement_Insert ann_ table_ targetCols_ insData_ returning_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Statement-              _lhsOenvUpdates :: ([EnvironmentUpdate])-              _targetColsOenv :: Environment-              _insDataOenv :: Environment-              _targetColsIannotatedTree :: StringList-              _targetColsIstrings :: ([String])-              _insDataIannotatedTree :: SelectExpression-              -- "./TypeChecking.ag"(line 310, column 9)-              _lhsOannotatedTree =-                  {-# LINE 310 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    $ Just (map StatementInfoA _statementInfo     ++-                            [EnvUpdates _envUpdates    ])-                  {-# LINE 7053 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 315, column 9)-              _lhsOenvUpdates =-                  {-# LINE 315 "./TypeChecking.ag" #-}-                  _envUpdates-                  {-# LINE 7058 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 681, column 9)-              _columnStuff =-                  {-# LINE 681 "./TypeChecking.ag" #-}-                  checkColumnConsistency _lhsIenv-                                         table_-                                         _targetColsIstrings-                                         (getCAtts $ getTypeAnnotation _insDataIannotatedTree)-                  {-# LINE 7066 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 686, column 9)-              _tpe =-                  {-# LINE 686 "./TypeChecking.ag" #-}-                  chainTypeCheckFailed [getTypeAnnotation _insDataIannotatedTree] $ do-                    _columnStuff-                    Right $ Pseudo Void-                  {-# LINE 7073 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 690, column 9)-              _statementInfo =-                  {-# LINE 690 "./TypeChecking.ag" #-}-                  [InsertInfo table_ $ errorToTypeFailF UnnamedCompositeType _columnStuff    ]-                  {-# LINE 7078 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 692, column 9)-              _backTree =-                  {-# LINE 692 "./TypeChecking.ag" #-}-                  Insert ann_ table_ _targetColsIannotatedTree-                         _insDataIannotatedTree returning_-                  {-# LINE 7084 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 694, column 9)-              _envUpdates =-                  {-# LINE 694 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7089 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Insert ann_ table_ _targetColsIannotatedTree _insDataIannotatedTree returning_-                  {-# LINE 7094 "AstInternal.hs" #-}-              -- copy rule (down)-              _targetColsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7099 "AstInternal.hs" #-}-              -- copy rule (down)-              _insDataOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7104 "AstInternal.hs" #-}-              ( _targetColsIannotatedTree,_targetColsIstrings) =-                  (targetCols_ _targetColsOenv )-              ( _insDataIannotatedTree) =-                  (insData_ _insDataOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_NullStatement :: Annotation ->-                               T_Statement -sem_Statement_NullStatement ann_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7120 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  NullStatement ann_-                  {-# LINE 7125 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7130 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_Perform :: Annotation ->-                         T_Expression  ->-                         T_Statement -sem_Statement_Perform ann_ expr_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _exprOenv :: Environment-              _exprIannotatedTree :: Expression-              _exprIliftedColumnName :: String-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7146 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Perform ann_ _exprIannotatedTree-                  {-# LINE 7151 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7156 "AstInternal.hs" #-}-              -- copy rule (down)-              _exprOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7161 "AstInternal.hs" #-}-              ( _exprIannotatedTree,_exprIliftedColumnName) =-                  (expr_ _exprOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_Raise :: Annotation ->-                       T_RaiseType  ->-                       String ->-                       T_ExpressionList  ->-                       T_Statement -sem_Statement_Raise ann_ level_ message_ args_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _levelOenv :: Environment-              _argsOenv :: Environment-              _levelIannotatedTree :: RaiseType-              _argsIannotatedTree :: ExpressionList-              _argsItypeList :: ([Type])-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7183 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Raise ann_ _levelIannotatedTree message_ _argsIannotatedTree-                  {-# LINE 7188 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7193 "AstInternal.hs" #-}-              -- copy rule (down)-              _levelOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7198 "AstInternal.hs" #-}-              -- copy rule (down)-              _argsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7203 "AstInternal.hs" #-}-              ( _levelIannotatedTree) =-                  (level_ _levelOenv )-              ( _argsIannotatedTree,_argsItypeList) =-                  (args_ _argsOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_Return :: Annotation ->-                        T_MaybeExpression  ->-                        T_Statement -sem_Statement_Return ann_ value_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Statement-              _lhsOenvUpdates :: ([EnvironmentUpdate])-              _valueOenv :: Environment-              _valueIannotatedTree :: MaybeExpression-              _valueIexprType :: (Maybe Type)-              -- "./TypeChecking.ag"(line 310, column 9)-              _lhsOannotatedTree =-                  {-# LINE 310 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    $ Just (map StatementInfoA _statementInfo     ++-                            [EnvUpdates _envUpdates    ])-                  {-# LINE 7227 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 315, column 9)-              _lhsOenvUpdates =-                  {-# LINE 315 "./TypeChecking.ag" #-}-                  _envUpdates-                  {-# LINE 7232 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 989, column 9)-              _tpe =-                  {-# LINE 989 "./TypeChecking.ag" #-}-                  chainTypeCheckFailed [fromMaybe typeBool _valueIexprType] $ Right $ Pseudo Void-                  {-# LINE 7237 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 990, column 9)-              _backTree =-                  {-# LINE 990 "./TypeChecking.ag" #-}-                  Return ann_ _valueIannotatedTree-                  {-# LINE 7242 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 991, column 9)-              _envUpdates =-                  {-# LINE 991 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7247 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 992, column 9)-              _statementInfo =-                  {-# LINE 992 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7252 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Return ann_ _valueIannotatedTree-                  {-# LINE 7257 "AstInternal.hs" #-}-              -- copy rule (down)-              _valueOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7262 "AstInternal.hs" #-}-              ( _valueIannotatedTree,_valueIexprType) =-                  (value_ _valueOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_ReturnNext :: Annotation ->-                            T_Expression  ->-                            T_Statement -sem_Statement_ReturnNext ann_ expr_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _exprOenv :: Environment-              _exprIannotatedTree :: Expression-              _exprIliftedColumnName :: String-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7280 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  ReturnNext ann_ _exprIannotatedTree-                  {-# LINE 7285 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7290 "AstInternal.hs" #-}-              -- copy rule (down)-              _exprOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7295 "AstInternal.hs" #-}-              ( _exprIannotatedTree,_exprIliftedColumnName) =-                  (expr_ _exprOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_ReturnQuery :: Annotation ->-                             T_SelectExpression  ->-                             T_Statement -sem_Statement_ReturnQuery ann_ sel_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _selOenv :: Environment-              _selIannotatedTree :: SelectExpression-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7312 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  ReturnQuery ann_ _selIannotatedTree-                  {-# LINE 7317 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7322 "AstInternal.hs" #-}-              -- copy rule (down)-              _selOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7327 "AstInternal.hs" #-}-              ( _selIannotatedTree) =-                  (sel_ _selOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_SelectStatement :: Annotation ->-                                 T_SelectExpression  ->-                                 T_Statement -sem_Statement_SelectStatement ann_ ex_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Statement-              _lhsOenvUpdates :: ([EnvironmentUpdate])-              _exOenv :: Environment-              _exIannotatedTree :: SelectExpression-              -- "./TypeChecking.ag"(line 310, column 9)-              _lhsOannotatedTree =-                  {-# LINE 310 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    $ Just (map StatementInfoA _statementInfo     ++-                            [EnvUpdates _envUpdates    ])-                  {-# LINE 7348 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 315, column 9)-              _lhsOenvUpdates =-                  {-# LINE 315 "./TypeChecking.ag" #-}-                  _envUpdates-                  {-# LINE 7353 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 371, column 9)-              _tpe =-                  {-# LINE 371 "./TypeChecking.ag" #-}-                  chainTypeCheckFailed [getTypeAnnotation _exIannotatedTree] $ Right $ Pseudo Void-                  {-# LINE 7358 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 372, column 9)-              _statementInfo =-                  {-# LINE 372 "./TypeChecking.ag" #-}-                  [SelectInfo $ getTypeAnnotation _exIannotatedTree]-                  {-# LINE 7363 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 373, column 9)-              _backTree =-                  {-# LINE 373 "./TypeChecking.ag" #-}-                  SelectStatement ann_ _exIannotatedTree-                  {-# LINE 7368 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 374, column 9)-              _envUpdates =-                  {-# LINE 374 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7373 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  SelectStatement ann_ _exIannotatedTree-                  {-# LINE 7378 "AstInternal.hs" #-}-              -- copy rule (down)-              _exOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7383 "AstInternal.hs" #-}-              ( _exIannotatedTree) =-                  (ex_ _exOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_Truncate :: Annotation ->-                          T_StringList  ->-                          T_RestartIdentity  ->-                          T_Cascade  ->-                          T_Statement -sem_Statement_Truncate ann_ tables_ restartIdentity_ cascade_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _tablesOenv :: Environment-              _restartIdentityOenv :: Environment-              _cascadeOenv :: Environment-              _tablesIannotatedTree :: StringList-              _tablesIstrings :: ([String])-              _restartIdentityIannotatedTree :: RestartIdentity-              _cascadeIannotatedTree :: Cascade-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7407 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Truncate ann_ _tablesIannotatedTree _restartIdentityIannotatedTree _cascadeIannotatedTree-                  {-# LINE 7412 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7417 "AstInternal.hs" #-}-              -- copy rule (down)-              _tablesOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7422 "AstInternal.hs" #-}-              -- copy rule (down)-              _restartIdentityOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7427 "AstInternal.hs" #-}-              -- copy rule (down)-              _cascadeOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7432 "AstInternal.hs" #-}-              ( _tablesIannotatedTree,_tablesIstrings) =-                  (tables_ _tablesOenv )-              ( _restartIdentityIannotatedTree) =-                  (restartIdentity_ _restartIdentityOenv )-              ( _cascadeIannotatedTree) =-                  (cascade_ _cascadeOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_Update :: Annotation ->-                        String ->-                        T_SetClauseList  ->-                        T_MaybeBoolExpression  ->-                        (Maybe SelectList) ->-                        T_Statement -sem_Statement_Update ann_ table_ assigns_ whr_ returning_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Statement-              _lhsOenvUpdates :: ([EnvironmentUpdate])-              _assignsOenv :: Environment-              _whrOenv :: Environment-              _assignsIannotatedTree :: SetClauseList-              _assignsIpairs :: ([(String,Type)])-              _assignsIrowSetErrors :: ([TypeError])-              _whrIannotatedTree :: MaybeBoolExpression-              -- "./TypeChecking.ag"(line 310, column 9)-              _lhsOannotatedTree =-                  {-# LINE 310 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    $ Just (map StatementInfoA _statementInfo     ++-                            [EnvUpdates _envUpdates    ])-                  {-# LINE 7464 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 315, column 9)-              _lhsOenvUpdates =-                  {-# LINE 315 "./TypeChecking.ag" #-}-                  _envUpdates-                  {-# LINE 7469 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 711, column 9)-              _tpe =-                  {-# LINE 711 "./TypeChecking.ag" #-}-                  do-                  let re = checkRelationExists _lhsIenv table_-                  when (isJust re) $-                       Left [fromJust $ re]-                  chainTypeCheckFailed (map snd _assignsIpairs) $ do-                    _columnsConsistent-                    checkErrorList _assignsIrowSetErrors $ Pseudo Void-                  {-# LINE 7480 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 719, column 9)-              _columnsConsistent =-                  {-# LINE 719 "./TypeChecking.ag" #-}-                  checkColumnConsistency _lhsIenv table_ (map fst _assignsIpairs) _assignsIpairs-                  {-# LINE 7485 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 721, column 9)-              _statementInfo =-                  {-# LINE 721 "./TypeChecking.ag" #-}-                  [UpdateInfo table_ $ errorToTypeFailF UnnamedCompositeType _columnsConsistent    ]-                  {-# LINE 7490 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 723, column 9)-              _backTree =-                  {-# LINE 723 "./TypeChecking.ag" #-}-                  Update ann_ table_ _assignsIannotatedTree _whrIannotatedTree returning_-                  {-# LINE 7495 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 724, column 9)-              _envUpdates =-                  {-# LINE 724 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7500 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Update ann_ table_ _assignsIannotatedTree _whrIannotatedTree returning_-                  {-# LINE 7505 "AstInternal.hs" #-}-              -- copy rule (down)-              _assignsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7510 "AstInternal.hs" #-}-              -- copy rule (down)-              _whrOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7515 "AstInternal.hs" #-}-              ( _assignsIannotatedTree,_assignsIpairs,_assignsIrowSetErrors) =-                  (assigns_ _assignsOenv )-              ( _whrIannotatedTree) =-                  (whr_ _whrOenv )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))-sem_Statement_WhileStatement :: Annotation ->-                                T_Expression  ->-                                T_StatementList  ->-                                T_Statement -sem_Statement_WhileStatement ann_ expr_ sts_  =-    (\ _lhsIenv ->-         (let _lhsOenvUpdates :: ([EnvironmentUpdate])-              _stsOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: Statement-              _exprOenv :: Environment-              _stsOenv :: Environment-              _exprIannotatedTree :: Expression-              _exprIliftedColumnName :: String-              _stsIannotatedTree :: StatementList-              _stsIproducedEnv :: Environment-              -- "./TypeChecking.ag"(line 324, column 9)-              _lhsOenvUpdates =-                  {-# LINE 324 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7540 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 355, column 10)-              _stsOenvUpdates =-                  {-# LINE 355 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7545 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  WhileStatement ann_ _exprIannotatedTree _stsIannotatedTree-                  {-# LINE 7550 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7555 "AstInternal.hs" #-}-              -- copy rule (down)-              _exprOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7560 "AstInternal.hs" #-}-              -- copy rule (down)-              _stsOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7565 "AstInternal.hs" #-}-              ( _exprIannotatedTree,_exprIliftedColumnName) =-                  (expr_ _exprOenv )-              ( _stsIannotatedTree,_stsIproducedEnv) =-                  (sts_ _stsOenv _stsOenvUpdates )-          in  ( _lhsOannotatedTree,_lhsOenvUpdates)))--- StatementList ------------------------------------------------{--   visit 0:-      inherited attributes:-         env                  : Environment-         envUpdates           : [EnvironmentUpdate]-      synthesized attributes:-         annotatedTree        : SELF -         producedEnv          : Environment-   alternatives:-      alternative Cons:-         child hd             : Statement -         child tl             : StatementList -         visit 0:-            local newEnv      : _-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type StatementList  = [(Statement)]--- cata-sem_StatementList :: StatementList  ->-                     T_StatementList -sem_StatementList list  =-    (Prelude.foldr sem_StatementList_Cons sem_StatementList_Nil (Prelude.map sem_Statement list) )--- semantic domain-type T_StatementList  = Environment ->-                        ([EnvironmentUpdate]) ->-                        ( StatementList,Environment)-data Inh_StatementList  = Inh_StatementList {env_Inh_StatementList :: Environment,envUpdates_Inh_StatementList :: [EnvironmentUpdate]}-data Syn_StatementList  = Syn_StatementList {annotatedTree_Syn_StatementList :: StatementList,producedEnv_Syn_StatementList :: Environment}-wrap_StatementList :: T_StatementList  ->-                      Inh_StatementList  ->-                      Syn_StatementList -wrap_StatementList sem (Inh_StatementList _lhsIenv _lhsIenvUpdates )  =-    (let ( _lhsOannotatedTree,_lhsOproducedEnv) =-             (sem _lhsIenv _lhsIenvUpdates )-     in  (Syn_StatementList _lhsOannotatedTree _lhsOproducedEnv ))-sem_StatementList_Cons :: T_Statement  ->-                          T_StatementList  ->-                          T_StatementList -sem_StatementList_Cons hd_ tl_  =-    (\ _lhsIenv-       _lhsIenvUpdates ->-         (let _hdOenv :: Environment-              _tlOenv :: Environment-              _lhsOproducedEnv :: Environment-              _tlOenvUpdates :: ([EnvironmentUpdate])-              _lhsOannotatedTree :: StatementList-              _hdIannotatedTree :: Statement-              _hdIenvUpdates :: ([EnvironmentUpdate])-              _tlIannotatedTree :: StatementList-              _tlIproducedEnv :: Environment-              -- "./TypeChecking.ag"(line 334, column 9)-              _newEnv =-                  {-# LINE 334 "./TypeChecking.ag" #-}-                  fromRight _lhsIenv $ updateEnvironment _lhsIenv _lhsIenvUpdates-                  {-# LINE 7629 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 335, column 9)-              _hdOenv =-                  {-# LINE 335 "./TypeChecking.ag" #-}-                  _newEnv-                  {-# LINE 7634 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 336, column 9)-              _tlOenv =-                  {-# LINE 336 "./TypeChecking.ag" #-}-                  _newEnv-                  {-# LINE 7639 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 337, column 9)-              _lhsOproducedEnv =-                  {-# LINE 337 "./TypeChecking.ag" #-}-                  case _tlIannotatedTree of-                   [] -> _newEnv-                   _ -> _tlIproducedEnv-                  {-# LINE 7646 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 340, column 9)-              _tlOenvUpdates =-                  {-# LINE 340 "./TypeChecking.ag" #-}-                  _hdIenvUpdates-                  {-# LINE 7651 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 7656 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7661 "AstInternal.hs" #-}-              ( _hdIannotatedTree,_hdIenvUpdates) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree,_tlIproducedEnv) =-                  (tl_ _tlOenv _tlOenvUpdates )-          in  ( _lhsOannotatedTree,_lhsOproducedEnv)))-sem_StatementList_Nil :: T_StatementList -sem_StatementList_Nil  =-    (\ _lhsIenv-       _lhsIenvUpdates ->-         (let _lhsOproducedEnv :: Environment-              _lhsOannotatedTree :: StatementList-              -- "./TypeChecking.ag"(line 342, column 9)-              _lhsOproducedEnv =-                  {-# LINE 342 "./TypeChecking.ag" #-}-                  emptyEnvironment-                  {-# LINE 7677 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7682 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7687 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOproducedEnv)))--- StringList ---------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         strings              : [String]-   alternatives:-      alternative Cons:-         child hd             : {String}-         child tl             : StringList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type StringList  = [(String)]--- cata-sem_StringList :: StringList  ->-                  T_StringList -sem_StringList list  =-    (Prelude.foldr sem_StringList_Cons sem_StringList_Nil list )--- semantic domain-type T_StringList  = Environment ->-                     ( StringList,([String]))-data Inh_StringList  = Inh_StringList {env_Inh_StringList :: Environment}-data Syn_StringList  = Syn_StringList {annotatedTree_Syn_StringList :: StringList,strings_Syn_StringList :: [String]}-wrap_StringList :: T_StringList  ->-                   Inh_StringList  ->-                   Syn_StringList -wrap_StringList sem (Inh_StringList _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOstrings) =-             (sem _lhsIenv )-     in  (Syn_StringList _lhsOannotatedTree _lhsOstrings ))-sem_StringList_Cons :: String ->-                       T_StringList  ->-                       T_StringList -sem_StringList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOstrings :: ([String])-              _lhsOannotatedTree :: StringList-              _tlOenv :: Environment-              _tlIannotatedTree :: StringList-              _tlIstrings :: ([String])-              -- "./TypeChecking.ag"(line 699, column 10)-              _lhsOstrings =-                  {-# LINE 699 "./TypeChecking.ag" #-}-                  hd_ : _tlIstrings-                  {-# LINE 7739 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) hd_ _tlIannotatedTree-                  {-# LINE 7744 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7749 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7754 "AstInternal.hs" #-}-              ( _tlIannotatedTree,_tlIstrings) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree,_lhsOstrings)))-sem_StringList_Nil :: T_StringList -sem_StringList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOstrings :: ([String])-              _lhsOannotatedTree :: StringList-              -- "./TypeChecking.ag"(line 700, column 9)-              _lhsOstrings =-                  {-# LINE 700 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7767 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7772 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7777 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOstrings)))--- StringStringListPair -----------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Tuple:-         child x1             : {String}-         child x2             : StringList -         visit 0:-            local annotatedTree : _--}-type StringStringListPair  = ( (String),(StringList))--- cata-sem_StringStringListPair :: StringStringListPair  ->-                            T_StringStringListPair -sem_StringStringListPair ( x1,x2)  =-    (sem_StringStringListPair_Tuple x1 (sem_StringList x2 ) )--- semantic domain-type T_StringStringListPair  = Environment ->-                               ( StringStringListPair)-data Inh_StringStringListPair  = Inh_StringStringListPair {env_Inh_StringStringListPair :: Environment}-data Syn_StringStringListPair  = Syn_StringStringListPair {annotatedTree_Syn_StringStringListPair :: StringStringListPair}-wrap_StringStringListPair :: T_StringStringListPair  ->-                             Inh_StringStringListPair  ->-                             Syn_StringStringListPair -wrap_StringStringListPair sem (Inh_StringStringListPair _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_StringStringListPair _lhsOannotatedTree ))-sem_StringStringListPair_Tuple :: String ->-                                  T_StringList  ->-                                  T_StringStringListPair -sem_StringStringListPair_Tuple x1_ x2_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: StringStringListPair-              _x2Oenv :: Environment-              _x2IannotatedTree :: StringList-              _x2Istrings :: ([String])-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (x1_,_x2IannotatedTree)-                  {-# LINE 7824 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7829 "AstInternal.hs" #-}-              -- copy rule (down)-              _x2Oenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7834 "AstInternal.hs" #-}-              ( _x2IannotatedTree,_x2Istrings) =-                  (x2_ _x2Oenv )-          in  ( _lhsOannotatedTree)))--- StringStringListPairList -------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Cons:-         child hd             : StringStringListPair -         child tl             : StringStringListPairList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type StringStringListPairList  = [(StringStringListPair)]--- cata-sem_StringStringListPairList :: StringStringListPairList  ->-                                T_StringStringListPairList -sem_StringStringListPairList list  =-    (Prelude.foldr sem_StringStringListPairList_Cons sem_StringStringListPairList_Nil (Prelude.map sem_StringStringListPair list) )--- semantic domain-type T_StringStringListPairList  = Environment ->-                                   ( StringStringListPairList)-data Inh_StringStringListPairList  = Inh_StringStringListPairList {env_Inh_StringStringListPairList :: Environment}-data Syn_StringStringListPairList  = Syn_StringStringListPairList {annotatedTree_Syn_StringStringListPairList :: StringStringListPairList}-wrap_StringStringListPairList :: T_StringStringListPairList  ->-                                 Inh_StringStringListPairList  ->-                                 Syn_StringStringListPairList -wrap_StringStringListPairList sem (Inh_StringStringListPairList _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_StringStringListPairList _lhsOannotatedTree ))-sem_StringStringListPairList_Cons :: T_StringStringListPair  ->-                                     T_StringStringListPairList  ->-                                     T_StringStringListPairList -sem_StringStringListPairList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: StringStringListPairList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: StringStringListPair-              _tlIannotatedTree :: StringStringListPairList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 7887 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7892 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7897 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 7902 "AstInternal.hs" #-}-              ( _hdIannotatedTree) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree)))-sem_StringStringListPairList_Nil :: T_StringStringListPairList -sem_StringStringListPairList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: StringStringListPairList-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 7916 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 7921 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))--- TableRef -----------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         idens                : [(String,([(String,Type)],[(String,Type)]))]-         joinIdens            : [String]-   alternatives:-      alternative JoinedTref:-         child ann            : {Annotation}-         child tbl            : TableRef -         child nat            : Natural -         child joinType       : JoinType -         child tbl1           : TableRef -         child onExpr         : OnExpr -         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative SubTref:-         child ann            : {Annotation}-         child sel            : SelectExpression -         child alias          : {String}-         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative Tref:-         child ann            : {Annotation}-         child tbl            : {String}-         visit 0:-            local tpe         : _-            local relType     : _-            local unwrappedRelType : _-            local backTree    : _-            local annotatedTree : _-      alternative TrefAlias:-         child ann            : {Annotation}-         child tbl            : {String}-         child alias          : {String}-         visit 0:-            local tpe         : _-            local relType     : _-            local unwrappedRelType : _-            local backTree    : _-            local annotatedTree : _-      alternative TrefFun:-         child ann            : {Annotation}-         child fn             : Expression -         visit 0:-            local tpe         : _-            local alias1      : _-            local backTree    : _-            local annotatedTree : _-      alternative TrefFunAlias:-         child ann            : {Annotation}-         child fn             : Expression -         child alias          : {String}-         visit 0:-            local tpe         : _-            local alias1      : _-            local backTree    : _-            local annotatedTree : _--}-data TableRef  = JoinedTref (Annotation) (TableRef) (Natural) (JoinType) (TableRef) (OnExpr) -               | SubTref (Annotation) (SelectExpression) (String) -               | Tref (Annotation) (String) -               | TrefAlias (Annotation) (String) (String) -               | TrefFun (Annotation) (Expression) -               | TrefFunAlias (Annotation) (Expression) (String) -               deriving ( Data,Eq,Show,Typeable)--- cata-sem_TableRef :: TableRef  ->-                T_TableRef -sem_TableRef (JoinedTref _ann _tbl _nat _joinType _tbl1 _onExpr )  =-    (sem_TableRef_JoinedTref _ann (sem_TableRef _tbl ) (sem_Natural _nat ) (sem_JoinType _joinType ) (sem_TableRef _tbl1 ) (sem_OnExpr _onExpr ) )-sem_TableRef (SubTref _ann _sel _alias )  =-    (sem_TableRef_SubTref _ann (sem_SelectExpression _sel ) _alias )-sem_TableRef (Tref _ann _tbl )  =-    (sem_TableRef_Tref _ann _tbl )-sem_TableRef (TrefAlias _ann _tbl _alias )  =-    (sem_TableRef_TrefAlias _ann _tbl _alias )-sem_TableRef (TrefFun _ann _fn )  =-    (sem_TableRef_TrefFun _ann (sem_Expression _fn ) )-sem_TableRef (TrefFunAlias _ann _fn _alias )  =-    (sem_TableRef_TrefFunAlias _ann (sem_Expression _fn ) _alias )--- semantic domain-type T_TableRef  = Environment ->-                   ( TableRef,([(String,([(String,Type)],[(String,Type)]))]),([String]))-data Inh_TableRef  = Inh_TableRef {env_Inh_TableRef :: Environment}-data Syn_TableRef  = Syn_TableRef {annotatedTree_Syn_TableRef :: TableRef,idens_Syn_TableRef :: [(String,([(String,Type)],[(String,Type)]))],joinIdens_Syn_TableRef :: [String]}-wrap_TableRef :: T_TableRef  ->-                 Inh_TableRef  ->-                 Syn_TableRef -wrap_TableRef sem (Inh_TableRef _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOidens,_lhsOjoinIdens) =-             (sem _lhsIenv )-     in  (Syn_TableRef _lhsOannotatedTree _lhsOidens _lhsOjoinIdens ))-sem_TableRef_JoinedTref :: Annotation ->-                           T_TableRef  ->-                           T_Natural  ->-                           T_JoinType  ->-                           T_TableRef  ->-                           T_OnExpr  ->-                           T_TableRef -sem_TableRef_JoinedTref ann_ tbl_ nat_ joinType_ tbl1_ onExpr_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: TableRef-              _lhsOidens :: ([(String,([(String,Type)],[(String,Type)]))])-              _lhsOjoinIdens :: ([String])-              _tblOenv :: Environment-              _natOenv :: Environment-              _joinTypeOenv :: Environment-              _tbl1Oenv :: Environment-              _onExprOenv :: Environment-              _tblIannotatedTree :: TableRef-              _tblIidens :: ([(String,([(String,Type)],[(String,Type)]))])-              _tblIjoinIdens :: ([String])-              _natIannotatedTree :: Natural-              _joinTypeIannotatedTree :: JoinType-              _tbl1IannotatedTree :: TableRef-              _tbl1Iidens :: ([(String,([(String,Type)],[(String,Type)]))])-              _tbl1IjoinIdens :: ([String])-              _onExprIannotatedTree :: OnExpr-              -- "./TypeChecking.ag"(line 433, column 9)-              _lhsOannotatedTree =-                  {-# LINE 433 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 8056 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 476, column 9)-              _tpe =-                  {-# LINE 476 "./TypeChecking.ag" #-}-                  chainTypeCheckFailed [tblt-                            ,tbl1t] $-                     case (_natIannotatedTree, _onExprIannotatedTree) of-                            (Natural, _) -> unionJoinList $-                                            commonFieldNames tblt tbl1t-                            (_,Just (JoinUsing _ s)) -> unionJoinList s-                            _ -> unionJoinList []-                  where-                    tblt = getTypeAnnotation _tblIannotatedTree-                    tbl1t = getTypeAnnotation _tbl1IannotatedTree-                    unionJoinList s =-                        combineTableTypesWithUsingList _lhsIenv s tblt tbl1t-                  {-# LINE 8072 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 489, column 9)-              _lhsOidens =-                  {-# LINE 489 "./TypeChecking.ag" #-}-                  _tblIidens ++ _tbl1Iidens-                  {-# LINE 8077 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 490, column 9)-              _lhsOjoinIdens =-                  {-# LINE 490 "./TypeChecking.ag" #-}-                  commonFieldNames (getTypeAnnotation _tblIannotatedTree)-                                   (getTypeAnnotation _tbl1IannotatedTree)-                  {-# LINE 8083 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 492, column 9)-              _backTree =-                  {-# LINE 492 "./TypeChecking.ag" #-}-                  JoinedTref ann_-                             _tblIannotatedTree-                             _natIannotatedTree-                             _joinTypeIannotatedTree-                             _tbl1IannotatedTree-                             _onExprIannotatedTree-                  {-# LINE 8093 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  JoinedTref ann_ _tblIannotatedTree _natIannotatedTree _joinTypeIannotatedTree _tbl1IannotatedTree _onExprIannotatedTree-                  {-# LINE 8098 "AstInternal.hs" #-}-              -- copy rule (down)-              _tblOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8103 "AstInternal.hs" #-}-              -- copy rule (down)-              _natOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8108 "AstInternal.hs" #-}-              -- copy rule (down)-              _joinTypeOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8113 "AstInternal.hs" #-}-              -- copy rule (down)-              _tbl1Oenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8118 "AstInternal.hs" #-}-              -- copy rule (down)-              _onExprOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8123 "AstInternal.hs" #-}-              ( _tblIannotatedTree,_tblIidens,_tblIjoinIdens) =-                  (tbl_ _tblOenv )-              ( _natIannotatedTree) =-                  (nat_ _natOenv )-              ( _joinTypeIannotatedTree) =-                  (joinType_ _joinTypeOenv )-              ( _tbl1IannotatedTree,_tbl1Iidens,_tbl1IjoinIdens) =-                  (tbl1_ _tbl1Oenv )-              ( _onExprIannotatedTree) =-                  (onExpr_ _onExprOenv )-          in  ( _lhsOannotatedTree,_lhsOidens,_lhsOjoinIdens)))-sem_TableRef_SubTref :: Annotation ->-                        T_SelectExpression  ->-                        String ->-                        T_TableRef -sem_TableRef_SubTref ann_ sel_ alias_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: TableRef-              _lhsOidens :: ([(String,([(String,Type)],[(String,Type)]))])-              _lhsOjoinIdens :: ([String])-              _selOenv :: Environment-              _selIannotatedTree :: SelectExpression-              -- "./TypeChecking.ag"(line 433, column 9)-              _lhsOannotatedTree =-                  {-# LINE 433 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 8153 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 440, column 15)-              _tpe =-                  {-# LINE 440 "./TypeChecking.ag" #-}-                  chainTypeCheckFailed [getTypeAnnotation _selIannotatedTree] <$>-                  unwrapSetOfWhenComposite $ getTypeAnnotation _selIannotatedTree-                  {-# LINE 8159 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 442, column 15)-              _backTree =-                  {-# LINE 442 "./TypeChecking.ag" #-}-                  SubTref ann_ _selIannotatedTree alias_-                  {-# LINE 8164 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 443, column 15)-              _lhsOidens =-                  {-# LINE 443 "./TypeChecking.ag" #-}-                  [(alias_, (fromRight [] $ getTbCols _selIannotatedTree, []))]-                  {-# LINE 8169 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 444, column 15)-              _lhsOjoinIdens =-                  {-# LINE 444 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 8174 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  SubTref ann_ _selIannotatedTree alias_-                  {-# LINE 8179 "AstInternal.hs" #-}-              -- copy rule (down)-              _selOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8184 "AstInternal.hs" #-}-              ( _selIannotatedTree) =-                  (sel_ _selOenv )-          in  ( _lhsOannotatedTree,_lhsOidens,_lhsOjoinIdens)))-sem_TableRef_Tref :: Annotation ->-                     String ->-                     T_TableRef -sem_TableRef_Tref ann_ tbl_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: TableRef-              _lhsOjoinIdens :: ([String])-              _lhsOidens :: ([(String,([(String,Type)],[(String,Type)]))])-              -- "./TypeChecking.ag"(line 433, column 9)-              _lhsOannotatedTree =-                  {-# LINE 433 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 8203 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 446, column 9)-              _tpe =-                  {-# LINE 446 "./TypeChecking.ag" #-}-                  either Left (Right . fst) _relType-                  {-# LINE 8208 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 447, column 9)-              _lhsOjoinIdens =-                  {-# LINE 447 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 8213 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 448, column 9)-              _relType =-                  {-# LINE 448 "./TypeChecking.ag" #-}-                  getRelationType _lhsIenv tbl_-                  {-# LINE 8218 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 449, column 9)-              _unwrappedRelType =-                  {-# LINE 449 "./TypeChecking.ag" #-}-                  fromRight ([],[]) $-                  do-                    lrt <- _relType-                    let (UnnamedCompositeType a,UnnamedCompositeType b) = lrt-                    return (a,b)-                  {-# LINE 8227 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 456, column 9)-              _lhsOidens =-                  {-# LINE 456 "./TypeChecking.ag" #-}-                  [(tbl_, _unwrappedRelType    )]-                  {-# LINE 8232 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 457, column 9)-              _backTree =-                  {-# LINE 457 "./TypeChecking.ag" #-}-                  Tref ann_ tbl_-                  {-# LINE 8237 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Tref ann_ tbl_-                  {-# LINE 8242 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOidens,_lhsOjoinIdens)))-sem_TableRef_TrefAlias :: Annotation ->-                          String ->-                          String ->-                          T_TableRef -sem_TableRef_TrefAlias ann_ tbl_ alias_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: TableRef-              _lhsOjoinIdens :: ([String])-              _lhsOidens :: ([(String,([(String,Type)],[(String,Type)]))])-              -- "./TypeChecking.ag"(line 433, column 9)-              _lhsOannotatedTree =-                  {-# LINE 433 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 8260 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 446, column 9)-              _tpe =-                  {-# LINE 446 "./TypeChecking.ag" #-}-                  either Left (Right . fst) _relType-                  {-# LINE 8265 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 447, column 9)-              _lhsOjoinIdens =-                  {-# LINE 447 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 8270 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 448, column 9)-              _relType =-                  {-# LINE 448 "./TypeChecking.ag" #-}-                  getRelationType _lhsIenv tbl_-                  {-# LINE 8275 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 449, column 9)-              _unwrappedRelType =-                  {-# LINE 449 "./TypeChecking.ag" #-}-                  fromRight ([],[]) $-                  do-                    lrt <- _relType-                    let (UnnamedCompositeType a,UnnamedCompositeType b) = lrt-                    return (a,b)-                  {-# LINE 8284 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 459, column 9)-              _lhsOidens =-                  {-# LINE 459 "./TypeChecking.ag" #-}-                  [(alias_, _unwrappedRelType    )]-                  {-# LINE 8289 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 460, column 9)-              _backTree =-                  {-# LINE 460 "./TypeChecking.ag" #-}-                  TrefAlias ann_ tbl_ alias_-                  {-# LINE 8294 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  TrefAlias ann_ tbl_ alias_-                  {-# LINE 8299 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOidens,_lhsOjoinIdens)))-sem_TableRef_TrefFun :: Annotation ->-                        T_Expression  ->-                        T_TableRef -sem_TableRef_TrefFun ann_ fn_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: TableRef-              _lhsOjoinIdens :: ([String])-              _lhsOidens :: ([(String,([(String,Type)],[(String,Type)]))])-              _fnOenv :: Environment-              _fnIannotatedTree :: Expression-              _fnIliftedColumnName :: String-              -- "./TypeChecking.ag"(line 433, column 9)-              _lhsOannotatedTree =-                  {-# LINE 433 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 8319 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 462, column 9)-              _tpe =-                  {-# LINE 462 "./TypeChecking.ag" #-}-                  getFnType _lhsIenv _alias1     _fnIannotatedTree-                  {-# LINE 8324 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 463, column 9)-              _lhsOjoinIdens =-                  {-# LINE 463 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 8329 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 464, column 9)-              _lhsOidens =-                  {-# LINE 464 "./TypeChecking.ag" #-}-                  case getFunIdens-                            _lhsIenv _alias1-                            _fnIannotatedTree of-                    Right (s, UnnamedCompositeType c) -> [(s,(c,[]))]-                    _ -> []-                  {-# LINE 8338 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 470, column 9)-              _alias1 =-                  {-# LINE 470 "./TypeChecking.ag" #-}-                  ""-                  {-# LINE 8343 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 471, column 9)-              _backTree =-                  {-# LINE 471 "./TypeChecking.ag" #-}-                  TrefFun ann_ _fnIannotatedTree-                  {-# LINE 8348 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  TrefFun ann_ _fnIannotatedTree-                  {-# LINE 8353 "AstInternal.hs" #-}-              -- copy rule (down)-              _fnOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8358 "AstInternal.hs" #-}-              ( _fnIannotatedTree,_fnIliftedColumnName) =-                  (fn_ _fnOenv )-          in  ( _lhsOannotatedTree,_lhsOidens,_lhsOjoinIdens)))-sem_TableRef_TrefFunAlias :: Annotation ->-                             T_Expression  ->-                             String ->-                             T_TableRef -sem_TableRef_TrefFunAlias ann_ fn_ alias_  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: TableRef-              _lhsOjoinIdens :: ([String])-              _lhsOidens :: ([(String,([(String,Type)],[(String,Type)]))])-              _fnOenv :: Environment-              _fnIannotatedTree :: Expression-              _fnIliftedColumnName :: String-              -- "./TypeChecking.ag"(line 433, column 9)-              _lhsOannotatedTree =-                  {-# LINE 433 "./TypeChecking.ag" #-}-                  annTypesAndErrors _backTree-                    (errorToTypeFail _tpe    )-                    (getErrors _tpe    )-                    Nothing-                  {-# LINE 8381 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 462, column 9)-              _tpe =-                  {-# LINE 462 "./TypeChecking.ag" #-}-                  getFnType _lhsIenv _alias1     _fnIannotatedTree-                  {-# LINE 8386 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 463, column 9)-              _lhsOjoinIdens =-                  {-# LINE 463 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 8391 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 464, column 9)-              _lhsOidens =-                  {-# LINE 464 "./TypeChecking.ag" #-}-                  case getFunIdens-                            _lhsIenv _alias1-                            _fnIannotatedTree of-                    Right (s, UnnamedCompositeType c) -> [(s,(c,[]))]-                    _ -> []-                  {-# LINE 8400 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 473, column 9)-              _alias1 =-                  {-# LINE 473 "./TypeChecking.ag" #-}-                  alias_-                  {-# LINE 8405 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 474, column 9)-              _backTree =-                  {-# LINE 474 "./TypeChecking.ag" #-}-                  TrefFunAlias ann_ _fnIannotatedTree alias_-                  {-# LINE 8410 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  TrefFunAlias ann_ _fnIannotatedTree alias_-                  {-# LINE 8415 "AstInternal.hs" #-}-              -- copy rule (down)-              _fnOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8420 "AstInternal.hs" #-}-              ( _fnIannotatedTree,_fnIliftedColumnName) =-                  (fn_ _fnOenv )-          in  ( _lhsOannotatedTree,_lhsOidens,_lhsOjoinIdens)))--- TableRefList -------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         idens                : [(String,([(String,Type)],[(String,Type)]))]-         joinIdens            : [String]-   alternatives:-      alternative Cons:-         child hd             : TableRef -         child tl             : TableRefList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type TableRefList  = [(TableRef)]--- cata-sem_TableRefList :: TableRefList  ->-                    T_TableRefList -sem_TableRefList list  =-    (Prelude.foldr sem_TableRefList_Cons sem_TableRefList_Nil (Prelude.map sem_TableRef list) )--- semantic domain-type T_TableRefList  = Environment ->-                       ( TableRefList,([(String,([(String,Type)],[(String,Type)]))]),([String]))-data Inh_TableRefList  = Inh_TableRefList {env_Inh_TableRefList :: Environment}-data Syn_TableRefList  = Syn_TableRefList {annotatedTree_Syn_TableRefList :: TableRefList,idens_Syn_TableRefList :: [(String,([(String,Type)],[(String,Type)]))],joinIdens_Syn_TableRefList :: [String]}-wrap_TableRefList :: T_TableRefList  ->-                     Inh_TableRefList  ->-                     Syn_TableRefList -wrap_TableRefList sem (Inh_TableRefList _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOidens,_lhsOjoinIdens) =-             (sem _lhsIenv )-     in  (Syn_TableRefList _lhsOannotatedTree _lhsOidens _lhsOjoinIdens ))-sem_TableRefList_Cons :: T_TableRef  ->-                         T_TableRefList  ->-                         T_TableRefList -sem_TableRefList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOidens :: ([(String,([(String,Type)],[(String,Type)]))])-              _lhsOjoinIdens :: ([String])-              _lhsOannotatedTree :: TableRefList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: TableRef-              _hdIidens :: ([(String,([(String,Type)],[(String,Type)]))])-              _hdIjoinIdens :: ([String])-              _tlIannotatedTree :: TableRefList-              _tlIidens :: ([(String,([(String,Type)],[(String,Type)]))])-              _tlIjoinIdens :: ([String])-              -- "./TypeChecking.ag"(line 527, column 12)-              _lhsOidens =-                  {-# LINE 527 "./TypeChecking.ag" #-}-                  _hdIidens-                  {-# LINE 8481 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 528, column 12)-              _lhsOjoinIdens =-                  {-# LINE 528 "./TypeChecking.ag" #-}-                  _hdIjoinIdens-                  {-# LINE 8486 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 8491 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 8496 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8501 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8506 "AstInternal.hs" #-}-              ( _hdIannotatedTree,_hdIidens,_hdIjoinIdens) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree,_tlIidens,_tlIjoinIdens) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree,_lhsOidens,_lhsOjoinIdens)))-sem_TableRefList_Nil :: T_TableRefList -sem_TableRefList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOidens :: ([(String,([(String,Type)],[(String,Type)]))])-              _lhsOjoinIdens :: ([String])-              _lhsOannotatedTree :: TableRefList-              -- "./TypeChecking.ag"(line 530, column 9)-              _lhsOidens =-                  {-# LINE 530 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 8522 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 531, column 9)-              _lhsOjoinIdens =-                  {-# LINE 531 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 8527 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 8532 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 8537 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOidens,_lhsOjoinIdens)))--- TypeAttributeDef ---------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         attrName             : String-         namedType            : Type-   alternatives:-      alternative TypeAttDef:-         child ann            : {Annotation}-         child name           : {String}-         child typ            : TypeName -         visit 0:-            local annotatedTree : _--}-data TypeAttributeDef  = TypeAttDef (Annotation) (String) (TypeName) -                       deriving ( Data,Eq,Show,Typeable)--- cata-sem_TypeAttributeDef :: TypeAttributeDef  ->-                        T_TypeAttributeDef -sem_TypeAttributeDef (TypeAttDef _ann _name _typ )  =-    (sem_TypeAttributeDef_TypeAttDef _ann _name (sem_TypeName _typ ) )--- semantic domain-type T_TypeAttributeDef  = Environment ->-                           ( TypeAttributeDef,String,Type)-data Inh_TypeAttributeDef  = Inh_TypeAttributeDef {env_Inh_TypeAttributeDef :: Environment}-data Syn_TypeAttributeDef  = Syn_TypeAttributeDef {annotatedTree_Syn_TypeAttributeDef :: TypeAttributeDef,attrName_Syn_TypeAttributeDef :: String,namedType_Syn_TypeAttributeDef :: Type}-wrap_TypeAttributeDef :: T_TypeAttributeDef  ->-                         Inh_TypeAttributeDef  ->-                         Syn_TypeAttributeDef -wrap_TypeAttributeDef sem (Inh_TypeAttributeDef _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOattrName,_lhsOnamedType) =-             (sem _lhsIenv )-     in  (Syn_TypeAttributeDef _lhsOannotatedTree _lhsOattrName _lhsOnamedType ))-sem_TypeAttributeDef_TypeAttDef :: Annotation ->-                                   String ->-                                   T_TypeName  ->-                                   T_TypeAttributeDef -sem_TypeAttributeDef_TypeAttDef ann_ name_ typ_  =-    (\ _lhsIenv ->-         (let _lhsOattrName :: String-              _lhsOnamedType :: Type-              _lhsOannotatedTree :: TypeAttributeDef-              _typOenv :: Environment-              _typIannotatedTree :: TypeName-              _typInamedType :: Type-              -- "./TypeChecking.ag"(line 846, column 9)-              _lhsOattrName =-                  {-# LINE 846 "./TypeChecking.ag" #-}-                  name_-                  {-# LINE 8591 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 847, column 9)-              _lhsOnamedType =-                  {-# LINE 847 "./TypeChecking.ag" #-}-                  _typInamedType-                  {-# LINE 8596 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  TypeAttDef ann_ name_ _typIannotatedTree-                  {-# LINE 8601 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 8606 "AstInternal.hs" #-}-              -- copy rule (down)-              _typOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8611 "AstInternal.hs" #-}-              ( _typIannotatedTree,_typInamedType) =-                  (typ_ _typOenv )-          in  ( _lhsOannotatedTree,_lhsOattrName,_lhsOnamedType)))--- TypeAttributeDefList -----------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         attrs                : [(String, Type)]-   alternatives:-      alternative Cons:-         child hd             : TypeAttributeDef -         child tl             : TypeAttributeDefList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type TypeAttributeDefList  = [(TypeAttributeDef)]--- cata-sem_TypeAttributeDefList :: TypeAttributeDefList  ->-                            T_TypeAttributeDefList -sem_TypeAttributeDefList list  =-    (Prelude.foldr sem_TypeAttributeDefList_Cons sem_TypeAttributeDefList_Nil (Prelude.map sem_TypeAttributeDef list) )--- semantic domain-type T_TypeAttributeDefList  = Environment ->-                               ( TypeAttributeDefList,([(String, Type)]))-data Inh_TypeAttributeDefList  = Inh_TypeAttributeDefList {env_Inh_TypeAttributeDefList :: Environment}-data Syn_TypeAttributeDefList  = Syn_TypeAttributeDefList {annotatedTree_Syn_TypeAttributeDefList :: TypeAttributeDefList,attrs_Syn_TypeAttributeDefList :: [(String, Type)]}-wrap_TypeAttributeDefList :: T_TypeAttributeDefList  ->-                             Inh_TypeAttributeDefList  ->-                             Syn_TypeAttributeDefList -wrap_TypeAttributeDefList sem (Inh_TypeAttributeDefList _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOattrs) =-             (sem _lhsIenv )-     in  (Syn_TypeAttributeDefList _lhsOannotatedTree _lhsOattrs ))-sem_TypeAttributeDefList_Cons :: T_TypeAttributeDef  ->-                                 T_TypeAttributeDefList  ->-                                 T_TypeAttributeDefList -sem_TypeAttributeDefList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOattrs :: ([(String, Type)])-              _lhsOannotatedTree :: TypeAttributeDefList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: TypeAttributeDef-              _hdIattrName :: String-              _hdInamedType :: Type-              _tlIannotatedTree :: TypeAttributeDefList-              _tlIattrs :: ([(String, Type)])-              -- "./TypeChecking.ag"(line 852, column 12)-              _lhsOattrs =-                  {-# LINE 852 "./TypeChecking.ag" #-}-                  (_hdIattrName, _hdInamedType) : _tlIattrs-                  {-# LINE 8669 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 8674 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 8679 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8684 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8689 "AstInternal.hs" #-}-              ( _hdIannotatedTree,_hdIattrName,_hdInamedType) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree,_tlIattrs) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree,_lhsOattrs)))-sem_TypeAttributeDefList_Nil :: T_TypeAttributeDefList -sem_TypeAttributeDefList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOattrs :: ([(String, Type)])-              _lhsOannotatedTree :: TypeAttributeDefList-              -- "./TypeChecking.ag"(line 853, column 11)-              _lhsOattrs =-                  {-# LINE 853 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 8704 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 8709 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 8714 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOattrs)))--- TypeName -----------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         namedType            : Type-   alternatives:-      alternative ArrayTypeName:-         child ann            : {Annotation}-         child typ            : TypeName -         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative PrecTypeName:-         child ann            : {Annotation}-         child tn             : {String}-         child prec           : {Integer}-         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative SetOfTypeName:-         child ann            : {Annotation}-         child typ            : TypeName -         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _-      alternative SimpleTypeName:-         child ann            : {Annotation}-         child tn             : {String}-         visit 0:-            local tpe         : _-            local backTree    : _-            local annotatedTree : _--}-data TypeName  = ArrayTypeName (Annotation) (TypeName) -               | PrecTypeName (Annotation) (String) (Integer) -               | SetOfTypeName (Annotation) (TypeName) -               | SimpleTypeName (Annotation) (String) -               deriving ( Data,Eq,Show,Typeable)--- cata-sem_TypeName :: TypeName  ->-                T_TypeName -sem_TypeName (ArrayTypeName _ann _typ )  =-    (sem_TypeName_ArrayTypeName _ann (sem_TypeName _typ ) )-sem_TypeName (PrecTypeName _ann _tn _prec )  =-    (sem_TypeName_PrecTypeName _ann _tn _prec )-sem_TypeName (SetOfTypeName _ann _typ )  =-    (sem_TypeName_SetOfTypeName _ann (sem_TypeName _typ ) )-sem_TypeName (SimpleTypeName _ann _tn )  =-    (sem_TypeName_SimpleTypeName _ann _tn )--- semantic domain-type T_TypeName  = Environment ->-                   ( TypeName,Type)-data Inh_TypeName  = Inh_TypeName {env_Inh_TypeName :: Environment}-data Syn_TypeName  = Syn_TypeName {annotatedTree_Syn_TypeName :: TypeName,namedType_Syn_TypeName :: Type}-wrap_TypeName :: T_TypeName  ->-                 Inh_TypeName  ->-                 Syn_TypeName -wrap_TypeName sem (Inh_TypeName _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOnamedType) =-             (sem _lhsIenv )-     in  (Syn_TypeName _lhsOannotatedTree _lhsOnamedType ))-sem_TypeName_ArrayTypeName :: Annotation ->-                              T_TypeName  ->-                              T_TypeName -sem_TypeName_ArrayTypeName ann_ typ_  =-    (\ _lhsIenv ->-         (let _lhsOnamedType :: Type-              _lhsOannotatedTree :: TypeName-              _typOenv :: Environment-              _typIannotatedTree :: TypeName-              _typInamedType :: Type-              -- "./TypeChecking.ag"(line 136, column 10)-              _lhsOnamedType =-                  {-# LINE 136 "./TypeChecking.ag" #-}-                  errorToTypeFail _tpe-                  {-# LINE 8797 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 137, column 10)-              _lhsOannotatedTree =-                  {-# LINE 137 "./TypeChecking.ag" #-}-                  updateAnnotation-                    ((map TypeErrorA $ getErrors _tpe    ) ++)-                    _backTree-                  {-# LINE 8804 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 147, column 9)-              _tpe =-                  {-# LINE 147 "./TypeChecking.ag" #-}-                  chainTypeCheckFailed [_typInamedType] $ Right $ ArrayType _typInamedType-                  {-# LINE 8809 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 148, column 9)-              _backTree =-                  {-# LINE 148 "./TypeChecking.ag" #-}-                  ArrayTypeName ann_ _typIannotatedTree-                  {-# LINE 8814 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  ArrayTypeName ann_ _typIannotatedTree-                  {-# LINE 8819 "AstInternal.hs" #-}-              -- copy rule (down)-              _typOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8824 "AstInternal.hs" #-}-              ( _typIannotatedTree,_typInamedType) =-                  (typ_ _typOenv )-          in  ( _lhsOannotatedTree,_lhsOnamedType)))-sem_TypeName_PrecTypeName :: Annotation ->-                             String ->-                             Integer ->-                             T_TypeName -sem_TypeName_PrecTypeName ann_ tn_ prec_  =-    (\ _lhsIenv ->-         (let _lhsOnamedType :: Type-              _lhsOannotatedTree :: TypeName-              -- "./TypeChecking.ag"(line 136, column 10)-              _lhsOnamedType =-                  {-# LINE 136 "./TypeChecking.ag" #-}-                  errorToTypeFail _tpe-                  {-# LINE 8840 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 137, column 10)-              _lhsOannotatedTree =-                  {-# LINE 137 "./TypeChecking.ag" #-}-                  updateAnnotation-                    ((map TypeErrorA $ getErrors _tpe    ) ++)-                    _backTree-                  {-# LINE 8847 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 153, column 9)-              _tpe =-                  {-# LINE 153 "./TypeChecking.ag" #-}-                  Right TypeCheckFailed-                  {-# LINE 8852 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 154, column 9)-              _backTree =-                  {-# LINE 154 "./TypeChecking.ag" #-}-                  PrecTypeName ann_ tn_ prec_-                  {-# LINE 8857 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  PrecTypeName ann_ tn_ prec_-                  {-# LINE 8862 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOnamedType)))-sem_TypeName_SetOfTypeName :: Annotation ->-                              T_TypeName  ->-                              T_TypeName -sem_TypeName_SetOfTypeName ann_ typ_  =-    (\ _lhsIenv ->-         (let _lhsOnamedType :: Type-              _lhsOannotatedTree :: TypeName-              _typOenv :: Environment-              _typIannotatedTree :: TypeName-              _typInamedType :: Type-              -- "./TypeChecking.ag"(line 136, column 10)-              _lhsOnamedType =-                  {-# LINE 136 "./TypeChecking.ag" #-}-                  errorToTypeFail _tpe-                  {-# LINE 8878 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 137, column 10)-              _lhsOannotatedTree =-                  {-# LINE 137 "./TypeChecking.ag" #-}-                  updateAnnotation-                    ((map TypeErrorA $ getErrors _tpe    ) ++)-                    _backTree-                  {-# LINE 8885 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 150, column 9)-              _tpe =-                  {-# LINE 150 "./TypeChecking.ag" #-}-                  chainTypeCheckFailed [_typInamedType] $ Right $ SetOfType _typInamedType-                  {-# LINE 8890 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 151, column 9)-              _backTree =-                  {-# LINE 151 "./TypeChecking.ag" #-}-                  SetOfTypeName ann_ _typIannotatedTree-                  {-# LINE 8895 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  SetOfTypeName ann_ _typIannotatedTree-                  {-# LINE 8900 "AstInternal.hs" #-}-              -- copy rule (down)-              _typOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 8905 "AstInternal.hs" #-}-              ( _typIannotatedTree,_typInamedType) =-                  (typ_ _typOenv )-          in  ( _lhsOannotatedTree,_lhsOnamedType)))-sem_TypeName_SimpleTypeName :: Annotation ->-                               String ->-                               T_TypeName -sem_TypeName_SimpleTypeName ann_ tn_  =-    (\ _lhsIenv ->-         (let _lhsOnamedType :: Type-              _lhsOannotatedTree :: TypeName-              -- "./TypeChecking.ag"(line 136, column 10)-              _lhsOnamedType =-                  {-# LINE 136 "./TypeChecking.ag" #-}-                  errorToTypeFail _tpe-                  {-# LINE 8920 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 137, column 10)-              _lhsOannotatedTree =-                  {-# LINE 137 "./TypeChecking.ag" #-}-                  updateAnnotation-                    ((map TypeErrorA $ getErrors _tpe    ) ++)-                    _backTree-                  {-# LINE 8927 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 144, column 9)-              _tpe =-                  {-# LINE 144 "./TypeChecking.ag" #-}-                  envLookupType _lhsIenv $ canonicalizeTypeName tn_-                  {-# LINE 8932 "AstInternal.hs" #-}-              -- "./TypeChecking.ag"(line 145, column 9)-              _backTree =-                  {-# LINE 145 "./TypeChecking.ag" #-}-                  SimpleTypeName ann_ tn_-                  {-# LINE 8937 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  SimpleTypeName ann_ tn_-                  {-# LINE 8942 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOnamedType)))--- VarDef -------------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         def                  : (String,Type)-   alternatives:-      alternative VarDef:-         child ann            : {Annotation}-         child name           : {String}-         child typ            : TypeName -         child value          : {Maybe Expression}-         visit 0:-            local annotatedTree : _--}-data VarDef  = VarDef (Annotation) (String) (TypeName) (Maybe Expression) -             deriving ( Data,Eq,Show,Typeable)--- cata-sem_VarDef :: VarDef  ->-              T_VarDef -sem_VarDef (VarDef _ann _name _typ _value )  =-    (sem_VarDef_VarDef _ann _name (sem_TypeName _typ ) _value )--- semantic domain-type T_VarDef  = Environment ->-                 ( VarDef,((String,Type)))-data Inh_VarDef  = Inh_VarDef {env_Inh_VarDef :: Environment}-data Syn_VarDef  = Syn_VarDef {annotatedTree_Syn_VarDef :: VarDef,def_Syn_VarDef :: (String,Type)}-wrap_VarDef :: T_VarDef  ->-               Inh_VarDef  ->-               Syn_VarDef -wrap_VarDef sem (Inh_VarDef _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOdef) =-             (sem _lhsIenv )-     in  (Syn_VarDef _lhsOannotatedTree _lhsOdef ))-sem_VarDef_VarDef :: Annotation ->-                     String ->-                     T_TypeName  ->-                     (Maybe Expression) ->-                     T_VarDef -sem_VarDef_VarDef ann_ name_ typ_ value_  =-    (\ _lhsIenv ->-         (let _lhsOdef :: ((String,Type))-              _lhsOannotatedTree :: VarDef-              _typOenv :: Environment-              _typIannotatedTree :: TypeName-              _typInamedType :: Type-              -- "./TypeChecking.ag"(line 950, column 14)-              _lhsOdef =-                  {-# LINE 950 "./TypeChecking.ag" #-}-                  (name_, _typInamedType)-                  {-# LINE 8996 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  VarDef ann_ name_ _typIannotatedTree value_-                  {-# LINE 9001 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 9006 "AstInternal.hs" #-}-              -- copy rule (down)-              _typOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 9011 "AstInternal.hs" #-}-              ( _typIannotatedTree,_typInamedType) =-                  (typ_ _typOenv )-          in  ( _lhsOannotatedTree,_lhsOdef)))--- VarDefList ---------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attributes:-         annotatedTree        : SELF -         defs                 : [(String,Type)]-   alternatives:-      alternative Cons:-         child hd             : VarDef -         child tl             : VarDefList -         visit 0:-            local annotatedTree : _-      alternative Nil:-         visit 0:-            local annotatedTree : _--}-type VarDefList  = [(VarDef)]--- cata-sem_VarDefList :: VarDefList  ->-                  T_VarDefList -sem_VarDefList list  =-    (Prelude.foldr sem_VarDefList_Cons sem_VarDefList_Nil (Prelude.map sem_VarDef list) )--- semantic domain-type T_VarDefList  = Environment ->-                     ( VarDefList,([(String,Type)]))-data Inh_VarDefList  = Inh_VarDefList {env_Inh_VarDefList :: Environment}-data Syn_VarDefList  = Syn_VarDefList {annotatedTree_Syn_VarDefList :: VarDefList,defs_Syn_VarDefList :: [(String,Type)]}-wrap_VarDefList :: T_VarDefList  ->-                   Inh_VarDefList  ->-                   Syn_VarDefList -wrap_VarDefList sem (Inh_VarDefList _lhsIenv )  =-    (let ( _lhsOannotatedTree,_lhsOdefs) =-             (sem _lhsIenv )-     in  (Syn_VarDefList _lhsOannotatedTree _lhsOdefs ))-sem_VarDefList_Cons :: T_VarDef  ->-                       T_VarDefList  ->-                       T_VarDefList -sem_VarDefList_Cons hd_ tl_  =-    (\ _lhsIenv ->-         (let _lhsOdefs :: ([(String,Type)])-              _lhsOannotatedTree :: VarDefList-              _hdOenv :: Environment-              _tlOenv :: Environment-              _hdIannotatedTree :: VarDef-              _hdIdef :: ((String,Type))-              _tlIannotatedTree :: VarDefList-              _tlIdefs :: ([(String,Type)])-              -- "./TypeChecking.ag"(line 953, column 12)-              _lhsOdefs =-                  {-# LINE 953 "./TypeChecking.ag" #-}-                  _hdIdef : _tlIdefs-                  {-# LINE 9068 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  (:) _hdIannotatedTree _tlIannotatedTree-                  {-# LINE 9073 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 9078 "AstInternal.hs" #-}-              -- copy rule (down)-              _hdOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 9083 "AstInternal.hs" #-}-              -- copy rule (down)-              _tlOenv =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _lhsIenv-                  {-# LINE 9088 "AstInternal.hs" #-}-              ( _hdIannotatedTree,_hdIdef) =-                  (hd_ _hdOenv )-              ( _tlIannotatedTree,_tlIdefs) =-                  (tl_ _tlOenv )-          in  ( _lhsOannotatedTree,_lhsOdefs)))-sem_VarDefList_Nil :: T_VarDefList -sem_VarDefList_Nil  =-    (\ _lhsIenv ->-         (let _lhsOdefs :: ([(String,Type)])-              _lhsOannotatedTree :: VarDefList-              -- "./TypeChecking.ag"(line 954, column 11)-              _lhsOdefs =-                  {-# LINE 954 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 9103 "AstInternal.hs" #-}-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  []-                  {-# LINE 9108 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 9113 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree,_lhsOdefs)))--- Volatility ---------------------------------------------------{--   visit 0:-      inherited attribute:-         env                  : Environment-      synthesized attribute:-         annotatedTree        : SELF -   alternatives:-      alternative Immutable:-         visit 0:-            local annotatedTree : _-      alternative Stable:-         visit 0:-            local annotatedTree : _-      alternative Volatile:-         visit 0:-            local annotatedTree : _--}-data Volatility  = Immutable -                 | Stable -                 | Volatile -                 deriving ( Data,Eq,Show,Typeable)--- cata-sem_Volatility :: Volatility  ->-                  T_Volatility -sem_Volatility (Immutable )  =-    (sem_Volatility_Immutable )-sem_Volatility (Stable )  =-    (sem_Volatility_Stable )-sem_Volatility (Volatile )  =-    (sem_Volatility_Volatile )--- semantic domain-type T_Volatility  = Environment ->-                     ( Volatility)-data Inh_Volatility  = Inh_Volatility {env_Inh_Volatility :: Environment}-data Syn_Volatility  = Syn_Volatility {annotatedTree_Syn_Volatility :: Volatility}-wrap_Volatility :: T_Volatility  ->-                   Inh_Volatility  ->-                   Syn_Volatility -wrap_Volatility sem (Inh_Volatility _lhsIenv )  =-    (let ( _lhsOannotatedTree) =-             (sem _lhsIenv )-     in  (Syn_Volatility _lhsOannotatedTree ))-sem_Volatility_Immutable :: T_Volatility -sem_Volatility_Immutable  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Volatility-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Immutable-                  {-# LINE 9166 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 9171 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_Volatility_Stable :: T_Volatility -sem_Volatility_Stable  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Volatility-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Stable-                  {-# LINE 9181 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 9186 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))-sem_Volatility_Volatile :: T_Volatility -sem_Volatility_Volatile  =-    (\ _lhsIenv ->-         (let _lhsOannotatedTree :: Volatility-              -- self rule-              _annotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  Volatile-                  {-# LINE 9196 "AstInternal.hs" #-}-              -- self rule-              _lhsOannotatedTree =-                  {-# LINE 56 "./TypeChecking.ag" #-}-                  _annotatedTree-                  {-# LINE 9201 "AstInternal.hs" #-}-          in  ( _lhsOannotatedTree)))+++-- UUAGC 0.9.11 (AstInternal.ag)+module Database.HsSqlPpp.AstInternals.AstInternal(+    -- {-# LANGUAGE DeriveDataTypeable,RankNTypes,ScopedTypeVariables #-}+    -- {-# OPTIONS_HADDOCK hide  #-}+    --from the ag files:+    --ast nodes+    Statement (..)+   ,SelectExpression (..)+   ,FnBody (..)+   ,SetClause (..)+   ,TableRef (..)+   ,TableAlias(..)+   ,JoinExpression (..)+   ,JoinType (..)+   ,SelectList (..)+   ,SelectItem (..)+   ,CopySource (..)+   ,AttributeDef (..)+   ,RowConstraint (..)+   ,AlterTableAction(..)+   ,Constraint (..)+   ,TypeAttributeDef (..)+   ,ParamDef (..)+   ,VarDef (..)+   ,RaiseType (..)+   ,CombineType (..)+   ,Volatility (..)+   ,Language (..)+   ,TypeName (..)+   ,DropType (..)+   ,Cascade (..)+   ,Direction (..)+   ,Distinct (..)+   ,Natural (..)+   ,IfExists (..)+   ,RestartIdentity (..)+   ,Expression (..)+   ,FrameClause(..)+   ,InList (..)+   ,LiftFlavour(..)+   ,TriggerWhen(..)+   ,TriggerEvent(..)+   ,TriggerFire(..)+   ,StatementList+   ,ExpressionListStatementListPairList+   ,ExpressionListStatementListPair+   ,ExpressionList+   ,StringList+   ,ParamDefList+   ,AttributeDefList+   ,ConstraintList+   ,TypeAttributeDefList+   ,TypeNameList+   ,StringTypeNameListPair+   ,StringTypeNameListPairList+   ,ExpressionStatementListPairList+   ,SetClauseList+   ,CaseExpressionListExpressionPairList+   ,MaybeExpression+   ,TableRefList+   ,ExpressionListList+   ,SelectItemList+   ,OnExpr+   ,RowConstraintList+   ,VarDefList+   ,ExpressionStatementListPair+   ,CaseExpressionListExpressionPair+   ,CaseExpressionList+   ,ExpressionDirectionPair+   ,ExpressionDirectionPairList+   ,MaybeBoolExpression+   ,MaybeSelectList+   ,SetValue(..)+   -- typechecking+   ,typeCheck+   ,typeCheckPS+   ,typeCheckExpression+) where++import Data.Maybe+import Data.List+import Debug.Trace+import Control.Monad.Error+import Control.Arrow+import Data.Either+import Control.Applicative+import Data.Generics+import Data.Char++import Database.HsSqlPpp.AstInternals.TypeType+import Database.HsSqlPpp.AstInternals.TypeChecking.TypeConversion+import Database.HsSqlPpp.AstInternals.TypeChecking.ErrorUtils+import Database.HsSqlPpp.AstInternals.AstAnnotation+import Database.HsSqlPpp.AstInternals.Environment.EnvironmentInternal+import Database.HsSqlPpp.AstInternals.Environment.LocalIdentifierBindings+import Database.HsSqlPpp.AstInternals.Environment.DefaultTemplate1Environment+import Database.HsSqlPpp.Utils+import Data.Generics.PlateData+++{-# LINE 683 "AstInternal.ag" #-}++{-+-- | Type check multiple asts, allowing type checking references in+--   later files to definitions in earlier files. This is probably+--   more straightforward if you parse the files then concatenate the+--   statementlists together before type checking rather than using+--   this function+typeCheckMany :: Environment -> [StatementList] -> [StatementList]+typeCheckMany env sts =+    annInt env sts []+    where+      annInt e (s:ss) ress =+          let (e1,res) = typeCheck e s+          in annInt e1 ss (res:ress)+      annInt _ [] ress = reverse ress+-}++-- | Takes an ast, checks against catalog passed, and adds+--   annotations, including types, type errors, and statement info.+--   Returns the updated catalog as well as the annotated ast.+typeCheck :: Environment -> StatementList -> (Environment,StatementList)+typeCheck env sts =+    let t = sem_Root (Root (fixupImplicitJoins sts))+        ta = wrap_Root t Inh_Root {env_Inh_Root = env+                                  ,lib_Inh_Root = emptyBindings}+        tl = annotatedTree_Syn_Root ta+        env1 = producedEnv_Syn_Root ta+   in case tl of+         Root r -> (env1,r)++-- | Unfinished version of type check which can type check an+-- individual statement with ? or positional arg placeholders in+-- it. Will error if the statement isn't select, update, insert or+-- delete. For use in type checking embedded parameterized+-- statements. Does all typechecking and annotation that the regular+-- typecheck does.+typeCheckPS :: Environment -> Statement -> Either String Statement+typeCheckPS env st =+    case st of+      SelectStatement _ _ -> tc+      Insert _ _ _ _ _ -> tc+      Update _ _ _ _ _ -> tc+      Delete _ _ _ _ -> tc+      _ -> Left "requires select, update, insert or delete statement"+    where+      tc = let t = sem_Root (Root (fixupImplicitJoins [st]))+               ta = wrap_Root t Inh_Root {env_Inh_Root = env+                                         ,lib_Inh_Root = emptyBindings}+               tl = annotatedTree_Syn_Root ta+               env1 = producedEnv_Syn_Root ta+           in case tl of+                Root [st1] -> Right st1+                _ -> error "impossible happened in typeCheckPS!"+++-- | Testing utility, mainly used to check an expression for type errors+-- or to get its type.+typeCheckExpression :: Environment -> Expression -> Expression+typeCheckExpression env ex =+    let t = sem_ExpressionRoot (ExpressionRoot (fixupImplicitJoins ex))+        rt = (annotatedTree_Syn_ExpressionRoot+              (wrap_ExpressionRoot t Inh_ExpressionRoot {env_Inh_ExpressionRoot = env+                                                        ,lib_Inh_ExpressionRoot = emptyBindings}))+    in case rt of+         ExpressionRoot e -> e++{-+bit of a hack, to avoid rewriting the tableref type checking to be+able to do implicit joins, we just convert them in to the equivalent+explicit join+-}++fixupImplicitJoins :: Data a => a -> a+fixupImplicitJoins =+    transformBi $ \x ->+            case x of+              -- alter asts to change implicit joins into explicit joins+              Select an dis sl trs@(_:_:_) whr grp hav ord lim off+                  -> Select an dis sl [convTrefs trs] whr grp hav ord lim off+              x1 -> x1+    where+      convTrefs (tr:tr1:trs) = JoinedTref [] tr Unnatural Cross (convTrefs (tr1:trs)) Nothing NoAlias+      convTrefs (tr:[]) = tr+      convTrefs _ = error "failed doing implicit join fixup hack"+{-# LINE 189 "AstInternal.hs" #-}++{-# LINE 81 "./TypeChecking/Misc.ag" #-}++{-+================================================================================++= couple of small utils++I think this should be alright, an identifier referenced in an+expression can only have zero or one dot in it.+-}++splitIdentifier :: String -> (String,String)+splitIdentifier s = let (a,b) = span (/= '.') s+                    in if b == ""+                         then ("", a)+                         else (a,tail b)++{-+helper to make adding annotations a bit easier+-}++annTypesAndErrors :: Data a => a -> Type -> [TypeError]+                  -> Maybe [AnnotationElement] -> a+annTypesAndErrors item nt errs add =+    updateAnnotation modifier item+    where+      modifier = (([TypeAnnotation nt] ++ fromMaybe [] add +++       map TypeErrorA errs) ++)++{-# LINE 220 "AstInternal.hs" #-}++{-# LINE 78 "./TypeChecking/Expressions.ag" #-}++{-++small shim in front of findCallMatch in the type conversion code, to+handle some special cases.++Some of the special cases will no longer be needed when variadic+support is added.++between, greatest and least are treated as syntactic sugar so we+delegate the function lookups to the <=/>= operators.++the row comparison should be more general than this, since it supports+any operator satisfying some properties+++TODO: move all of this into find call match. Don't know why it's separate+-}+typeCheckFunCall :: Environment -> String -> [Type] -> Either [TypeError] Type+typeCheckFunCall env fnName' argsType =+    {-trace ("typecheckfncall " ++ fnName' ++ show argsType) $-}+    dependsOnRTpe argsType $+      case fnName of+              "count" -> -- not quite sure how this is suppose to work,+                         -- the counts in the pg catalog accept either+                         -- no args, or one arg of type any, but you can call+                         -- count with multiple arguments?+                         return typeBigInt+              "!between" -> do+                    f1 <- lookupFn ">=" [argsType !! 0, argsType !! 1]+                    f2 <- lookupFn "<=" [argsType !! 0, argsType !! 2]+                    lookupFn "!and" [f1,f2]+              --"coalesce" -> resolveResultSetType env argsType+              "greatest" -> do+                    t <- lookupFn fnName argsType -- t <- resolveResultSetType env argsType+                    lookupFn ">=" [t,t]+                    return t+              "least" -> do+                    t <- lookupFn fnName argsType -- resolveResultSetType env argsType+                    lookupFn "<=" [t,t]+                    return t+              "!rowctor" -> return $ AnonymousRecordType argsType+                    -- special case the row comparison ops+                    -- this needs to be fixed: we want to match+                    -- any implicit casts to functions on composite types+                    -- first, then we can use the anonymous record type on+                    -- any composite+              _ | fnName `elem` ["=", "<>", "<=", ">=", "<", ">"]+                         && length argsType == 2+                         && all isCompositeOrSetOfCompositeType argsType+                         && compositesCompatible env (head argsType) (head $ tail argsType) -> Right typeBool+              --checked for all special cases, so run general case now+              s -> lookupFn s argsType+    where+      lookupFn :: String -> [Type] -> Either [TypeError] Type+      lookupFn s1 args = do+        (_,_,r,_) <- findCallMatch env+                             (if s1 == "u-" then "-" else s1) args+        return r+      checkRowTypesMatch (AnonymousRecordType t1s) (AnonymousRecordType t2s) = do+        when (length t1s /= length t2s) $ Left [ValuesListsMustBeSameLength]+        let errs = map (resolveResultSetType env . (\(a,b) -> [a,b])) $+                     zip t1s t2s+        liftErrors $ concat $ lefts errs+        return typeBool+      checkRowTypesMatch x y  =+        error $ "internal error: checkRowTypesMatch called with " +++                show x ++ "," ++ show y+      fnName = map toLower fnName'+{-# LINE 292 "AstInternal.hs" #-}++{-# LINE 141 "./TypeChecking/SelectStatement.ag" #-}+++typeCheckValuesExpr :: Environment -> [[Type]] -> Either [TypeError] Type+typeCheckValuesExpr env rowsTs =+        let colNames = zipWith (++)+                           (repeat "column")+                           (map show [1..length $ head rowsTs])+        in unionRelTypes env rowsTs colNames+++typeCheckCombineSelect :: Environment -> Type -> Type -> Either [TypeError] Type+typeCheckCombineSelect env v1 v2 = do+    u1 <- unwrapSetOfComposite v1+    let colNames = map fst u1+    u2 <- unwrapSetOfComposite v2+    let colTypes1 = map snd u1+    let colTypes2 = map snd u2+    unionRelTypes env [colTypes1,colTypes2] colNames++unionRelTypes :: Environment -> [[Type]] -> [String] -> Either [TypeError] Type+unionRelTypes env rowsTs colNames =+  let lengths = map length rowsTs+  in case () of+             _ | null rowsTs ->+                   Left [NoRowsGivenForValues]+               | not (all (==head lengths) lengths) ->+                   Left [ValuesListsMustBeSameLength]+               | otherwise ->+                   --i don't think this propagates all the errors, just the first set+                   mapM (resolveResultSetType env) (transpose rowsTs) >>=+                     (return . SetOfType . CompositeType . zip colNames)++{-# LINE 327 "AstInternal.hs" #-}++{-# LINE 180 "./TypeChecking/SelectStatement.ag" #-}++getPlaceholders :: Data a => a -> [Expression]+getPlaceholders st =+    filter isPlaceholder $ everything (++) (mkQ [] ga) st+    where+      ga :: Expression -> [Expression]+      ga s = [s]+      isPlaceholder e = case e of+                          PositionalArg _ _ -> True+                          Placeholder _ -> True+                          _ -> False+{-# LINE 341 "AstInternal.hs" #-}++{-# LINE 200 "./TypeChecking/TableRefs.ag" #-}++{-+convert a function call into a [String,[(string,type)]] list for use+in a tableref context+first consideration is the alias: if there is an alias in the select,+e.g. select * from generate_series(1,2) x;  (alias is x)+we use that, otherwise we use the name of the function+second consideration is the attributes coming out, roughly speaking+we have to convert an arbitrary type to a relation type+if we have a relation valued function, we don't need to do anything+if we have a setof non composite, we lift the single type to an+attribute, using the function name for the attribute name+if we have a non setof, we lift the single type to an attribute and+then relation, using the function name for the attribute name+need to check to see what should happen with arrayof++-}+funIdens :: Environment -> String -> Expression -> Either [TypeError] (String,[(String,Type)])+funIdens env alias fnVal = do+   errorWhen (case fnVal of+                FunCall _ _ _ -> False+                _ -> True)+             [ContextError "FunCall"]+   let (FunCall _ fnName _) = fnVal+       correlationName = if alias /= ""+                           then alias+                           else fnName+   attrs <- do+     case getTypeAnnotation fnVal of+       SetOfType (NamedCompositeType t) -> envCompositePublicAttrs env [] t+       SetOfType x -> return [(correlationName,x)]+       y -> return [(correlationName,y)]+   return (correlationName, attrs)++getAlias :: String -> TableAlias -> String+getAlias def alias =+  case alias of+    NoAlias -> def+    TableAlias t -> t+    FullAlias t _ -> t++{-# LINE 385 "AstInternal.hs" #-}++{-# LINE 92 "./TypeChecking/SelectLists.ag" #-}++expandStar :: LocalIdentifierBindings+           -> String+           -> Type+           -> [(String,Type)]+           -> [(String,Type)]+expandStar env colName colType types =+    fromRight types $ do+    let (correlationName,iden) = splitIdentifier colName+    newCols <- if iden == "*"+                 then libExpandStar env correlationName+                 else return [(iden, colType)]+    return $ newCols ++ types++fixStar :: Expression -> Expression+fixStar =+    everywhere (mkT fixStar')+    where+      fixStar' :: Annotation -> Annotation+      fixStar' a =+          if TypeAnnotation TypeCheckFailed `elem` a+              && any (\an ->+                       case an of+                         TypeErrorA (UnrecognisedIdentifier x) |+                           let (_,iden) = splitIdentifier x+                           in iden == "*" -> True+                         _ -> False) a+             then filter (\an -> case an of+                                   TypeAnnotation TypeCheckFailed -> False+                                   TypeErrorA (UnrecognisedIdentifier _) -> False+                                   _ -> True) a+             else a+{-# LINE 420 "AstInternal.hs" #-}++{-# LINE 136 "./TypeChecking/Dml.ag" #-}++getRowTypes :: [Type] -> [Type]+getRowTypes [AnonymousRecordType ts] = ts+getRowTypes ts = ts+{-# LINE 427 "AstInternal.hs" #-}++{-# LINE 174 "./TypeChecking/Dml.ag" #-}+++--small shortcut to help produce better errors?+checkRelationExists :: Environment -> String -> Either [TypeError] ()+checkRelationExists env tbl =+    envCompositeDef env relationComposites tbl >>+    return ()++--used by both insert and update+checkColumnConsistency :: Environment ->  String -> [String] -> [(String,Type)]+                       -> Either [TypeError] [(String,Type)]+checkColumnConsistency env tbl cols' insNameTypePairs = do+  ttcols <- lowerize <$> envCompositePublicAttrs env [] tbl+  let cols = if null cols'+               then map fst ttcols+               else map (map toLower) cols'+  errorWhen (length insNameTypePairs /= length cols) [WrongNumberOfColumns]+  let nonMatchingColumns = cols \\ map fst ttcols+  errorWhen (not $ null nonMatchingColumns) $+       map UnrecognisedIdentifier nonMatchingColumns+  let targetNameTypePairs = map (\l -> (l,fromJust $ lookup l ttcols)) cols+        --check the types of the insdata match the column targets+        --name datatype columntype+      typeTriples = map (\((a,b),c) -> (a,b,c)) $+                    zip targetNameTypePairs $+                    map snd insNameTypePairs+      errs :: [TypeError]+      errs = concat $ lefts $+             map (\(_,b,c) -> checkAssignmentValid env c b) typeTriples+  liftErrors errs+  return targetNameTypePairs+  where+    lowerize = map (\(a,b) -> (map toLower a,b))++{-# LINE 464 "AstInternal.hs" #-}++{-# LINE 40 "./TypeChecking/CreateTable.ag" #-}++defaultSystemColumns :: [(String,Type)]+defaultSystemColumns = [("tableoid", ScalarType "oid")+                       ,("cmax", ScalarType "cid")+                       ,("xmax", ScalarType "xid")+                       ,("cmin", ScalarType "cid")+                       ,("xmin", ScalarType "xid")+                       ,("ctid", ScalarType "tid")]+{-# LINE 475 "AstInternal.hs" #-}+-- AlterTableAction --------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative AddConstraint:+         child ann            : {Annotation}+         child con            : Constraint +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative AlterColumnDefault:+         child ann            : {Annotation}+         child nm             : {String}+         child def            : Expression +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data AlterTableAction  = AddConstraint (Annotation) (Constraint) +                       | AlterColumnDefault (Annotation) (String) (Expression) +                       deriving ( Data,Eq,Show,Typeable)+-- cata+sem_AlterTableAction :: AlterTableAction  ->+                        T_AlterTableAction +sem_AlterTableAction (AddConstraint _ann _con )  =+    (sem_AlterTableAction_AddConstraint _ann (sem_Constraint _con ) )+sem_AlterTableAction (AlterColumnDefault _ann _nm _def )  =+    (sem_AlterTableAction_AlterColumnDefault _ann _nm (sem_Expression _def ) )+-- semantic domain+type T_AlterTableAction  = Environment ->+                           LocalIdentifierBindings ->+                           ( AlterTableAction,AlterTableAction)+data Inh_AlterTableAction  = Inh_AlterTableAction {env_Inh_AlterTableAction :: Environment,lib_Inh_AlterTableAction :: LocalIdentifierBindings}+data Syn_AlterTableAction  = Syn_AlterTableAction {annotatedTree_Syn_AlterTableAction :: AlterTableAction,originalTree_Syn_AlterTableAction :: AlterTableAction}+wrap_AlterTableAction :: T_AlterTableAction  ->+                         Inh_AlterTableAction  ->+                         Syn_AlterTableAction +wrap_AlterTableAction sem (Inh_AlterTableAction _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_AlterTableAction _lhsOannotatedTree _lhsOoriginalTree ))+sem_AlterTableAction_AddConstraint :: Annotation ->+                                      T_Constraint  ->+                                      T_AlterTableAction +sem_AlterTableAction_AddConstraint ann_ con_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: AlterTableAction+              _lhsOoriginalTree :: AlterTableAction+              _conOenv :: Environment+              _conOlib :: LocalIdentifierBindings+              _conIannotatedTree :: Constraint+              _conIoriginalTree :: Constraint+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  AddConstraint ann_ _conIannotatedTree+                  {-# LINE 539 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  AddConstraint ann_ _conIoriginalTree+                  {-# LINE 544 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 549 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 554 "AstInternal.hs" #-}+              -- copy rule (down)+              _conOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 559 "AstInternal.hs" #-}+              -- copy rule (down)+              _conOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 564 "AstInternal.hs" #-}+              ( _conIannotatedTree,_conIoriginalTree) =+                  (con_ _conOenv _conOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_AlterTableAction_AlterColumnDefault :: Annotation ->+                                           String ->+                                           T_Expression  ->+                                           T_AlterTableAction +sem_AlterTableAction_AlterColumnDefault ann_ nm_ def_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: AlterTableAction+              _lhsOoriginalTree :: AlterTableAction+              _defOenv :: Environment+              _defOlib :: LocalIdentifierBindings+              _defIannotatedTree :: Expression+              _defIliftedColumnName :: String+              _defIoriginalTree :: Expression+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  AlterColumnDefault ann_ nm_ _defIannotatedTree+                  {-# LINE 586 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  AlterColumnDefault ann_ nm_ _defIoriginalTree+                  {-# LINE 591 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 596 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 601 "AstInternal.hs" #-}+              -- copy rule (down)+              _defOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 606 "AstInternal.hs" #-}+              -- copy rule (down)+              _defOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 611 "AstInternal.hs" #-}+              ( _defIannotatedTree,_defIliftedColumnName,_defIoriginalTree) =+                  (def_ _defOenv _defOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- AttributeDef ------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         attrName             : String+         namedType            : Type+         originalTree         : SELF +   alternatives:+      alternative AttributeDef:+         child ann            : {Annotation}+         child name           : {String}+         child typ            : TypeName +         child def            : MaybeExpression +         child cons           : RowConstraintList +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data AttributeDef  = AttributeDef (Annotation) (String) (TypeName) (MaybeExpression) (RowConstraintList) +                   deriving ( Data,Eq,Show,Typeable)+-- cata+sem_AttributeDef :: AttributeDef  ->+                    T_AttributeDef +sem_AttributeDef (AttributeDef _ann _name _typ _def _cons )  =+    (sem_AttributeDef_AttributeDef _ann _name (sem_TypeName _typ ) (sem_MaybeExpression _def ) (sem_RowConstraintList _cons ) )+-- semantic domain+type T_AttributeDef  = Environment ->+                       LocalIdentifierBindings ->+                       ( AttributeDef,String,Type,AttributeDef)+data Inh_AttributeDef  = Inh_AttributeDef {env_Inh_AttributeDef :: Environment,lib_Inh_AttributeDef :: LocalIdentifierBindings}+data Syn_AttributeDef  = Syn_AttributeDef {annotatedTree_Syn_AttributeDef :: AttributeDef,attrName_Syn_AttributeDef :: String,namedType_Syn_AttributeDef :: Type,originalTree_Syn_AttributeDef :: AttributeDef}+wrap_AttributeDef :: T_AttributeDef  ->+                     Inh_AttributeDef  ->+                     Syn_AttributeDef +wrap_AttributeDef sem (Inh_AttributeDef _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOattrName,_lhsOnamedType,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_AttributeDef _lhsOannotatedTree _lhsOattrName _lhsOnamedType _lhsOoriginalTree ))+sem_AttributeDef_AttributeDef :: Annotation ->+                                 String ->+                                 T_TypeName  ->+                                 T_MaybeExpression  ->+                                 T_RowConstraintList  ->+                                 T_AttributeDef +sem_AttributeDef_AttributeDef ann_ name_ typ_ def_ cons_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOattrName :: String+              _lhsOnamedType :: Type+              _consOlib :: LocalIdentifierBindings+              _lhsOannotatedTree :: AttributeDef+              _lhsOoriginalTree :: AttributeDef+              _typOenv :: Environment+              _typOlib :: LocalIdentifierBindings+              _defOenv :: Environment+              _defOlib :: LocalIdentifierBindings+              _consOenv :: Environment+              _typIannotatedTree :: TypeName+              _typInamedType :: Type+              _typIoriginalTree :: TypeName+              _defIannotatedTree :: MaybeExpression+              _defIoriginalTree :: MaybeExpression+              _consIannotatedTree :: RowConstraintList+              _consIoriginalTree :: RowConstraintList+              -- "./TypeChecking/CreateTable.ag"(line 79, column 9)+              _lhsOattrName =+                  {-# LINE 79 "./TypeChecking/CreateTable.ag" #-}+                  map toLower name_+                  {-# LINE 687 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 80, column 9)+              _lhsOnamedType =+                  {-# LINE 80 "./TypeChecking/CreateTable.ag" #-}+                  _typInamedType+                  {-# LINE 692 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 95, column 9)+              _consOlib =+                  {-# LINE 95 "./TypeChecking/CreateTable.ag" #-}+                  case updateBindings _lhsIlib _lhsIenv+                           [LibStackIDs [("", [(name_, _typInamedType)])]] of+                    Left x -> error $ show x+                    Right e -> e+                  {-# LINE 700 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  AttributeDef ann_ name_ _typIannotatedTree _defIannotatedTree _consIannotatedTree+                  {-# LINE 705 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  AttributeDef ann_ name_ _typIoriginalTree _defIoriginalTree _consIoriginalTree+                  {-# LINE 710 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 715 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 720 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 725 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 730 "AstInternal.hs" #-}+              -- copy rule (down)+              _defOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 735 "AstInternal.hs" #-}+              -- copy rule (down)+              _defOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 740 "AstInternal.hs" #-}+              -- copy rule (down)+              _consOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 745 "AstInternal.hs" #-}+              ( _typIannotatedTree,_typInamedType,_typIoriginalTree) =+                  (typ_ _typOenv _typOlib )+              ( _defIannotatedTree,_defIoriginalTree) =+                  (def_ _defOenv _defOlib )+              ( _consIannotatedTree,_consIoriginalTree) =+                  (cons_ _consOenv _consOlib )+          in  ( _lhsOannotatedTree,_lhsOattrName,_lhsOnamedType,_lhsOoriginalTree)))+-- AttributeDefList --------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         attrs                : [(String, Type)]+         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : AttributeDef +         child tl             : AttributeDefList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type AttributeDefList  = [(AttributeDef)]+-- cata+sem_AttributeDefList :: AttributeDefList  ->+                        T_AttributeDefList +sem_AttributeDefList list  =+    (Prelude.foldr sem_AttributeDefList_Cons sem_AttributeDefList_Nil (Prelude.map sem_AttributeDef list) )+-- semantic domain+type T_AttributeDefList  = Environment ->+                           LocalIdentifierBindings ->+                           ( AttributeDefList,([(String, Type)]),AttributeDefList)+data Inh_AttributeDefList  = Inh_AttributeDefList {env_Inh_AttributeDefList :: Environment,lib_Inh_AttributeDefList :: LocalIdentifierBindings}+data Syn_AttributeDefList  = Syn_AttributeDefList {annotatedTree_Syn_AttributeDefList :: AttributeDefList,attrs_Syn_AttributeDefList :: [(String, Type)],originalTree_Syn_AttributeDefList :: AttributeDefList}+wrap_AttributeDefList :: T_AttributeDefList  ->+                         Inh_AttributeDefList  ->+                         Syn_AttributeDefList +wrap_AttributeDefList sem (Inh_AttributeDefList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOattrs,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_AttributeDefList _lhsOannotatedTree _lhsOattrs _lhsOoriginalTree ))+sem_AttributeDefList_Cons :: T_AttributeDef  ->+                             T_AttributeDefList  ->+                             T_AttributeDefList +sem_AttributeDefList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOattrs :: ([(String, Type)])+              _lhsOannotatedTree :: AttributeDefList+              _lhsOoriginalTree :: AttributeDefList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: AttributeDef+              _hdIattrName :: String+              _hdInamedType :: Type+              _hdIoriginalTree :: AttributeDef+              _tlIannotatedTree :: AttributeDefList+              _tlIattrs :: ([(String, Type)])+              _tlIoriginalTree :: AttributeDefList+              -- "./TypeChecking/CreateTable.ag"(line 85, column 12)+              _lhsOattrs =+                  {-# LINE 85 "./TypeChecking/CreateTable.ag" #-}+                  (_hdIattrName, _hdInamedType) : _tlIattrs+                  {-# LINE 818 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 823 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 828 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 833 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 838 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 843 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 848 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 853 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 858 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIattrName,_hdInamedType,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIattrs,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOattrs,_lhsOoriginalTree)))+sem_AttributeDefList_Nil :: T_AttributeDefList +sem_AttributeDefList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOattrs :: ([(String, Type)])+              _lhsOannotatedTree :: AttributeDefList+              _lhsOoriginalTree :: AttributeDefList+              -- "./TypeChecking/CreateTable.ag"(line 86, column 11)+              _lhsOattrs =+                  {-# LINE 86 "./TypeChecking/CreateTable.ag" #-}+                  []+                  {-# LINE 875 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 880 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 885 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 890 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 895 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOattrs,_lhsOoriginalTree)))+-- Cascade -----------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Cascade:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Restrict:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data Cascade  = Cascade +              | Restrict +              deriving ( Data,Eq,Show,Typeable)+-- cata+sem_Cascade :: Cascade  ->+               T_Cascade +sem_Cascade (Cascade )  =+    (sem_Cascade_Cascade )+sem_Cascade (Restrict )  =+    (sem_Cascade_Restrict )+-- semantic domain+type T_Cascade  = Environment ->+                  LocalIdentifierBindings ->+                  ( Cascade,Cascade)+data Inh_Cascade  = Inh_Cascade {env_Inh_Cascade :: Environment,lib_Inh_Cascade :: LocalIdentifierBindings}+data Syn_Cascade  = Syn_Cascade {annotatedTree_Syn_Cascade :: Cascade,originalTree_Syn_Cascade :: Cascade}+wrap_Cascade :: T_Cascade  ->+                Inh_Cascade  ->+                Syn_Cascade +wrap_Cascade sem (Inh_Cascade _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_Cascade _lhsOannotatedTree _lhsOoriginalTree ))+sem_Cascade_Cascade :: T_Cascade +sem_Cascade_Cascade  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Cascade+              _lhsOoriginalTree :: Cascade+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Cascade+                  {-# LINE 949 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Cascade+                  {-# LINE 954 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 959 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 964 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_Cascade_Restrict :: T_Cascade +sem_Cascade_Restrict  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Cascade+              _lhsOoriginalTree :: Cascade+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Restrict+                  {-# LINE 976 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Restrict+                  {-# LINE 981 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 986 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 991 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- CaseExpressionList ------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : Expression +         child tl             : CaseExpressionList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type CaseExpressionList  = [(Expression)]+-- cata+sem_CaseExpressionList :: CaseExpressionList  ->+                          T_CaseExpressionList +sem_CaseExpressionList list  =+    (Prelude.foldr sem_CaseExpressionList_Cons sem_CaseExpressionList_Nil (Prelude.map sem_Expression list) )+-- semantic domain+type T_CaseExpressionList  = Environment ->+                             LocalIdentifierBindings ->+                             ( CaseExpressionList,CaseExpressionList)+data Inh_CaseExpressionList  = Inh_CaseExpressionList {env_Inh_CaseExpressionList :: Environment,lib_Inh_CaseExpressionList :: LocalIdentifierBindings}+data Syn_CaseExpressionList  = Syn_CaseExpressionList {annotatedTree_Syn_CaseExpressionList :: CaseExpressionList,originalTree_Syn_CaseExpressionList :: CaseExpressionList}+wrap_CaseExpressionList :: T_CaseExpressionList  ->+                           Inh_CaseExpressionList  ->+                           Syn_CaseExpressionList +wrap_CaseExpressionList sem (Inh_CaseExpressionList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_CaseExpressionList _lhsOannotatedTree _lhsOoriginalTree ))+sem_CaseExpressionList_Cons :: T_Expression  ->+                               T_CaseExpressionList  ->+                               T_CaseExpressionList +sem_CaseExpressionList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: CaseExpressionList+              _lhsOoriginalTree :: CaseExpressionList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: Expression+              _hdIliftedColumnName :: String+              _hdIoriginalTree :: Expression+              _tlIannotatedTree :: CaseExpressionList+              _tlIoriginalTree :: CaseExpressionList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 1054 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 1059 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1064 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1069 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1074 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1079 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1084 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1089 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIliftedColumnName,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_CaseExpressionList_Nil :: T_CaseExpressionList +sem_CaseExpressionList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: CaseExpressionList+              _lhsOoriginalTree :: CaseExpressionList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 1105 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 1110 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1115 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1120 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- CaseExpressionListExpressionPair ----------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Tuple:+         child x1             : CaseExpressionList +         child x2             : Expression +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type CaseExpressionListExpressionPair  = ( (CaseExpressionList),(Expression))+-- cata+sem_CaseExpressionListExpressionPair :: CaseExpressionListExpressionPair  ->+                                        T_CaseExpressionListExpressionPair +sem_CaseExpressionListExpressionPair ( x1,x2)  =+    (sem_CaseExpressionListExpressionPair_Tuple (sem_CaseExpressionList x1 ) (sem_Expression x2 ) )+-- semantic domain+type T_CaseExpressionListExpressionPair  = Environment ->+                                           LocalIdentifierBindings ->+                                           ( CaseExpressionListExpressionPair,CaseExpressionListExpressionPair)+data Inh_CaseExpressionListExpressionPair  = Inh_CaseExpressionListExpressionPair {env_Inh_CaseExpressionListExpressionPair :: Environment,lib_Inh_CaseExpressionListExpressionPair :: LocalIdentifierBindings}+data Syn_CaseExpressionListExpressionPair  = Syn_CaseExpressionListExpressionPair {annotatedTree_Syn_CaseExpressionListExpressionPair :: CaseExpressionListExpressionPair,originalTree_Syn_CaseExpressionListExpressionPair :: CaseExpressionListExpressionPair}+wrap_CaseExpressionListExpressionPair :: T_CaseExpressionListExpressionPair  ->+                                         Inh_CaseExpressionListExpressionPair  ->+                                         Syn_CaseExpressionListExpressionPair +wrap_CaseExpressionListExpressionPair sem (Inh_CaseExpressionListExpressionPair _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_CaseExpressionListExpressionPair _lhsOannotatedTree _lhsOoriginalTree ))+sem_CaseExpressionListExpressionPair_Tuple :: T_CaseExpressionList  ->+                                              T_Expression  ->+                                              T_CaseExpressionListExpressionPair +sem_CaseExpressionListExpressionPair_Tuple x1_ x2_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: CaseExpressionListExpressionPair+              _lhsOoriginalTree :: CaseExpressionListExpressionPair+              _x1Oenv :: Environment+              _x1Olib :: LocalIdentifierBindings+              _x2Oenv :: Environment+              _x2Olib :: LocalIdentifierBindings+              _x1IannotatedTree :: CaseExpressionList+              _x1IoriginalTree :: CaseExpressionList+              _x2IannotatedTree :: Expression+              _x2IliftedColumnName :: String+              _x2IoriginalTree :: Expression+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (_x1IannotatedTree,_x2IannotatedTree)+                  {-# LINE 1179 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (_x1IoriginalTree,_x2IoriginalTree)+                  {-# LINE 1184 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1189 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1194 "AstInternal.hs" #-}+              -- copy rule (down)+              _x1Oenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1199 "AstInternal.hs" #-}+              -- copy rule (down)+              _x1Olib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1204 "AstInternal.hs" #-}+              -- copy rule (down)+              _x2Oenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1209 "AstInternal.hs" #-}+              -- copy rule (down)+              _x2Olib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1214 "AstInternal.hs" #-}+              ( _x1IannotatedTree,_x1IoriginalTree) =+                  (x1_ _x1Oenv _x1Olib )+              ( _x2IannotatedTree,_x2IliftedColumnName,_x2IoriginalTree) =+                  (x2_ _x2Oenv _x2Olib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- CaseExpressionListExpressionPairList ------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : CaseExpressionListExpressionPair +         child tl             : CaseExpressionListExpressionPairList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type CaseExpressionListExpressionPairList  = [(CaseExpressionListExpressionPair)]+-- cata+sem_CaseExpressionListExpressionPairList :: CaseExpressionListExpressionPairList  ->+                                            T_CaseExpressionListExpressionPairList +sem_CaseExpressionListExpressionPairList list  =+    (Prelude.foldr sem_CaseExpressionListExpressionPairList_Cons sem_CaseExpressionListExpressionPairList_Nil (Prelude.map sem_CaseExpressionListExpressionPair list) )+-- semantic domain+type T_CaseExpressionListExpressionPairList  = Environment ->+                                               LocalIdentifierBindings ->+                                               ( CaseExpressionListExpressionPairList,CaseExpressionListExpressionPairList)+data Inh_CaseExpressionListExpressionPairList  = Inh_CaseExpressionListExpressionPairList {env_Inh_CaseExpressionListExpressionPairList :: Environment,lib_Inh_CaseExpressionListExpressionPairList :: LocalIdentifierBindings}+data Syn_CaseExpressionListExpressionPairList  = Syn_CaseExpressionListExpressionPairList {annotatedTree_Syn_CaseExpressionListExpressionPairList :: CaseExpressionListExpressionPairList,originalTree_Syn_CaseExpressionListExpressionPairList :: CaseExpressionListExpressionPairList}+wrap_CaseExpressionListExpressionPairList :: T_CaseExpressionListExpressionPairList  ->+                                             Inh_CaseExpressionListExpressionPairList  ->+                                             Syn_CaseExpressionListExpressionPairList +wrap_CaseExpressionListExpressionPairList sem (Inh_CaseExpressionListExpressionPairList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_CaseExpressionListExpressionPairList _lhsOannotatedTree _lhsOoriginalTree ))+sem_CaseExpressionListExpressionPairList_Cons :: T_CaseExpressionListExpressionPair  ->+                                                 T_CaseExpressionListExpressionPairList  ->+                                                 T_CaseExpressionListExpressionPairList +sem_CaseExpressionListExpressionPairList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: CaseExpressionListExpressionPairList+              _lhsOoriginalTree :: CaseExpressionListExpressionPairList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: CaseExpressionListExpressionPair+              _hdIoriginalTree :: CaseExpressionListExpressionPair+              _tlIannotatedTree :: CaseExpressionListExpressionPairList+              _tlIoriginalTree :: CaseExpressionListExpressionPairList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 1280 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 1285 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1290 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1295 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1300 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1305 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1310 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1315 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_CaseExpressionListExpressionPairList_Nil :: T_CaseExpressionListExpressionPairList +sem_CaseExpressionListExpressionPairList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: CaseExpressionListExpressionPairList+              _lhsOoriginalTree :: CaseExpressionListExpressionPairList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 1331 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 1336 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1341 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1346 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- CombineType -------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Except:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Intersect:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Union:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative UnionAll:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data CombineType  = Except +                  | Intersect +                  | Union +                  | UnionAll +                  deriving ( Data,Eq,Show,Typeable)+-- cata+sem_CombineType :: CombineType  ->+                   T_CombineType +sem_CombineType (Except )  =+    (sem_CombineType_Except )+sem_CombineType (Intersect )  =+    (sem_CombineType_Intersect )+sem_CombineType (Union )  =+    (sem_CombineType_Union )+sem_CombineType (UnionAll )  =+    (sem_CombineType_UnionAll )+-- semantic domain+type T_CombineType  = Environment ->+                      LocalIdentifierBindings ->+                      ( CombineType,CombineType)+data Inh_CombineType  = Inh_CombineType {env_Inh_CombineType :: Environment,lib_Inh_CombineType :: LocalIdentifierBindings}+data Syn_CombineType  = Syn_CombineType {annotatedTree_Syn_CombineType :: CombineType,originalTree_Syn_CombineType :: CombineType}+wrap_CombineType :: T_CombineType  ->+                    Inh_CombineType  ->+                    Syn_CombineType +wrap_CombineType sem (Inh_CombineType _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_CombineType _lhsOannotatedTree _lhsOoriginalTree ))+sem_CombineType_Except :: T_CombineType +sem_CombineType_Except  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: CombineType+              _lhsOoriginalTree :: CombineType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Except+                  {-# LINE 1414 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Except+                  {-# LINE 1419 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1424 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1429 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_CombineType_Intersect :: T_CombineType +sem_CombineType_Intersect  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: CombineType+              _lhsOoriginalTree :: CombineType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Intersect+                  {-# LINE 1441 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Intersect+                  {-# LINE 1446 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1451 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1456 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_CombineType_Union :: T_CombineType +sem_CombineType_Union  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: CombineType+              _lhsOoriginalTree :: CombineType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Union+                  {-# LINE 1468 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Union+                  {-# LINE 1473 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1478 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1483 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_CombineType_UnionAll :: T_CombineType +sem_CombineType_UnionAll  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: CombineType+              _lhsOoriginalTree :: CombineType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  UnionAll+                  {-# LINE 1495 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  UnionAll+                  {-# LINE 1500 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1505 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1510 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- Constraint --------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative CheckConstraint:+         child ann            : {Annotation}+         child name           : {String}+         child expression     : Expression +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative PrimaryKeyConstraint:+         child ann            : {Annotation}+         child name           : {String}+         child stringList     : StringList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative ReferenceConstraint:+         child ann            : {Annotation}+         child name           : {String}+         child atts           : StringList +         child table          : {String}+         child tableAtts      : StringList +         child onUpdate       : Cascade +         child onDelete       : Cascade +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative UniqueConstraint:+         child ann            : {Annotation}+         child name           : {String}+         child stringList     : StringList +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data Constraint  = CheckConstraint (Annotation) (String) (Expression) +                 | PrimaryKeyConstraint (Annotation) (String) (StringList) +                 | ReferenceConstraint (Annotation) (String) (StringList) (String) (StringList) (Cascade) (Cascade) +                 | UniqueConstraint (Annotation) (String) (StringList) +                 deriving ( Data,Eq,Show,Typeable)+-- cata+sem_Constraint :: Constraint  ->+                  T_Constraint +sem_Constraint (CheckConstraint _ann _name _expression )  =+    (sem_Constraint_CheckConstraint _ann _name (sem_Expression _expression ) )+sem_Constraint (PrimaryKeyConstraint _ann _name _stringList )  =+    (sem_Constraint_PrimaryKeyConstraint _ann _name (sem_StringList _stringList ) )+sem_Constraint (ReferenceConstraint _ann _name _atts _table _tableAtts _onUpdate _onDelete )  =+    (sem_Constraint_ReferenceConstraint _ann _name (sem_StringList _atts ) _table (sem_StringList _tableAtts ) (sem_Cascade _onUpdate ) (sem_Cascade _onDelete ) )+sem_Constraint (UniqueConstraint _ann _name _stringList )  =+    (sem_Constraint_UniqueConstraint _ann _name (sem_StringList _stringList ) )+-- semantic domain+type T_Constraint  = Environment ->+                     LocalIdentifierBindings ->+                     ( Constraint,Constraint)+data Inh_Constraint  = Inh_Constraint {env_Inh_Constraint :: Environment,lib_Inh_Constraint :: LocalIdentifierBindings}+data Syn_Constraint  = Syn_Constraint {annotatedTree_Syn_Constraint :: Constraint,originalTree_Syn_Constraint :: Constraint}+wrap_Constraint :: T_Constraint  ->+                   Inh_Constraint  ->+                   Syn_Constraint +wrap_Constraint sem (Inh_Constraint _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_Constraint _lhsOannotatedTree _lhsOoriginalTree ))+sem_Constraint_CheckConstraint :: Annotation ->+                                  String ->+                                  T_Expression  ->+                                  T_Constraint +sem_Constraint_CheckConstraint ann_ name_ expression_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Constraint+              _lhsOoriginalTree :: Constraint+              _expressionOenv :: Environment+              _expressionOlib :: LocalIdentifierBindings+              _expressionIannotatedTree :: Expression+              _expressionIliftedColumnName :: String+              _expressionIoriginalTree :: Expression+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CheckConstraint ann_ name_ _expressionIannotatedTree+                  {-# LINE 1602 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CheckConstraint ann_ name_ _expressionIoriginalTree+                  {-# LINE 1607 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1612 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1617 "AstInternal.hs" #-}+              -- copy rule (down)+              _expressionOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1622 "AstInternal.hs" #-}+              -- copy rule (down)+              _expressionOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1627 "AstInternal.hs" #-}+              ( _expressionIannotatedTree,_expressionIliftedColumnName,_expressionIoriginalTree) =+                  (expression_ _expressionOenv _expressionOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_Constraint_PrimaryKeyConstraint :: Annotation ->+                                       String ->+                                       T_StringList  ->+                                       T_Constraint +sem_Constraint_PrimaryKeyConstraint ann_ name_ stringList_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Constraint+              _lhsOoriginalTree :: Constraint+              _stringListOenv :: Environment+              _stringListOlib :: LocalIdentifierBindings+              _stringListIannotatedTree :: StringList+              _stringListIoriginalTree :: StringList+              _stringListIstrings :: ([String])+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  PrimaryKeyConstraint ann_ name_ _stringListIannotatedTree+                  {-# LINE 1649 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  PrimaryKeyConstraint ann_ name_ _stringListIoriginalTree+                  {-# LINE 1654 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1659 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1664 "AstInternal.hs" #-}+              -- copy rule (down)+              _stringListOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1669 "AstInternal.hs" #-}+              -- copy rule (down)+              _stringListOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1674 "AstInternal.hs" #-}+              ( _stringListIannotatedTree,_stringListIoriginalTree,_stringListIstrings) =+                  (stringList_ _stringListOenv _stringListOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_Constraint_ReferenceConstraint :: Annotation ->+                                      String ->+                                      T_StringList  ->+                                      String ->+                                      T_StringList  ->+                                      T_Cascade  ->+                                      T_Cascade  ->+                                      T_Constraint +sem_Constraint_ReferenceConstraint ann_ name_ atts_ table_ tableAtts_ onUpdate_ onDelete_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Constraint+              _lhsOoriginalTree :: Constraint+              _attsOenv :: Environment+              _attsOlib :: LocalIdentifierBindings+              _tableAttsOenv :: Environment+              _tableAttsOlib :: LocalIdentifierBindings+              _onUpdateOenv :: Environment+              _onUpdateOlib :: LocalIdentifierBindings+              _onDeleteOenv :: Environment+              _onDeleteOlib :: LocalIdentifierBindings+              _attsIannotatedTree :: StringList+              _attsIoriginalTree :: StringList+              _attsIstrings :: ([String])+              _tableAttsIannotatedTree :: StringList+              _tableAttsIoriginalTree :: StringList+              _tableAttsIstrings :: ([String])+              _onUpdateIannotatedTree :: Cascade+              _onUpdateIoriginalTree :: Cascade+              _onDeleteIannotatedTree :: Cascade+              _onDeleteIoriginalTree :: Cascade+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  ReferenceConstraint ann_ name_ _attsIannotatedTree table_ _tableAttsIannotatedTree _onUpdateIannotatedTree _onDeleteIannotatedTree+                  {-# LINE 1713 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  ReferenceConstraint ann_ name_ _attsIoriginalTree table_ _tableAttsIoriginalTree _onUpdateIoriginalTree _onDeleteIoriginalTree+                  {-# LINE 1718 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1723 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1728 "AstInternal.hs" #-}+              -- copy rule (down)+              _attsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1733 "AstInternal.hs" #-}+              -- copy rule (down)+              _attsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1738 "AstInternal.hs" #-}+              -- copy rule (down)+              _tableAttsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1743 "AstInternal.hs" #-}+              -- copy rule (down)+              _tableAttsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1748 "AstInternal.hs" #-}+              -- copy rule (down)+              _onUpdateOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1753 "AstInternal.hs" #-}+              -- copy rule (down)+              _onUpdateOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1758 "AstInternal.hs" #-}+              -- copy rule (down)+              _onDeleteOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1763 "AstInternal.hs" #-}+              -- copy rule (down)+              _onDeleteOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1768 "AstInternal.hs" #-}+              ( _attsIannotatedTree,_attsIoriginalTree,_attsIstrings) =+                  (atts_ _attsOenv _attsOlib )+              ( _tableAttsIannotatedTree,_tableAttsIoriginalTree,_tableAttsIstrings) =+                  (tableAtts_ _tableAttsOenv _tableAttsOlib )+              ( _onUpdateIannotatedTree,_onUpdateIoriginalTree) =+                  (onUpdate_ _onUpdateOenv _onUpdateOlib )+              ( _onDeleteIannotatedTree,_onDeleteIoriginalTree) =+                  (onDelete_ _onDeleteOenv _onDeleteOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_Constraint_UniqueConstraint :: Annotation ->+                                   String ->+                                   T_StringList  ->+                                   T_Constraint +sem_Constraint_UniqueConstraint ann_ name_ stringList_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Constraint+              _lhsOoriginalTree :: Constraint+              _stringListOenv :: Environment+              _stringListOlib :: LocalIdentifierBindings+              _stringListIannotatedTree :: StringList+              _stringListIoriginalTree :: StringList+              _stringListIstrings :: ([String])+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  UniqueConstraint ann_ name_ _stringListIannotatedTree+                  {-# LINE 1796 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  UniqueConstraint ann_ name_ _stringListIoriginalTree+                  {-# LINE 1801 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1806 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1811 "AstInternal.hs" #-}+              -- copy rule (down)+              _stringListOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1816 "AstInternal.hs" #-}+              -- copy rule (down)+              _stringListOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1821 "AstInternal.hs" #-}+              ( _stringListIannotatedTree,_stringListIoriginalTree,_stringListIstrings) =+                  (stringList_ _stringListOenv _stringListOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- ConstraintList ----------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : Constraint +         child tl             : ConstraintList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type ConstraintList  = [(Constraint)]+-- cata+sem_ConstraintList :: ConstraintList  ->+                      T_ConstraintList +sem_ConstraintList list  =+    (Prelude.foldr sem_ConstraintList_Cons sem_ConstraintList_Nil (Prelude.map sem_Constraint list) )+-- semantic domain+type T_ConstraintList  = Environment ->+                         LocalIdentifierBindings ->+                         ( ConstraintList,ConstraintList)+data Inh_ConstraintList  = Inh_ConstraintList {env_Inh_ConstraintList :: Environment,lib_Inh_ConstraintList :: LocalIdentifierBindings}+data Syn_ConstraintList  = Syn_ConstraintList {annotatedTree_Syn_ConstraintList :: ConstraintList,originalTree_Syn_ConstraintList :: ConstraintList}+wrap_ConstraintList :: T_ConstraintList  ->+                       Inh_ConstraintList  ->+                       Syn_ConstraintList +wrap_ConstraintList sem (Inh_ConstraintList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_ConstraintList _lhsOannotatedTree _lhsOoriginalTree ))+sem_ConstraintList_Cons :: T_Constraint  ->+                           T_ConstraintList  ->+                           T_ConstraintList +sem_ConstraintList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: ConstraintList+              _lhsOoriginalTree :: ConstraintList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: Constraint+              _hdIoriginalTree :: Constraint+              _tlIannotatedTree :: ConstraintList+              _tlIoriginalTree :: ConstraintList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 1885 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 1890 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1895 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1900 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1905 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1910 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 1915 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 1920 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_ConstraintList_Nil :: T_ConstraintList +sem_ConstraintList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: ConstraintList+              _lhsOoriginalTree :: ConstraintList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 1936 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 1941 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 1946 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 1951 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- CopySource --------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative CopyFilename:+         child string         : {String}+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Stdin:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data CopySource  = CopyFilename (String) +                 | Stdin +                 deriving ( Data,Eq,Show,Typeable)+-- cata+sem_CopySource :: CopySource  ->+                  T_CopySource +sem_CopySource (CopyFilename _string )  =+    (sem_CopySource_CopyFilename _string )+sem_CopySource (Stdin )  =+    (sem_CopySource_Stdin )+-- semantic domain+type T_CopySource  = Environment ->+                     LocalIdentifierBindings ->+                     ( CopySource,CopySource)+data Inh_CopySource  = Inh_CopySource {env_Inh_CopySource :: Environment,lib_Inh_CopySource :: LocalIdentifierBindings}+data Syn_CopySource  = Syn_CopySource {annotatedTree_Syn_CopySource :: CopySource,originalTree_Syn_CopySource :: CopySource}+wrap_CopySource :: T_CopySource  ->+                   Inh_CopySource  ->+                   Syn_CopySource +wrap_CopySource sem (Inh_CopySource _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_CopySource _lhsOannotatedTree _lhsOoriginalTree ))+sem_CopySource_CopyFilename :: String ->+                               T_CopySource +sem_CopySource_CopyFilename string_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: CopySource+              _lhsOoriginalTree :: CopySource+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CopyFilename string_+                  {-# LINE 2007 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CopyFilename string_+                  {-# LINE 2012 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 2017 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2022 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_CopySource_Stdin :: T_CopySource +sem_CopySource_Stdin  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: CopySource+              _lhsOoriginalTree :: CopySource+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Stdin+                  {-# LINE 2034 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Stdin+                  {-# LINE 2039 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 2044 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2049 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- Direction ---------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Asc:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Desc:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data Direction  = Asc +                | Desc +                deriving ( Data,Eq,Show,Typeable)+-- cata+sem_Direction :: Direction  ->+                 T_Direction +sem_Direction (Asc )  =+    (sem_Direction_Asc )+sem_Direction (Desc )  =+    (sem_Direction_Desc )+-- semantic domain+type T_Direction  = Environment ->+                    LocalIdentifierBindings ->+                    ( Direction,Direction)+data Inh_Direction  = Inh_Direction {env_Inh_Direction :: Environment,lib_Inh_Direction :: LocalIdentifierBindings}+data Syn_Direction  = Syn_Direction {annotatedTree_Syn_Direction :: Direction,originalTree_Syn_Direction :: Direction}+wrap_Direction :: T_Direction  ->+                  Inh_Direction  ->+                  Syn_Direction +wrap_Direction sem (Inh_Direction _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_Direction _lhsOannotatedTree _lhsOoriginalTree ))+sem_Direction_Asc :: T_Direction +sem_Direction_Asc  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Direction+              _lhsOoriginalTree :: Direction+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Asc+                  {-# LINE 2103 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Asc+                  {-# LINE 2108 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 2113 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2118 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_Direction_Desc :: T_Direction +sem_Direction_Desc  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Direction+              _lhsOoriginalTree :: Direction+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Desc+                  {-# LINE 2130 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Desc+                  {-# LINE 2135 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 2140 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2145 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- Distinct ----------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Distinct:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Dupes:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data Distinct  = Distinct +               | Dupes +               deriving ( Data,Eq,Show,Typeable)+-- cata+sem_Distinct :: Distinct  ->+                T_Distinct +sem_Distinct (Distinct )  =+    (sem_Distinct_Distinct )+sem_Distinct (Dupes )  =+    (sem_Distinct_Dupes )+-- semantic domain+type T_Distinct  = Environment ->+                   LocalIdentifierBindings ->+                   ( Distinct,Distinct)+data Inh_Distinct  = Inh_Distinct {env_Inh_Distinct :: Environment,lib_Inh_Distinct :: LocalIdentifierBindings}+data Syn_Distinct  = Syn_Distinct {annotatedTree_Syn_Distinct :: Distinct,originalTree_Syn_Distinct :: Distinct}+wrap_Distinct :: T_Distinct  ->+                 Inh_Distinct  ->+                 Syn_Distinct +wrap_Distinct sem (Inh_Distinct _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_Distinct _lhsOannotatedTree _lhsOoriginalTree ))+sem_Distinct_Distinct :: T_Distinct +sem_Distinct_Distinct  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Distinct+              _lhsOoriginalTree :: Distinct+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Distinct+                  {-# LINE 2199 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Distinct+                  {-# LINE 2204 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 2209 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2214 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_Distinct_Dupes :: T_Distinct +sem_Distinct_Dupes  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Distinct+              _lhsOoriginalTree :: Distinct+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Dupes+                  {-# LINE 2226 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Dupes+                  {-# LINE 2231 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 2236 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2241 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- DropType ----------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Domain:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Table:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Type:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative View:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data DropType  = Domain +               | Table +               | Type +               | View +               deriving ( Data,Eq,Show,Typeable)+-- cata+sem_DropType :: DropType  ->+                T_DropType +sem_DropType (Domain )  =+    (sem_DropType_Domain )+sem_DropType (Table )  =+    (sem_DropType_Table )+sem_DropType (Type )  =+    (sem_DropType_Type )+sem_DropType (View )  =+    (sem_DropType_View )+-- semantic domain+type T_DropType  = Environment ->+                   LocalIdentifierBindings ->+                   ( DropType,DropType)+data Inh_DropType  = Inh_DropType {env_Inh_DropType :: Environment,lib_Inh_DropType :: LocalIdentifierBindings}+data Syn_DropType  = Syn_DropType {annotatedTree_Syn_DropType :: DropType,originalTree_Syn_DropType :: DropType}+wrap_DropType :: T_DropType  ->+                 Inh_DropType  ->+                 Syn_DropType +wrap_DropType sem (Inh_DropType _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_DropType _lhsOannotatedTree _lhsOoriginalTree ))+sem_DropType_Domain :: T_DropType +sem_DropType_Domain  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: DropType+              _lhsOoriginalTree :: DropType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Domain+                  {-# LINE 2309 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Domain+                  {-# LINE 2314 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 2319 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2324 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_DropType_Table :: T_DropType +sem_DropType_Table  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: DropType+              _lhsOoriginalTree :: DropType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Table+                  {-# LINE 2336 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Table+                  {-# LINE 2341 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 2346 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2351 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_DropType_Type :: T_DropType +sem_DropType_Type  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: DropType+              _lhsOoriginalTree :: DropType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Type+                  {-# LINE 2363 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Type+                  {-# LINE 2368 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 2373 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2378 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_DropType_View :: T_DropType +sem_DropType_View  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: DropType+              _lhsOoriginalTree :: DropType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  View+                  {-# LINE 2390 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  View+                  {-# LINE 2395 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 2400 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2405 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- Expression --------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         liftedColumnName     : String+         originalTree         : SELF +   alternatives:+      alternative BooleanLit:+         child ann            : {Annotation}+         child b              : {Bool}+         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative Case:+         child ann            : {Annotation}+         child cases          : CaseExpressionListExpressionPairList +         child els            : MaybeExpression +         visit 0:+            local whenTypes   : _+            local thenTypes   : _+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative CaseSimple:+         child ann            : {Annotation}+         child value          : Expression +         child cases          : CaseExpressionListExpressionPairList +         child els            : MaybeExpression +         visit 0:+            local whenTypes   : _+            local thenTypes   : _+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative Cast:+         child ann            : {Annotation}+         child expr           : Expression +         child tn             : TypeName +         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative Exists:+         child ann            : {Annotation}+         child sel            : SelectExpression +         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative FloatLit:+         child ann            : {Annotation}+         child d              : {Double}+         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative FunCall:+         child ann            : {Annotation}+         child funName        : {String}+         child args           : ExpressionList +         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative Identifier:+         child ann            : {Annotation}+         child i              : {String}+         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative InPredicate:+         child ann            : {Annotation}+         child expr           : Expression +         child i              : {Bool}+         child list           : InList +         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative IntegerLit:+         child ann            : {Annotation}+         child i              : {Integer}+         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative LiftOperator:+         child ann            : {Annotation}+         child oper           : {String}+         child flav           : LiftFlavour +         child args           : ExpressionList +         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative NullLit:+         child ann            : {Annotation}+         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative Placeholder:+         child ann            : {Annotation}+         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative PositionalArg:+         child ann            : {Annotation}+         child p              : {Integer}+         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative ScalarSubQuery:+         child ann            : {Annotation}+         child sel            : SelectExpression +         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative StringLit:+         child ann            : {Annotation}+         child quote          : {String}+         child value          : {String}+         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative WindowFn:+         child ann            : {Annotation}+         child fn             : Expression +         child partitionBy    : ExpressionList +         child orderBy        : ExpressionList +         child dir            : Direction +         child frm            : FrameClause +         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+-}+data Expression  = BooleanLit (Annotation) (Bool) +                 | Case (Annotation) (CaseExpressionListExpressionPairList) (MaybeExpression) +                 | CaseSimple (Annotation) (Expression) (CaseExpressionListExpressionPairList) (MaybeExpression) +                 | Cast (Annotation) (Expression) (TypeName) +                 | Exists (Annotation) (SelectExpression) +                 | FloatLit (Annotation) (Double) +                 | FunCall (Annotation) (String) (ExpressionList) +                 | Identifier (Annotation) (String) +                 | InPredicate (Annotation) (Expression) (Bool) (InList) +                 | IntegerLit (Annotation) (Integer) +                 | LiftOperator (Annotation) (String) (LiftFlavour) (ExpressionList) +                 | NullLit (Annotation) +                 | Placeholder (Annotation) +                 | PositionalArg (Annotation) (Integer) +                 | ScalarSubQuery (Annotation) (SelectExpression) +                 | StringLit (Annotation) (String) (String) +                 | WindowFn (Annotation) (Expression) (ExpressionList) (ExpressionList) (Direction) (FrameClause) +                 deriving ( Data,Eq,Show,Typeable)+-- cata+sem_Expression :: Expression  ->+                  T_Expression +sem_Expression (BooleanLit _ann _b )  =+    (sem_Expression_BooleanLit _ann _b )+sem_Expression (Case _ann _cases _els )  =+    (sem_Expression_Case _ann (sem_CaseExpressionListExpressionPairList _cases ) (sem_MaybeExpression _els ) )+sem_Expression (CaseSimple _ann _value _cases _els )  =+    (sem_Expression_CaseSimple _ann (sem_Expression _value ) (sem_CaseExpressionListExpressionPairList _cases ) (sem_MaybeExpression _els ) )+sem_Expression (Cast _ann _expr _tn )  =+    (sem_Expression_Cast _ann (sem_Expression _expr ) (sem_TypeName _tn ) )+sem_Expression (Exists _ann _sel )  =+    (sem_Expression_Exists _ann (sem_SelectExpression _sel ) )+sem_Expression (FloatLit _ann _d )  =+    (sem_Expression_FloatLit _ann _d )+sem_Expression (FunCall _ann _funName _args )  =+    (sem_Expression_FunCall _ann _funName (sem_ExpressionList _args ) )+sem_Expression (Identifier _ann _i )  =+    (sem_Expression_Identifier _ann _i )+sem_Expression (InPredicate _ann _expr _i _list )  =+    (sem_Expression_InPredicate _ann (sem_Expression _expr ) _i (sem_InList _list ) )+sem_Expression (IntegerLit _ann _i )  =+    (sem_Expression_IntegerLit _ann _i )+sem_Expression (LiftOperator _ann _oper _flav _args )  =+    (sem_Expression_LiftOperator _ann _oper (sem_LiftFlavour _flav ) (sem_ExpressionList _args ) )+sem_Expression (NullLit _ann )  =+    (sem_Expression_NullLit _ann )+sem_Expression (Placeholder _ann )  =+    (sem_Expression_Placeholder _ann )+sem_Expression (PositionalArg _ann _p )  =+    (sem_Expression_PositionalArg _ann _p )+sem_Expression (ScalarSubQuery _ann _sel )  =+    (sem_Expression_ScalarSubQuery _ann (sem_SelectExpression _sel ) )+sem_Expression (StringLit _ann _quote _value )  =+    (sem_Expression_StringLit _ann _quote _value )+sem_Expression (WindowFn _ann _fn _partitionBy _orderBy _dir _frm )  =+    (sem_Expression_WindowFn _ann (sem_Expression _fn ) (sem_ExpressionList _partitionBy ) (sem_ExpressionList _orderBy ) (sem_Direction _dir ) (sem_FrameClause _frm ) )+-- semantic domain+type T_Expression  = Environment ->+                     LocalIdentifierBindings ->+                     ( Expression,String,Expression)+data Inh_Expression  = Inh_Expression {env_Inh_Expression :: Environment,lib_Inh_Expression :: LocalIdentifierBindings}+data Syn_Expression  = Syn_Expression {annotatedTree_Syn_Expression :: Expression,liftedColumnName_Syn_Expression :: String,originalTree_Syn_Expression :: Expression}+wrap_Expression :: T_Expression  ->+                   Inh_Expression  ->+                   Syn_Expression +wrap_Expression sem (Inh_Expression _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_Expression _lhsOannotatedTree _lhsOliftedColumnName _lhsOoriginalTree ))+sem_Expression_BooleanLit :: Annotation ->+                             Bool ->+                             T_Expression +sem_Expression_BooleanLit ann_ b_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 2655 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 29, column 19)+              _tpe =+                  {-# LINE 29 "./TypeChecking/Expressions.ag" #-}+                  Right typeBool+                  {-# LINE 2660 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 41, column 9)+              _backTree =+                  {-# LINE 41 "./TypeChecking/Expressions.ag" #-}+                  BooleanLit ann_ b_+                  {-# LINE 2665 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 177, column 7)+              _lhsOliftedColumnName =+                  {-# LINE 177 "./TypeChecking/SelectLists.ag" #-}+                  ""+                  {-# LINE 2670 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  BooleanLit ann_ b_+                  {-# LINE 2675 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  BooleanLit ann_ b_+                  {-# LINE 2680 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2685 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_Case :: Annotation ->+                       T_CaseExpressionListExpressionPairList  ->+                       T_MaybeExpression  ->+                       T_Expression +sem_Expression_Case ann_ cases_ els_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              _casesOenv :: Environment+              _casesOlib :: LocalIdentifierBindings+              _elsOenv :: Environment+              _elsOlib :: LocalIdentifierBindings+              _casesIannotatedTree :: CaseExpressionListExpressionPairList+              _casesIoriginalTree :: CaseExpressionListExpressionPairList+              _elsIannotatedTree :: MaybeExpression+              _elsIoriginalTree :: MaybeExpression+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 2712 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 196, column 9)+              _whenTypes =+                  {-# LINE 196 "./TypeChecking/Expressions.ag" #-}+                  map getTypeAnnotation $ concatMap fst $+                  _casesIannotatedTree+                  {-# LINE 2718 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 198, column 9)+              _thenTypes =+                  {-# LINE 198 "./TypeChecking/Expressions.ag" #-}+                  map getTypeAnnotation $+                      (map snd $ _casesIannotatedTree) +++                        maybeToList _elsIannotatedTree+                  {-# LINE 2725 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 204, column 9)+              _tpe =+                  {-# LINE 204 "./TypeChecking/Expressions.ag" #-}+                  dependsOnRTpe _whenTypes     $ do+                  errorWhen (any (/= typeBool) _whenTypes    ) $+                            [WrongTypes typeBool _whenTypes    ]+                  dependsOnRTpe _thenTypes     $+                    resolveResultSetType _lhsIenv _thenTypes+                  {-# LINE 2734 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 210, column 9)+              _backTree =+                  {-# LINE 210 "./TypeChecking/Expressions.ag" #-}+                  Case ann_ _casesIannotatedTree _elsIannotatedTree+                  {-# LINE 2739 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 177, column 7)+              _lhsOliftedColumnName =+                  {-# LINE 177 "./TypeChecking/SelectLists.ag" #-}+                  ""+                  {-# LINE 2744 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Case ann_ _casesIannotatedTree _elsIannotatedTree+                  {-# LINE 2749 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Case ann_ _casesIoriginalTree _elsIoriginalTree+                  {-# LINE 2754 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2759 "AstInternal.hs" #-}+              -- copy rule (down)+              _casesOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 2764 "AstInternal.hs" #-}+              -- copy rule (down)+              _casesOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 2769 "AstInternal.hs" #-}+              -- copy rule (down)+              _elsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 2774 "AstInternal.hs" #-}+              -- copy rule (down)+              _elsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 2779 "AstInternal.hs" #-}+              ( _casesIannotatedTree,_casesIoriginalTree) =+                  (cases_ _casesOenv _casesOlib )+              ( _elsIannotatedTree,_elsIoriginalTree) =+                  (els_ _elsOenv _elsOlib )+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_CaseSimple :: Annotation ->+                             T_Expression  ->+                             T_CaseExpressionListExpressionPairList  ->+                             T_MaybeExpression  ->+                             T_Expression +sem_Expression_CaseSimple ann_ value_ cases_ els_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOoriginalTree :: Expression+              _lhsOliftedColumnName :: String+              _valueOenv :: Environment+              _valueOlib :: LocalIdentifierBindings+              _casesOenv :: Environment+              _casesOlib :: LocalIdentifierBindings+              _elsOenv :: Environment+              _elsOlib :: LocalIdentifierBindings+              _valueIannotatedTree :: Expression+              _valueIliftedColumnName :: String+              _valueIoriginalTree :: Expression+              _casesIannotatedTree :: CaseExpressionListExpressionPairList+              _casesIoriginalTree :: CaseExpressionListExpressionPairList+              _elsIannotatedTree :: MaybeExpression+              _elsIoriginalTree :: MaybeExpression+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 2816 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 196, column 9)+              _whenTypes =+                  {-# LINE 196 "./TypeChecking/Expressions.ag" #-}+                  map getTypeAnnotation $ concatMap fst $+                  _casesIannotatedTree+                  {-# LINE 2822 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 198, column 9)+              _thenTypes =+                  {-# LINE 198 "./TypeChecking/Expressions.ag" #-}+                  map getTypeAnnotation $+                      (map snd $ _casesIannotatedTree) +++                        maybeToList _elsIannotatedTree+                  {-# LINE 2829 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 215, column 9)+              _tpe =+                  {-# LINE 215 "./TypeChecking/Expressions.ag" #-}+                  dependsOnRTpe _whenTypes     $ do+                  let valueType = getTypeAnnotation _valueIannotatedTree+                  checkWhenTypes <-+                      resolveResultSetType _lhsIenv (valueType : _whenTypes    )+                  dependsOnRTpe _thenTypes     $+                    resolveResultSetType _lhsIenv _thenTypes+                  {-# LINE 2839 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 222, column 9)+              _backTree =+                  {-# LINE 222 "./TypeChecking/Expressions.ag" #-}+                  CaseSimple ann_+                             _valueIannotatedTree+                             _casesIannotatedTree+                             _elsIannotatedTree+                  {-# LINE 2847 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CaseSimple ann_ _valueIannotatedTree _casesIannotatedTree _elsIannotatedTree+                  {-# LINE 2852 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CaseSimple ann_ _valueIoriginalTree _casesIoriginalTree _elsIoriginalTree+                  {-# LINE 2857 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2862 "AstInternal.hs" #-}+              -- copy rule (up)+              _lhsOliftedColumnName =+                  {-# LINE 161 "./TypeChecking/SelectLists.ag" #-}+                  _valueIliftedColumnName+                  {-# LINE 2867 "AstInternal.hs" #-}+              -- copy rule (down)+              _valueOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 2872 "AstInternal.hs" #-}+              -- copy rule (down)+              _valueOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 2877 "AstInternal.hs" #-}+              -- copy rule (down)+              _casesOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 2882 "AstInternal.hs" #-}+              -- copy rule (down)+              _casesOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 2887 "AstInternal.hs" #-}+              -- copy rule (down)+              _elsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 2892 "AstInternal.hs" #-}+              -- copy rule (down)+              _elsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 2897 "AstInternal.hs" #-}+              ( _valueIannotatedTree,_valueIliftedColumnName,_valueIoriginalTree) =+                  (value_ _valueOenv _valueOlib )+              ( _casesIannotatedTree,_casesIoriginalTree) =+                  (cases_ _casesOenv _casesOlib )+              ( _elsIannotatedTree,_elsIoriginalTree) =+                  (els_ _elsOenv _elsOlib )+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_Cast :: Annotation ->+                       T_Expression  ->+                       T_TypeName  ->+                       T_Expression +sem_Expression_Cast ann_ expr_ tn_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              _exprOenv :: Environment+              _exprOlib :: LocalIdentifierBindings+              _tnOenv :: Environment+              _tnOlib :: LocalIdentifierBindings+              _exprIannotatedTree :: Expression+              _exprIliftedColumnName :: String+              _exprIoriginalTree :: Expression+              _tnIannotatedTree :: TypeName+              _tnInamedType :: Type+              _tnIoriginalTree :: TypeName+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 2932 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 54, column 12)+              _tpe =+                  {-# LINE 54 "./TypeChecking/Expressions.ag" #-}+                  Right $ _tnInamedType+                  {-# LINE 2937 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 55, column 12)+              _backTree =+                  {-# LINE 55 "./TypeChecking/Expressions.ag" #-}+                  Cast ann_ _exprIannotatedTree _tnIannotatedTree+                  {-# LINE 2942 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 169, column 10)+              _lhsOliftedColumnName =+                  {-# LINE 169 "./TypeChecking/SelectLists.ag" #-}+                  case _tnIannotatedTree of+                    SimpleTypeName _ tn -> tn+                    _ -> ""+                  {-# LINE 2949 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Cast ann_ _exprIannotatedTree _tnIannotatedTree+                  {-# LINE 2954 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Cast ann_ _exprIoriginalTree _tnIoriginalTree+                  {-# LINE 2959 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 2964 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 2969 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 2974 "AstInternal.hs" #-}+              -- copy rule (down)+              _tnOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 2979 "AstInternal.hs" #-}+              -- copy rule (down)+              _tnOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 2984 "AstInternal.hs" #-}+              ( _exprIannotatedTree,_exprIliftedColumnName,_exprIoriginalTree) =+                  (expr_ _exprOenv _exprOlib )+              ( _tnIannotatedTree,_tnInamedType,_tnIoriginalTree) =+                  (tn_ _tnOenv _tnOlib )+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_Exists :: Annotation ->+                         T_SelectExpression  ->+                         T_Expression +sem_Expression_Exists ann_ sel_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              _selOenv :: Environment+              _selOlib :: LocalIdentifierBindings+              _selIannotatedTree :: SelectExpression+              _selIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _selIoriginalTree :: SelectExpression+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 3011 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 253, column 9)+              _tpe =+                  {-# LINE 253 "./TypeChecking/Expressions.ag" #-}+                  Right typeBool+                  {-# LINE 3016 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 254, column 9)+              _backTree =+                  {-# LINE 254 "./TypeChecking/Expressions.ag" #-}+                  Exists ann_ _selIannotatedTree+                  {-# LINE 3021 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 177, column 7)+              _lhsOliftedColumnName =+                  {-# LINE 177 "./TypeChecking/SelectLists.ag" #-}+                  ""+                  {-# LINE 3026 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Exists ann_ _selIannotatedTree+                  {-# LINE 3031 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Exists ann_ _selIoriginalTree+                  {-# LINE 3036 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3041 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3046 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3051 "AstInternal.hs" #-}+              ( _selIannotatedTree,_selIlibUpdates,_selIoriginalTree) =+                  (sel_ _selOenv _selOlib )+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_FloatLit :: Annotation ->+                           Double ->+                           T_Expression +sem_Expression_FloatLit ann_ d_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 3071 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 28, column 17)+              _tpe =+                  {-# LINE 28 "./TypeChecking/Expressions.ag" #-}+                  Right typeNumeric+                  {-# LINE 3076 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 39, column 9)+              _backTree =+                  {-# LINE 39 "./TypeChecking/Expressions.ag" #-}+                  FloatLit ann_ d_+                  {-# LINE 3081 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 177, column 7)+              _lhsOliftedColumnName =+                  {-# LINE 177 "./TypeChecking/SelectLists.ag" #-}+                  ""+                  {-# LINE 3086 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  FloatLit ann_ d_+                  {-# LINE 3091 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  FloatLit ann_ d_+                  {-# LINE 3096 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3101 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_FunCall :: Annotation ->+                          String ->+                          T_ExpressionList  ->+                          T_Expression +sem_Expression_FunCall ann_ funName_ args_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              _argsOenv :: Environment+              _argsOlib :: LocalIdentifierBindings+              _argsIannotatedTree :: ExpressionList+              _argsIoriginalTree :: ExpressionList+              _argsItypeList :: ([Type])+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 3125 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 62, column 9)+              _tpe =+                  {-# LINE 62 "./TypeChecking/Expressions.ag" #-}+                  dependsOnRTpe _argsItypeList $+                    typeCheckFunCall+                      _lhsIenv+                      funName_+                      _argsItypeList+                  {-# LINE 3134 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 67, column 9)+              _backTree =+                  {-# LINE 67 "./TypeChecking/Expressions.ag" #-}+                  FunCall ann_ funName_ _argsIannotatedTree+                  {-# LINE 3139 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 165, column 13)+              _lhsOliftedColumnName =+                  {-# LINE 165 "./TypeChecking/SelectLists.ag" #-}+                  if isOperatorName funName_+                     then ""+                     else funName_+                  {-# LINE 3146 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  FunCall ann_ funName_ _argsIannotatedTree+                  {-# LINE 3151 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  FunCall ann_ funName_ _argsIoriginalTree+                  {-# LINE 3156 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3161 "AstInternal.hs" #-}+              -- copy rule (down)+              _argsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3166 "AstInternal.hs" #-}+              -- copy rule (down)+              _argsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3171 "AstInternal.hs" #-}+              ( _argsIannotatedTree,_argsIoriginalTree,_argsItypeList) =+                  (args_ _argsOenv _argsOlib )+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_Identifier :: Annotation ->+                             String ->+                             T_Expression +sem_Expression_Identifier ann_ i_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 3191 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 235, column 9)+              _tpe =+                  {-# LINE 235 "./TypeChecking/Expressions.ag" #-}+                  libLookupID _lhsIlib i_+                  {-# LINE 3196 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 236, column 9)+              _backTree =+                  {-# LINE 236 "./TypeChecking/Expressions.ag" #-}+                  Identifier ann_ i_+                  {-# LINE 3201 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 164, column 16)+              _lhsOliftedColumnName =+                  {-# LINE 164 "./TypeChecking/SelectLists.ag" #-}+                  i_+                  {-# LINE 3206 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Identifier ann_ i_+                  {-# LINE 3211 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Identifier ann_ i_+                  {-# LINE 3216 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3221 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_InPredicate :: Annotation ->+                              T_Expression  ->+                              Bool ->+                              T_InList  ->+                              T_Expression +sem_Expression_InPredicate ann_ expr_ i_ list_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOoriginalTree :: Expression+              _lhsOliftedColumnName :: String+              _exprOenv :: Environment+              _exprOlib :: LocalIdentifierBindings+              _listOenv :: Environment+              _listOlib :: LocalIdentifierBindings+              _exprIannotatedTree :: Expression+              _exprIliftedColumnName :: String+              _exprIoriginalTree :: Expression+              _listIannotatedTree :: InList+              _listIlistType :: (Either [TypeError] Type)+              _listIoriginalTree :: InList+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 3251 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 283, column 9)+              _tpe =+                  {-# LINE 283 "./TypeChecking/Expressions.ag" #-}+                  do+                  lt <- _listIlistType+                  ty <- resolveResultSetType+                            _lhsIenv+                            [getTypeAnnotation _exprIannotatedTree, lt]+                  return typeBool+                  {-# LINE 3261 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 289, column 9)+              _backTree =+                  {-# LINE 289 "./TypeChecking/Expressions.ag" #-}+                  InPredicate ann_+                              _exprIannotatedTree+                              i_+                              _listIannotatedTree+                  {-# LINE 3269 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  InPredicate ann_ _exprIannotatedTree i_ _listIannotatedTree+                  {-# LINE 3274 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  InPredicate ann_ _exprIoriginalTree i_ _listIoriginalTree+                  {-# LINE 3279 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3284 "AstInternal.hs" #-}+              -- copy rule (up)+              _lhsOliftedColumnName =+                  {-# LINE 161 "./TypeChecking/SelectLists.ag" #-}+                  _exprIliftedColumnName+                  {-# LINE 3289 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3294 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3299 "AstInternal.hs" #-}+              -- copy rule (down)+              _listOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3304 "AstInternal.hs" #-}+              -- copy rule (down)+              _listOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3309 "AstInternal.hs" #-}+              ( _exprIannotatedTree,_exprIliftedColumnName,_exprIoriginalTree) =+                  (expr_ _exprOenv _exprOlib )+              ( _listIannotatedTree,_listIlistType,_listIoriginalTree) =+                  (list_ _listOenv _listOlib )+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_IntegerLit :: Annotation ->+                             Integer ->+                             T_Expression +sem_Expression_IntegerLit ann_ i_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 3331 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 26, column 19)+              _tpe =+                  {-# LINE 26 "./TypeChecking/Expressions.ag" #-}+                  Right typeInt+                  {-# LINE 3336 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 35, column 9)+              _backTree =+                  {-# LINE 35 "./TypeChecking/Expressions.ag" #-}+                  IntegerLit ann_ i_+                  {-# LINE 3341 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 177, column 7)+              _lhsOliftedColumnName =+                  {-# LINE 177 "./TypeChecking/SelectLists.ag" #-}+                  ""+                  {-# LINE 3346 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  IntegerLit ann_ i_+                  {-# LINE 3351 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  IntegerLit ann_ i_+                  {-# LINE 3356 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3361 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_LiftOperator :: Annotation ->+                               String ->+                               T_LiftFlavour  ->+                               T_ExpressionList  ->+                               T_Expression +sem_Expression_LiftOperator ann_ oper_ flav_ args_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              _flavOenv :: Environment+              _flavOlib :: LocalIdentifierBindings+              _argsOenv :: Environment+              _argsOlib :: LocalIdentifierBindings+              _flavIannotatedTree :: LiftFlavour+              _flavIoriginalTree :: LiftFlavour+              _argsIannotatedTree :: ExpressionList+              _argsIoriginalTree :: ExpressionList+              _argsItypeList :: ([Type])+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 3390 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 161, column 9)+              _tpe =+                  {-# LINE 161 "./TypeChecking/Expressions.ag" #-}+                  dependsOnRTpe _argsItypeList $ do+                  let args = _argsIannotatedTree+                  errorWhen (length args /= 2)+                            [AnyAllError $ "must have two args, got " ++ show args]+                  let [a,b] = args+                      aType = getTypeAnnotation a+                      bType = getTypeAnnotation b+                  dependsOnRTpe [aType,bType] $ do+                  errorWhen (not $ isArrayType bType)+                            [AnyAllError $ "second arg must be array, got " ++ show args]+                  elemType <- unwrapArray $ bType+                  resType <- typeCheckFunCall+                                     _lhsIenv+                                     oper_+                                     [aType,elemType]+                  errorWhen (resType /= typeBool)+                            [AnyAllError $ "operator must have bool return, got " ++ show resType]+                  return resType+                  {-# LINE 3412 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 179, column 9)+              _backTree =+                  {-# LINE 179 "./TypeChecking/Expressions.ag" #-}+                  LiftOperator ann_ oper_ _flavIannotatedTree _argsIannotatedTree+                  {-# LINE 3417 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 177, column 7)+              _lhsOliftedColumnName =+                  {-# LINE 177 "./TypeChecking/SelectLists.ag" #-}+                  ""+                  {-# LINE 3422 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  LiftOperator ann_ oper_ _flavIannotatedTree _argsIannotatedTree+                  {-# LINE 3427 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  LiftOperator ann_ oper_ _flavIoriginalTree _argsIoriginalTree+                  {-# LINE 3432 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3437 "AstInternal.hs" #-}+              -- copy rule (down)+              _flavOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3442 "AstInternal.hs" #-}+              -- copy rule (down)+              _flavOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3447 "AstInternal.hs" #-}+              -- copy rule (down)+              _argsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3452 "AstInternal.hs" #-}+              -- copy rule (down)+              _argsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3457 "AstInternal.hs" #-}+              ( _flavIannotatedTree,_flavIoriginalTree) =+                  (flav_ _flavOenv _flavOlib )+              ( _argsIannotatedTree,_argsIoriginalTree,_argsItypeList) =+                  (args_ _argsOenv _argsOlib )+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_NullLit :: Annotation ->+                          T_Expression +sem_Expression_NullLit ann_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 3478 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 31, column 16)+              _tpe =+                  {-# LINE 31 "./TypeChecking/Expressions.ag" #-}+                  Right UnknownType+                  {-# LINE 3483 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 43, column 9)+              _backTree =+                  {-# LINE 43 "./TypeChecking/Expressions.ag" #-}+                  NullLit ann_+                  {-# LINE 3488 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 177, column 7)+              _lhsOliftedColumnName =+                  {-# LINE 177 "./TypeChecking/SelectLists.ag" #-}+                  ""+                  {-# LINE 3493 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  NullLit ann_+                  {-# LINE 3498 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  NullLit ann_+                  {-# LINE 3503 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3508 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_Placeholder :: Annotation ->+                              T_Expression +sem_Expression_Placeholder ann_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 3525 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 247, column 9)+              _tpe =+                  {-# LINE 247 "./TypeChecking/Expressions.ag" #-}+                  Right UnknownType+                  {-# LINE 3530 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 248, column 9)+              _backTree =+                  {-# LINE 248 "./TypeChecking/Expressions.ag" #-}+                  Placeholder ann_+                  {-# LINE 3535 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 177, column 7)+              _lhsOliftedColumnName =+                  {-# LINE 177 "./TypeChecking/SelectLists.ag" #-}+                  ""+                  {-# LINE 3540 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Placeholder ann_+                  {-# LINE 3545 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Placeholder ann_+                  {-# LINE 3550 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3555 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_PositionalArg :: Annotation ->+                                Integer ->+                                T_Expression +sem_Expression_PositionalArg ann_ p_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 3573 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 241, column 9)+              _tpe =+                  {-# LINE 241 "./TypeChecking/Expressions.ag" #-}+                  libLookupID _lhsIlib ('$':show p_)+                  {-# LINE 3578 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 242, column 9)+              _backTree =+                  {-# LINE 242 "./TypeChecking/Expressions.ag" #-}+                  PositionalArg ann_ p_+                  {-# LINE 3583 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 177, column 7)+              _lhsOliftedColumnName =+                  {-# LINE 177 "./TypeChecking/SelectLists.ag" #-}+                  ""+                  {-# LINE 3588 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  PositionalArg ann_ p_+                  {-# LINE 3593 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  PositionalArg ann_ p_+                  {-# LINE 3598 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3603 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_ScalarSubQuery :: Annotation ->+                                 T_SelectExpression  ->+                                 T_Expression +sem_Expression_ScalarSubQuery ann_ sel_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              _selOenv :: Environment+              _selOlib :: LocalIdentifierBindings+              _selIannotatedTree :: SelectExpression+              _selIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _selIoriginalTree :: SelectExpression+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 3626 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 265, column 9)+              _tpe =+                  {-# LINE 265 "./TypeChecking/Expressions.ag" #-}+                  do+                  let selType = getTypeAnnotation _selIannotatedTree+                  dependsOnRTpe [selType] $ do+                  f <- map snd <$> unwrapSetOfComposite selType+                  case length f of+                    0 -> Left [InternalError "no columns in scalar subquery?"]+                    1 -> Right $ head f+                    _ -> Right $ AnonymousRecordType f+                  {-# LINE 3638 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 275, column 9)+              _backTree =+                  {-# LINE 275 "./TypeChecking/Expressions.ag" #-}+                  ScalarSubQuery ann_ _selIannotatedTree+                  {-# LINE 3643 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 177, column 7)+              _lhsOliftedColumnName =+                  {-# LINE 177 "./TypeChecking/SelectLists.ag" #-}+                  ""+                  {-# LINE 3648 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  ScalarSubQuery ann_ _selIannotatedTree+                  {-# LINE 3653 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  ScalarSubQuery ann_ _selIoriginalTree+                  {-# LINE 3658 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3663 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3668 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3673 "AstInternal.hs" #-}+              ( _selIannotatedTree,_selIlibUpdates,_selIoriginalTree) =+                  (sel_ _selOenv _selOlib )+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_StringLit :: Annotation ->+                            String ->+                            String ->+                            T_Expression +sem_Expression_StringLit ann_ quote_ value_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOliftedColumnName :: String+              _lhsOoriginalTree :: Expression+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 3694 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 27, column 18)+              _tpe =+                  {-# LINE 27 "./TypeChecking/Expressions.ag" #-}+                  Right UnknownType+                  {-# LINE 3699 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 37, column 9)+              _backTree =+                  {-# LINE 37 "./TypeChecking/Expressions.ag" #-}+                  StringLit ann_ quote_ value_+                  {-# LINE 3704 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 177, column 7)+              _lhsOliftedColumnName =+                  {-# LINE 177 "./TypeChecking/SelectLists.ag" #-}+                  ""+                  {-# LINE 3709 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  StringLit ann_ quote_ value_+                  {-# LINE 3714 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  StringLit ann_ quote_ value_+                  {-# LINE 3719 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3724 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+sem_Expression_WindowFn :: Annotation ->+                           T_Expression  ->+                           T_ExpressionList  ->+                           T_ExpressionList  ->+                           T_Direction  ->+                           T_FrameClause  ->+                           T_Expression +sem_Expression_WindowFn ann_ fn_ partitionBy_ orderBy_ dir_ frm_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Expression+              _lhsOoriginalTree :: Expression+              _lhsOliftedColumnName :: String+              _fnOenv :: Environment+              _fnOlib :: LocalIdentifierBindings+              _partitionByOenv :: Environment+              _partitionByOlib :: LocalIdentifierBindings+              _orderByOenv :: Environment+              _orderByOlib :: LocalIdentifierBindings+              _dirOenv :: Environment+              _dirOlib :: LocalIdentifierBindings+              _frmOenv :: Environment+              _frmOlib :: LocalIdentifierBindings+              _fnIannotatedTree :: Expression+              _fnIliftedColumnName :: String+              _fnIoriginalTree :: Expression+              _partitionByIannotatedTree :: ExpressionList+              _partitionByIoriginalTree :: ExpressionList+              _partitionByItypeList :: ([Type])+              _orderByIannotatedTree :: ExpressionList+              _orderByIoriginalTree :: ExpressionList+              _orderByItypeList :: ([Type])+              _dirIannotatedTree :: Direction+              _dirIoriginalTree :: Direction+              _frmIannotatedTree :: FrameClause+              _frmIoriginalTree :: FrameClause+              -- "./TypeChecking/Expressions.ag"(line 14, column 9)+              _lhsOannotatedTree =+                  {-# LINE 14 "./TypeChecking/Expressions.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 3769 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 71, column 9)+              _tpe =+                  {-# LINE 71 "./TypeChecking/Expressions.ag" #-}+                  Right (getTypeAnnotation _fnIannotatedTree)+                  {-# LINE 3774 "AstInternal.hs" #-}+              -- "./TypeChecking/Expressions.ag"(line 72, column 9)+              _backTree =+                  {-# LINE 72 "./TypeChecking/Expressions.ag" #-}+                  WindowFn ann_+                           _fnIannotatedTree+                           _partitionByIannotatedTree+                           _orderByIannotatedTree+                           _dirIannotatedTree+                           _frmIannotatedTree+                  {-# LINE 3784 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  WindowFn ann_ _fnIannotatedTree _partitionByIannotatedTree _orderByIannotatedTree _dirIannotatedTree _frmIannotatedTree+                  {-# LINE 3789 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  WindowFn ann_ _fnIoriginalTree _partitionByIoriginalTree _orderByIoriginalTree _dirIoriginalTree _frmIoriginalTree+                  {-# LINE 3794 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3799 "AstInternal.hs" #-}+              -- copy rule (up)+              _lhsOliftedColumnName =+                  {-# LINE 161 "./TypeChecking/SelectLists.ag" #-}+                  _fnIliftedColumnName+                  {-# LINE 3804 "AstInternal.hs" #-}+              -- copy rule (down)+              _fnOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3809 "AstInternal.hs" #-}+              -- copy rule (down)+              _fnOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3814 "AstInternal.hs" #-}+              -- copy rule (down)+              _partitionByOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3819 "AstInternal.hs" #-}+              -- copy rule (down)+              _partitionByOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3824 "AstInternal.hs" #-}+              -- copy rule (down)+              _orderByOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3829 "AstInternal.hs" #-}+              -- copy rule (down)+              _orderByOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3834 "AstInternal.hs" #-}+              -- copy rule (down)+              _dirOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3839 "AstInternal.hs" #-}+              -- copy rule (down)+              _dirOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3844 "AstInternal.hs" #-}+              -- copy rule (down)+              _frmOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3849 "AstInternal.hs" #-}+              -- copy rule (down)+              _frmOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3854 "AstInternal.hs" #-}+              ( _fnIannotatedTree,_fnIliftedColumnName,_fnIoriginalTree) =+                  (fn_ _fnOenv _fnOlib )+              ( _partitionByIannotatedTree,_partitionByIoriginalTree,_partitionByItypeList) =+                  (partitionBy_ _partitionByOenv _partitionByOlib )+              ( _orderByIannotatedTree,_orderByIoriginalTree,_orderByItypeList) =+                  (orderBy_ _orderByOenv _orderByOlib )+              ( _dirIannotatedTree,_dirIoriginalTree) =+                  (dir_ _dirOenv _dirOlib )+              ( _frmIannotatedTree,_frmIoriginalTree) =+                  (frm_ _frmOenv _frmOlib )+          in  ( _lhsOannotatedTree,_lhsOliftedColumnName,_lhsOoriginalTree)))+-- ExpressionDirectionPair -------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Tuple:+         child x1             : Expression +         child x2             : Direction +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type ExpressionDirectionPair  = ( (Expression),(Direction))+-- cata+sem_ExpressionDirectionPair :: ExpressionDirectionPair  ->+                               T_ExpressionDirectionPair +sem_ExpressionDirectionPair ( x1,x2)  =+    (sem_ExpressionDirectionPair_Tuple (sem_Expression x1 ) (sem_Direction x2 ) )+-- semantic domain+type T_ExpressionDirectionPair  = Environment ->+                                  LocalIdentifierBindings ->+                                  ( ExpressionDirectionPair,ExpressionDirectionPair)+data Inh_ExpressionDirectionPair  = Inh_ExpressionDirectionPair {env_Inh_ExpressionDirectionPair :: Environment,lib_Inh_ExpressionDirectionPair :: LocalIdentifierBindings}+data Syn_ExpressionDirectionPair  = Syn_ExpressionDirectionPair {annotatedTree_Syn_ExpressionDirectionPair :: ExpressionDirectionPair,originalTree_Syn_ExpressionDirectionPair :: ExpressionDirectionPair}+wrap_ExpressionDirectionPair :: T_ExpressionDirectionPair  ->+                                Inh_ExpressionDirectionPair  ->+                                Syn_ExpressionDirectionPair +wrap_ExpressionDirectionPair sem (Inh_ExpressionDirectionPair _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_ExpressionDirectionPair _lhsOannotatedTree _lhsOoriginalTree ))+sem_ExpressionDirectionPair_Tuple :: T_Expression  ->+                                     T_Direction  ->+                                     T_ExpressionDirectionPair +sem_ExpressionDirectionPair_Tuple x1_ x2_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: ExpressionDirectionPair+              _lhsOoriginalTree :: ExpressionDirectionPair+              _x1Oenv :: Environment+              _x1Olib :: LocalIdentifierBindings+              _x2Oenv :: Environment+              _x2Olib :: LocalIdentifierBindings+              _x1IannotatedTree :: Expression+              _x1IliftedColumnName :: String+              _x1IoriginalTree :: Expression+              _x2IannotatedTree :: Direction+              _x2IoriginalTree :: Direction+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (_x1IannotatedTree,_x2IannotatedTree)+                  {-# LINE 3923 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (_x1IoriginalTree,_x2IoriginalTree)+                  {-# LINE 3928 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 3933 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 3938 "AstInternal.hs" #-}+              -- copy rule (down)+              _x1Oenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3943 "AstInternal.hs" #-}+              -- copy rule (down)+              _x1Olib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3948 "AstInternal.hs" #-}+              -- copy rule (down)+              _x2Oenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 3953 "AstInternal.hs" #-}+              -- copy rule (down)+              _x2Olib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 3958 "AstInternal.hs" #-}+              ( _x1IannotatedTree,_x1IliftedColumnName,_x1IoriginalTree) =+                  (x1_ _x1Oenv _x1Olib )+              ( _x2IannotatedTree,_x2IoriginalTree) =+                  (x2_ _x2Oenv _x2Olib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- ExpressionDirectionPairList ---------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : ExpressionDirectionPair +         child tl             : ExpressionDirectionPairList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type ExpressionDirectionPairList  = [(ExpressionDirectionPair)]+-- cata+sem_ExpressionDirectionPairList :: ExpressionDirectionPairList  ->+                                   T_ExpressionDirectionPairList +sem_ExpressionDirectionPairList list  =+    (Prelude.foldr sem_ExpressionDirectionPairList_Cons sem_ExpressionDirectionPairList_Nil (Prelude.map sem_ExpressionDirectionPair list) )+-- semantic domain+type T_ExpressionDirectionPairList  = Environment ->+                                      LocalIdentifierBindings ->+                                      ( ExpressionDirectionPairList,ExpressionDirectionPairList)+data Inh_ExpressionDirectionPairList  = Inh_ExpressionDirectionPairList {env_Inh_ExpressionDirectionPairList :: Environment,lib_Inh_ExpressionDirectionPairList :: LocalIdentifierBindings}+data Syn_ExpressionDirectionPairList  = Syn_ExpressionDirectionPairList {annotatedTree_Syn_ExpressionDirectionPairList :: ExpressionDirectionPairList,originalTree_Syn_ExpressionDirectionPairList :: ExpressionDirectionPairList}+wrap_ExpressionDirectionPairList :: T_ExpressionDirectionPairList  ->+                                    Inh_ExpressionDirectionPairList  ->+                                    Syn_ExpressionDirectionPairList +wrap_ExpressionDirectionPairList sem (Inh_ExpressionDirectionPairList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_ExpressionDirectionPairList _lhsOannotatedTree _lhsOoriginalTree ))+sem_ExpressionDirectionPairList_Cons :: T_ExpressionDirectionPair  ->+                                        T_ExpressionDirectionPairList  ->+                                        T_ExpressionDirectionPairList +sem_ExpressionDirectionPairList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: ExpressionDirectionPairList+              _lhsOoriginalTree :: ExpressionDirectionPairList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: ExpressionDirectionPair+              _hdIoriginalTree :: ExpressionDirectionPair+              _tlIannotatedTree :: ExpressionDirectionPairList+              _tlIoriginalTree :: ExpressionDirectionPairList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 4024 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 4029 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 4034 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 4039 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4044 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4049 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4054 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4059 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_ExpressionDirectionPairList_Nil :: T_ExpressionDirectionPairList +sem_ExpressionDirectionPairList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: ExpressionDirectionPairList+              _lhsOoriginalTree :: ExpressionDirectionPairList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 4075 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 4080 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 4085 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 4090 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- ExpressionList ----------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +         typeList             : [Type]+   alternatives:+      alternative Cons:+         child hd             : Expression +         child tl             : ExpressionList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type ExpressionList  = [(Expression)]+-- cata+sem_ExpressionList :: ExpressionList  ->+                      T_ExpressionList +sem_ExpressionList list  =+    (Prelude.foldr sem_ExpressionList_Cons sem_ExpressionList_Nil (Prelude.map sem_Expression list) )+-- semantic domain+type T_ExpressionList  = Environment ->+                         LocalIdentifierBindings ->+                         ( ExpressionList,ExpressionList,([Type]))+data Inh_ExpressionList  = Inh_ExpressionList {env_Inh_ExpressionList :: Environment,lib_Inh_ExpressionList :: LocalIdentifierBindings}+data Syn_ExpressionList  = Syn_ExpressionList {annotatedTree_Syn_ExpressionList :: ExpressionList,originalTree_Syn_ExpressionList :: ExpressionList,typeList_Syn_ExpressionList :: [Type]}+wrap_ExpressionList :: T_ExpressionList  ->+                       Inh_ExpressionList  ->+                       Syn_ExpressionList +wrap_ExpressionList sem (Inh_ExpressionList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOtypeList) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_ExpressionList _lhsOannotatedTree _lhsOoriginalTree _lhsOtypeList ))+sem_ExpressionList_Cons :: T_Expression  ->+                           T_ExpressionList  ->+                           T_ExpressionList +sem_ExpressionList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOtypeList :: ([Type])+              _lhsOannotatedTree :: ExpressionList+              _lhsOoriginalTree :: ExpressionList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: Expression+              _hdIliftedColumnName :: String+              _hdIoriginalTree :: Expression+              _tlIannotatedTree :: ExpressionList+              _tlIoriginalTree :: ExpressionList+              _tlItypeList :: ([Type])+              -- "./TypeChecking/Misc.ag"(line 52, column 12)+              _lhsOtypeList =+                  {-# LINE 52 "./TypeChecking/Misc.ag" #-}+                  getTypeAnnotation _hdIannotatedTree : _tlItypeList+                  {-# LINE 4156 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 4161 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 4166 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 4171 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 4176 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4181 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4186 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4191 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4196 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIliftedColumnName,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIoriginalTree,_tlItypeList) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOtypeList)))+sem_ExpressionList_Nil :: T_ExpressionList +sem_ExpressionList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOtypeList :: ([Type])+              _lhsOannotatedTree :: ExpressionList+              _lhsOoriginalTree :: ExpressionList+              -- "./TypeChecking/Misc.ag"(line 53, column 11)+              _lhsOtypeList =+                  {-# LINE 53 "./TypeChecking/Misc.ag" #-}+                  []+                  {-# LINE 4213 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 4218 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 4223 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 4228 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 4233 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOtypeList)))+-- ExpressionListList ------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +         typeListList         : [[Type]]+   alternatives:+      alternative Cons:+         child hd             : ExpressionList +         child tl             : ExpressionListList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type ExpressionListList  = [(ExpressionList)]+-- cata+sem_ExpressionListList :: ExpressionListList  ->+                          T_ExpressionListList +sem_ExpressionListList list  =+    (Prelude.foldr sem_ExpressionListList_Cons sem_ExpressionListList_Nil (Prelude.map sem_ExpressionList list) )+-- semantic domain+type T_ExpressionListList  = Environment ->+                             LocalIdentifierBindings ->+                             ( ExpressionListList,ExpressionListList,([[Type]]))+data Inh_ExpressionListList  = Inh_ExpressionListList {env_Inh_ExpressionListList :: Environment,lib_Inh_ExpressionListList :: LocalIdentifierBindings}+data Syn_ExpressionListList  = Syn_ExpressionListList {annotatedTree_Syn_ExpressionListList :: ExpressionListList,originalTree_Syn_ExpressionListList :: ExpressionListList,typeListList_Syn_ExpressionListList :: [[Type]]}+wrap_ExpressionListList :: T_ExpressionListList  ->+                           Inh_ExpressionListList  ->+                           Syn_ExpressionListList +wrap_ExpressionListList sem (Inh_ExpressionListList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOtypeListList) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_ExpressionListList _lhsOannotatedTree _lhsOoriginalTree _lhsOtypeListList ))+sem_ExpressionListList_Cons :: T_ExpressionList  ->+                               T_ExpressionListList  ->+                               T_ExpressionListList +sem_ExpressionListList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOtypeListList :: ([[Type]])+              _lhsOannotatedTree :: ExpressionListList+              _lhsOoriginalTree :: ExpressionListList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: ExpressionList+              _hdIoriginalTree :: ExpressionList+              _hdItypeList :: ([Type])+              _tlIannotatedTree :: ExpressionListList+              _tlIoriginalTree :: ExpressionListList+              _tlItypeListList :: ([[Type]])+              -- "./TypeChecking/Misc.ag"(line 59, column 12)+              _lhsOtypeListList =+                  {-# LINE 59 "./TypeChecking/Misc.ag" #-}+                  _hdItypeList : _tlItypeListList+                  {-# LINE 4299 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 4304 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 4309 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 4314 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 4319 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4324 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4329 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4334 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4339 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIoriginalTree,_hdItypeList) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIoriginalTree,_tlItypeListList) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOtypeListList)))+sem_ExpressionListList_Nil :: T_ExpressionListList +sem_ExpressionListList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOtypeListList :: ([[Type]])+              _lhsOannotatedTree :: ExpressionListList+              _lhsOoriginalTree :: ExpressionListList+              -- "./TypeChecking/Misc.ag"(line 60, column 11)+              _lhsOtypeListList =+                  {-# LINE 60 "./TypeChecking/Misc.ag" #-}+                  []+                  {-# LINE 4356 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 4361 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 4366 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 4371 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 4376 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOtypeListList)))+-- ExpressionListStatementListPair -----------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Tuple:+         child x1             : ExpressionList +         child x2             : StatementList +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type ExpressionListStatementListPair  = ( (ExpressionList),(StatementList))+-- cata+sem_ExpressionListStatementListPair :: ExpressionListStatementListPair  ->+                                       T_ExpressionListStatementListPair +sem_ExpressionListStatementListPair ( x1,x2)  =+    (sem_ExpressionListStatementListPair_Tuple (sem_ExpressionList x1 ) (sem_StatementList x2 ) )+-- semantic domain+type T_ExpressionListStatementListPair  = Environment ->+                                          LocalIdentifierBindings ->+                                          ( ExpressionListStatementListPair,ExpressionListStatementListPair)+data Inh_ExpressionListStatementListPair  = Inh_ExpressionListStatementListPair {env_Inh_ExpressionListStatementListPair :: Environment,lib_Inh_ExpressionListStatementListPair :: LocalIdentifierBindings}+data Syn_ExpressionListStatementListPair  = Syn_ExpressionListStatementListPair {annotatedTree_Syn_ExpressionListStatementListPair :: ExpressionListStatementListPair,originalTree_Syn_ExpressionListStatementListPair :: ExpressionListStatementListPair}+wrap_ExpressionListStatementListPair :: T_ExpressionListStatementListPair  ->+                                        Inh_ExpressionListStatementListPair  ->+                                        Syn_ExpressionListStatementListPair +wrap_ExpressionListStatementListPair sem (Inh_ExpressionListStatementListPair _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_ExpressionListStatementListPair _lhsOannotatedTree _lhsOoriginalTree ))+sem_ExpressionListStatementListPair_Tuple :: T_ExpressionList  ->+                                             T_StatementList  ->+                                             T_ExpressionListStatementListPair +sem_ExpressionListStatementListPair_Tuple x1_ x2_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _x2OenvUpdates :: ([EnvironmentUpdate])+              _x2OlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: ExpressionListStatementListPair+              _lhsOoriginalTree :: ExpressionListStatementListPair+              _x1Oenv :: Environment+              _x1Olib :: LocalIdentifierBindings+              _x2Oenv :: Environment+              _x2Olib :: LocalIdentifierBindings+              _x1IannotatedTree :: ExpressionList+              _x1IoriginalTree :: ExpressionList+              _x1ItypeList :: ([Type])+              _x2IannotatedTree :: StatementList+              _x2IoriginalTree :: StatementList+              _x2IproducedEnv :: Environment+              _x2IproducedLib :: LocalIdentifierBindings+              -- "./TypeChecking/Statements.ag"(line 94, column 9)+              _x2OenvUpdates =+                  {-# LINE 94 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 4439 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 95, column 9)+              _x2OlibUpdates =+                  {-# LINE 95 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 4444 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (_x1IannotatedTree,_x2IannotatedTree)+                  {-# LINE 4449 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (_x1IoriginalTree,_x2IoriginalTree)+                  {-# LINE 4454 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 4459 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 4464 "AstInternal.hs" #-}+              -- copy rule (down)+              _x1Oenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4469 "AstInternal.hs" #-}+              -- copy rule (down)+              _x1Olib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4474 "AstInternal.hs" #-}+              -- copy rule (down)+              _x2Oenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4479 "AstInternal.hs" #-}+              -- copy rule (down)+              _x2Olib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4484 "AstInternal.hs" #-}+              ( _x1IannotatedTree,_x1IoriginalTree,_x1ItypeList) =+                  (x1_ _x1Oenv _x1Olib )+              ( _x2IannotatedTree,_x2IoriginalTree,_x2IproducedEnv,_x2IproducedLib) =+                  (x2_ _x2Oenv _x2OenvUpdates _x2Olib _x2OlibUpdates )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- ExpressionListStatementListPairList -------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : ExpressionListStatementListPair +         child tl             : ExpressionListStatementListPairList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type ExpressionListStatementListPairList  = [(ExpressionListStatementListPair)]+-- cata+sem_ExpressionListStatementListPairList :: ExpressionListStatementListPairList  ->+                                           T_ExpressionListStatementListPairList +sem_ExpressionListStatementListPairList list  =+    (Prelude.foldr sem_ExpressionListStatementListPairList_Cons sem_ExpressionListStatementListPairList_Nil (Prelude.map sem_ExpressionListStatementListPair list) )+-- semantic domain+type T_ExpressionListStatementListPairList  = Environment ->+                                              LocalIdentifierBindings ->+                                              ( ExpressionListStatementListPairList,ExpressionListStatementListPairList)+data Inh_ExpressionListStatementListPairList  = Inh_ExpressionListStatementListPairList {env_Inh_ExpressionListStatementListPairList :: Environment,lib_Inh_ExpressionListStatementListPairList :: LocalIdentifierBindings}+data Syn_ExpressionListStatementListPairList  = Syn_ExpressionListStatementListPairList {annotatedTree_Syn_ExpressionListStatementListPairList :: ExpressionListStatementListPairList,originalTree_Syn_ExpressionListStatementListPairList :: ExpressionListStatementListPairList}+wrap_ExpressionListStatementListPairList :: T_ExpressionListStatementListPairList  ->+                                            Inh_ExpressionListStatementListPairList  ->+                                            Syn_ExpressionListStatementListPairList +wrap_ExpressionListStatementListPairList sem (Inh_ExpressionListStatementListPairList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_ExpressionListStatementListPairList _lhsOannotatedTree _lhsOoriginalTree ))+sem_ExpressionListStatementListPairList_Cons :: T_ExpressionListStatementListPair  ->+                                                T_ExpressionListStatementListPairList  ->+                                                T_ExpressionListStatementListPairList +sem_ExpressionListStatementListPairList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: ExpressionListStatementListPairList+              _lhsOoriginalTree :: ExpressionListStatementListPairList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: ExpressionListStatementListPair+              _hdIoriginalTree :: ExpressionListStatementListPair+              _tlIannotatedTree :: ExpressionListStatementListPairList+              _tlIoriginalTree :: ExpressionListStatementListPairList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 4550 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 4555 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 4560 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 4565 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4570 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4575 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4580 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4585 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_ExpressionListStatementListPairList_Nil :: T_ExpressionListStatementListPairList +sem_ExpressionListStatementListPairList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: ExpressionListStatementListPairList+              _lhsOoriginalTree :: ExpressionListStatementListPairList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 4601 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 4606 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 4611 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 4616 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- ExpressionRoot ----------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative ExpressionRoot:+         child expr           : Expression +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data ExpressionRoot  = ExpressionRoot (Expression) +                     deriving ( Show)+-- cata+sem_ExpressionRoot :: ExpressionRoot  ->+                      T_ExpressionRoot +sem_ExpressionRoot (ExpressionRoot _expr )  =+    (sem_ExpressionRoot_ExpressionRoot (sem_Expression _expr ) )+-- semantic domain+type T_ExpressionRoot  = Environment ->+                         LocalIdentifierBindings ->+                         ( ExpressionRoot,ExpressionRoot)+data Inh_ExpressionRoot  = Inh_ExpressionRoot {env_Inh_ExpressionRoot :: Environment,lib_Inh_ExpressionRoot :: LocalIdentifierBindings}+data Syn_ExpressionRoot  = Syn_ExpressionRoot {annotatedTree_Syn_ExpressionRoot :: ExpressionRoot,originalTree_Syn_ExpressionRoot :: ExpressionRoot}+wrap_ExpressionRoot :: T_ExpressionRoot  ->+                       Inh_ExpressionRoot  ->+                       Syn_ExpressionRoot +wrap_ExpressionRoot sem (Inh_ExpressionRoot _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_ExpressionRoot _lhsOannotatedTree _lhsOoriginalTree ))+sem_ExpressionRoot_ExpressionRoot :: T_Expression  ->+                                     T_ExpressionRoot +sem_ExpressionRoot_ExpressionRoot expr_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: ExpressionRoot+              _lhsOoriginalTree :: ExpressionRoot+              _exprOenv :: Environment+              _exprOlib :: LocalIdentifierBindings+              _exprIannotatedTree :: Expression+              _exprIliftedColumnName :: String+              _exprIoriginalTree :: Expression+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  ExpressionRoot _exprIannotatedTree+                  {-# LINE 4670 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  ExpressionRoot _exprIoriginalTree+                  {-# LINE 4675 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 4680 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 4685 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4690 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4695 "AstInternal.hs" #-}+              ( _exprIannotatedTree,_exprIliftedColumnName,_exprIoriginalTree) =+                  (expr_ _exprOenv _exprOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- ExpressionStatementListPair ---------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Tuple:+         child x1             : Expression +         child x2             : StatementList +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type ExpressionStatementListPair  = ( (Expression),(StatementList))+-- cata+sem_ExpressionStatementListPair :: ExpressionStatementListPair  ->+                                   T_ExpressionStatementListPair +sem_ExpressionStatementListPair ( x1,x2)  =+    (sem_ExpressionStatementListPair_Tuple (sem_Expression x1 ) (sem_StatementList x2 ) )+-- semantic domain+type T_ExpressionStatementListPair  = Environment ->+                                      LocalIdentifierBindings ->+                                      ( ExpressionStatementListPair,ExpressionStatementListPair)+data Inh_ExpressionStatementListPair  = Inh_ExpressionStatementListPair {env_Inh_ExpressionStatementListPair :: Environment,lib_Inh_ExpressionStatementListPair :: LocalIdentifierBindings}+data Syn_ExpressionStatementListPair  = Syn_ExpressionStatementListPair {annotatedTree_Syn_ExpressionStatementListPair :: ExpressionStatementListPair,originalTree_Syn_ExpressionStatementListPair :: ExpressionStatementListPair}+wrap_ExpressionStatementListPair :: T_ExpressionStatementListPair  ->+                                    Inh_ExpressionStatementListPair  ->+                                    Syn_ExpressionStatementListPair +wrap_ExpressionStatementListPair sem (Inh_ExpressionStatementListPair _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_ExpressionStatementListPair _lhsOannotatedTree _lhsOoriginalTree ))+sem_ExpressionStatementListPair_Tuple :: T_Expression  ->+                                         T_StatementList  ->+                                         T_ExpressionStatementListPair +sem_ExpressionStatementListPair_Tuple x1_ x2_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _x2OenvUpdates :: ([EnvironmentUpdate])+              _x2OlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: ExpressionStatementListPair+              _lhsOoriginalTree :: ExpressionStatementListPair+              _x1Oenv :: Environment+              _x1Olib :: LocalIdentifierBindings+              _x2Oenv :: Environment+              _x2Olib :: LocalIdentifierBindings+              _x1IannotatedTree :: Expression+              _x1IliftedColumnName :: String+              _x1IoriginalTree :: Expression+              _x2IannotatedTree :: StatementList+              _x2IoriginalTree :: StatementList+              _x2IproducedEnv :: Environment+              _x2IproducedLib :: LocalIdentifierBindings+              -- "./TypeChecking/Statements.ag"(line 98, column 9)+              _x2OenvUpdates =+                  {-# LINE 98 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 4760 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 99, column 9)+              _x2OlibUpdates =+                  {-# LINE 99 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 4765 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (_x1IannotatedTree,_x2IannotatedTree)+                  {-# LINE 4770 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (_x1IoriginalTree,_x2IoriginalTree)+                  {-# LINE 4775 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 4780 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 4785 "AstInternal.hs" #-}+              -- copy rule (down)+              _x1Oenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4790 "AstInternal.hs" #-}+              -- copy rule (down)+              _x1Olib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4795 "AstInternal.hs" #-}+              -- copy rule (down)+              _x2Oenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4800 "AstInternal.hs" #-}+              -- copy rule (down)+              _x2Olib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4805 "AstInternal.hs" #-}+              ( _x1IannotatedTree,_x1IliftedColumnName,_x1IoriginalTree) =+                  (x1_ _x1Oenv _x1Olib )+              ( _x2IannotatedTree,_x2IoriginalTree,_x2IproducedEnv,_x2IproducedLib) =+                  (x2_ _x2Oenv _x2OenvUpdates _x2Olib _x2OlibUpdates )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- ExpressionStatementListPairList -----------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : ExpressionStatementListPair +         child tl             : ExpressionStatementListPairList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type ExpressionStatementListPairList  = [(ExpressionStatementListPair)]+-- cata+sem_ExpressionStatementListPairList :: ExpressionStatementListPairList  ->+                                       T_ExpressionStatementListPairList +sem_ExpressionStatementListPairList list  =+    (Prelude.foldr sem_ExpressionStatementListPairList_Cons sem_ExpressionStatementListPairList_Nil (Prelude.map sem_ExpressionStatementListPair list) )+-- semantic domain+type T_ExpressionStatementListPairList  = Environment ->+                                          LocalIdentifierBindings ->+                                          ( ExpressionStatementListPairList,ExpressionStatementListPairList)+data Inh_ExpressionStatementListPairList  = Inh_ExpressionStatementListPairList {env_Inh_ExpressionStatementListPairList :: Environment,lib_Inh_ExpressionStatementListPairList :: LocalIdentifierBindings}+data Syn_ExpressionStatementListPairList  = Syn_ExpressionStatementListPairList {annotatedTree_Syn_ExpressionStatementListPairList :: ExpressionStatementListPairList,originalTree_Syn_ExpressionStatementListPairList :: ExpressionStatementListPairList}+wrap_ExpressionStatementListPairList :: T_ExpressionStatementListPairList  ->+                                        Inh_ExpressionStatementListPairList  ->+                                        Syn_ExpressionStatementListPairList +wrap_ExpressionStatementListPairList sem (Inh_ExpressionStatementListPairList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_ExpressionStatementListPairList _lhsOannotatedTree _lhsOoriginalTree ))+sem_ExpressionStatementListPairList_Cons :: T_ExpressionStatementListPair  ->+                                            T_ExpressionStatementListPairList  ->+                                            T_ExpressionStatementListPairList +sem_ExpressionStatementListPairList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: ExpressionStatementListPairList+              _lhsOoriginalTree :: ExpressionStatementListPairList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: ExpressionStatementListPair+              _hdIoriginalTree :: ExpressionStatementListPair+              _tlIannotatedTree :: ExpressionStatementListPairList+              _tlIoriginalTree :: ExpressionStatementListPairList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 4871 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 4876 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 4881 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 4886 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4891 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4896 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 4901 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 4906 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_ExpressionStatementListPairList_Nil :: T_ExpressionStatementListPairList +sem_ExpressionStatementListPairList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: ExpressionStatementListPairList+              _lhsOoriginalTree :: ExpressionStatementListPairList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 4922 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 4927 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 4932 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 4937 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- FnBody ------------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative PlpgsqlFnBody:+         child ann            : {Annotation}+         child vars           : VarDefList +         child sts            : StatementList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative SqlFnBody:+         child ann            : {Annotation}+         child sts            : StatementList +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data FnBody  = PlpgsqlFnBody (Annotation) (VarDefList) (StatementList) +             | SqlFnBody (Annotation) (StatementList) +             deriving ( Data,Eq,Show,Typeable)+-- cata+sem_FnBody :: FnBody  ->+              T_FnBody +sem_FnBody (PlpgsqlFnBody _ann _vars _sts )  =+    (sem_FnBody_PlpgsqlFnBody _ann (sem_VarDefList _vars ) (sem_StatementList _sts ) )+sem_FnBody (SqlFnBody _ann _sts )  =+    (sem_FnBody_SqlFnBody _ann (sem_StatementList _sts ) )+-- semantic domain+type T_FnBody  = Environment ->+                 LocalIdentifierBindings ->+                 ( FnBody,FnBody)+data Inh_FnBody  = Inh_FnBody {env_Inh_FnBody :: Environment,lib_Inh_FnBody :: LocalIdentifierBindings}+data Syn_FnBody  = Syn_FnBody {annotatedTree_Syn_FnBody :: FnBody,originalTree_Syn_FnBody :: FnBody}+wrap_FnBody :: T_FnBody  ->+               Inh_FnBody  ->+               Syn_FnBody +wrap_FnBody sem (Inh_FnBody _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_FnBody _lhsOannotatedTree _lhsOoriginalTree ))+sem_FnBody_PlpgsqlFnBody :: Annotation ->+                            T_VarDefList  ->+                            T_StatementList  ->+                            T_FnBody +sem_FnBody_PlpgsqlFnBody ann_ vars_ sts_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _stsOenvUpdates :: ([EnvironmentUpdate])+              _stsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _stsOlib :: LocalIdentifierBindings+              _lhsOannotatedTree :: FnBody+              _lhsOoriginalTree :: FnBody+              _varsOenv :: Environment+              _varsOlib :: LocalIdentifierBindings+              _stsOenv :: Environment+              _varsIannotatedTree :: VarDefList+              _varsIdefs :: ([(String,Type)])+              _varsIoriginalTree :: VarDefList+              _stsIannotatedTree :: StatementList+              _stsIoriginalTree :: StatementList+              _stsIproducedEnv :: Environment+              _stsIproducedLib :: LocalIdentifierBindings+              -- "./TypeChecking/Statements.ag"(line 102, column 9)+              _stsOenvUpdates =+                  {-# LINE 102 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 5012 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 103, column 9)+              _stsOlibUpdates =+                  {-# LINE 103 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 5017 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateFunction.ag"(line 121, column 9)+              _stsOlib =+                  {-# LINE 121 "./TypeChecking/CreateFunction.ag" #-}+                  fromRight _lhsIlib $+                  updateBindings _lhsIlib _lhsIenv+                                 [LibStackIDs [("", _varsIdefs)]]+                  {-# LINE 5024 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  PlpgsqlFnBody ann_ _varsIannotatedTree _stsIannotatedTree+                  {-# LINE 5029 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  PlpgsqlFnBody ann_ _varsIoriginalTree _stsIoriginalTree+                  {-# LINE 5034 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5039 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5044 "AstInternal.hs" #-}+              -- copy rule (down)+              _varsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 5049 "AstInternal.hs" #-}+              -- copy rule (down)+              _varsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 5054 "AstInternal.hs" #-}+              -- copy rule (down)+              _stsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 5059 "AstInternal.hs" #-}+              ( _varsIannotatedTree,_varsIdefs,_varsIoriginalTree) =+                  (vars_ _varsOenv _varsOlib )+              ( _stsIannotatedTree,_stsIoriginalTree,_stsIproducedEnv,_stsIproducedLib) =+                  (sts_ _stsOenv _stsOenvUpdates _stsOlib _stsOlibUpdates )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_FnBody_SqlFnBody :: Annotation ->+                        T_StatementList  ->+                        T_FnBody +sem_FnBody_SqlFnBody ann_ sts_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _stsOenvUpdates :: ([EnvironmentUpdate])+              _stsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: FnBody+              _lhsOoriginalTree :: FnBody+              _stsOenv :: Environment+              _stsOlib :: LocalIdentifierBindings+              _stsIannotatedTree :: StatementList+              _stsIoriginalTree :: StatementList+              _stsIproducedEnv :: Environment+              _stsIproducedLib :: LocalIdentifierBindings+              -- "./TypeChecking/Statements.ag"(line 102, column 9)+              _stsOenvUpdates =+                  {-# LINE 102 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 5085 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 103, column 9)+              _stsOlibUpdates =+                  {-# LINE 103 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 5090 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  SqlFnBody ann_ _stsIannotatedTree+                  {-# LINE 5095 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  SqlFnBody ann_ _stsIoriginalTree+                  {-# LINE 5100 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5105 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5110 "AstInternal.hs" #-}+              -- copy rule (down)+              _stsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 5115 "AstInternal.hs" #-}+              -- copy rule (down)+              _stsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 5120 "AstInternal.hs" #-}+              ( _stsIannotatedTree,_stsIoriginalTree,_stsIproducedEnv,_stsIproducedLib) =+                  (sts_ _stsOenv _stsOenvUpdates _stsOlib _stsOlibUpdates )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- FrameClause -------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative FrameRowsUnboundedPreceding:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative FrameUnboundedFull:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative FrameUnboundedPreceding:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data FrameClause  = FrameRowsUnboundedPreceding +                  | FrameUnboundedFull +                  | FrameUnboundedPreceding +                  deriving ( Data,Eq,Show,Typeable)+-- cata+sem_FrameClause :: FrameClause  ->+                   T_FrameClause +sem_FrameClause (FrameRowsUnboundedPreceding )  =+    (sem_FrameClause_FrameRowsUnboundedPreceding )+sem_FrameClause (FrameUnboundedFull )  =+    (sem_FrameClause_FrameUnboundedFull )+sem_FrameClause (FrameUnboundedPreceding )  =+    (sem_FrameClause_FrameUnboundedPreceding )+-- semantic domain+type T_FrameClause  = Environment ->+                      LocalIdentifierBindings ->+                      ( FrameClause,FrameClause)+data Inh_FrameClause  = Inh_FrameClause {env_Inh_FrameClause :: Environment,lib_Inh_FrameClause :: LocalIdentifierBindings}+data Syn_FrameClause  = Syn_FrameClause {annotatedTree_Syn_FrameClause :: FrameClause,originalTree_Syn_FrameClause :: FrameClause}+wrap_FrameClause :: T_FrameClause  ->+                    Inh_FrameClause  ->+                    Syn_FrameClause +wrap_FrameClause sem (Inh_FrameClause _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_FrameClause _lhsOannotatedTree _lhsOoriginalTree ))+sem_FrameClause_FrameRowsUnboundedPreceding :: T_FrameClause +sem_FrameClause_FrameRowsUnboundedPreceding  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: FrameClause+              _lhsOoriginalTree :: FrameClause+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  FrameRowsUnboundedPreceding+                  {-# LINE 5183 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  FrameRowsUnboundedPreceding+                  {-# LINE 5188 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5193 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5198 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_FrameClause_FrameUnboundedFull :: T_FrameClause +sem_FrameClause_FrameUnboundedFull  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: FrameClause+              _lhsOoriginalTree :: FrameClause+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  FrameUnboundedFull+                  {-# LINE 5210 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  FrameUnboundedFull+                  {-# LINE 5215 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5220 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5225 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_FrameClause_FrameUnboundedPreceding :: T_FrameClause +sem_FrameClause_FrameUnboundedPreceding  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: FrameClause+              _lhsOoriginalTree :: FrameClause+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  FrameUnboundedPreceding+                  {-# LINE 5237 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  FrameUnboundedPreceding+                  {-# LINE 5242 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5247 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5252 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- IfExists ----------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative IfExists:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Require:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data IfExists  = IfExists +               | Require +               deriving ( Data,Eq,Show,Typeable)+-- cata+sem_IfExists :: IfExists  ->+                T_IfExists +sem_IfExists (IfExists )  =+    (sem_IfExists_IfExists )+sem_IfExists (Require )  =+    (sem_IfExists_Require )+-- semantic domain+type T_IfExists  = Environment ->+                   LocalIdentifierBindings ->+                   ( IfExists,IfExists)+data Inh_IfExists  = Inh_IfExists {env_Inh_IfExists :: Environment,lib_Inh_IfExists :: LocalIdentifierBindings}+data Syn_IfExists  = Syn_IfExists {annotatedTree_Syn_IfExists :: IfExists,originalTree_Syn_IfExists :: IfExists}+wrap_IfExists :: T_IfExists  ->+                 Inh_IfExists  ->+                 Syn_IfExists +wrap_IfExists sem (Inh_IfExists _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_IfExists _lhsOannotatedTree _lhsOoriginalTree ))+sem_IfExists_IfExists :: T_IfExists +sem_IfExists_IfExists  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: IfExists+              _lhsOoriginalTree :: IfExists+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  IfExists+                  {-# LINE 5306 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  IfExists+                  {-# LINE 5311 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5316 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5321 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_IfExists_Require :: T_IfExists +sem_IfExists_Require  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: IfExists+              _lhsOoriginalTree :: IfExists+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Require+                  {-# LINE 5333 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Require+                  {-# LINE 5338 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5343 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5348 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- InList ------------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         listType             : Either [TypeError] Type+         originalTree         : SELF +   alternatives:+      alternative InList:+         child ann            : {Annotation}+         child exprs          : ExpressionList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative InSelect:+         child ann            : {Annotation}+         child sel            : SelectExpression +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data InList  = InList (Annotation) (ExpressionList) +             | InSelect (Annotation) (SelectExpression) +             deriving ( Data,Eq,Show,Typeable)+-- cata+sem_InList :: InList  ->+              T_InList +sem_InList (InList _ann _exprs )  =+    (sem_InList_InList _ann (sem_ExpressionList _exprs ) )+sem_InList (InSelect _ann _sel )  =+    (sem_InList_InSelect _ann (sem_SelectExpression _sel ) )+-- semantic domain+type T_InList  = Environment ->+                 LocalIdentifierBindings ->+                 ( InList,(Either [TypeError] Type),InList)+data Inh_InList  = Inh_InList {env_Inh_InList :: Environment,lib_Inh_InList :: LocalIdentifierBindings}+data Syn_InList  = Syn_InList {annotatedTree_Syn_InList :: InList,listType_Syn_InList :: Either [TypeError] Type,originalTree_Syn_InList :: InList}+wrap_InList :: T_InList  ->+               Inh_InList  ->+               Syn_InList +wrap_InList sem (Inh_InList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOlistType,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_InList _lhsOannotatedTree _lhsOlistType _lhsOoriginalTree ))+sem_InList_InList :: Annotation ->+                     T_ExpressionList  ->+                     T_InList +sem_InList_InList ann_ exprs_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOlistType :: (Either [TypeError] Type)+              _lhsOannotatedTree :: InList+              _lhsOoriginalTree :: InList+              _exprsOenv :: Environment+              _exprsOlib :: LocalIdentifierBindings+              _exprsIannotatedTree :: ExpressionList+              _exprsIoriginalTree :: ExpressionList+              _exprsItypeList :: ([Type])+              -- "./TypeChecking/Expressions.ag"(line 299, column 9)+              _lhsOlistType =+                  {-# LINE 299 "./TypeChecking/Expressions.ag" #-}+                  resolveResultSetType _lhsIenv _exprsItypeList+                  {-# LINE 5415 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  InList ann_ _exprsIannotatedTree+                  {-# LINE 5420 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  InList ann_ _exprsIoriginalTree+                  {-# LINE 5425 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5430 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5435 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 5440 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 5445 "AstInternal.hs" #-}+              ( _exprsIannotatedTree,_exprsIoriginalTree,_exprsItypeList) =+                  (exprs_ _exprsOenv _exprsOlib )+          in  ( _lhsOannotatedTree,_lhsOlistType,_lhsOoriginalTree)))+sem_InList_InSelect :: Annotation ->+                       T_SelectExpression  ->+                       T_InList +sem_InList_InSelect ann_ sel_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOlistType :: (Either [TypeError] Type)+              _lhsOannotatedTree :: InList+              _lhsOoriginalTree :: InList+              _selOenv :: Environment+              _selOlib :: LocalIdentifierBindings+              _selIannotatedTree :: SelectExpression+              _selIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _selIoriginalTree :: SelectExpression+              -- "./TypeChecking/Expressions.ag"(line 301, column 9)+              _lhsOlistType =+                  {-# LINE 301 "./TypeChecking/Expressions.ag" #-}+                  do+                  attrs <- map snd <$> (unwrapSetOfComposite $+                                        getTypeAnnotation _selIannotatedTree)+                  typ <- case length attrs of+                            0 -> Left [InternalError+                                       "got subquery with no columns? in inselect"]+                            1 -> Right $ head attrs+                            _ -> Right $ AnonymousRecordType attrs+                  dependsOnRTpe attrs $ Right typ+                  {-# LINE 5475 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  InSelect ann_ _selIannotatedTree+                  {-# LINE 5480 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  InSelect ann_ _selIoriginalTree+                  {-# LINE 5485 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5490 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5495 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 5500 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 5505 "AstInternal.hs" #-}+              ( _selIannotatedTree,_selIlibUpdates,_selIoriginalTree) =+                  (sel_ _selOenv _selOlib )+          in  ( _lhsOannotatedTree,_lhsOlistType,_lhsOoriginalTree)))+-- JoinExpression ----------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative JoinOn:+         child ann            : {Annotation}+         child expression     : Expression +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative JoinUsing:+         child ann            : {Annotation}+         child stringList     : StringList +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data JoinExpression  = JoinOn (Annotation) (Expression) +                     | JoinUsing (Annotation) (StringList) +                     deriving ( Data,Eq,Show,Typeable)+-- cata+sem_JoinExpression :: JoinExpression  ->+                      T_JoinExpression +sem_JoinExpression (JoinOn _ann _expression )  =+    (sem_JoinExpression_JoinOn _ann (sem_Expression _expression ) )+sem_JoinExpression (JoinUsing _ann _stringList )  =+    (sem_JoinExpression_JoinUsing _ann (sem_StringList _stringList ) )+-- semantic domain+type T_JoinExpression  = Environment ->+                         LocalIdentifierBindings ->+                         ( JoinExpression,JoinExpression)+data Inh_JoinExpression  = Inh_JoinExpression {env_Inh_JoinExpression :: Environment,lib_Inh_JoinExpression :: LocalIdentifierBindings}+data Syn_JoinExpression  = Syn_JoinExpression {annotatedTree_Syn_JoinExpression :: JoinExpression,originalTree_Syn_JoinExpression :: JoinExpression}+wrap_JoinExpression :: T_JoinExpression  ->+                       Inh_JoinExpression  ->+                       Syn_JoinExpression +wrap_JoinExpression sem (Inh_JoinExpression _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_JoinExpression _lhsOannotatedTree _lhsOoriginalTree ))+sem_JoinExpression_JoinOn :: Annotation ->+                             T_Expression  ->+                             T_JoinExpression +sem_JoinExpression_JoinOn ann_ expression_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: JoinExpression+              _lhsOoriginalTree :: JoinExpression+              _expressionOenv :: Environment+              _expressionOlib :: LocalIdentifierBindings+              _expressionIannotatedTree :: Expression+              _expressionIliftedColumnName :: String+              _expressionIoriginalTree :: Expression+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  JoinOn ann_ _expressionIannotatedTree+                  {-# LINE 5572 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  JoinOn ann_ _expressionIoriginalTree+                  {-# LINE 5577 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5582 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5587 "AstInternal.hs" #-}+              -- copy rule (down)+              _expressionOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 5592 "AstInternal.hs" #-}+              -- copy rule (down)+              _expressionOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 5597 "AstInternal.hs" #-}+              ( _expressionIannotatedTree,_expressionIliftedColumnName,_expressionIoriginalTree) =+                  (expression_ _expressionOenv _expressionOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_JoinExpression_JoinUsing :: Annotation ->+                                T_StringList  ->+                                T_JoinExpression +sem_JoinExpression_JoinUsing ann_ stringList_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: JoinExpression+              _lhsOoriginalTree :: JoinExpression+              _stringListOenv :: Environment+              _stringListOlib :: LocalIdentifierBindings+              _stringListIannotatedTree :: StringList+              _stringListIoriginalTree :: StringList+              _stringListIstrings :: ([String])+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  JoinUsing ann_ _stringListIannotatedTree+                  {-# LINE 5618 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  JoinUsing ann_ _stringListIoriginalTree+                  {-# LINE 5623 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5628 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5633 "AstInternal.hs" #-}+              -- copy rule (down)+              _stringListOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 5638 "AstInternal.hs" #-}+              -- copy rule (down)+              _stringListOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 5643 "AstInternal.hs" #-}+              ( _stringListIannotatedTree,_stringListIoriginalTree,_stringListIstrings) =+                  (stringList_ _stringListOenv _stringListOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- JoinType ----------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Cross:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative FullOuter:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Inner:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative LeftOuter:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative RightOuter:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data JoinType  = Cross +               | FullOuter +               | Inner +               | LeftOuter +               | RightOuter +               deriving ( Data,Eq,Show,Typeable)+-- cata+sem_JoinType :: JoinType  ->+                T_JoinType +sem_JoinType (Cross )  =+    (sem_JoinType_Cross )+sem_JoinType (FullOuter )  =+    (sem_JoinType_FullOuter )+sem_JoinType (Inner )  =+    (sem_JoinType_Inner )+sem_JoinType (LeftOuter )  =+    (sem_JoinType_LeftOuter )+sem_JoinType (RightOuter )  =+    (sem_JoinType_RightOuter )+-- semantic domain+type T_JoinType  = Environment ->+                   LocalIdentifierBindings ->+                   ( JoinType,JoinType)+data Inh_JoinType  = Inh_JoinType {env_Inh_JoinType :: Environment,lib_Inh_JoinType :: LocalIdentifierBindings}+data Syn_JoinType  = Syn_JoinType {annotatedTree_Syn_JoinType :: JoinType,originalTree_Syn_JoinType :: JoinType}+wrap_JoinType :: T_JoinType  ->+                 Inh_JoinType  ->+                 Syn_JoinType +wrap_JoinType sem (Inh_JoinType _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_JoinType _lhsOannotatedTree _lhsOoriginalTree ))+sem_JoinType_Cross :: T_JoinType +sem_JoinType_Cross  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: JoinType+              _lhsOoriginalTree :: JoinType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Cross+                  {-# LINE 5720 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Cross+                  {-# LINE 5725 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5730 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5735 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_JoinType_FullOuter :: T_JoinType +sem_JoinType_FullOuter  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: JoinType+              _lhsOoriginalTree :: JoinType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  FullOuter+                  {-# LINE 5747 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  FullOuter+                  {-# LINE 5752 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5757 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5762 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_JoinType_Inner :: T_JoinType +sem_JoinType_Inner  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: JoinType+              _lhsOoriginalTree :: JoinType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Inner+                  {-# LINE 5774 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Inner+                  {-# LINE 5779 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5784 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5789 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_JoinType_LeftOuter :: T_JoinType +sem_JoinType_LeftOuter  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: JoinType+              _lhsOoriginalTree :: JoinType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  LeftOuter+                  {-# LINE 5801 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  LeftOuter+                  {-# LINE 5806 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5811 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5816 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_JoinType_RightOuter :: T_JoinType +sem_JoinType_RightOuter  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: JoinType+              _lhsOoriginalTree :: JoinType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  RightOuter+                  {-# LINE 5828 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  RightOuter+                  {-# LINE 5833 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5838 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5843 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- Language ----------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Plpgsql:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Sql:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data Language  = Plpgsql +               | Sql +               deriving ( Data,Eq,Show,Typeable)+-- cata+sem_Language :: Language  ->+                T_Language +sem_Language (Plpgsql )  =+    (sem_Language_Plpgsql )+sem_Language (Sql )  =+    (sem_Language_Sql )+-- semantic domain+type T_Language  = Environment ->+                   LocalIdentifierBindings ->+                   ( Language,Language)+data Inh_Language  = Inh_Language {env_Inh_Language :: Environment,lib_Inh_Language :: LocalIdentifierBindings}+data Syn_Language  = Syn_Language {annotatedTree_Syn_Language :: Language,originalTree_Syn_Language :: Language}+wrap_Language :: T_Language  ->+                 Inh_Language  ->+                 Syn_Language +wrap_Language sem (Inh_Language _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_Language _lhsOannotatedTree _lhsOoriginalTree ))+sem_Language_Plpgsql :: T_Language +sem_Language_Plpgsql  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Language+              _lhsOoriginalTree :: Language+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Plpgsql+                  {-# LINE 5897 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Plpgsql+                  {-# LINE 5902 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5907 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5912 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_Language_Sql :: T_Language +sem_Language_Sql  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Language+              _lhsOoriginalTree :: Language+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Sql+                  {-# LINE 5924 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Sql+                  {-# LINE 5929 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 5934 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 5939 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- LiftFlavour -------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative LiftAll:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative LiftAny:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data LiftFlavour  = LiftAll +                  | LiftAny +                  deriving ( Data,Eq,Show,Typeable)+-- cata+sem_LiftFlavour :: LiftFlavour  ->+                   T_LiftFlavour +sem_LiftFlavour (LiftAll )  =+    (sem_LiftFlavour_LiftAll )+sem_LiftFlavour (LiftAny )  =+    (sem_LiftFlavour_LiftAny )+-- semantic domain+type T_LiftFlavour  = Environment ->+                      LocalIdentifierBindings ->+                      ( LiftFlavour,LiftFlavour)+data Inh_LiftFlavour  = Inh_LiftFlavour {env_Inh_LiftFlavour :: Environment,lib_Inh_LiftFlavour :: LocalIdentifierBindings}+data Syn_LiftFlavour  = Syn_LiftFlavour {annotatedTree_Syn_LiftFlavour :: LiftFlavour,originalTree_Syn_LiftFlavour :: LiftFlavour}+wrap_LiftFlavour :: T_LiftFlavour  ->+                    Inh_LiftFlavour  ->+                    Syn_LiftFlavour +wrap_LiftFlavour sem (Inh_LiftFlavour _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_LiftFlavour _lhsOannotatedTree _lhsOoriginalTree ))+sem_LiftFlavour_LiftAll :: T_LiftFlavour +sem_LiftFlavour_LiftAll  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: LiftFlavour+              _lhsOoriginalTree :: LiftFlavour+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  LiftAll+                  {-# LINE 5993 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  LiftAll+                  {-# LINE 5998 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6003 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6008 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_LiftFlavour_LiftAny :: T_LiftFlavour +sem_LiftFlavour_LiftAny  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: LiftFlavour+              _lhsOoriginalTree :: LiftFlavour+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  LiftAny+                  {-# LINE 6020 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  LiftAny+                  {-# LINE 6025 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6030 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6035 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- MaybeBoolExpression -----------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Just:+         child just           : Expression +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nothing:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type MaybeBoolExpression  = (Maybe (Expression))+-- cata+sem_MaybeBoolExpression :: MaybeBoolExpression  ->+                           T_MaybeBoolExpression +sem_MaybeBoolExpression (Prelude.Just x )  =+    (sem_MaybeBoolExpression_Just (sem_Expression x ) )+sem_MaybeBoolExpression Prelude.Nothing  =+    sem_MaybeBoolExpression_Nothing+-- semantic domain+type T_MaybeBoolExpression  = Environment ->+                              LocalIdentifierBindings ->+                              ( MaybeBoolExpression,MaybeBoolExpression)+data Inh_MaybeBoolExpression  = Inh_MaybeBoolExpression {env_Inh_MaybeBoolExpression :: Environment,lib_Inh_MaybeBoolExpression :: LocalIdentifierBindings}+data Syn_MaybeBoolExpression  = Syn_MaybeBoolExpression {annotatedTree_Syn_MaybeBoolExpression :: MaybeBoolExpression,originalTree_Syn_MaybeBoolExpression :: MaybeBoolExpression}+wrap_MaybeBoolExpression :: T_MaybeBoolExpression  ->+                            Inh_MaybeBoolExpression  ->+                            Syn_MaybeBoolExpression +wrap_MaybeBoolExpression sem (Inh_MaybeBoolExpression _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_MaybeBoolExpression _lhsOannotatedTree _lhsOoriginalTree ))+sem_MaybeBoolExpression_Just :: T_Expression  ->+                                T_MaybeBoolExpression +sem_MaybeBoolExpression_Just just_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: MaybeBoolExpression+              _lhsOoriginalTree :: MaybeBoolExpression+              _justOenv :: Environment+              _justOlib :: LocalIdentifierBindings+              _justIannotatedTree :: Expression+              _justIliftedColumnName :: String+              _justIoriginalTree :: Expression+              -- "./TypeChecking/Misc.ag"(line 74, column 9)+              _lhsOannotatedTree =+                  {-# LINE 74 "./TypeChecking/Misc.ag" #-}+                  if getTypeAnnotation _justIannotatedTree `notElem` [typeBool, TypeCheckFailed]+                    then Just $ updateAnnotation ((TypeErrorA ExpressionMustBeBool) :)+                                  _justIannotatedTree+                    else Just $ _justIannotatedTree+                  {-# LINE 6097 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Just _justIannotatedTree+                  {-# LINE 6102 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Just _justIoriginalTree+                  {-# LINE 6107 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6112 "AstInternal.hs" #-}+              -- copy rule (down)+              _justOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 6117 "AstInternal.hs" #-}+              -- copy rule (down)+              _justOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 6122 "AstInternal.hs" #-}+              ( _justIannotatedTree,_justIliftedColumnName,_justIoriginalTree) =+                  (just_ _justOenv _justOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_MaybeBoolExpression_Nothing :: T_MaybeBoolExpression +sem_MaybeBoolExpression_Nothing  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: MaybeBoolExpression+              _lhsOoriginalTree :: MaybeBoolExpression+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Nothing+                  {-# LINE 6136 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Nothing+                  {-# LINE 6141 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6146 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6151 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- MaybeExpression ---------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Just:+         child just           : Expression +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nothing:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type MaybeExpression  = (Maybe (Expression))+-- cata+sem_MaybeExpression :: MaybeExpression  ->+                       T_MaybeExpression +sem_MaybeExpression (Prelude.Just x )  =+    (sem_MaybeExpression_Just (sem_Expression x ) )+sem_MaybeExpression Prelude.Nothing  =+    sem_MaybeExpression_Nothing+-- semantic domain+type T_MaybeExpression  = Environment ->+                          LocalIdentifierBindings ->+                          ( MaybeExpression,MaybeExpression)+data Inh_MaybeExpression  = Inh_MaybeExpression {env_Inh_MaybeExpression :: Environment,lib_Inh_MaybeExpression :: LocalIdentifierBindings}+data Syn_MaybeExpression  = Syn_MaybeExpression {annotatedTree_Syn_MaybeExpression :: MaybeExpression,originalTree_Syn_MaybeExpression :: MaybeExpression}+wrap_MaybeExpression :: T_MaybeExpression  ->+                        Inh_MaybeExpression  ->+                        Syn_MaybeExpression +wrap_MaybeExpression sem (Inh_MaybeExpression _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_MaybeExpression _lhsOannotatedTree _lhsOoriginalTree ))+sem_MaybeExpression_Just :: T_Expression  ->+                            T_MaybeExpression +sem_MaybeExpression_Just just_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: MaybeExpression+              _lhsOoriginalTree :: MaybeExpression+              _justOenv :: Environment+              _justOlib :: LocalIdentifierBindings+              _justIannotatedTree :: Expression+              _justIliftedColumnName :: String+              _justIoriginalTree :: Expression+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Just _justIannotatedTree+                  {-# LINE 6210 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Just _justIoriginalTree+                  {-# LINE 6215 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6220 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6225 "AstInternal.hs" #-}+              -- copy rule (down)+              _justOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 6230 "AstInternal.hs" #-}+              -- copy rule (down)+              _justOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 6235 "AstInternal.hs" #-}+              ( _justIannotatedTree,_justIliftedColumnName,_justIoriginalTree) =+                  (just_ _justOenv _justOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_MaybeExpression_Nothing :: T_MaybeExpression +sem_MaybeExpression_Nothing  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: MaybeExpression+              _lhsOoriginalTree :: MaybeExpression+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Nothing+                  {-# LINE 6249 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Nothing+                  {-# LINE 6254 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6259 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6264 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- MaybeSelectList ---------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         listType             : Maybe [(String,Type)]+         originalTree         : SELF +   alternatives:+      alternative Just:+         child just           : SelectList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nothing:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type MaybeSelectList  = (Maybe (SelectList))+-- cata+sem_MaybeSelectList :: MaybeSelectList  ->+                       T_MaybeSelectList +sem_MaybeSelectList (Prelude.Just x )  =+    (sem_MaybeSelectList_Just (sem_SelectList x ) )+sem_MaybeSelectList Prelude.Nothing  =+    sem_MaybeSelectList_Nothing+-- semantic domain+type T_MaybeSelectList  = Environment ->+                          LocalIdentifierBindings ->+                          ( MaybeSelectList,(Maybe [(String,Type)]),MaybeSelectList)+data Inh_MaybeSelectList  = Inh_MaybeSelectList {env_Inh_MaybeSelectList :: Environment,lib_Inh_MaybeSelectList :: LocalIdentifierBindings}+data Syn_MaybeSelectList  = Syn_MaybeSelectList {annotatedTree_Syn_MaybeSelectList :: MaybeSelectList,listType_Syn_MaybeSelectList :: Maybe [(String,Type)],originalTree_Syn_MaybeSelectList :: MaybeSelectList}+wrap_MaybeSelectList :: T_MaybeSelectList  ->+                        Inh_MaybeSelectList  ->+                        Syn_MaybeSelectList +wrap_MaybeSelectList sem (Inh_MaybeSelectList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOlistType,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_MaybeSelectList _lhsOannotatedTree _lhsOlistType _lhsOoriginalTree ))+sem_MaybeSelectList_Just :: T_SelectList  ->+                            T_MaybeSelectList +sem_MaybeSelectList_Just just_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOlistType :: (Maybe [(String,Type)])+              _lhsOannotatedTree :: MaybeSelectList+              _lhsOoriginalTree :: MaybeSelectList+              _justOenv :: Environment+              _justOlib :: LocalIdentifierBindings+              _justIannotatedTree :: SelectList+              _justIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _justIlistType :: ([(String,Type)])+              _justIoriginalTree :: SelectList+              -- "./TypeChecking/SelectLists.ag"(line 25, column 12)+              _lhsOlistType =+                  {-# LINE 25 "./TypeChecking/SelectLists.ag" #-}+                  Just _justIlistType+                  {-# LINE 6326 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Just _justIannotatedTree+                  {-# LINE 6331 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Just _justIoriginalTree+                  {-# LINE 6336 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6341 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6346 "AstInternal.hs" #-}+              -- copy rule (down)+              _justOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 6351 "AstInternal.hs" #-}+              -- copy rule (down)+              _justOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 6356 "AstInternal.hs" #-}+              ( _justIannotatedTree,_justIlibUpdates,_justIlistType,_justIoriginalTree) =+                  (just_ _justOenv _justOlib )+          in  ( _lhsOannotatedTree,_lhsOlistType,_lhsOoriginalTree)))+sem_MaybeSelectList_Nothing :: T_MaybeSelectList +sem_MaybeSelectList_Nothing  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOlistType :: (Maybe [(String,Type)])+              _lhsOannotatedTree :: MaybeSelectList+              _lhsOoriginalTree :: MaybeSelectList+              -- "./TypeChecking/SelectLists.ag"(line 26, column 15)+              _lhsOlistType =+                  {-# LINE 26 "./TypeChecking/SelectLists.ag" #-}+                  Nothing+                  {-# LINE 6371 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Nothing+                  {-# LINE 6376 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Nothing+                  {-# LINE 6381 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6386 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6391 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOlistType,_lhsOoriginalTree)))+-- Natural -----------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Natural:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Unnatural:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data Natural  = Natural +              | Unnatural +              deriving ( Data,Eq,Show,Typeable)+-- cata+sem_Natural :: Natural  ->+               T_Natural +sem_Natural (Natural )  =+    (sem_Natural_Natural )+sem_Natural (Unnatural )  =+    (sem_Natural_Unnatural )+-- semantic domain+type T_Natural  = Environment ->+                  LocalIdentifierBindings ->+                  ( Natural,Natural)+data Inh_Natural  = Inh_Natural {env_Inh_Natural :: Environment,lib_Inh_Natural :: LocalIdentifierBindings}+data Syn_Natural  = Syn_Natural {annotatedTree_Syn_Natural :: Natural,originalTree_Syn_Natural :: Natural}+wrap_Natural :: T_Natural  ->+                Inh_Natural  ->+                Syn_Natural +wrap_Natural sem (Inh_Natural _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_Natural _lhsOannotatedTree _lhsOoriginalTree ))+sem_Natural_Natural :: T_Natural +sem_Natural_Natural  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Natural+              _lhsOoriginalTree :: Natural+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Natural+                  {-# LINE 6445 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Natural+                  {-# LINE 6450 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6455 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6460 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_Natural_Unnatural :: T_Natural +sem_Natural_Unnatural  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Natural+              _lhsOoriginalTree :: Natural+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Unnatural+                  {-# LINE 6472 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Unnatural+                  {-# LINE 6477 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6482 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6487 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- OnExpr ------------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Just:+         child just           : JoinExpression +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nothing:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type OnExpr  = (Maybe (JoinExpression))+-- cata+sem_OnExpr :: OnExpr  ->+              T_OnExpr +sem_OnExpr (Prelude.Just x )  =+    (sem_OnExpr_Just (sem_JoinExpression x ) )+sem_OnExpr Prelude.Nothing  =+    sem_OnExpr_Nothing+-- semantic domain+type T_OnExpr  = Environment ->+                 LocalIdentifierBindings ->+                 ( OnExpr,OnExpr)+data Inh_OnExpr  = Inh_OnExpr {env_Inh_OnExpr :: Environment,lib_Inh_OnExpr :: LocalIdentifierBindings}+data Syn_OnExpr  = Syn_OnExpr {annotatedTree_Syn_OnExpr :: OnExpr,originalTree_Syn_OnExpr :: OnExpr}+wrap_OnExpr :: T_OnExpr  ->+               Inh_OnExpr  ->+               Syn_OnExpr +wrap_OnExpr sem (Inh_OnExpr _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_OnExpr _lhsOannotatedTree _lhsOoriginalTree ))+sem_OnExpr_Just :: T_JoinExpression  ->+                   T_OnExpr +sem_OnExpr_Just just_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: OnExpr+              _lhsOoriginalTree :: OnExpr+              _justOenv :: Environment+              _justOlib :: LocalIdentifierBindings+              _justIannotatedTree :: JoinExpression+              _justIoriginalTree :: JoinExpression+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Just _justIannotatedTree+                  {-# LINE 6545 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Just _justIoriginalTree+                  {-# LINE 6550 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6555 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6560 "AstInternal.hs" #-}+              -- copy rule (down)+              _justOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 6565 "AstInternal.hs" #-}+              -- copy rule (down)+              _justOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 6570 "AstInternal.hs" #-}+              ( _justIannotatedTree,_justIoriginalTree) =+                  (just_ _justOenv _justOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_OnExpr_Nothing :: T_OnExpr +sem_OnExpr_Nothing  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: OnExpr+              _lhsOoriginalTree :: OnExpr+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Nothing+                  {-# LINE 6584 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Nothing+                  {-# LINE 6589 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6594 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6599 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- ParamDef ----------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         namedType            : Type+         originalTree         : SELF +         paramName            : String+   alternatives:+      alternative ParamDef:+         child ann            : {Annotation}+         child name           : {String}+         child typ            : TypeName +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative ParamDefTp:+         child ann            : {Annotation}+         child typ            : TypeName +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data ParamDef  = ParamDef (Annotation) (String) (TypeName) +               | ParamDefTp (Annotation) (TypeName) +               deriving ( Data,Eq,Show,Typeable)+-- cata+sem_ParamDef :: ParamDef  ->+                T_ParamDef +sem_ParamDef (ParamDef _ann _name _typ )  =+    (sem_ParamDef_ParamDef _ann _name (sem_TypeName _typ ) )+sem_ParamDef (ParamDefTp _ann _typ )  =+    (sem_ParamDef_ParamDefTp _ann (sem_TypeName _typ ) )+-- semantic domain+type T_ParamDef  = Environment ->+                   LocalIdentifierBindings ->+                   ( ParamDef,Type,ParamDef,String)+data Inh_ParamDef  = Inh_ParamDef {env_Inh_ParamDef :: Environment,lib_Inh_ParamDef :: LocalIdentifierBindings}+data Syn_ParamDef  = Syn_ParamDef {annotatedTree_Syn_ParamDef :: ParamDef,namedType_Syn_ParamDef :: Type,originalTree_Syn_ParamDef :: ParamDef,paramName_Syn_ParamDef :: String}+wrap_ParamDef :: T_ParamDef  ->+                 Inh_ParamDef  ->+                 Syn_ParamDef +wrap_ParamDef sem (Inh_ParamDef _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOnamedType,_lhsOoriginalTree,_lhsOparamName) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_ParamDef _lhsOannotatedTree _lhsOnamedType _lhsOoriginalTree _lhsOparamName ))+sem_ParamDef_ParamDef :: Annotation ->+                         String ->+                         T_TypeName  ->+                         T_ParamDef +sem_ParamDef_ParamDef ann_ name_ typ_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOnamedType :: Type+              _lhsOparamName :: String+              _lhsOannotatedTree :: ParamDef+              _lhsOoriginalTree :: ParamDef+              _typOenv :: Environment+              _typOlib :: LocalIdentifierBindings+              _typIannotatedTree :: TypeName+              _typInamedType :: Type+              _typIoriginalTree :: TypeName+              -- "./TypeChecking/CreateFunction.ag"(line 56, column 9)+              _lhsOnamedType =+                  {-# LINE 56 "./TypeChecking/CreateFunction.ag" #-}+                  _typInamedType+                  {-# LINE 6670 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateFunction.ag"(line 58, column 9)+              _lhsOparamName =+                  {-# LINE 58 "./TypeChecking/CreateFunction.ag" #-}+                  name_+                  {-# LINE 6675 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  ParamDef ann_ name_ _typIannotatedTree+                  {-# LINE 6680 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  ParamDef ann_ name_ _typIoriginalTree+                  {-# LINE 6685 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6690 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6695 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 6700 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 6705 "AstInternal.hs" #-}+              ( _typIannotatedTree,_typInamedType,_typIoriginalTree) =+                  (typ_ _typOenv _typOlib )+          in  ( _lhsOannotatedTree,_lhsOnamedType,_lhsOoriginalTree,_lhsOparamName)))+sem_ParamDef_ParamDefTp :: Annotation ->+                           T_TypeName  ->+                           T_ParamDef +sem_ParamDef_ParamDefTp ann_ typ_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOnamedType :: Type+              _lhsOparamName :: String+              _lhsOannotatedTree :: ParamDef+              _lhsOoriginalTree :: ParamDef+              _typOenv :: Environment+              _typOlib :: LocalIdentifierBindings+              _typIannotatedTree :: TypeName+              _typInamedType :: Type+              _typIoriginalTree :: TypeName+              -- "./TypeChecking/CreateFunction.ag"(line 56, column 9)+              _lhsOnamedType =+                  {-# LINE 56 "./TypeChecking/CreateFunction.ag" #-}+                  _typInamedType+                  {-# LINE 6728 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateFunction.ag"(line 60, column 9)+              _lhsOparamName =+                  {-# LINE 60 "./TypeChecking/CreateFunction.ag" #-}+                  ""+                  {-# LINE 6733 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  ParamDefTp ann_ _typIannotatedTree+                  {-# LINE 6738 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  ParamDefTp ann_ _typIoriginalTree+                  {-# LINE 6743 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6748 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6753 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 6758 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 6763 "AstInternal.hs" #-}+              ( _typIannotatedTree,_typInamedType,_typIoriginalTree) =+                  (typ_ _typOenv _typOlib )+          in  ( _lhsOannotatedTree,_lhsOnamedType,_lhsOoriginalTree,_lhsOparamName)))+-- ParamDefList ------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +         params               : [(String, Type)]+   alternatives:+      alternative Cons:+         child hd             : ParamDef +         child tl             : ParamDefList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type ParamDefList  = [(ParamDef)]+-- cata+sem_ParamDefList :: ParamDefList  ->+                    T_ParamDefList +sem_ParamDefList list  =+    (Prelude.foldr sem_ParamDefList_Cons sem_ParamDefList_Nil (Prelude.map sem_ParamDef list) )+-- semantic domain+type T_ParamDefList  = Environment ->+                       LocalIdentifierBindings ->+                       ( ParamDefList,ParamDefList,([(String, Type)]))+data Inh_ParamDefList  = Inh_ParamDefList {env_Inh_ParamDefList :: Environment,lib_Inh_ParamDefList :: LocalIdentifierBindings}+data Syn_ParamDefList  = Syn_ParamDefList {annotatedTree_Syn_ParamDefList :: ParamDefList,originalTree_Syn_ParamDefList :: ParamDefList,params_Syn_ParamDefList :: [(String, Type)]}+wrap_ParamDefList :: T_ParamDefList  ->+                     Inh_ParamDefList  ->+                     Syn_ParamDefList +wrap_ParamDefList sem (Inh_ParamDefList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOparams) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_ParamDefList _lhsOannotatedTree _lhsOoriginalTree _lhsOparams ))+sem_ParamDefList_Cons :: T_ParamDef  ->+                         T_ParamDefList  ->+                         T_ParamDefList +sem_ParamDefList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOparams :: ([(String, Type)])+              _lhsOannotatedTree :: ParamDefList+              _lhsOoriginalTree :: ParamDefList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: ParamDef+              _hdInamedType :: Type+              _hdIoriginalTree :: ParamDef+              _hdIparamName :: String+              _tlIannotatedTree :: ParamDefList+              _tlIoriginalTree :: ParamDefList+              _tlIparams :: ([(String, Type)])+              -- "./TypeChecking/CreateFunction.ag"(line 64, column 13)+              _lhsOparams =+                  {-# LINE 64 "./TypeChecking/CreateFunction.ag" #-}+                  ((_hdIparamName, _hdInamedType) : _tlIparams)+                  {-# LINE 6832 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 6837 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 6842 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6847 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6852 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 6857 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 6862 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 6867 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 6872 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdInamedType,_hdIoriginalTree,_hdIparamName) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIoriginalTree,_tlIparams) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOparams)))+sem_ParamDefList_Nil :: T_ParamDefList +sem_ParamDefList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOparams :: ([(String, Type)])+              _lhsOannotatedTree :: ParamDefList+              _lhsOoriginalTree :: ParamDefList+              -- "./TypeChecking/CreateFunction.ag"(line 63, column 12)+              _lhsOparams =+                  {-# LINE 63 "./TypeChecking/CreateFunction.ag" #-}+                  []+                  {-# LINE 6889 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 6894 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 6899 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6904 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6909 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOparams)))+-- RaiseType ---------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative RError:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative RException:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative RNotice:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data RaiseType  = RError +                | RException +                | RNotice +                deriving ( Data,Eq,Show,Typeable)+-- cata+sem_RaiseType :: RaiseType  ->+                 T_RaiseType +sem_RaiseType (RError )  =+    (sem_RaiseType_RError )+sem_RaiseType (RException )  =+    (sem_RaiseType_RException )+sem_RaiseType (RNotice )  =+    (sem_RaiseType_RNotice )+-- semantic domain+type T_RaiseType  = Environment ->+                    LocalIdentifierBindings ->+                    ( RaiseType,RaiseType)+data Inh_RaiseType  = Inh_RaiseType {env_Inh_RaiseType :: Environment,lib_Inh_RaiseType :: LocalIdentifierBindings}+data Syn_RaiseType  = Syn_RaiseType {annotatedTree_Syn_RaiseType :: RaiseType,originalTree_Syn_RaiseType :: RaiseType}+wrap_RaiseType :: T_RaiseType  ->+                  Inh_RaiseType  ->+                  Syn_RaiseType +wrap_RaiseType sem (Inh_RaiseType _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_RaiseType _lhsOannotatedTree _lhsOoriginalTree ))+sem_RaiseType_RError :: T_RaiseType +sem_RaiseType_RError  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: RaiseType+              _lhsOoriginalTree :: RaiseType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  RError+                  {-# LINE 6970 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  RError+                  {-# LINE 6975 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 6980 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 6985 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_RaiseType_RException :: T_RaiseType +sem_RaiseType_RException  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: RaiseType+              _lhsOoriginalTree :: RaiseType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  RException+                  {-# LINE 6997 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  RException+                  {-# LINE 7002 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 7007 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7012 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_RaiseType_RNotice :: T_RaiseType +sem_RaiseType_RNotice  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: RaiseType+              _lhsOoriginalTree :: RaiseType+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  RNotice+                  {-# LINE 7024 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  RNotice+                  {-# LINE 7029 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 7034 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7039 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- RestartIdentity ---------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative ContinueIdentity:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative RestartIdentity:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data RestartIdentity  = ContinueIdentity +                      | RestartIdentity +                      deriving ( Data,Eq,Show,Typeable)+-- cata+sem_RestartIdentity :: RestartIdentity  ->+                       T_RestartIdentity +sem_RestartIdentity (ContinueIdentity )  =+    (sem_RestartIdentity_ContinueIdentity )+sem_RestartIdentity (RestartIdentity )  =+    (sem_RestartIdentity_RestartIdentity )+-- semantic domain+type T_RestartIdentity  = Environment ->+                          LocalIdentifierBindings ->+                          ( RestartIdentity,RestartIdentity)+data Inh_RestartIdentity  = Inh_RestartIdentity {env_Inh_RestartIdentity :: Environment,lib_Inh_RestartIdentity :: LocalIdentifierBindings}+data Syn_RestartIdentity  = Syn_RestartIdentity {annotatedTree_Syn_RestartIdentity :: RestartIdentity,originalTree_Syn_RestartIdentity :: RestartIdentity}+wrap_RestartIdentity :: T_RestartIdentity  ->+                        Inh_RestartIdentity  ->+                        Syn_RestartIdentity +wrap_RestartIdentity sem (Inh_RestartIdentity _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_RestartIdentity _lhsOannotatedTree _lhsOoriginalTree ))+sem_RestartIdentity_ContinueIdentity :: T_RestartIdentity +sem_RestartIdentity_ContinueIdentity  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: RestartIdentity+              _lhsOoriginalTree :: RestartIdentity+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  ContinueIdentity+                  {-# LINE 7093 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  ContinueIdentity+                  {-# LINE 7098 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 7103 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7108 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_RestartIdentity_RestartIdentity :: T_RestartIdentity +sem_RestartIdentity_RestartIdentity  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: RestartIdentity+              _lhsOoriginalTree :: RestartIdentity+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  RestartIdentity+                  {-# LINE 7120 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  RestartIdentity+                  {-# LINE 7125 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 7130 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7135 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- Root --------------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +         producedEnv          : Environment+         producedLib          : LocalIdentifierBindings+   alternatives:+      alternative Root:+         child statements     : StatementList +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data Root  = Root (StatementList) +           deriving ( Show)+-- cata+sem_Root :: Root  ->+            T_Root +sem_Root (Root _statements )  =+    (sem_Root_Root (sem_StatementList _statements ) )+-- semantic domain+type T_Root  = Environment ->+               LocalIdentifierBindings ->+               ( Root,Root,Environment,LocalIdentifierBindings)+data Inh_Root  = Inh_Root {env_Inh_Root :: Environment,lib_Inh_Root :: LocalIdentifierBindings}+data Syn_Root  = Syn_Root {annotatedTree_Syn_Root :: Root,originalTree_Syn_Root :: Root,producedEnv_Syn_Root :: Environment,producedLib_Syn_Root :: LocalIdentifierBindings}+wrap_Root :: T_Root  ->+             Inh_Root  ->+             Syn_Root +wrap_Root sem (Inh_Root _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOproducedEnv,_lhsOproducedLib) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_Root _lhsOannotatedTree _lhsOoriginalTree _lhsOproducedEnv _lhsOproducedLib ))+sem_Root_Root :: T_StatementList  ->+                 T_Root +sem_Root_Root statements_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _statementsOenvUpdates :: ([EnvironmentUpdate])+              _statementsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Root+              _lhsOoriginalTree :: Root+              _lhsOproducedEnv :: Environment+              _lhsOproducedLib :: LocalIdentifierBindings+              _statementsOenv :: Environment+              _statementsOlib :: LocalIdentifierBindings+              _statementsIannotatedTree :: StatementList+              _statementsIoriginalTree :: StatementList+              _statementsIproducedEnv :: Environment+              _statementsIproducedLib :: LocalIdentifierBindings+              -- "./TypeChecking/Statements.ag"(line 80, column 12)+              _statementsOenvUpdates =+                  {-# LINE 80 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 7196 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 81, column 12)+              _statementsOlibUpdates =+                  {-# LINE 81 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 7201 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Root _statementsIannotatedTree+                  {-# LINE 7206 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Root _statementsIoriginalTree+                  {-# LINE 7211 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 7216 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7221 "AstInternal.hs" #-}+              -- copy rule (up)+              _lhsOproducedEnv =+                  {-# LINE 27 "./TypeChecking/Statements.ag" #-}+                  _statementsIproducedEnv+                  {-# LINE 7226 "AstInternal.hs" #-}+              -- copy rule (up)+              _lhsOproducedLib =+                  {-# LINE 28 "./TypeChecking/Statements.ag" #-}+                  _statementsIproducedLib+                  {-# LINE 7231 "AstInternal.hs" #-}+              -- copy rule (down)+              _statementsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 7236 "AstInternal.hs" #-}+              -- copy rule (down)+              _statementsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 7241 "AstInternal.hs" #-}+              ( _statementsIannotatedTree,_statementsIoriginalTree,_statementsIproducedEnv,_statementsIproducedLib) =+                  (statements_ _statementsOenv _statementsOenvUpdates _statementsOlib _statementsOlibUpdates )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOproducedEnv,_lhsOproducedLib)))+-- RowConstraint -----------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative NotNullConstraint:+         child ann            : {Annotation}+         child name           : {String}+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative NullConstraint:+         child ann            : {Annotation}+         child name           : {String}+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative RowCheckConstraint:+         child ann            : {Annotation}+         child name           : {String}+         child expression     : Expression +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative RowPrimaryKeyConstraint:+         child ann            : {Annotation}+         child name           : {String}+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative RowReferenceConstraint:+         child ann            : {Annotation}+         child name           : {String}+         child table          : {String}+         child att            : {Maybe String}+         child onUpdate       : Cascade +         child onDelete       : Cascade +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative RowUniqueConstraint:+         child ann            : {Annotation}+         child name           : {String}+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data RowConstraint  = NotNullConstraint (Annotation) (String) +                    | NullConstraint (Annotation) (String) +                    | RowCheckConstraint (Annotation) (String) (Expression) +                    | RowPrimaryKeyConstraint (Annotation) (String) +                    | RowReferenceConstraint (Annotation) (String) (String) (Maybe String) (Cascade) (Cascade) +                    | RowUniqueConstraint (Annotation) (String) +                    deriving ( Data,Eq,Show,Typeable)+-- cata+sem_RowConstraint :: RowConstraint  ->+                     T_RowConstraint +sem_RowConstraint (NotNullConstraint _ann _name )  =+    (sem_RowConstraint_NotNullConstraint _ann _name )+sem_RowConstraint (NullConstraint _ann _name )  =+    (sem_RowConstraint_NullConstraint _ann _name )+sem_RowConstraint (RowCheckConstraint _ann _name _expression )  =+    (sem_RowConstraint_RowCheckConstraint _ann _name (sem_Expression _expression ) )+sem_RowConstraint (RowPrimaryKeyConstraint _ann _name )  =+    (sem_RowConstraint_RowPrimaryKeyConstraint _ann _name )+sem_RowConstraint (RowReferenceConstraint _ann _name _table _att _onUpdate _onDelete )  =+    (sem_RowConstraint_RowReferenceConstraint _ann _name _table _att (sem_Cascade _onUpdate ) (sem_Cascade _onDelete ) )+sem_RowConstraint (RowUniqueConstraint _ann _name )  =+    (sem_RowConstraint_RowUniqueConstraint _ann _name )+-- semantic domain+type T_RowConstraint  = Environment ->+                        LocalIdentifierBindings ->+                        ( RowConstraint,RowConstraint)+data Inh_RowConstraint  = Inh_RowConstraint {env_Inh_RowConstraint :: Environment,lib_Inh_RowConstraint :: LocalIdentifierBindings}+data Syn_RowConstraint  = Syn_RowConstraint {annotatedTree_Syn_RowConstraint :: RowConstraint,originalTree_Syn_RowConstraint :: RowConstraint}+wrap_RowConstraint :: T_RowConstraint  ->+                      Inh_RowConstraint  ->+                      Syn_RowConstraint +wrap_RowConstraint sem (Inh_RowConstraint _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_RowConstraint _lhsOannotatedTree _lhsOoriginalTree ))+sem_RowConstraint_NotNullConstraint :: Annotation ->+                                       String ->+                                       T_RowConstraint +sem_RowConstraint_NotNullConstraint ann_ name_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: RowConstraint+              _lhsOoriginalTree :: RowConstraint+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  NotNullConstraint ann_ name_+                  {-# LINE 7344 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  NotNullConstraint ann_ name_+                  {-# LINE 7349 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 7354 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7359 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_RowConstraint_NullConstraint :: Annotation ->+                                    String ->+                                    T_RowConstraint +sem_RowConstraint_NullConstraint ann_ name_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: RowConstraint+              _lhsOoriginalTree :: RowConstraint+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  NullConstraint ann_ name_+                  {-# LINE 7373 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  NullConstraint ann_ name_+                  {-# LINE 7378 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 7383 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7388 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_RowConstraint_RowCheckConstraint :: Annotation ->+                                        String ->+                                        T_Expression  ->+                                        T_RowConstraint +sem_RowConstraint_RowCheckConstraint ann_ name_ expression_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: RowConstraint+              _lhsOoriginalTree :: RowConstraint+              _expressionOenv :: Environment+              _expressionOlib :: LocalIdentifierBindings+              _expressionIannotatedTree :: Expression+              _expressionIliftedColumnName :: String+              _expressionIoriginalTree :: Expression+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  RowCheckConstraint ann_ name_ _expressionIannotatedTree+                  {-# LINE 7408 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  RowCheckConstraint ann_ name_ _expressionIoriginalTree+                  {-# LINE 7413 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 7418 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7423 "AstInternal.hs" #-}+              -- copy rule (down)+              _expressionOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 7428 "AstInternal.hs" #-}+              -- copy rule (down)+              _expressionOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 7433 "AstInternal.hs" #-}+              ( _expressionIannotatedTree,_expressionIliftedColumnName,_expressionIoriginalTree) =+                  (expression_ _expressionOenv _expressionOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_RowConstraint_RowPrimaryKeyConstraint :: Annotation ->+                                             String ->+                                             T_RowConstraint +sem_RowConstraint_RowPrimaryKeyConstraint ann_ name_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: RowConstraint+              _lhsOoriginalTree :: RowConstraint+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  RowPrimaryKeyConstraint ann_ name_+                  {-# LINE 7449 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  RowPrimaryKeyConstraint ann_ name_+                  {-# LINE 7454 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 7459 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7464 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_RowConstraint_RowReferenceConstraint :: Annotation ->+                                            String ->+                                            String ->+                                            (Maybe String) ->+                                            T_Cascade  ->+                                            T_Cascade  ->+                                            T_RowConstraint +sem_RowConstraint_RowReferenceConstraint ann_ name_ table_ att_ onUpdate_ onDelete_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: RowConstraint+              _lhsOoriginalTree :: RowConstraint+              _onUpdateOenv :: Environment+              _onUpdateOlib :: LocalIdentifierBindings+              _onDeleteOenv :: Environment+              _onDeleteOlib :: LocalIdentifierBindings+              _onUpdateIannotatedTree :: Cascade+              _onUpdateIoriginalTree :: Cascade+              _onDeleteIannotatedTree :: Cascade+              _onDeleteIoriginalTree :: Cascade+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  RowReferenceConstraint ann_ name_ table_ att_ _onUpdateIannotatedTree _onDeleteIannotatedTree+                  {-# LINE 7490 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  RowReferenceConstraint ann_ name_ table_ att_ _onUpdateIoriginalTree _onDeleteIoriginalTree+                  {-# LINE 7495 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 7500 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7505 "AstInternal.hs" #-}+              -- copy rule (down)+              _onUpdateOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 7510 "AstInternal.hs" #-}+              -- copy rule (down)+              _onUpdateOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 7515 "AstInternal.hs" #-}+              -- copy rule (down)+              _onDeleteOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 7520 "AstInternal.hs" #-}+              -- copy rule (down)+              _onDeleteOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 7525 "AstInternal.hs" #-}+              ( _onUpdateIannotatedTree,_onUpdateIoriginalTree) =+                  (onUpdate_ _onUpdateOenv _onUpdateOlib )+              ( _onDeleteIannotatedTree,_onDeleteIoriginalTree) =+                  (onDelete_ _onDeleteOenv _onDeleteOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_RowConstraint_RowUniqueConstraint :: Annotation ->+                                         String ->+                                         T_RowConstraint +sem_RowConstraint_RowUniqueConstraint ann_ name_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: RowConstraint+              _lhsOoriginalTree :: RowConstraint+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  RowUniqueConstraint ann_ name_+                  {-# LINE 7543 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  RowUniqueConstraint ann_ name_+                  {-# LINE 7548 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 7553 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7558 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- RowConstraintList -------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : RowConstraint +         child tl             : RowConstraintList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type RowConstraintList  = [(RowConstraint)]+-- cata+sem_RowConstraintList :: RowConstraintList  ->+                         T_RowConstraintList +sem_RowConstraintList list  =+    (Prelude.foldr sem_RowConstraintList_Cons sem_RowConstraintList_Nil (Prelude.map sem_RowConstraint list) )+-- semantic domain+type T_RowConstraintList  = Environment ->+                            LocalIdentifierBindings ->+                            ( RowConstraintList,RowConstraintList)+data Inh_RowConstraintList  = Inh_RowConstraintList {env_Inh_RowConstraintList :: Environment,lib_Inh_RowConstraintList :: LocalIdentifierBindings}+data Syn_RowConstraintList  = Syn_RowConstraintList {annotatedTree_Syn_RowConstraintList :: RowConstraintList,originalTree_Syn_RowConstraintList :: RowConstraintList}+wrap_RowConstraintList :: T_RowConstraintList  ->+                          Inh_RowConstraintList  ->+                          Syn_RowConstraintList +wrap_RowConstraintList sem (Inh_RowConstraintList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_RowConstraintList _lhsOannotatedTree _lhsOoriginalTree ))+sem_RowConstraintList_Cons :: T_RowConstraint  ->+                              T_RowConstraintList  ->+                              T_RowConstraintList +sem_RowConstraintList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: RowConstraintList+              _lhsOoriginalTree :: RowConstraintList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: RowConstraint+              _hdIoriginalTree :: RowConstraint+              _tlIannotatedTree :: RowConstraintList+              _tlIoriginalTree :: RowConstraintList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 7620 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 7625 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 7630 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7635 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 7640 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 7645 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 7650 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 7655 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_RowConstraintList_Nil :: T_RowConstraintList +sem_RowConstraintList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: RowConstraintList+              _lhsOoriginalTree :: RowConstraintList+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 7671 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 7676 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 7681 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7686 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- SelectExpression --------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         libUpdates           : [LocalIdentifierBindingsUpdate]+         originalTree         : SELF +   alternatives:+      alternative CombineSelect:+         child ann            : {Annotation}+         child ctype          : CombineType +         child sel1           : SelectExpression +         child sel2           : SelectExpression +         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative Select:+         child ann            : {Annotation}+         child selDistinct    : Distinct +         child selSelectList  : SelectList +         child selTref        : TableRefList +         child selWhere       : MaybeBoolExpression +         child selGroupBy     : ExpressionList +         child selHaving      : MaybeBoolExpression +         child selOrderBy     : ExpressionDirectionPairList +         child selLimit       : MaybeExpression +         child selOffset      : MaybeExpression +         visit 0:+            local newLib      : _+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative Values:+         child ann            : {Annotation}+         child vll            : ExpressionListList +         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+-}+data SelectExpression  = CombineSelect (Annotation) (CombineType) (SelectExpression) (SelectExpression) +                       | Select (Annotation) (Distinct) (SelectList) (TableRefList) (MaybeBoolExpression) (ExpressionList) (MaybeBoolExpression) (ExpressionDirectionPairList) (MaybeExpression) (MaybeExpression) +                       | Values (Annotation) (ExpressionListList) +                       deriving ( Data,Eq,Show,Typeable)+-- cata+sem_SelectExpression :: SelectExpression  ->+                        T_SelectExpression +sem_SelectExpression (CombineSelect _ann _ctype _sel1 _sel2 )  =+    (sem_SelectExpression_CombineSelect _ann (sem_CombineType _ctype ) (sem_SelectExpression _sel1 ) (sem_SelectExpression _sel2 ) )+sem_SelectExpression (Select _ann _selDistinct _selSelectList _selTref _selWhere _selGroupBy _selHaving _selOrderBy _selLimit _selOffset )  =+    (sem_SelectExpression_Select _ann (sem_Distinct _selDistinct ) (sem_SelectList _selSelectList ) (sem_TableRefList _selTref ) (sem_MaybeBoolExpression _selWhere ) (sem_ExpressionList _selGroupBy ) (sem_MaybeBoolExpression _selHaving ) (sem_ExpressionDirectionPairList _selOrderBy ) (sem_MaybeExpression _selLimit ) (sem_MaybeExpression _selOffset ) )+sem_SelectExpression (Values _ann _vll )  =+    (sem_SelectExpression_Values _ann (sem_ExpressionListList _vll ) )+-- semantic domain+type T_SelectExpression  = Environment ->+                           LocalIdentifierBindings ->+                           ( SelectExpression,([LocalIdentifierBindingsUpdate]),SelectExpression)+data Inh_SelectExpression  = Inh_SelectExpression {env_Inh_SelectExpression :: Environment,lib_Inh_SelectExpression :: LocalIdentifierBindings}+data Syn_SelectExpression  = Syn_SelectExpression {annotatedTree_Syn_SelectExpression :: SelectExpression,libUpdates_Syn_SelectExpression :: [LocalIdentifierBindingsUpdate],originalTree_Syn_SelectExpression :: SelectExpression}+wrap_SelectExpression :: T_SelectExpression  ->+                         Inh_SelectExpression  ->+                         Syn_SelectExpression +wrap_SelectExpression sem (Inh_SelectExpression _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOlibUpdates,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_SelectExpression _lhsOannotatedTree _lhsOlibUpdates _lhsOoriginalTree ))+sem_SelectExpression_CombineSelect :: Annotation ->+                                      T_CombineType  ->+                                      T_SelectExpression  ->+                                      T_SelectExpression  ->+                                      T_SelectExpression +sem_SelectExpression_CombineSelect ann_ ctype_ sel1_ sel2_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: SelectExpression+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOoriginalTree :: SelectExpression+              _ctypeOenv :: Environment+              _ctypeOlib :: LocalIdentifierBindings+              _sel1Oenv :: Environment+              _sel1Olib :: LocalIdentifierBindings+              _sel2Oenv :: Environment+              _sel2Olib :: LocalIdentifierBindings+              _ctypeIannotatedTree :: CombineType+              _ctypeIoriginalTree :: CombineType+              _sel1IannotatedTree :: SelectExpression+              _sel1IlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _sel1IoriginalTree :: SelectExpression+              _sel2IannotatedTree :: SelectExpression+              _sel2IlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _sel2IoriginalTree :: SelectExpression+              -- "./TypeChecking/SelectStatement.ag"(line 26, column 9)+              _lhsOannotatedTree =+                  {-# LINE 26 "./TypeChecking/SelectStatement.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 7793 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 132, column 9)+              _tpe =+                  {-# LINE 132 "./TypeChecking/SelectStatement.ag" #-}+                  let sel1t = getTypeAnnotation _sel1IannotatedTree+                      sel2t = getTypeAnnotation _sel2IannotatedTree+                  in dependsOnRTpe [sel1t, sel2t] $+                        typeCheckCombineSelect _lhsIenv sel1t sel2t+                  {-# LINE 7801 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 137, column 9)+              _backTree =+                  {-# LINE 137 "./TypeChecking/SelectStatement.ag" #-}+                  CombineSelect ann_ _ctypeIannotatedTree+                                _sel1IannotatedTree+                                _sel2IannotatedTree+                  {-# LINE 7808 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 87, column 11)+              _lhsOlibUpdates =+                  {-# LINE 87 "./TypeChecking/SelectLists.ag" #-}+                  []+                  {-# LINE 7813 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CombineSelect ann_ _ctypeIannotatedTree _sel1IannotatedTree _sel2IannotatedTree+                  {-# LINE 7818 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CombineSelect ann_ _ctypeIoriginalTree _sel1IoriginalTree _sel2IoriginalTree+                  {-# LINE 7823 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7828 "AstInternal.hs" #-}+              -- copy rule (down)+              _ctypeOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 7833 "AstInternal.hs" #-}+              -- copy rule (down)+              _ctypeOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 7838 "AstInternal.hs" #-}+              -- copy rule (down)+              _sel1Oenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 7843 "AstInternal.hs" #-}+              -- copy rule (down)+              _sel1Olib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 7848 "AstInternal.hs" #-}+              -- copy rule (down)+              _sel2Oenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 7853 "AstInternal.hs" #-}+              -- copy rule (down)+              _sel2Olib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 7858 "AstInternal.hs" #-}+              ( _ctypeIannotatedTree,_ctypeIoriginalTree) =+                  (ctype_ _ctypeOenv _ctypeOlib )+              ( _sel1IannotatedTree,_sel1IlibUpdates,_sel1IoriginalTree) =+                  (sel1_ _sel1Oenv _sel1Olib )+              ( _sel2IannotatedTree,_sel2IlibUpdates,_sel2IoriginalTree) =+                  (sel2_ _sel2Oenv _sel2Olib )+          in  ( _lhsOannotatedTree,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_SelectExpression_Select :: Annotation ->+                               T_Distinct  ->+                               T_SelectList  ->+                               T_TableRefList  ->+                               T_MaybeBoolExpression  ->+                               T_ExpressionList  ->+                               T_MaybeBoolExpression  ->+                               T_ExpressionDirectionPairList  ->+                               T_MaybeExpression  ->+                               T_MaybeExpression  ->+                               T_SelectExpression +sem_SelectExpression_Select ann_ selDistinct_ selSelectList_ selTref_ selWhere_ selGroupBy_ selHaving_ selOrderBy_ selLimit_ selOffset_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: SelectExpression+              _selSelectListOlib :: LocalIdentifierBindings+              _selWhereOlib :: LocalIdentifierBindings+              _selGroupByOlib :: LocalIdentifierBindings+              _selOrderByOlib :: LocalIdentifierBindings+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOoriginalTree :: SelectExpression+              _selDistinctOenv :: Environment+              _selDistinctOlib :: LocalIdentifierBindings+              _selSelectListOenv :: Environment+              _selTrefOenv :: Environment+              _selTrefOlib :: LocalIdentifierBindings+              _selWhereOenv :: Environment+              _selGroupByOenv :: Environment+              _selHavingOenv :: Environment+              _selHavingOlib :: LocalIdentifierBindings+              _selOrderByOenv :: Environment+              _selLimitOenv :: Environment+              _selLimitOlib :: LocalIdentifierBindings+              _selOffsetOenv :: Environment+              _selOffsetOlib :: LocalIdentifierBindings+              _selDistinctIannotatedTree :: Distinct+              _selDistinctIoriginalTree :: Distinct+              _selSelectListIannotatedTree :: SelectList+              _selSelectListIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _selSelectListIlistType :: ([(String,Type)])+              _selSelectListIoriginalTree :: SelectList+              _selTrefIannotatedTree :: TableRefList+              _selTrefIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _selTrefIoriginalTree :: TableRefList+              _selWhereIannotatedTree :: MaybeBoolExpression+              _selWhereIoriginalTree :: MaybeBoolExpression+              _selGroupByIannotatedTree :: ExpressionList+              _selGroupByIoriginalTree :: ExpressionList+              _selGroupByItypeList :: ([Type])+              _selHavingIannotatedTree :: MaybeBoolExpression+              _selHavingIoriginalTree :: MaybeBoolExpression+              _selOrderByIannotatedTree :: ExpressionDirectionPairList+              _selOrderByIoriginalTree :: ExpressionDirectionPairList+              _selLimitIannotatedTree :: MaybeExpression+              _selLimitIoriginalTree :: MaybeExpression+              _selOffsetIannotatedTree :: MaybeExpression+              _selOffsetIoriginalTree :: MaybeExpression+              -- "./TypeChecking/SelectStatement.ag"(line 26, column 9)+              _lhsOannotatedTree =+                  {-# LINE 26 "./TypeChecking/SelectStatement.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 7930 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 97, column 10)+              _newLib =+                  {-# LINE 97 "./TypeChecking/SelectStatement.ag" #-}+                  case updateBindings _lhsIlib _lhsIenv _selTrefIlibUpdates of+                    Left x -> error $ show x+                    Right e -> e+                  {-# LINE 7937 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 100, column 10)+              _selSelectListOlib =+                  {-# LINE 100 "./TypeChecking/SelectStatement.ag" #-}+                  _newLib+                  {-# LINE 7942 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 101, column 10)+              _selWhereOlib =+                  {-# LINE 101 "./TypeChecking/SelectStatement.ag" #-}+                  _newLib+                  {-# LINE 7947 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 102, column 10)+              _selGroupByOlib =+                  {-# LINE 102 "./TypeChecking/SelectStatement.ag" #-}+                  _newLib+                  {-# LINE 7952 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 103, column 10)+              _selOrderByOlib =+                  {-# LINE 103 "./TypeChecking/SelectStatement.ag" #-}+                  _newLib+                  {-# LINE 7957 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 114, column 9)+              _tpe =+                  {-# LINE 114 "./TypeChecking/SelectStatement.ag" #-}+                  do+                  Right $ case _selSelectListIlistType of+                            [(_,Pseudo Void)] -> Pseudo Void+                            _ -> SetOfType $ CompositeType _selSelectListIlistType+                  {-# LINE 7965 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 121, column 9)+              _backTree =+                  {-# LINE 121 "./TypeChecking/SelectStatement.ag" #-}+                  Select ann_+                         _selDistinctIannotatedTree+                         _selSelectListIannotatedTree+                         _selTrefIannotatedTree+                         _selWhereIannotatedTree+                         _selGroupByIannotatedTree+                         _selHavingIannotatedTree+                         _selOrderByIannotatedTree+                         _selLimitIannotatedTree+                         _selOffsetIannotatedTree+                  {-# LINE 7979 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 85, column 9)+              _lhsOlibUpdates =+                  {-# LINE 85 "./TypeChecking/SelectLists.ag" #-}+                  _selSelectListIlibUpdates+                  {-# LINE 7984 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Select ann_ _selDistinctIannotatedTree _selSelectListIannotatedTree _selTrefIannotatedTree _selWhereIannotatedTree _selGroupByIannotatedTree _selHavingIannotatedTree _selOrderByIannotatedTree _selLimitIannotatedTree _selOffsetIannotatedTree+                  {-# LINE 7989 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Select ann_ _selDistinctIoriginalTree _selSelectListIoriginalTree _selTrefIoriginalTree _selWhereIoriginalTree _selGroupByIoriginalTree _selHavingIoriginalTree _selOrderByIoriginalTree _selLimitIoriginalTree _selOffsetIoriginalTree+                  {-# LINE 7994 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 7999 "AstInternal.hs" #-}+              -- copy rule (down)+              _selDistinctOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8004 "AstInternal.hs" #-}+              -- copy rule (down)+              _selDistinctOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8009 "AstInternal.hs" #-}+              -- copy rule (down)+              _selSelectListOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8014 "AstInternal.hs" #-}+              -- copy rule (down)+              _selTrefOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8019 "AstInternal.hs" #-}+              -- copy rule (down)+              _selTrefOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8024 "AstInternal.hs" #-}+              -- copy rule (down)+              _selWhereOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8029 "AstInternal.hs" #-}+              -- copy rule (down)+              _selGroupByOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8034 "AstInternal.hs" #-}+              -- copy rule (down)+              _selHavingOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8039 "AstInternal.hs" #-}+              -- copy rule (down)+              _selHavingOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8044 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOrderByOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8049 "AstInternal.hs" #-}+              -- copy rule (down)+              _selLimitOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8054 "AstInternal.hs" #-}+              -- copy rule (down)+              _selLimitOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8059 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOffsetOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8064 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOffsetOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8069 "AstInternal.hs" #-}+              ( _selDistinctIannotatedTree,_selDistinctIoriginalTree) =+                  (selDistinct_ _selDistinctOenv _selDistinctOlib )+              ( _selSelectListIannotatedTree,_selSelectListIlibUpdates,_selSelectListIlistType,_selSelectListIoriginalTree) =+                  (selSelectList_ _selSelectListOenv _selSelectListOlib )+              ( _selTrefIannotatedTree,_selTrefIlibUpdates,_selTrefIoriginalTree) =+                  (selTref_ _selTrefOenv _selTrefOlib )+              ( _selWhereIannotatedTree,_selWhereIoriginalTree) =+                  (selWhere_ _selWhereOenv _selWhereOlib )+              ( _selGroupByIannotatedTree,_selGroupByIoriginalTree,_selGroupByItypeList) =+                  (selGroupBy_ _selGroupByOenv _selGroupByOlib )+              ( _selHavingIannotatedTree,_selHavingIoriginalTree) =+                  (selHaving_ _selHavingOenv _selHavingOlib )+              ( _selOrderByIannotatedTree,_selOrderByIoriginalTree) =+                  (selOrderBy_ _selOrderByOenv _selOrderByOlib )+              ( _selLimitIannotatedTree,_selLimitIoriginalTree) =+                  (selLimit_ _selLimitOenv _selLimitOlib )+              ( _selOffsetIannotatedTree,_selOffsetIoriginalTree) =+                  (selOffset_ _selOffsetOenv _selOffsetOlib )+          in  ( _lhsOannotatedTree,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_SelectExpression_Values :: Annotation ->+                               T_ExpressionListList  ->+                               T_SelectExpression +sem_SelectExpression_Values ann_ vll_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: SelectExpression+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOoriginalTree :: SelectExpression+              _vllOenv :: Environment+              _vllOlib :: LocalIdentifierBindings+              _vllIannotatedTree :: ExpressionListList+              _vllIoriginalTree :: ExpressionListList+              _vllItypeListList :: ([[Type]])+              -- "./TypeChecking/SelectStatement.ag"(line 26, column 9)+              _lhsOannotatedTree =+                  {-# LINE 26 "./TypeChecking/SelectStatement.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    Nothing+                  {-# LINE 8110 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 109, column 9)+              _tpe =+                  {-# LINE 109 "./TypeChecking/SelectStatement.ag" #-}+                  typeCheckValuesExpr+                              _lhsIenv+                              _vllItypeListList+                  {-# LINE 8117 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 112, column 9)+              _backTree =+                  {-# LINE 112 "./TypeChecking/SelectStatement.ag" #-}+                  Values ann_ _vllIannotatedTree+                  {-# LINE 8122 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 87, column 11)+              _lhsOlibUpdates =+                  {-# LINE 87 "./TypeChecking/SelectLists.ag" #-}+                  []+                  {-# LINE 8127 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Values ann_ _vllIannotatedTree+                  {-# LINE 8132 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Values ann_ _vllIoriginalTree+                  {-# LINE 8137 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 8142 "AstInternal.hs" #-}+              -- copy rule (down)+              _vllOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8147 "AstInternal.hs" #-}+              -- copy rule (down)+              _vllOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8152 "AstInternal.hs" #-}+              ( _vllIannotatedTree,_vllIoriginalTree,_vllItypeListList) =+                  (vll_ _vllOenv _vllOlib )+          in  ( _lhsOannotatedTree,_lhsOlibUpdates,_lhsOoriginalTree)))+-- SelectItem --------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         columnName           : String+         itemType             : Type+         originalTree         : SELF +   alternatives:+      alternative SelExp:+         child ann            : {Annotation}+         child ex             : Expression +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative SelectItem:+         child ann            : {Annotation}+         child ex             : Expression +         child name           : {String}+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data SelectItem  = SelExp (Annotation) (Expression) +                 | SelectItem (Annotation) (Expression) (String) +                 deriving ( Data,Eq,Show,Typeable)+-- cata+sem_SelectItem :: SelectItem  ->+                  T_SelectItem +sem_SelectItem (SelExp _ann _ex )  =+    (sem_SelectItem_SelExp _ann (sem_Expression _ex ) )+sem_SelectItem (SelectItem _ann _ex _name )  =+    (sem_SelectItem_SelectItem _ann (sem_Expression _ex ) _name )+-- semantic domain+type T_SelectItem  = Environment ->+                     LocalIdentifierBindings ->+                     ( SelectItem,String,Type,SelectItem)+data Inh_SelectItem  = Inh_SelectItem {env_Inh_SelectItem :: Environment,lib_Inh_SelectItem :: LocalIdentifierBindings}+data Syn_SelectItem  = Syn_SelectItem {annotatedTree_Syn_SelectItem :: SelectItem,columnName_Syn_SelectItem :: String,itemType_Syn_SelectItem :: Type,originalTree_Syn_SelectItem :: SelectItem}+wrap_SelectItem :: T_SelectItem  ->+                   Inh_SelectItem  ->+                   Syn_SelectItem +wrap_SelectItem sem (Inh_SelectItem _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOcolumnName,_lhsOitemType,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_SelectItem _lhsOannotatedTree _lhsOcolumnName _lhsOitemType _lhsOoriginalTree ))+sem_SelectItem_SelExp :: Annotation ->+                         T_Expression  ->+                         T_SelectItem +sem_SelectItem_SelExp ann_ ex_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOitemType :: Type+              _lhsOcolumnName :: String+              _lhsOannotatedTree :: SelectItem+              _lhsOoriginalTree :: SelectItem+              _exOenv :: Environment+              _exOlib :: LocalIdentifierBindings+              _exIannotatedTree :: Expression+              _exIliftedColumnName :: String+              _exIoriginalTree :: Expression+              -- "./TypeChecking/SelectLists.ag"(line 13, column 9)+              _annotatedTree =+                  {-# LINE 13 "./TypeChecking/SelectLists.ag" #-}+                  SelExp ann_ $ fixStar _exIannotatedTree+                  {-# LINE 8224 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 35, column 9)+              _lhsOitemType =+                  {-# LINE 35 "./TypeChecking/SelectLists.ag" #-}+                  getTypeAnnotation _exIannotatedTree+                  {-# LINE 8229 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 181, column 14)+              _lhsOcolumnName =+                  {-# LINE 181 "./TypeChecking/SelectLists.ag" #-}+                  case _exIliftedColumnName of+                    "" -> "?column?"+                    s -> s+                  {-# LINE 8236 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  SelExp ann_ _exIoriginalTree+                  {-# LINE 8241 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 8246 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 8251 "AstInternal.hs" #-}+              -- copy rule (down)+              _exOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8256 "AstInternal.hs" #-}+              -- copy rule (down)+              _exOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8261 "AstInternal.hs" #-}+              ( _exIannotatedTree,_exIliftedColumnName,_exIoriginalTree) =+                  (ex_ _exOenv _exOlib )+          in  ( _lhsOannotatedTree,_lhsOcolumnName,_lhsOitemType,_lhsOoriginalTree)))+sem_SelectItem_SelectItem :: Annotation ->+                             T_Expression  ->+                             String ->+                             T_SelectItem +sem_SelectItem_SelectItem ann_ ex_ name_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOitemType :: Type+              _lhsOcolumnName :: String+              _lhsOannotatedTree :: SelectItem+              _lhsOoriginalTree :: SelectItem+              _exOenv :: Environment+              _exOlib :: LocalIdentifierBindings+              _exIannotatedTree :: Expression+              _exIliftedColumnName :: String+              _exIoriginalTree :: Expression+              -- "./TypeChecking/SelectLists.ag"(line 15, column 9)+              _annotatedTree =+                  {-# LINE 15 "./TypeChecking/SelectLists.ag" #-}+                  SelectItem ann_ (fixStar _exIannotatedTree) name_+                  {-# LINE 8285 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 35, column 9)+              _lhsOitemType =+                  {-# LINE 35 "./TypeChecking/SelectLists.ag" #-}+                  getTypeAnnotation _exIannotatedTree+                  {-# LINE 8290 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 184, column 18)+              _lhsOcolumnName =+                  {-# LINE 184 "./TypeChecking/SelectLists.ag" #-}+                  name_+                  {-# LINE 8295 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  SelectItem ann_ _exIoriginalTree name_+                  {-# LINE 8300 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 8305 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 8310 "AstInternal.hs" #-}+              -- copy rule (down)+              _exOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8315 "AstInternal.hs" #-}+              -- copy rule (down)+              _exOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8320 "AstInternal.hs" #-}+              ( _exIannotatedTree,_exIliftedColumnName,_exIoriginalTree) =+                  (ex_ _exOenv _exOlib )+          in  ( _lhsOannotatedTree,_lhsOcolumnName,_lhsOitemType,_lhsOoriginalTree)))+-- SelectItemList ----------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         listType             : [(String,Type)]+         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : SelectItem +         child tl             : SelectItemList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type SelectItemList  = [(SelectItem)]+-- cata+sem_SelectItemList :: SelectItemList  ->+                      T_SelectItemList +sem_SelectItemList list  =+    (Prelude.foldr sem_SelectItemList_Cons sem_SelectItemList_Nil (Prelude.map sem_SelectItem list) )+-- semantic domain+type T_SelectItemList  = Environment ->+                         LocalIdentifierBindings ->+                         ( SelectItemList,([(String,Type)]),SelectItemList)+data Inh_SelectItemList  = Inh_SelectItemList {env_Inh_SelectItemList :: Environment,lib_Inh_SelectItemList :: LocalIdentifierBindings}+data Syn_SelectItemList  = Syn_SelectItemList {annotatedTree_Syn_SelectItemList :: SelectItemList,listType_Syn_SelectItemList :: [(String,Type)],originalTree_Syn_SelectItemList :: SelectItemList}+wrap_SelectItemList :: T_SelectItemList  ->+                       Inh_SelectItemList  ->+                       Syn_SelectItemList +wrap_SelectItemList sem (Inh_SelectItemList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOlistType,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_SelectItemList _lhsOannotatedTree _lhsOlistType _lhsOoriginalTree ))+sem_SelectItemList_Cons :: T_SelectItem  ->+                           T_SelectItemList  ->+                           T_SelectItemList +sem_SelectItemList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOlistType :: ([(String,Type)])+              _lhsOannotatedTree :: SelectItemList+              _lhsOoriginalTree :: SelectItemList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: SelectItem+              _hdIcolumnName :: String+              _hdIitemType :: Type+              _hdIoriginalTree :: SelectItem+              _tlIannotatedTree :: SelectItemList+              _tlIlistType :: ([(String,Type)])+              _tlIoriginalTree :: SelectItemList+              -- "./TypeChecking/SelectLists.ag"(line 29, column 12)+              _lhsOlistType =+                  {-# LINE 29 "./TypeChecking/SelectLists.ag" #-}+                  expandStar _lhsIlib _hdIcolumnName _hdIitemType _tlIlistType+                  {-# LINE 8389 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 8394 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 8399 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 8404 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 8409 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8414 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8419 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8424 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8429 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIcolumnName,_hdIitemType,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIlistType,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOlistType,_lhsOoriginalTree)))+sem_SelectItemList_Nil :: T_SelectItemList +sem_SelectItemList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOlistType :: ([(String,Type)])+              _lhsOannotatedTree :: SelectItemList+              _lhsOoriginalTree :: SelectItemList+              -- "./TypeChecking/SelectLists.ag"(line 30, column 11)+              _lhsOlistType =+                  {-# LINE 30 "./TypeChecking/SelectLists.ag" #-}+                  []+                  {-# LINE 8446 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 8451 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 8456 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 8461 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 8466 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOlistType,_lhsOoriginalTree)))+-- SelectList --------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         libUpdates           : [LocalIdentifierBindingsUpdate]+         listType             : [(String,Type)]+         originalTree         : SELF +   alternatives:+      alternative SelectList:+         child ann            : {Annotation}+         child items          : SelectItemList +         child into           : StringList +         visit 0:+            local errs        : _+            local stuff       : _+            local annotatedTree : _+            local originalTree : _+-}+data SelectList  = SelectList (Annotation) (SelectItemList) (StringList) +                 deriving ( Data,Eq,Show,Typeable)+-- cata+sem_SelectList :: SelectList  ->+                  T_SelectList +sem_SelectList (SelectList _ann _items _into )  =+    (sem_SelectList_SelectList _ann (sem_SelectItemList _items ) (sem_StringList _into ) )+-- semantic domain+type T_SelectList  = Environment ->+                     LocalIdentifierBindings ->+                     ( SelectList,([LocalIdentifierBindingsUpdate]),([(String,Type)]),SelectList)+data Inh_SelectList  = Inh_SelectList {env_Inh_SelectList :: Environment,lib_Inh_SelectList :: LocalIdentifierBindings}+data Syn_SelectList  = Syn_SelectList {annotatedTree_Syn_SelectList :: SelectList,libUpdates_Syn_SelectList :: [LocalIdentifierBindingsUpdate],listType_Syn_SelectList :: [(String,Type)],originalTree_Syn_SelectList :: SelectList}+wrap_SelectList :: T_SelectList  ->+                   Inh_SelectList  ->+                   Syn_SelectList +wrap_SelectList sem (Inh_SelectList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOlibUpdates,_lhsOlistType,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_SelectList _lhsOannotatedTree _lhsOlibUpdates _lhsOlistType _lhsOoriginalTree ))+sem_SelectList_SelectList :: Annotation ->+                             T_SelectItemList  ->+                             T_StringList  ->+                             T_SelectList +sem_SelectList_SelectList ann_ items_ into_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOlistType :: ([(String,Type)])+              _lhsOannotatedTree :: SelectList+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOoriginalTree :: SelectList+              _itemsOenv :: Environment+              _itemsOlib :: LocalIdentifierBindings+              _intoOenv :: Environment+              _intoOlib :: LocalIdentifierBindings+              _itemsIannotatedTree :: SelectItemList+              _itemsIlistType :: ([(String,Type)])+              _itemsIoriginalTree :: SelectItemList+              _intoIannotatedTree :: StringList+              _intoIoriginalTree :: StringList+              _intoIstrings :: ([String])+              -- "./TypeChecking/SelectLists.ag"(line 41, column 9)+              _lhsOlistType =+                  {-# LINE 41 "./TypeChecking/SelectLists.ag" #-}+                  _itemsIlistType+                  {-# LINE 8535 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 43, column 9)+              _errs =+                  {-# LINE 43 "./TypeChecking/SelectLists.ag" #-}+                  case _stuff     of+                    (er,_) -> er+                  {-# LINE 8541 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 45, column 9)+              _stuff =+                  {-# LINE 45 "./TypeChecking/SelectLists.ag" #-}+                  case () of+                    _ | null sl -> ([],Nothing)+                      | not (null targetTypeErrs) -> (targetTypeErrs,Nothing)+                      | (case targetTypes of+                           [PgRecord _] -> True+                           _ -> False) -> ([],Just (head sl, CompositeType _itemsIlistType))+                      | matchingComposite /= Left [] -> (fromLeft [] matchingComposite,Nothing)+                      | length sl /= length _itemsIlistType -> ([WrongNumberOfColumns],Nothing)+                      | not (null assignErrs) -> (assignErrs,Nothing)+                      | otherwise -> ([],Nothing)+                  where+                    targetTypeEithers = map (libLookupID _lhsIlib) sl+                    targetTypeErrs = concat $ lefts $ targetTypeEithers+                    targetTypes = rights $ targetTypeEithers+                    typePairs = zip (map snd _itemsIlistType) targetTypes+                    assignErrs = concat $ lefts $ map (uncurry $ checkAssignmentValid _lhsIenv) typePairs+                    sl = _intoIstrings+                    matchingComposite =+                        case targetTypes of+                          [t] | isCompositeType t -> checkAssignmentValid _lhsIenv (AnonymousRecordType (map snd _itemsIlistType)) t+                          _ -> Left []+                  {-# LINE 8566 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 68, column 9)+              _lhsOannotatedTree =+                  {-# LINE 68 "./TypeChecking/SelectLists.ag" #-}+                  SelectList (ann_ ++ map TypeErrorA _errs    )+                             _itemsIannotatedTree+                             _intoIannotatedTree+                  {-# LINE 8573 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 71, column 9)+              _lhsOlibUpdates =+                  {-# LINE 71 "./TypeChecking/SelectLists.ag" #-}+                  case _stuff     of+                    (_,Just r) -> [LibStackIDs [("", [r])]]+                    _ -> []+                  {-# LINE 8580 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  SelectList ann_ _itemsIannotatedTree _intoIannotatedTree+                  {-# LINE 8585 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  SelectList ann_ _itemsIoriginalTree _intoIoriginalTree+                  {-# LINE 8590 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 8595 "AstInternal.hs" #-}+              -- copy rule (down)+              _itemsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8600 "AstInternal.hs" #-}+              -- copy rule (down)+              _itemsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8605 "AstInternal.hs" #-}+              -- copy rule (down)+              _intoOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8610 "AstInternal.hs" #-}+              -- copy rule (down)+              _intoOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8615 "AstInternal.hs" #-}+              ( _itemsIannotatedTree,_itemsIlistType,_itemsIoriginalTree) =+                  (items_ _itemsOenv _itemsOlib )+              ( _intoIannotatedTree,_intoIoriginalTree,_intoIstrings) =+                  (into_ _intoOenv _intoOlib )+          in  ( _lhsOannotatedTree,_lhsOlibUpdates,_lhsOlistType,_lhsOoriginalTree)))+-- SetClause ---------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +         pairs                : [(String,Type)]+         rowSetError          : Maybe TypeError+   alternatives:+      alternative RowSetClause:+         child ann            : {Annotation}+         child atts           : StringList +         child vals           : ExpressionList +         visit 0:+            local rowSetError : _+            local annotatedTree : _+            local originalTree : _+      alternative SetClause:+         child ann            : {Annotation}+         child att            : {String}+         child val            : Expression +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data SetClause  = RowSetClause (Annotation) (StringList) (ExpressionList) +                | SetClause (Annotation) (String) (Expression) +                deriving ( Data,Eq,Show,Typeable)+-- cata+sem_SetClause :: SetClause  ->+                 T_SetClause +sem_SetClause (RowSetClause _ann _atts _vals )  =+    (sem_SetClause_RowSetClause _ann (sem_StringList _atts ) (sem_ExpressionList _vals ) )+sem_SetClause (SetClause _ann _att _val )  =+    (sem_SetClause_SetClause _ann _att (sem_Expression _val ) )+-- semantic domain+type T_SetClause  = Environment ->+                    LocalIdentifierBindings ->+                    ( SetClause,SetClause,([(String,Type)]),(Maybe TypeError))+data Inh_SetClause  = Inh_SetClause {env_Inh_SetClause :: Environment,lib_Inh_SetClause :: LocalIdentifierBindings}+data Syn_SetClause  = Syn_SetClause {annotatedTree_Syn_SetClause :: SetClause,originalTree_Syn_SetClause :: SetClause,pairs_Syn_SetClause :: [(String,Type)],rowSetError_Syn_SetClause :: Maybe TypeError}+wrap_SetClause :: T_SetClause  ->+                  Inh_SetClause  ->+                  Syn_SetClause +wrap_SetClause sem (Inh_SetClause _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOpairs,_lhsOrowSetError) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_SetClause _lhsOannotatedTree _lhsOoriginalTree _lhsOpairs _lhsOrowSetError ))+sem_SetClause_RowSetClause :: Annotation ->+                              T_StringList  ->+                              T_ExpressionList  ->+                              T_SetClause +sem_SetClause_RowSetClause ann_ atts_ vals_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOpairs :: ([(String,Type)])+              _lhsOannotatedTree :: SetClause+              _lhsOoriginalTree :: SetClause+              _lhsOrowSetError :: (Maybe TypeError)+              _attsOenv :: Environment+              _attsOlib :: LocalIdentifierBindings+              _valsOenv :: Environment+              _valsOlib :: LocalIdentifierBindings+              _attsIannotatedTree :: StringList+              _attsIoriginalTree :: StringList+              _attsIstrings :: ([String])+              _valsIannotatedTree :: ExpressionList+              _valsIoriginalTree :: ExpressionList+              _valsItypeList :: ([Type])+              -- "./TypeChecking/Dml.ag"(line 128, column 9)+              _rowSetError =+                  {-# LINE 128 "./TypeChecking/Dml.ag" #-}+                  let atts = _attsIstrings+                      types = getRowTypes _valsItypeList+                  in if length atts /= length types+                       then Just WrongNumberOfColumns+                       else Nothing+                  {-# LINE 8701 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 134, column 9)+              _lhsOpairs =+                  {-# LINE 134 "./TypeChecking/Dml.ag" #-}+                  zip _attsIstrings $ getRowTypes _valsItypeList+                  {-# LINE 8706 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  RowSetClause ann_ _attsIannotatedTree _valsIannotatedTree+                  {-# LINE 8711 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  RowSetClause ann_ _attsIoriginalTree _valsIoriginalTree+                  {-# LINE 8716 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 8721 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 8726 "AstInternal.hs" #-}+              -- copy rule (from local)+              _lhsOrowSetError =+                  {-# LINE 121 "./TypeChecking/Dml.ag" #-}+                  _rowSetError+                  {-# LINE 8731 "AstInternal.hs" #-}+              -- copy rule (down)+              _attsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8736 "AstInternal.hs" #-}+              -- copy rule (down)+              _attsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8741 "AstInternal.hs" #-}+              -- copy rule (down)+              _valsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8746 "AstInternal.hs" #-}+              -- copy rule (down)+              _valsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8751 "AstInternal.hs" #-}+              ( _attsIannotatedTree,_attsIoriginalTree,_attsIstrings) =+                  (atts_ _attsOenv _attsOlib )+              ( _valsIannotatedTree,_valsIoriginalTree,_valsItypeList) =+                  (vals_ _valsOenv _valsOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOpairs,_lhsOrowSetError)))+sem_SetClause_SetClause :: Annotation ->+                           String ->+                           T_Expression  ->+                           T_SetClause +sem_SetClause_SetClause ann_ att_ val_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOpairs :: ([(String,Type)])+              _lhsOrowSetError :: (Maybe TypeError)+              _lhsOannotatedTree :: SetClause+              _lhsOoriginalTree :: SetClause+              _valOenv :: Environment+              _valOlib :: LocalIdentifierBindings+              _valIannotatedTree :: Expression+              _valIliftedColumnName :: String+              _valIoriginalTree :: Expression+              -- "./TypeChecking/Dml.ag"(line 125, column 9)+              _lhsOpairs =+                  {-# LINE 125 "./TypeChecking/Dml.ag" #-}+                  [(att_, getTypeAnnotation _valIannotatedTree)]+                  {-# LINE 8777 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 126, column 9)+              _lhsOrowSetError =+                  {-# LINE 126 "./TypeChecking/Dml.ag" #-}+                  Nothing+                  {-# LINE 8782 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  SetClause ann_ att_ _valIannotatedTree+                  {-# LINE 8787 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  SetClause ann_ att_ _valIoriginalTree+                  {-# LINE 8792 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 8797 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 8802 "AstInternal.hs" #-}+              -- copy rule (down)+              _valOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8807 "AstInternal.hs" #-}+              -- copy rule (down)+              _valOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8812 "AstInternal.hs" #-}+              ( _valIannotatedTree,_valIliftedColumnName,_valIoriginalTree) =+                  (val_ _valOenv _valOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOpairs,_lhsOrowSetError)))+-- SetClauseList -----------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +         pairs                : [(String,Type)]+         rowSetErrors         : [TypeError]+   alternatives:+      alternative Cons:+         child hd             : SetClause +         child tl             : SetClauseList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type SetClauseList  = [(SetClause)]+-- cata+sem_SetClauseList :: SetClauseList  ->+                     T_SetClauseList +sem_SetClauseList list  =+    (Prelude.foldr sem_SetClauseList_Cons sem_SetClauseList_Nil (Prelude.map sem_SetClause list) )+-- semantic domain+type T_SetClauseList  = Environment ->+                        LocalIdentifierBindings ->+                        ( SetClauseList,SetClauseList,([(String,Type)]),([TypeError]))+data Inh_SetClauseList  = Inh_SetClauseList {env_Inh_SetClauseList :: Environment,lib_Inh_SetClauseList :: LocalIdentifierBindings}+data Syn_SetClauseList  = Syn_SetClauseList {annotatedTree_Syn_SetClauseList :: SetClauseList,originalTree_Syn_SetClauseList :: SetClauseList,pairs_Syn_SetClauseList :: [(String,Type)],rowSetErrors_Syn_SetClauseList :: [TypeError]}+wrap_SetClauseList :: T_SetClauseList  ->+                      Inh_SetClauseList  ->+                      Syn_SetClauseList +wrap_SetClauseList sem (Inh_SetClauseList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOpairs,_lhsOrowSetErrors) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_SetClauseList _lhsOannotatedTree _lhsOoriginalTree _lhsOpairs _lhsOrowSetErrors ))+sem_SetClauseList_Cons :: T_SetClause  ->+                          T_SetClauseList  ->+                          T_SetClauseList +sem_SetClauseList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOpairs :: ([(String,Type)])+              _lhsOrowSetErrors :: ([TypeError])+              _lhsOannotatedTree :: SetClauseList+              _lhsOoriginalTree :: SetClauseList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: SetClause+              _hdIoriginalTree :: SetClause+              _hdIpairs :: ([(String,Type)])+              _hdIrowSetError :: (Maybe TypeError)+              _tlIannotatedTree :: SetClauseList+              _tlIoriginalTree :: SetClauseList+              _tlIpairs :: ([(String,Type)])+              _tlIrowSetErrors :: ([TypeError])+              -- "./TypeChecking/Dml.ag"(line 115, column 10)+              _lhsOpairs =+                  {-# LINE 115 "./TypeChecking/Dml.ag" #-}+                  _hdIpairs ++ _tlIpairs+                  {-# LINE 8884 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 116, column 10)+              _lhsOrowSetErrors =+                  {-# LINE 116 "./TypeChecking/Dml.ag" #-}+                  maybeToList _hdIrowSetError ++ _tlIrowSetErrors+                  {-# LINE 8889 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 8894 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 8899 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 8904 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 8909 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8914 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8919 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 8924 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 8929 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIoriginalTree,_hdIpairs,_hdIrowSetError) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIoriginalTree,_tlIpairs,_tlIrowSetErrors) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOpairs,_lhsOrowSetErrors)))+sem_SetClauseList_Nil :: T_SetClauseList +sem_SetClauseList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOpairs :: ([(String,Type)])+              _lhsOrowSetErrors :: ([TypeError])+              _lhsOannotatedTree :: SetClauseList+              _lhsOoriginalTree :: SetClauseList+              -- "./TypeChecking/Dml.ag"(line 117, column 9)+              _lhsOpairs =+                  {-# LINE 117 "./TypeChecking/Dml.ag" #-}+                  []+                  {-# LINE 8947 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 118, column 9)+              _lhsOrowSetErrors =+                  {-# LINE 118 "./TypeChecking/Dml.ag" #-}+                  []+                  {-# LINE 8952 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 8957 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 8962 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 8967 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 8972 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOpairs,_lhsOrowSetErrors)))+-- SetValue ----------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative SetId:+         child ann            : {Annotation}+         child string         : {String}+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative SetNum:+         child ann            : {Annotation}+         child double         : {Double}+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative SetStr:+         child ann            : {Annotation}+         child string         : {String}+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data SetValue  = SetId (Annotation) (String) +               | SetNum (Annotation) (Double) +               | SetStr (Annotation) (String) +               deriving ( Data,Eq,Show,Typeable)+-- cata+sem_SetValue :: SetValue  ->+                T_SetValue +sem_SetValue (SetId _ann _string )  =+    (sem_SetValue_SetId _ann _string )+sem_SetValue (SetNum _ann _double )  =+    (sem_SetValue_SetNum _ann _double )+sem_SetValue (SetStr _ann _string )  =+    (sem_SetValue_SetStr _ann _string )+-- semantic domain+type T_SetValue  = Environment ->+                   LocalIdentifierBindings ->+                   ( SetValue,SetValue)+data Inh_SetValue  = Inh_SetValue {env_Inh_SetValue :: Environment,lib_Inh_SetValue :: LocalIdentifierBindings}+data Syn_SetValue  = Syn_SetValue {annotatedTree_Syn_SetValue :: SetValue,originalTree_Syn_SetValue :: SetValue}+wrap_SetValue :: T_SetValue  ->+                 Inh_SetValue  ->+                 Syn_SetValue +wrap_SetValue sem (Inh_SetValue _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_SetValue _lhsOannotatedTree _lhsOoriginalTree ))+sem_SetValue_SetId :: Annotation ->+                      String ->+                      T_SetValue +sem_SetValue_SetId ann_ string_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: SetValue+              _lhsOoriginalTree :: SetValue+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  SetId ann_ string_+                  {-# LINE 9041 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  SetId ann_ string_+                  {-# LINE 9046 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 9051 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 9056 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_SetValue_SetNum :: Annotation ->+                       Double ->+                       T_SetValue +sem_SetValue_SetNum ann_ double_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: SetValue+              _lhsOoriginalTree :: SetValue+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  SetNum ann_ double_+                  {-# LINE 9070 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  SetNum ann_ double_+                  {-# LINE 9075 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 9080 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 9085 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_SetValue_SetStr :: Annotation ->+                       String ->+                       T_SetValue +sem_SetValue_SetStr ann_ string_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: SetValue+              _lhsOoriginalTree :: SetValue+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  SetStr ann_ string_+                  {-# LINE 9099 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  SetStr ann_ string_+                  {-# LINE 9104 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 9109 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 9114 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- Statement ---------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         inProducedEnv        : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         envUpdates           : [EnvironmentUpdate]+         libUpdates           : [LocalIdentifierBindingsUpdate]+         originalTree         : SELF +   alternatives:+      alternative AlterSequence:+         child ann            : {Annotation}+         child name           : {String}+         child ownedBy        : {String}+         visit 0:+            local libUpdates  : _+            local annotatedTree : _+            local originalTree : _+      alternative AlterTable:+         child ann            : {Annotation}+         child name           : {String}+         child actions        : {[AlterTableAction]}+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Assignment:+         child ann            : {Annotation}+         child target         : {String}+         child value          : Expression +         visit 0:+            local libUpdates  : _+            local tpe         : {Either [TypeError] Type}+            local backTree    : _+            local envUpdates  : {[EnvironmentUpdate]}+            local statementType : _+            local annotatedTree : _+            local originalTree : _+      alternative CaseStatement:+         child ann            : {Annotation}+         child val            : Expression +         child cases          : ExpressionListStatementListPairList +         child els            : StatementList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative ContinueStatement:+         child ann            : {Annotation}+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Copy:+         child ann            : {Annotation}+         child table          : {String}+         child targetCols     : StringList +         child source         : CopySource +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative CopyData:+         child ann            : {Annotation}+         child insData        : {String}+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative CreateDomain:+         child ann            : {Annotation}+         child name           : {String}+         child typ            : TypeName +         child checkName      : {String}+         child check          : MaybeBoolExpression +         visit 0:+            local libUpdates  : _+            local tpe         : {Either [TypeError] Type}+            local backTree    : _+            local statementType : _+            local envUpdates  : {[EnvironmentUpdate]}+            local annotatedTree : _+            local originalTree : _+      alternative CreateFunction:+         child ann            : {Annotation}+         child name           : {String}+         child params         : ParamDefList +         child rettype        : TypeName +         child lang           : Language +         child bodyQuote      : {String}+         child body           : FnBody +         child vol            : Volatility +         visit 0:+            local libUpdates  : _+            local tpe         : {Either [TypeError] Type}+            local envUpdates  : {[EnvironmentUpdate]}+            local parameterTypes : _+            local backTree    : _+            local statementType : _+            local annotatedTree : _+            local originalTree : _+      alternative CreateLanguage:+         child ann            : {Annotation}+         child name           : {String}+         visit 0:+            local libUpdates  : _+            local annotatedTree : _+            local originalTree : _+      alternative CreateSequence:+         child ann            : {Annotation}+         child name           : {String}+         child incr           : {Integer}+         child min            : {Integer}+         child max            : {Integer}+         child start          : {Integer}+         child cache          : {Integer}+         visit 0:+            local libUpdates  : _+            local annotatedTree : _+            local originalTree : _+      alternative CreateTable:+         child ann            : {Annotation}+         child name           : {String}+         child atts           : AttributeDefList +         child cons           : ConstraintList +         visit 0:+            local libUpdates  : _+            local tpe         : {Either [TypeError] Type}+            local envUpdates  : {[EnvironmentUpdate]}+            local attrTypes   : {[Type]}+            local statementType : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative CreateTableAs:+         child ann            : {Annotation}+         child name           : {String}+         child expr           : SelectExpression +         visit 0:+            local libUpdates  : _+            local tpe         : {Either [TypeError] Type}+            local envUpdates  : {[EnvironmentUpdate]}+            local selType     : _+            local attrs       : _+            local backTree    : _+            local statementType : _+            local annotatedTree : _+            local originalTree : _+      alternative CreateTrigger:+         child ann            : {Annotation}+         child name           : {String}+         child wh             : TriggerWhen +         child events         : {[TriggerEvent]}+         child tbl            : {String}+         child firing         : TriggerFire +         child fnName         : {String}+         child fnArgs         : {[Expression]}+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative CreateType:+         child ann            : {Annotation}+         child name           : {String}+         child atts           : TypeAttributeDefList +         visit 0:+            local libUpdates  : _+            local tpe         : {Either [TypeError] Type}+            local backTree    : _+            local statementType : _+            local envUpdates  : {[EnvironmentUpdate]}+            local annotatedTree : _+            local originalTree : _+      alternative CreateView:+         child ann            : {Annotation}+         child name           : {String}+         child expr           : SelectExpression +         visit 0:+            local libUpdates  : _+            local tpe         : {Either [TypeError] Type}+            local backTree    : _+            local attrs       : _+            local envUpdates  : {[EnvironmentUpdate]}+            local statementType : _+            local annotatedTree : _+            local originalTree : _+      alternative Delete:+         child ann            : {Annotation}+         child table          : {String}+         child whr            : MaybeBoolExpression +         child returning      : MaybeSelectList +         visit 0:+            local libUpdates  : _+            local tpe         : {Either [TypeError] Type}+            local statementType : _+            local backTree    : _+            local envUpdates  : {[EnvironmentUpdate]}+            local lib         : _+            local annotatedTree : _+            local originalTree : _+      alternative DropFunction:+         child ann            : {Annotation}+         child ifE            : IfExists +         child sigs           : StringTypeNameListPairList +         child cascade        : Cascade +         visit 0:+            local libUpdates  : _+            local tpe         : {Either [TypeError] Type}+            local backTree    : _+            local envUpdates  : {[EnvironmentUpdate]}+            local statementType : _+            local annotatedTree : _+            local originalTree : _+      alternative DropSomething:+         child ann            : {Annotation}+         child dropType       : DropType +         child ifE            : IfExists +         child names          : StringList +         child cascade        : Cascade +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Execute:+         child ann            : {Annotation}+         child expr           : Expression +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative ExecuteInto:+         child ann            : {Annotation}+         child expr           : Expression +         child targets        : StringList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative ForIntegerStatement:+         child ann            : {Annotation}+         child var            : {String}+         child from           : Expression +         child to             : Expression +         child sts            : StatementList +         visit 0:+            local libUpdates  : _+            local varTypeE    : _+            local tpe         : {Either [TypeError] Type}+            local backTree    : _+            local envUpdates  : {[EnvironmentUpdate]}+            local statementType : _+            local annotatedTree : _+            local originalTree : _+      alternative ForSelectStatement:+         child ann            : {Annotation}+         child var            : {String}+         child sel            : SelectExpression +         child sts            : StatementList +         visit 0:+            local libUpdates  : _+            local selType     : _+            local tpe         : {Either [TypeError] Type}+            local backTree    : _+            local envUpdates  : {[EnvironmentUpdate]}+            local statementType : _+            local annotatedTree : _+            local originalTree : _+      alternative If:+         child ann            : {Annotation}+         child cases          : ExpressionStatementListPairList +         child els            : StatementList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Insert:+         child ann            : {Annotation}+         child table          : {String}+         child targetCols     : StringList +         child insData        : SelectExpression +         child returning      : MaybeSelectList +         visit 0:+            local libUpdates  : _+            local tpe         : {Either [TypeError] Type}+            local statementType : _+            local columnTypes : _+            local backTree    : _+            local envUpdates  : {[EnvironmentUpdate]}+            local annotatedTree : _+            local originalTree : _+      alternative Notify:+         child ann            : {Annotation}+         child name           : {String}+         visit 0:+            local libUpdates  : _+            local annotatedTree : _+            local originalTree : _+      alternative NullStatement:+         child ann            : {Annotation}+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Perform:+         child ann            : {Annotation}+         child expr           : Expression +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Raise:+         child ann            : {Annotation}+         child level          : RaiseType +         child message        : {String}+         child args           : ExpressionList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Return:+         child ann            : {Annotation}+         child value          : MaybeExpression +         visit 0:+            local libUpdates  : _+            local tpe         : {Either [TypeError] Type}+            local backTree    : _+            local envUpdates  : {[EnvironmentUpdate]}+            local statementType : _+            local annotatedTree : _+            local originalTree : _+      alternative ReturnNext:+         child ann            : {Annotation}+         child expr           : Expression +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative ReturnQuery:+         child ann            : {Annotation}+         child sel            : SelectExpression +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative SelectStatement:+         child ann            : {Annotation}+         child ex             : SelectExpression +         visit 0:+            local tpe         : {Either [TypeError] Type}+            local statementType : _+            local backTree    : _+            local envUpdates  : {[EnvironmentUpdate]}+            local libUpdates  : _+            local annotatedTree : _+            local originalTree : _+      alternative Set:+         child ann            : {Annotation}+         child name           : {String}+         child values         : {[SetValue]}+         visit 0:+            local libUpdates  : _+            local annotatedTree : _+            local originalTree : _+      alternative Truncate:+         child ann            : {Annotation}+         child tables         : StringList +         child restartIdentity : RestartIdentity +         child cascade        : Cascade +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Update:+         child ann            : {Annotation}+         child table          : {String}+         child assigns        : SetClauseList +         child whr            : MaybeBoolExpression +         child returning      : MaybeSelectList +         visit 0:+            local libUpdates  : _+            local tpe         : {Either [TypeError] Type}+            local statementType : _+            local columnTypes : _+            local backTree    : _+            local envUpdates  : {[EnvironmentUpdate]}+            local lib         : _+            local annotatedTree : _+            local originalTree : _+      alternative WhileStatement:+         child ann            : {Annotation}+         child expr           : Expression +         child sts            : StatementList +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data Statement  = AlterSequence (Annotation) (String) (String) +                | AlterTable (Annotation) (String) ([AlterTableAction]) +                | Assignment (Annotation) (String) (Expression) +                | CaseStatement (Annotation) (Expression) (ExpressionListStatementListPairList) (StatementList) +                | ContinueStatement (Annotation) +                | Copy (Annotation) (String) (StringList) (CopySource) +                | CopyData (Annotation) (String) +                | CreateDomain (Annotation) (String) (TypeName) (String) (MaybeBoolExpression) +                | CreateFunction (Annotation) (String) (ParamDefList) (TypeName) (Language) (String) (FnBody) (Volatility) +                | CreateLanguage (Annotation) (String) +                | CreateSequence (Annotation) (String) (Integer) (Integer) (Integer) (Integer) (Integer) +                | CreateTable (Annotation) (String) (AttributeDefList) (ConstraintList) +                | CreateTableAs (Annotation) (String) (SelectExpression) +                | CreateTrigger (Annotation) (String) (TriggerWhen) ([TriggerEvent]) (String) (TriggerFire) (String) ([Expression]) +                | CreateType (Annotation) (String) (TypeAttributeDefList) +                | CreateView (Annotation) (String) (SelectExpression) +                | Delete (Annotation) (String) (MaybeBoolExpression) (MaybeSelectList) +                | DropFunction (Annotation) (IfExists) (StringTypeNameListPairList) (Cascade) +                | DropSomething (Annotation) (DropType) (IfExists) (StringList) (Cascade) +                | Execute (Annotation) (Expression) +                | ExecuteInto (Annotation) (Expression) (StringList) +                | ForIntegerStatement (Annotation) (String) (Expression) (Expression) (StatementList) +                | ForSelectStatement (Annotation) (String) (SelectExpression) (StatementList) +                | If (Annotation) (ExpressionStatementListPairList) (StatementList) +                | Insert (Annotation) (String) (StringList) (SelectExpression) (MaybeSelectList) +                | Notify (Annotation) (String) +                | NullStatement (Annotation) +                | Perform (Annotation) (Expression) +                | Raise (Annotation) (RaiseType) (String) (ExpressionList) +                | Return (Annotation) (MaybeExpression) +                | ReturnNext (Annotation) (Expression) +                | ReturnQuery (Annotation) (SelectExpression) +                | SelectStatement (Annotation) (SelectExpression) +                | Set (Annotation) (String) ([SetValue]) +                | Truncate (Annotation) (StringList) (RestartIdentity) (Cascade) +                | Update (Annotation) (String) (SetClauseList) (MaybeBoolExpression) (MaybeSelectList) +                | WhileStatement (Annotation) (Expression) (StatementList) +                deriving ( Data,Eq,Show,Typeable)+-- cata+sem_Statement :: Statement  ->+                 T_Statement +sem_Statement (AlterSequence _ann _name _ownedBy )  =+    (sem_Statement_AlterSequence _ann _name _ownedBy )+sem_Statement (AlterTable _ann _name _actions )  =+    (sem_Statement_AlterTable _ann _name _actions )+sem_Statement (Assignment _ann _target _value )  =+    (sem_Statement_Assignment _ann _target (sem_Expression _value ) )+sem_Statement (CaseStatement _ann _val _cases _els )  =+    (sem_Statement_CaseStatement _ann (sem_Expression _val ) (sem_ExpressionListStatementListPairList _cases ) (sem_StatementList _els ) )+sem_Statement (ContinueStatement _ann )  =+    (sem_Statement_ContinueStatement _ann )+sem_Statement (Copy _ann _table _targetCols _source )  =+    (sem_Statement_Copy _ann _table (sem_StringList _targetCols ) (sem_CopySource _source ) )+sem_Statement (CopyData _ann _insData )  =+    (sem_Statement_CopyData _ann _insData )+sem_Statement (CreateDomain _ann _name _typ _checkName _check )  =+    (sem_Statement_CreateDomain _ann _name (sem_TypeName _typ ) _checkName (sem_MaybeBoolExpression _check ) )+sem_Statement (CreateFunction _ann _name _params _rettype _lang _bodyQuote _body _vol )  =+    (sem_Statement_CreateFunction _ann _name (sem_ParamDefList _params ) (sem_TypeName _rettype ) (sem_Language _lang ) _bodyQuote (sem_FnBody _body ) (sem_Volatility _vol ) )+sem_Statement (CreateLanguage _ann _name )  =+    (sem_Statement_CreateLanguage _ann _name )+sem_Statement (CreateSequence _ann _name _incr _min _max _start _cache )  =+    (sem_Statement_CreateSequence _ann _name _incr _min _max _start _cache )+sem_Statement (CreateTable _ann _name _atts _cons )  =+    (sem_Statement_CreateTable _ann _name (sem_AttributeDefList _atts ) (sem_ConstraintList _cons ) )+sem_Statement (CreateTableAs _ann _name _expr )  =+    (sem_Statement_CreateTableAs _ann _name (sem_SelectExpression _expr ) )+sem_Statement (CreateTrigger _ann _name _wh _events _tbl _firing _fnName _fnArgs )  =+    (sem_Statement_CreateTrigger _ann _name (sem_TriggerWhen _wh ) _events _tbl (sem_TriggerFire _firing ) _fnName _fnArgs )+sem_Statement (CreateType _ann _name _atts )  =+    (sem_Statement_CreateType _ann _name (sem_TypeAttributeDefList _atts ) )+sem_Statement (CreateView _ann _name _expr )  =+    (sem_Statement_CreateView _ann _name (sem_SelectExpression _expr ) )+sem_Statement (Delete _ann _table _whr _returning )  =+    (sem_Statement_Delete _ann _table (sem_MaybeBoolExpression _whr ) (sem_MaybeSelectList _returning ) )+sem_Statement (DropFunction _ann _ifE _sigs _cascade )  =+    (sem_Statement_DropFunction _ann (sem_IfExists _ifE ) (sem_StringTypeNameListPairList _sigs ) (sem_Cascade _cascade ) )+sem_Statement (DropSomething _ann _dropType _ifE _names _cascade )  =+    (sem_Statement_DropSomething _ann (sem_DropType _dropType ) (sem_IfExists _ifE ) (sem_StringList _names ) (sem_Cascade _cascade ) )+sem_Statement (Execute _ann _expr )  =+    (sem_Statement_Execute _ann (sem_Expression _expr ) )+sem_Statement (ExecuteInto _ann _expr _targets )  =+    (sem_Statement_ExecuteInto _ann (sem_Expression _expr ) (sem_StringList _targets ) )+sem_Statement (ForIntegerStatement _ann _var _from _to _sts )  =+    (sem_Statement_ForIntegerStatement _ann _var (sem_Expression _from ) (sem_Expression _to ) (sem_StatementList _sts ) )+sem_Statement (ForSelectStatement _ann _var _sel _sts )  =+    (sem_Statement_ForSelectStatement _ann _var (sem_SelectExpression _sel ) (sem_StatementList _sts ) )+sem_Statement (If _ann _cases _els )  =+    (sem_Statement_If _ann (sem_ExpressionStatementListPairList _cases ) (sem_StatementList _els ) )+sem_Statement (Insert _ann _table _targetCols _insData _returning )  =+    (sem_Statement_Insert _ann _table (sem_StringList _targetCols ) (sem_SelectExpression _insData ) (sem_MaybeSelectList _returning ) )+sem_Statement (Notify _ann _name )  =+    (sem_Statement_Notify _ann _name )+sem_Statement (NullStatement _ann )  =+    (sem_Statement_NullStatement _ann )+sem_Statement (Perform _ann _expr )  =+    (sem_Statement_Perform _ann (sem_Expression _expr ) )+sem_Statement (Raise _ann _level _message _args )  =+    (sem_Statement_Raise _ann (sem_RaiseType _level ) _message (sem_ExpressionList _args ) )+sem_Statement (Return _ann _value )  =+    (sem_Statement_Return _ann (sem_MaybeExpression _value ) )+sem_Statement (ReturnNext _ann _expr )  =+    (sem_Statement_ReturnNext _ann (sem_Expression _expr ) )+sem_Statement (ReturnQuery _ann _sel )  =+    (sem_Statement_ReturnQuery _ann (sem_SelectExpression _sel ) )+sem_Statement (SelectStatement _ann _ex )  =+    (sem_Statement_SelectStatement _ann (sem_SelectExpression _ex ) )+sem_Statement (Set _ann _name _values )  =+    (sem_Statement_Set _ann _name _values )+sem_Statement (Truncate _ann _tables _restartIdentity _cascade )  =+    (sem_Statement_Truncate _ann (sem_StringList _tables ) (sem_RestartIdentity _restartIdentity ) (sem_Cascade _cascade ) )+sem_Statement (Update _ann _table _assigns _whr _returning )  =+    (sem_Statement_Update _ann _table (sem_SetClauseList _assigns ) (sem_MaybeBoolExpression _whr ) (sem_MaybeSelectList _returning ) )+sem_Statement (WhileStatement _ann _expr _sts )  =+    (sem_Statement_WhileStatement _ann (sem_Expression _expr ) (sem_StatementList _sts ) )+-- semantic domain+type T_Statement  = Environment ->+                    Environment ->+                    LocalIdentifierBindings ->+                    ( Statement,([EnvironmentUpdate]),([LocalIdentifierBindingsUpdate]),Statement)+data Inh_Statement  = Inh_Statement {env_Inh_Statement :: Environment,inProducedEnv_Inh_Statement :: Environment,lib_Inh_Statement :: LocalIdentifierBindings}+data Syn_Statement  = Syn_Statement {annotatedTree_Syn_Statement :: Statement,envUpdates_Syn_Statement :: [EnvironmentUpdate],libUpdates_Syn_Statement :: [LocalIdentifierBindingsUpdate],originalTree_Syn_Statement :: Statement}+wrap_Statement :: T_Statement  ->+                  Inh_Statement  ->+                  Syn_Statement +wrap_Statement sem (Inh_Statement _lhsIenv _lhsIinProducedEnv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIinProducedEnv _lhsIlib )+     in  (Syn_Statement _lhsOannotatedTree _lhsOenvUpdates _lhsOlibUpdates _lhsOoriginalTree ))+sem_Statement_AlterSequence :: Annotation ->+                               String ->+                               String ->+                               T_Statement +sem_Statement_AlterSequence ann_ name_ ownedBy_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9644 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9649 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9654 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  AlterSequence ann_ name_ ownedBy_+                  {-# LINE 9659 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  AlterSequence ann_ name_ ownedBy_+                  {-# LINE 9664 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 9669 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 9674 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_AlterTable :: Annotation ->+                            String ->+                            ([AlterTableAction]) ->+                            T_Statement +sem_Statement_AlterTable ann_ name_ actions_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9692 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9697 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  AlterTable ann_ name_ actions_+                  {-# LINE 9702 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  AlterTable ann_ name_ actions_+                  {-# LINE 9707 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 9712 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 9717 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_Assignment :: Annotation ->+                            String ->+                            T_Expression  ->+                            T_Statement +sem_Statement_Assignment ann_ target_ value_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _envUpdates :: ([EnvironmentUpdate])+              _lhsOoriginalTree :: Statement+              _valueOenv :: Environment+              _valueOlib :: LocalIdentifierBindings+              _valueIannotatedTree :: Expression+              _valueIliftedColumnName :: String+              _valueIoriginalTree :: Expression+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 9746 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 9751 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 9756 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9761 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 23, column 9)+              _tpe =+                  {-# LINE 23 "./TypeChecking/Plpgsql.ag" #-}+                  do+                  let fromType = getTypeAnnotation _valueIannotatedTree+                  toType <- libLookupID _lhsIlib target_+                  dependsOnRTpe [getTypeAnnotation _valueIannotatedTree, toType] $ do+                  checkAssignmentValid _lhsIenv fromType toType+                  return $ Pseudo Void+                  {-# LINE 9771 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 30, column 9)+              _backTree =+                  {-# LINE 30 "./TypeChecking/Plpgsql.ag" #-}+                  Assignment ann_ target_ _valueIannotatedTree+                  {-# LINE 9776 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 31, column 9)+              _envUpdates =+                  {-# LINE 31 "./TypeChecking/Plpgsql.ag" #-}+                  []+                  {-# LINE 9781 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 32, column 9)+              _statementType =+                  {-# LINE 32 "./TypeChecking/Plpgsql.ag" #-}+                  []+                  {-# LINE 9786 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Assignment ann_ target_ _valueIannotatedTree+                  {-# LINE 9791 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Assignment ann_ target_ _valueIoriginalTree+                  {-# LINE 9796 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 9801 "AstInternal.hs" #-}+              -- copy rule (down)+              _valueOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 9806 "AstInternal.hs" #-}+              -- copy rule (down)+              _valueOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 9811 "AstInternal.hs" #-}+              ( _valueIannotatedTree,_valueIliftedColumnName,_valueIoriginalTree) =+                  (value_ _valueOenv _valueOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_CaseStatement :: Annotation ->+                               T_Expression  ->+                               T_ExpressionListStatementListPairList  ->+                               T_StatementList  ->+                               T_Statement +sem_Statement_CaseStatement ann_ val_ cases_ els_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _elsOenvUpdates :: ([EnvironmentUpdate])+              _elsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              _valOenv :: Environment+              _valOlib :: LocalIdentifierBindings+              _casesOenv :: Environment+              _casesOlib :: LocalIdentifierBindings+              _elsOenv :: Environment+              _elsOlib :: LocalIdentifierBindings+              _valIannotatedTree :: Expression+              _valIliftedColumnName :: String+              _valIoriginalTree :: Expression+              _casesIannotatedTree :: ExpressionListStatementListPairList+              _casesIoriginalTree :: ExpressionListStatementListPairList+              _elsIannotatedTree :: StatementList+              _elsIoriginalTree :: StatementList+              _elsIproducedEnv :: Environment+              _elsIproducedLib :: LocalIdentifierBindings+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9849 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9854 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 106, column 9)+              _elsOenvUpdates =+                  {-# LINE 106 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9859 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 107, column 9)+              _elsOlibUpdates =+                  {-# LINE 107 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9864 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CaseStatement ann_ _valIannotatedTree _casesIannotatedTree _elsIannotatedTree+                  {-# LINE 9869 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CaseStatement ann_ _valIoriginalTree _casesIoriginalTree _elsIoriginalTree+                  {-# LINE 9874 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 9879 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 9884 "AstInternal.hs" #-}+              -- copy rule (down)+              _valOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 9889 "AstInternal.hs" #-}+              -- copy rule (down)+              _valOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 9894 "AstInternal.hs" #-}+              -- copy rule (down)+              _casesOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 9899 "AstInternal.hs" #-}+              -- copy rule (down)+              _casesOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 9904 "AstInternal.hs" #-}+              -- copy rule (down)+              _elsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 9909 "AstInternal.hs" #-}+              -- copy rule (down)+              _elsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 9914 "AstInternal.hs" #-}+              ( _valIannotatedTree,_valIliftedColumnName,_valIoriginalTree) =+                  (val_ _valOenv _valOlib )+              ( _casesIannotatedTree,_casesIoriginalTree) =+                  (cases_ _casesOenv _casesOlib )+              ( _elsIannotatedTree,_elsIoriginalTree,_elsIproducedEnv,_elsIproducedLib) =+                  (els_ _elsOenv _elsOenvUpdates _elsOlib _elsOlibUpdates )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_ContinueStatement :: Annotation ->+                                   T_Statement +sem_Statement_ContinueStatement ann_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9936 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9941 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  ContinueStatement ann_+                  {-# LINE 9946 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  ContinueStatement ann_+                  {-# LINE 9951 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 9956 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 9961 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_Copy :: Annotation ->+                      String ->+                      T_StringList  ->+                      T_CopySource  ->+                      T_Statement +sem_Statement_Copy ann_ table_ targetCols_ source_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              _targetColsOenv :: Environment+              _targetColsOlib :: LocalIdentifierBindings+              _sourceOenv :: Environment+              _sourceOlib :: LocalIdentifierBindings+              _targetColsIannotatedTree :: StringList+              _targetColsIoriginalTree :: StringList+              _targetColsIstrings :: ([String])+              _sourceIannotatedTree :: CopySource+              _sourceIoriginalTree :: CopySource+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9989 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 9994 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Copy ann_ table_ _targetColsIannotatedTree _sourceIannotatedTree+                  {-# LINE 9999 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Copy ann_ table_ _targetColsIoriginalTree _sourceIoriginalTree+                  {-# LINE 10004 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 10009 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 10014 "AstInternal.hs" #-}+              -- copy rule (down)+              _targetColsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10019 "AstInternal.hs" #-}+              -- copy rule (down)+              _targetColsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 10024 "AstInternal.hs" #-}+              -- copy rule (down)+              _sourceOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10029 "AstInternal.hs" #-}+              -- copy rule (down)+              _sourceOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 10034 "AstInternal.hs" #-}+              ( _targetColsIannotatedTree,_targetColsIoriginalTree,_targetColsIstrings) =+                  (targetCols_ _targetColsOenv _targetColsOlib )+              ( _sourceIannotatedTree,_sourceIoriginalTree) =+                  (source_ _sourceOenv _sourceOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_CopyData :: Annotation ->+                          String ->+                          T_Statement +sem_Statement_CopyData ann_ insData_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10055 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10060 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CopyData ann_ insData_+                  {-# LINE 10065 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CopyData ann_ insData_+                  {-# LINE 10070 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 10075 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 10080 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_CreateDomain :: Annotation ->+                              String ->+                              T_TypeName  ->+                              String ->+                              T_MaybeBoolExpression  ->+                              T_Statement +sem_Statement_CreateDomain ann_ name_ typ_ checkName_ check_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _envUpdates :: ([EnvironmentUpdate])+              _checkOlib :: LocalIdentifierBindings+              _lhsOoriginalTree :: Statement+              _typOenv :: Environment+              _typOlib :: LocalIdentifierBindings+              _checkOenv :: Environment+              _typIannotatedTree :: TypeName+              _typInamedType :: Type+              _typIoriginalTree :: TypeName+              _checkIannotatedTree :: MaybeBoolExpression+              _checkIoriginalTree :: MaybeBoolExpression+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 10115 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 10120 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 10125 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10130 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 64, column 9)+              _tpe =+                  {-# LINE 64 "./TypeChecking/MiscCreates.ag" #-}+                  Right $ Pseudo Void+                  {-# LINE 10135 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 65, column 9)+              _backTree =+                  {-# LINE 65 "./TypeChecking/MiscCreates.ag" #-}+                  CreateDomain ann_ name_ _typIannotatedTree checkName_ _checkIannotatedTree+                  {-# LINE 10140 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 66, column 9)+              _statementType =+                  {-# LINE 66 "./TypeChecking/MiscCreates.ag" #-}+                  []+                  {-# LINE 10145 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 67, column 9)+              _envUpdates =+                  {-# LINE 67 "./TypeChecking/MiscCreates.ag" #-}+                  [EnvCreateDomain (DomainType name_) _typInamedType]+                  {-# LINE 10150 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 69, column 9)+              _checkOlib =+                  {-# LINE 69 "./TypeChecking/MiscCreates.ag" #-}+                  fromRight _lhsIlib $+                  updateBindings _lhsIlib _lhsIenv+                    [LibStackIDs [("", [("value", _typInamedType)])]]+                  {-# LINE 10157 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CreateDomain ann_ name_ _typIannotatedTree checkName_ _checkIannotatedTree+                  {-# LINE 10162 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CreateDomain ann_ name_ _typIoriginalTree checkName_ _checkIoriginalTree+                  {-# LINE 10167 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 10172 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10177 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 10182 "AstInternal.hs" #-}+              -- copy rule (down)+              _checkOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10187 "AstInternal.hs" #-}+              ( _typIannotatedTree,_typInamedType,_typIoriginalTree) =+                  (typ_ _typOenv _typOlib )+              ( _checkIannotatedTree,_checkIoriginalTree) =+                  (check_ _checkOenv _checkOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_CreateFunction :: Annotation ->+                                String ->+                                T_ParamDefList  ->+                                T_TypeName  ->+                                T_Language  ->+                                String ->+                                T_FnBody  ->+                                T_Volatility  ->+                                T_Statement +sem_Statement_CreateFunction ann_ name_ params_ rettype_ lang_ bodyQuote_ body_ vol_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _envUpdates :: ([EnvironmentUpdate])+              _bodyOenv :: Environment+              _bodyOlib :: LocalIdentifierBindings+              _lhsOoriginalTree :: Statement+              _paramsOenv :: Environment+              _paramsOlib :: LocalIdentifierBindings+              _rettypeOenv :: Environment+              _rettypeOlib :: LocalIdentifierBindings+              _langOenv :: Environment+              _langOlib :: LocalIdentifierBindings+              _volOenv :: Environment+              _volOlib :: LocalIdentifierBindings+              _paramsIannotatedTree :: ParamDefList+              _paramsIoriginalTree :: ParamDefList+              _paramsIparams :: ([(String, Type)])+              _rettypeIannotatedTree :: TypeName+              _rettypeInamedType :: Type+              _rettypeIoriginalTree :: TypeName+              _langIannotatedTree :: Language+              _langIoriginalTree :: Language+              _bodyIannotatedTree :: FnBody+              _bodyIoriginalTree :: FnBody+              _volIannotatedTree :: Volatility+              _volIoriginalTree :: Volatility+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 10242 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 10247 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 10252 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10257 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateFunction.ag"(line 23, column 9)+              _tpe =+                  {-# LINE 23 "./TypeChecking/CreateFunction.ag" #-}+                  dependsOnRTpe+                    (_rettypeInamedType : _parameterTypes    ) $+                    Right $ Pseudo Void+                  {-# LINE 10264 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateFunction.ag"(line 26, column 9)+              _envUpdates =+                  {-# LINE 26 "./TypeChecking/CreateFunction.ag" #-}+                  dependsOn [tpeToT _tpe    ] []+                            [EnvCreateFunction FunName+                                               (map toLower name_)+                                               _parameterTypes+                                               _rettypeInamedType+                                               False]+                  {-# LINE 10274 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateFunction.ag"(line 32, column 9)+              _parameterTypes =+                  {-# LINE 32 "./TypeChecking/CreateFunction.ag" #-}+                  (map snd _paramsIparams)+                  {-# LINE 10279 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateFunction.ag"(line 34, column 9)+              _backTree =+                  {-# LINE 34 "./TypeChecking/CreateFunction.ag" #-}+                  CreateFunction ann_+                                 name_+                                 _paramsIannotatedTree+                                 _rettypeIannotatedTree+                                 _langIannotatedTree+                                 bodyQuote_+                                 _bodyIannotatedTree+                                 _volIannotatedTree+                  {-# LINE 10291 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateFunction.ag"(line 42, column 9)+              _statementType =+                  {-# LINE 42 "./TypeChecking/CreateFunction.ag" #-}+                  []+                  {-# LINE 10296 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateFunction.ag"(line 43, column 9)+              _bodyOenv =+                  {-# LINE 43 "./TypeChecking/CreateFunction.ag" #-}+                  _lhsIinProducedEnv+                  {-# LINE 10301 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateFunction.ag"(line 99, column 9)+              _bodyOlib =+                  {-# LINE 99 "./TypeChecking/CreateFunction.ag" #-}+                  let p = _paramsIparams+                          ++ (zip posNames $ map snd _paramsIparams)+                  in fromRight _lhsIlib $+                     updateBindings _lhsIlib _lhsIenv+                                    [LibStackIDs [("", p)+                                                 ,(name_, _paramsIparams)]]+                  where+                    posNames :: [String]+                    posNames = map (\l -> '$':show l) [1..]+                  {-# LINE 10314 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CreateFunction ann_ name_ _paramsIannotatedTree _rettypeIannotatedTree _langIannotatedTree bodyQuote_ _bodyIannotatedTree _volIannotatedTree+                  {-# LINE 10319 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CreateFunction ann_ name_ _paramsIoriginalTree _rettypeIoriginalTree _langIoriginalTree bodyQuote_ _bodyIoriginalTree _volIoriginalTree+                  {-# LINE 10324 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 10329 "AstInternal.hs" #-}+              -- copy rule (down)+              _paramsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10334 "AstInternal.hs" #-}+              -- copy rule (down)+              _paramsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 10339 "AstInternal.hs" #-}+              -- copy rule (down)+              _rettypeOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10344 "AstInternal.hs" #-}+              -- copy rule (down)+              _rettypeOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 10349 "AstInternal.hs" #-}+              -- copy rule (down)+              _langOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10354 "AstInternal.hs" #-}+              -- copy rule (down)+              _langOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 10359 "AstInternal.hs" #-}+              -- copy rule (down)+              _volOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10364 "AstInternal.hs" #-}+              -- copy rule (down)+              _volOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 10369 "AstInternal.hs" #-}+              ( _paramsIannotatedTree,_paramsIoriginalTree,_paramsIparams) =+                  (params_ _paramsOenv _paramsOlib )+              ( _rettypeIannotatedTree,_rettypeInamedType,_rettypeIoriginalTree) =+                  (rettype_ _rettypeOenv _rettypeOlib )+              ( _langIannotatedTree,_langIoriginalTree) =+                  (lang_ _langOenv _langOlib )+              ( _bodyIannotatedTree,_bodyIoriginalTree) =+                  (body_ _bodyOenv _bodyOlib )+              ( _volIannotatedTree,_volIoriginalTree) =+                  (vol_ _volOenv _volOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_CreateLanguage :: Annotation ->+                                String ->+                                T_Statement +sem_Statement_CreateLanguage ann_ name_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10396 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10401 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10406 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CreateLanguage ann_ name_+                  {-# LINE 10411 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CreateLanguage ann_ name_+                  {-# LINE 10416 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 10421 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 10426 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_CreateSequence :: Annotation ->+                                String ->+                                Integer ->+                                Integer ->+                                Integer ->+                                Integer ->+                                Integer ->+                                T_Statement +sem_Statement_CreateSequence ann_ name_ incr_ min_ max_ start_ cache_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10448 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10453 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10458 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CreateSequence ann_ name_ incr_ min_ max_ start_ cache_+                  {-# LINE 10463 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CreateSequence ann_ name_ incr_ min_ max_ start_ cache_+                  {-# LINE 10468 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 10473 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 10478 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_CreateTable :: Annotation ->+                             String ->+                             T_AttributeDefList  ->+                             T_ConstraintList  ->+                             T_Statement +sem_Statement_CreateTable ann_ name_ atts_ cons_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _envUpdates :: ([EnvironmentUpdate])+              _attrTypes :: ([Type])+              _consOlib :: LocalIdentifierBindings+              _lhsOoriginalTree :: Statement+              _attsOenv :: Environment+              _attsOlib :: LocalIdentifierBindings+              _consOenv :: Environment+              _attsIannotatedTree :: AttributeDefList+              _attsIattrs :: ([(String, Type)])+              _attsIoriginalTree :: AttributeDefList+              _consIannotatedTree :: ConstraintList+              _consIoriginalTree :: ConstraintList+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 10513 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 10518 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 10523 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10528 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 25, column 9)+              _tpe =+                  {-# LINE 25 "./TypeChecking/CreateTable.ag" #-}+                  dependsOnRTpe _attrTypes     $ Right $ Pseudo Void+                  {-# LINE 10533 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 26, column 9)+              _envUpdates =+                  {-# LINE 26 "./TypeChecking/CreateTable.ag" #-}+                  dependsOn _attrTypes     []+                    [EnvCreateTable name_ _attsIattrs defaultSystemColumns]+                  {-# LINE 10539 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 29, column 9)+              _attrTypes =+                  {-# LINE 29 "./TypeChecking/CreateTable.ag" #-}+                  map snd _attsIattrs+                  {-# LINE 10544 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 31, column 9)+              _statementType =+                  {-# LINE 31 "./TypeChecking/CreateTable.ag" #-}+                  []+                  {-# LINE 10549 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 32, column 9)+              _backTree =+                  {-# LINE 32 "./TypeChecking/CreateTable.ag" #-}+                  CreateTable ann_+                              name_+                              _attsIannotatedTree+                              _consIannotatedTree+                  {-# LINE 10557 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 36, column 9)+              _consOlib =+                  {-# LINE 36 "./TypeChecking/CreateTable.ag" #-}+                  case updateBindings _lhsIlib _lhsIenv+                    [LibStackIDs [("", _attsIattrs)]] of+                     Left x -> error $ show x+                     Right e -> e+                  {-# LINE 10565 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CreateTable ann_ name_ _attsIannotatedTree _consIannotatedTree+                  {-# LINE 10570 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CreateTable ann_ name_ _attsIoriginalTree _consIoriginalTree+                  {-# LINE 10575 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 10580 "AstInternal.hs" #-}+              -- copy rule (down)+              _attsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10585 "AstInternal.hs" #-}+              -- copy rule (down)+              _attsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 10590 "AstInternal.hs" #-}+              -- copy rule (down)+              _consOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10595 "AstInternal.hs" #-}+              ( _attsIannotatedTree,_attsIattrs,_attsIoriginalTree) =+                  (atts_ _attsOenv _attsOlib )+              ( _consIannotatedTree,_consIoriginalTree) =+                  (cons_ _consOenv _consOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_CreateTableAs :: Annotation ->+                               String ->+                               T_SelectExpression  ->+                               T_Statement +sem_Statement_CreateTableAs ann_ name_ expr_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _envUpdates :: ([EnvironmentUpdate])+              _lhsOoriginalTree :: Statement+              _exprOenv :: Environment+              _exprOlib :: LocalIdentifierBindings+              _exprIannotatedTree :: SelectExpression+              _exprIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _exprIoriginalTree :: SelectExpression+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 10628 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 10633 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 10638 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10643 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 53, column 9)+              _tpe =+                  {-# LINE 53 "./TypeChecking/CreateTable.ag" #-}+                  dependsOnRTpe [_selType    ] $ do+                    _attrs+                    Right _selType+                  {-# LINE 10650 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 57, column 9)+              _envUpdates =+                  {-# LINE 57 "./TypeChecking/CreateTable.ag" #-}+                  leftToEmpty (\as -> [EnvCreateTable name_ as defaultSystemColumns]) $ do+                     ats <- _attrs+                     return $ dependsOn (tpeToT _tpe     :+                                         (map snd ats)) [] ats+                  {-# LINE 10658 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 63, column 9)+              _selType =+                  {-# LINE 63 "./TypeChecking/CreateTable.ag" #-}+                  getTypeAnnotation _exprIannotatedTree+                  {-# LINE 10663 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 65, column 9)+              _attrs =+                  {-# LINE 65 "./TypeChecking/CreateTable.ag" #-}+                  unwrapSetOfComposite _selType+                  {-# LINE 10668 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 67, column 9)+              _backTree =+                  {-# LINE 67 "./TypeChecking/CreateTable.ag" #-}+                  CreateTableAs ann_ name_ _exprIannotatedTree+                  {-# LINE 10673 "AstInternal.hs" #-}+              -- "./TypeChecking/CreateTable.ag"(line 68, column 9)+              _statementType =+                  {-# LINE 68 "./TypeChecking/CreateTable.ag" #-}+                  []+                  {-# LINE 10678 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CreateTableAs ann_ name_ _exprIannotatedTree+                  {-# LINE 10683 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CreateTableAs ann_ name_ _exprIoriginalTree+                  {-# LINE 10688 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 10693 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10698 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 10703 "AstInternal.hs" #-}+              ( _exprIannotatedTree,_exprIlibUpdates,_exprIoriginalTree) =+                  (expr_ _exprOenv _exprOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_CreateTrigger :: Annotation ->+                               String ->+                               T_TriggerWhen  ->+                               ([TriggerEvent]) ->+                               String ->+                               T_TriggerFire  ->+                               String ->+                               ([Expression]) ->+                               T_Statement +sem_Statement_CreateTrigger ann_ name_ wh_ events_ tbl_ firing_ fnName_ fnArgs_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              _whOenv :: Environment+              _whOlib :: LocalIdentifierBindings+              _firingOenv :: Environment+              _firingOlib :: LocalIdentifierBindings+              _whIannotatedTree :: TriggerWhen+              _whIoriginalTree :: TriggerWhen+              _firingIannotatedTree :: TriggerFire+              _firingIoriginalTree :: TriggerFire+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10736 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10741 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CreateTrigger ann_ name_ _whIannotatedTree events_ tbl_ _firingIannotatedTree fnName_ fnArgs_+                  {-# LINE 10746 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CreateTrigger ann_ name_ _whIoriginalTree events_ tbl_ _firingIoriginalTree fnName_ fnArgs_+                  {-# LINE 10751 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 10756 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 10761 "AstInternal.hs" #-}+              -- copy rule (down)+              _whOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10766 "AstInternal.hs" #-}+              -- copy rule (down)+              _whOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 10771 "AstInternal.hs" #-}+              -- copy rule (down)+              _firingOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10776 "AstInternal.hs" #-}+              -- copy rule (down)+              _firingOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 10781 "AstInternal.hs" #-}+              ( _whIannotatedTree,_whIoriginalTree) =+                  (wh_ _whOenv _whOlib )+              ( _firingIannotatedTree,_firingIoriginalTree) =+                  (firing_ _firingOenv _firingOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_CreateType :: Annotation ->+                            String ->+                            T_TypeAttributeDefList  ->+                            T_Statement +sem_Statement_CreateType ann_ name_ atts_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _envUpdates :: ([EnvironmentUpdate])+              _lhsOoriginalTree :: Statement+              _attsOenv :: Environment+              _attsOlib :: LocalIdentifierBindings+              _attsIannotatedTree :: TypeAttributeDefList+              _attsIattrs :: ([(String, Type)])+              _attsIoriginalTree :: TypeAttributeDefList+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 10814 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 10819 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 10824 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10829 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 51, column 9)+              _tpe =+                  {-# LINE 51 "./TypeChecking/MiscCreates.ag" #-}+                  Right $ Pseudo Void+                  {-# LINE 10834 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 52, column 9)+              _backTree =+                  {-# LINE 52 "./TypeChecking/MiscCreates.ag" #-}+                  CreateType ann_ name_ _attsIannotatedTree+                  {-# LINE 10839 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 53, column 9)+              _statementType =+                  {-# LINE 53 "./TypeChecking/MiscCreates.ag" #-}+                  []+                  {-# LINE 10844 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 54, column 9)+              _envUpdates =+                  {-# LINE 54 "./TypeChecking/MiscCreates.ag" #-}+                  [EnvCreateComposite name_ _attsIattrs]+                  {-# LINE 10849 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CreateType ann_ name_ _attsIannotatedTree+                  {-# LINE 10854 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CreateType ann_ name_ _attsIoriginalTree+                  {-# LINE 10859 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 10864 "AstInternal.hs" #-}+              -- copy rule (down)+              _attsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10869 "AstInternal.hs" #-}+              -- copy rule (down)+              _attsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 10874 "AstInternal.hs" #-}+              ( _attsIannotatedTree,_attsIattrs,_attsIoriginalTree) =+                  (atts_ _attsOenv _attsOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_CreateView :: Annotation ->+                            String ->+                            T_SelectExpression  ->+                            T_Statement +sem_Statement_CreateView ann_ name_ expr_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _envUpdates :: ([EnvironmentUpdate])+              _lhsOoriginalTree :: Statement+              _exprOenv :: Environment+              _exprOlib :: LocalIdentifierBindings+              _exprIannotatedTree :: SelectExpression+              _exprIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _exprIoriginalTree :: SelectExpression+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 10905 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 10910 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 10915 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 10920 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 15, column 9)+              _tpe =+                  {-# LINE 15 "./TypeChecking/MiscCreates.ag" #-}+                  dependsOnRTpe [getTypeAnnotation _exprIannotatedTree] $+                    Right $ Pseudo Void+                  {-# LINE 10926 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 17, column 9)+              _backTree =+                  {-# LINE 17 "./TypeChecking/MiscCreates.ag" #-}+                  CreateView ann_ name_ _exprIannotatedTree+                  {-# LINE 10931 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 18, column 9)+              _attrs =+                  {-# LINE 18 "./TypeChecking/MiscCreates.ag" #-}+                  case getTypeAnnotation _exprIannotatedTree of+                    SetOfType (CompositeType c) -> c+                    _ -> []+                  {-# LINE 10938 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 21, column 9)+              _envUpdates =+                  {-# LINE 21 "./TypeChecking/MiscCreates.ag" #-}+                  [EnvCreateView name_ _attrs    ]+                  {-# LINE 10943 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 22, column 9)+              _statementType =+                  {-# LINE 22 "./TypeChecking/MiscCreates.ag" #-}+                  []+                  {-# LINE 10948 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  CreateView ann_ name_ _exprIannotatedTree+                  {-# LINE 10953 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  CreateView ann_ name_ _exprIoriginalTree+                  {-# LINE 10958 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 10963 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 10968 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 10973 "AstInternal.hs" #-}+              ( _exprIannotatedTree,_exprIlibUpdates,_exprIoriginalTree) =+                  (expr_ _exprOenv _exprOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_Delete :: Annotation ->+                        String ->+                        T_MaybeBoolExpression  ->+                        T_MaybeSelectList  ->+                        T_Statement +sem_Statement_Delete ann_ table_ whr_ returning_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _envUpdates :: ([EnvironmentUpdate])+              _whrOlib :: LocalIdentifierBindings+              _returningOlib :: LocalIdentifierBindings+              _lhsOoriginalTree :: Statement+              _whrOenv :: Environment+              _returningOenv :: Environment+              _whrIannotatedTree :: MaybeBoolExpression+              _whrIoriginalTree :: MaybeBoolExpression+              _returningIannotatedTree :: MaybeSelectList+              _returningIlistType :: (Maybe [(String,Type)])+              _returningIoriginalTree :: MaybeSelectList+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 11009 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 11014 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 11019 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11024 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 153, column 9)+              _tpe =+                  {-# LINE 153 "./TypeChecking/Dml.ag" #-}+                  checkRelationExists _lhsIenv table_ >>+                  Right (Pseudo Void)+                  {-# LINE 11030 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 156, column 9)+              _statementType =+                  {-# LINE 156 "./TypeChecking/Dml.ag" #-}+                  [StatementType [] (fromMaybe [] _returningIlistType)]+                  {-# LINE 11035 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 158, column 9)+              _backTree =+                  {-# LINE 158 "./TypeChecking/Dml.ag" #-}+                  Delete ann_ table_ _whrIannotatedTree _returningIannotatedTree+                  {-# LINE 11040 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 159, column 9)+              _envUpdates =+                  {-# LINE 159 "./TypeChecking/Dml.ag" #-}+                  []+                  {-# LINE 11045 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 164, column 9)+              _lib =+                  {-# LINE 164 "./TypeChecking/Dml.ag" #-}+                  fromRight _lhsIlib $ do+                  columnTypes <- envCompositeAttrs _lhsIenv relationComposites table_+                  updateBindings _lhsIlib _lhsIenv [LibStackIDs [("", columnTypes)]]+                  {-# LINE 11052 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 168, column 9)+              _whrOlib =+                  {-# LINE 168 "./TypeChecking/Dml.ag" #-}+                  _lib+                  {-# LINE 11057 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 169, column 9)+              _returningOlib =+                  {-# LINE 169 "./TypeChecking/Dml.ag" #-}+                  _lib+                  {-# LINE 11062 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Delete ann_ table_ _whrIannotatedTree _returningIannotatedTree+                  {-# LINE 11067 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Delete ann_ table_ _whrIoriginalTree _returningIoriginalTree+                  {-# LINE 11072 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 11077 "AstInternal.hs" #-}+              -- copy rule (down)+              _whrOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11082 "AstInternal.hs" #-}+              -- copy rule (down)+              _returningOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11087 "AstInternal.hs" #-}+              ( _whrIannotatedTree,_whrIoriginalTree) =+                  (whr_ _whrOenv _whrOlib )+              ( _returningIannotatedTree,_returningIlistType,_returningIoriginalTree) =+                  (returning_ _returningOenv _returningOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_DropFunction :: Annotation ->+                              T_IfExists  ->+                              T_StringTypeNameListPairList  ->+                              T_Cascade  ->+                              T_Statement +sem_Statement_DropFunction ann_ ifE_ sigs_ cascade_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _envUpdates :: ([EnvironmentUpdate])+              _lhsOoriginalTree :: Statement+              _ifEOenv :: Environment+              _ifEOlib :: LocalIdentifierBindings+              _sigsOenv :: Environment+              _sigsOlib :: LocalIdentifierBindings+              _cascadeOenv :: Environment+              _cascadeOlib :: LocalIdentifierBindings+              _ifEIannotatedTree :: IfExists+              _ifEIoriginalTree :: IfExists+              _sigsIannotatedTree :: StringTypeNameListPairList+              _sigsIfnSigs :: ([(String,[Type])])+              _sigsIoriginalTree :: StringTypeNameListPairList+              _cascadeIannotatedTree :: Cascade+              _cascadeIoriginalTree :: Cascade+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 11129 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 11134 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 11139 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11144 "AstInternal.hs" #-}+              -- "./TypeChecking/Drops.ag"(line 10, column 9)+              _tpe =+                  {-# LINE 10 "./TypeChecking/Drops.ag" #-}+                  Right $ Pseudo Void+                  {-# LINE 11149 "AstInternal.hs" #-}+              -- "./TypeChecking/Drops.ag"(line 11, column 9)+              _backTree =+                  {-# LINE 11 "./TypeChecking/Drops.ag" #-}+                  DropFunction ann_ _ifEIannotatedTree _sigsIannotatedTree _cascadeIannotatedTree+                  {-# LINE 11154 "AstInternal.hs" #-}+              -- "./TypeChecking/Drops.ag"(line 12, column 9)+              _envUpdates =+                  {-# LINE 12 "./TypeChecking/Drops.ag" #-}+                  flip map _sigsIfnSigs $ \(nm,args) ->+                        EnvDropFunction ifE nm args+                  where+                    ifE = _ifEIannotatedTree == IfExists+                  {-# LINE 11162 "AstInternal.hs" #-}+              -- "./TypeChecking/Drops.ag"(line 16, column 9)+              _statementType =+                  {-# LINE 16 "./TypeChecking/Drops.ag" #-}+                  []+                  {-# LINE 11167 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  DropFunction ann_ _ifEIannotatedTree _sigsIannotatedTree _cascadeIannotatedTree+                  {-# LINE 11172 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  DropFunction ann_ _ifEIoriginalTree _sigsIoriginalTree _cascadeIoriginalTree+                  {-# LINE 11177 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 11182 "AstInternal.hs" #-}+              -- copy rule (down)+              _ifEOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11187 "AstInternal.hs" #-}+              -- copy rule (down)+              _ifEOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11192 "AstInternal.hs" #-}+              -- copy rule (down)+              _sigsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11197 "AstInternal.hs" #-}+              -- copy rule (down)+              _sigsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11202 "AstInternal.hs" #-}+              -- copy rule (down)+              _cascadeOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11207 "AstInternal.hs" #-}+              -- copy rule (down)+              _cascadeOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11212 "AstInternal.hs" #-}+              ( _ifEIannotatedTree,_ifEIoriginalTree) =+                  (ifE_ _ifEOenv _ifEOlib )+              ( _sigsIannotatedTree,_sigsIfnSigs,_sigsIoriginalTree) =+                  (sigs_ _sigsOenv _sigsOlib )+              ( _cascadeIannotatedTree,_cascadeIoriginalTree) =+                  (cascade_ _cascadeOenv _cascadeOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_DropSomething :: Annotation ->+                               T_DropType  ->+                               T_IfExists  ->+                               T_StringList  ->+                               T_Cascade  ->+                               T_Statement +sem_Statement_DropSomething ann_ dropType_ ifE_ names_ cascade_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              _dropTypeOenv :: Environment+              _dropTypeOlib :: LocalIdentifierBindings+              _ifEOenv :: Environment+              _ifEOlib :: LocalIdentifierBindings+              _namesOenv :: Environment+              _namesOlib :: LocalIdentifierBindings+              _cascadeOenv :: Environment+              _cascadeOlib :: LocalIdentifierBindings+              _dropTypeIannotatedTree :: DropType+              _dropTypeIoriginalTree :: DropType+              _ifEIannotatedTree :: IfExists+              _ifEIoriginalTree :: IfExists+              _namesIannotatedTree :: StringList+              _namesIoriginalTree :: StringList+              _namesIstrings :: ([String])+              _cascadeIannotatedTree :: Cascade+              _cascadeIoriginalTree :: Cascade+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11255 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11260 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  DropSomething ann_ _dropTypeIannotatedTree _ifEIannotatedTree _namesIannotatedTree _cascadeIannotatedTree+                  {-# LINE 11265 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  DropSomething ann_ _dropTypeIoriginalTree _ifEIoriginalTree _namesIoriginalTree _cascadeIoriginalTree+                  {-# LINE 11270 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 11275 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 11280 "AstInternal.hs" #-}+              -- copy rule (down)+              _dropTypeOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11285 "AstInternal.hs" #-}+              -- copy rule (down)+              _dropTypeOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11290 "AstInternal.hs" #-}+              -- copy rule (down)+              _ifEOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11295 "AstInternal.hs" #-}+              -- copy rule (down)+              _ifEOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11300 "AstInternal.hs" #-}+              -- copy rule (down)+              _namesOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11305 "AstInternal.hs" #-}+              -- copy rule (down)+              _namesOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11310 "AstInternal.hs" #-}+              -- copy rule (down)+              _cascadeOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11315 "AstInternal.hs" #-}+              -- copy rule (down)+              _cascadeOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11320 "AstInternal.hs" #-}+              ( _dropTypeIannotatedTree,_dropTypeIoriginalTree) =+                  (dropType_ _dropTypeOenv _dropTypeOlib )+              ( _ifEIannotatedTree,_ifEIoriginalTree) =+                  (ifE_ _ifEOenv _ifEOlib )+              ( _namesIannotatedTree,_namesIoriginalTree,_namesIstrings) =+                  (names_ _namesOenv _namesOlib )+              ( _cascadeIannotatedTree,_cascadeIoriginalTree) =+                  (cascade_ _cascadeOenv _cascadeOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_Execute :: Annotation ->+                         T_Expression  ->+                         T_Statement +sem_Statement_Execute ann_ expr_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              _exprOenv :: Environment+              _exprOlib :: LocalIdentifierBindings+              _exprIannotatedTree :: Expression+              _exprIliftedColumnName :: String+              _exprIoriginalTree :: Expression+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11350 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11355 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Execute ann_ _exprIannotatedTree+                  {-# LINE 11360 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Execute ann_ _exprIoriginalTree+                  {-# LINE 11365 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 11370 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 11375 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11380 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11385 "AstInternal.hs" #-}+              ( _exprIannotatedTree,_exprIliftedColumnName,_exprIoriginalTree) =+                  (expr_ _exprOenv _exprOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_ExecuteInto :: Annotation ->+                             T_Expression  ->+                             T_StringList  ->+                             T_Statement +sem_Statement_ExecuteInto ann_ expr_ targets_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              _exprOenv :: Environment+              _exprOlib :: LocalIdentifierBindings+              _targetsOenv :: Environment+              _targetsOlib :: LocalIdentifierBindings+              _exprIannotatedTree :: Expression+              _exprIliftedColumnName :: String+              _exprIoriginalTree :: Expression+              _targetsIannotatedTree :: StringList+              _targetsIoriginalTree :: StringList+              _targetsIstrings :: ([String])+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11415 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11420 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  ExecuteInto ann_ _exprIannotatedTree _targetsIannotatedTree+                  {-# LINE 11425 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  ExecuteInto ann_ _exprIoriginalTree _targetsIoriginalTree+                  {-# LINE 11430 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 11435 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 11440 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11445 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11450 "AstInternal.hs" #-}+              -- copy rule (down)+              _targetsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11455 "AstInternal.hs" #-}+              -- copy rule (down)+              _targetsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11460 "AstInternal.hs" #-}+              ( _exprIannotatedTree,_exprIliftedColumnName,_exprIoriginalTree) =+                  (expr_ _exprOenv _exprOlib )+              ( _targetsIannotatedTree,_targetsIoriginalTree,_targetsIstrings) =+                  (targets_ _targetsOenv _targetsOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_ForIntegerStatement :: Annotation ->+                                     String ->+                                     T_Expression  ->+                                     T_Expression  ->+                                     T_StatementList  ->+                                     T_Statement +sem_Statement_ForIntegerStatement ann_ var_ from_ to_ sts_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _stsOenvUpdates :: ([EnvironmentUpdate])+              _stsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _stsOlib :: LocalIdentifierBindings+              _envUpdates :: ([EnvironmentUpdate])+              _lhsOoriginalTree :: Statement+              _fromOenv :: Environment+              _fromOlib :: LocalIdentifierBindings+              _toOenv :: Environment+              _toOlib :: LocalIdentifierBindings+              _stsOenv :: Environment+              _fromIannotatedTree :: Expression+              _fromIliftedColumnName :: String+              _fromIoriginalTree :: Expression+              _toIannotatedTree :: Expression+              _toIliftedColumnName :: String+              _toIoriginalTree :: Expression+              _stsIannotatedTree :: StatementList+              _stsIoriginalTree :: StatementList+              _stsIproducedEnv :: Environment+              _stsIproducedLib :: LocalIdentifierBindings+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 11508 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 11513 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 11518 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11523 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 110, column 9)+              _stsOenvUpdates =+                  {-# LINE 110 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11528 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 111, column 9)+              _stsOlibUpdates =+                  {-# LINE 111 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11533 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 36, column 9)+              _varTypeE =+                  {-# LINE 36 "./TypeChecking/Plpgsql.ag" #-}+                  libLookupID _lhsIlib var_+                  {-# LINE 11538 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 37, column 9)+              _tpe =+                  {-# LINE 37 "./TypeChecking/Plpgsql.ag" #-}+                  do+                  let fromType = getTypeAnnotation _fromIannotatedTree+                      toType = getTypeAnnotation _toIannotatedTree+                  dependsOnRTpe [fromType,toType] $ do+                  errorWhen (fromType /= toType) [FromToTypesNotSame fromType toType]+                  case _varTypeE     of+                    Right t -> checkAssignmentValid _lhsIenv fromType t+                    Left _ -> return ()+                  return $ Pseudo Void+                  {-# LINE 11551 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 48, column 9)+              _stsOlib =+                  {-# LINE 48 "./TypeChecking/Plpgsql.ag" #-}+                  case _varTypeE     of+                    Left [UnrecognisedIdentifier var_] ->+                        fromRight _lhsIlib $+                        updateBindings _lhsIlib _lhsIenv+                                       [LibStackIDs [("", [(var_,getTypeAnnotation _fromIannotatedTree)])]]+                    _ -> _lhsIlib+                  {-# LINE 11561 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 56, column 9)+              _backTree =+                  {-# LINE 56 "./TypeChecking/Plpgsql.ag" #-}+                  ForIntegerStatement ann_ var_ _fromIannotatedTree _toIannotatedTree _stsIannotatedTree+                  {-# LINE 11566 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 57, column 9)+              _envUpdates =+                  {-# LINE 57 "./TypeChecking/Plpgsql.ag" #-}+                  []+                  {-# LINE 11571 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 58, column 9)+              _statementType =+                  {-# LINE 58 "./TypeChecking/Plpgsql.ag" #-}+                  []+                  {-# LINE 11576 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  ForIntegerStatement ann_ var_ _fromIannotatedTree _toIannotatedTree _stsIannotatedTree+                  {-# LINE 11581 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  ForIntegerStatement ann_ var_ _fromIoriginalTree _toIoriginalTree _stsIoriginalTree+                  {-# LINE 11586 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 11591 "AstInternal.hs" #-}+              -- copy rule (down)+              _fromOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11596 "AstInternal.hs" #-}+              -- copy rule (down)+              _fromOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11601 "AstInternal.hs" #-}+              -- copy rule (down)+              _toOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11606 "AstInternal.hs" #-}+              -- copy rule (down)+              _toOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11611 "AstInternal.hs" #-}+              -- copy rule (down)+              _stsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11616 "AstInternal.hs" #-}+              ( _fromIannotatedTree,_fromIliftedColumnName,_fromIoriginalTree) =+                  (from_ _fromOenv _fromOlib )+              ( _toIannotatedTree,_toIliftedColumnName,_toIoriginalTree) =+                  (to_ _toOenv _toOlib )+              ( _stsIannotatedTree,_stsIoriginalTree,_stsIproducedEnv,_stsIproducedLib) =+                  (sts_ _stsOenv _stsOenvUpdates _stsOlib _stsOlibUpdates )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_ForSelectStatement :: Annotation ->+                                    String ->+                                    T_SelectExpression  ->+                                    T_StatementList  ->+                                    T_Statement +sem_Statement_ForSelectStatement ann_ var_ sel_ sts_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _stsOenvUpdates :: ([EnvironmentUpdate])+              _stsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _stsOlib :: LocalIdentifierBindings+              _envUpdates :: ([EnvironmentUpdate])+              _lhsOoriginalTree :: Statement+              _selOenv :: Environment+              _selOlib :: LocalIdentifierBindings+              _stsOenv :: Environment+              _selIannotatedTree :: SelectExpression+              _selIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _selIoriginalTree :: SelectExpression+              _stsIannotatedTree :: StatementList+              _stsIoriginalTree :: StatementList+              _stsIproducedEnv :: Environment+              _stsIproducedLib :: LocalIdentifierBindings+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 11660 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 11665 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 11670 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11675 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 110, column 9)+              _stsOenvUpdates =+                  {-# LINE 110 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11680 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 111, column 9)+              _stsOlibUpdates =+                  {-# LINE 111 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11685 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 63, column 9)+              _selType =+                  {-# LINE 63 "./TypeChecking/Plpgsql.ag" #-}+                  getTypeAnnotation _selIannotatedTree+                  {-# LINE 11690 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 64, column 9)+              _tpe =+                  {-# LINE 64 "./TypeChecking/Plpgsql.ag" #-}+                  do+                  dependsOnRTpe [_selType    ] $ do+                  toType <- libLookupID _lhsIlib var_+                  dependsOnRTpe [toType] $ do+                  checkAssignmentValid _lhsIenv _selType     toType+                  return $ Pseudo Void+                  {-# LINE 11700 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 75, column 9)+              _stsOlib =+                  {-# LINE 75 "./TypeChecking/Plpgsql.ag" #-}+                  if okToUpdate+                    then fromRight _lhsIlib $+                         updateBindings _lhsIlib _lhsIenv [LibStackIDs [("", [(var_,_selType    )])]]+                    else _lhsIlib+                  where+                    okToUpdate = isRight _tpe     && _selType     /= TypeCheckFailed+                  {-# LINE 11710 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 84, column 9)+              _backTree =+                  {-# LINE 84 "./TypeChecking/Plpgsql.ag" #-}+                  ForSelectStatement ann_ var_ _selIannotatedTree _stsIannotatedTree+                  {-# LINE 11715 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 85, column 9)+              _envUpdates =+                  {-# LINE 85 "./TypeChecking/Plpgsql.ag" #-}+                  []+                  {-# LINE 11720 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 86, column 9)+              _statementType =+                  {-# LINE 86 "./TypeChecking/Plpgsql.ag" #-}+                  []+                  {-# LINE 11725 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  ForSelectStatement ann_ var_ _selIannotatedTree _stsIannotatedTree+                  {-# LINE 11730 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  ForSelectStatement ann_ var_ _selIoriginalTree _stsIoriginalTree+                  {-# LINE 11735 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 11740 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11745 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11750 "AstInternal.hs" #-}+              -- copy rule (down)+              _stsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11755 "AstInternal.hs" #-}+              ( _selIannotatedTree,_selIlibUpdates,_selIoriginalTree) =+                  (sel_ _selOenv _selOlib )+              ( _stsIannotatedTree,_stsIoriginalTree,_stsIproducedEnv,_stsIproducedLib) =+                  (sts_ _stsOenv _stsOenvUpdates _stsOlib _stsOlibUpdates )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_If :: Annotation ->+                    T_ExpressionStatementListPairList  ->+                    T_StatementList  ->+                    T_Statement +sem_Statement_If ann_ cases_ els_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _elsOenvUpdates :: ([EnvironmentUpdate])+              _elsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              _casesOenv :: Environment+              _casesOlib :: LocalIdentifierBindings+              _elsOenv :: Environment+              _elsOlib :: LocalIdentifierBindings+              _casesIannotatedTree :: ExpressionStatementListPairList+              _casesIoriginalTree :: ExpressionStatementListPairList+              _elsIannotatedTree :: StatementList+              _elsIoriginalTree :: StatementList+              _elsIproducedEnv :: Environment+              _elsIproducedLib :: LocalIdentifierBindings+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11789 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11794 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 106, column 9)+              _elsOenvUpdates =+                  {-# LINE 106 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11799 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 107, column 9)+              _elsOlibUpdates =+                  {-# LINE 107 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11804 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  If ann_ _casesIannotatedTree _elsIannotatedTree+                  {-# LINE 11809 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  If ann_ _casesIoriginalTree _elsIoriginalTree+                  {-# LINE 11814 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 11819 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 11824 "AstInternal.hs" #-}+              -- copy rule (down)+              _casesOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11829 "AstInternal.hs" #-}+              -- copy rule (down)+              _casesOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11834 "AstInternal.hs" #-}+              -- copy rule (down)+              _elsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11839 "AstInternal.hs" #-}+              -- copy rule (down)+              _elsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11844 "AstInternal.hs" #-}+              ( _casesIannotatedTree,_casesIoriginalTree) =+                  (cases_ _casesOenv _casesOlib )+              ( _elsIannotatedTree,_elsIoriginalTree,_elsIproducedEnv,_elsIproducedLib) =+                  (els_ _elsOenv _elsOenvUpdates _elsOlib _elsOlibUpdates )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_Insert :: Annotation ->+                        String ->+                        T_StringList  ->+                        T_SelectExpression  ->+                        T_MaybeSelectList  ->+                        T_Statement +sem_Statement_Insert ann_ table_ targetCols_ insData_ returning_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _envUpdates :: ([EnvironmentUpdate])+              _returningOlib :: LocalIdentifierBindings+              _lhsOoriginalTree :: Statement+              _targetColsOenv :: Environment+              _targetColsOlib :: LocalIdentifierBindings+              _insDataOenv :: Environment+              _insDataOlib :: LocalIdentifierBindings+              _returningOenv :: Environment+              _targetColsIannotatedTree :: StringList+              _targetColsIoriginalTree :: StringList+              _targetColsIstrings :: ([String])+              _insDataIannotatedTree :: SelectExpression+              _insDataIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _insDataIoriginalTree :: SelectExpression+              _returningIannotatedTree :: MaybeSelectList+              _returningIlistType :: (Maybe [(String,Type)])+              _returningIoriginalTree :: MaybeSelectList+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 11889 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 11894 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 11899 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 11904 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 18, column 9)+              _tpe =+                  {-# LINE 18 "./TypeChecking/Dml.ag" #-}+                  dependsOnRTpe [getTypeAnnotation _insDataIannotatedTree] $ do+                    _columnTypes+                    Right $ Pseudo Void+                  {-# LINE 11911 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 22, column 9)+              _statementType =+                  {-# LINE 22 "./TypeChecking/Dml.ag" #-}+                  leftToEmpty (\ct -> [StatementType [] (fromMaybe [] _returningIlistType)]) _columnTypes+                  {-# LINE 11916 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 25, column 9)+              _columnTypes =+                  {-# LINE 25 "./TypeChecking/Dml.ag" #-}+                  do+                  tys <- unwrapSetOfComposite $+                         getTypeAnnotation _insDataIannotatedTree+                  checkColumnConsistency _lhsIenv+                                         table_+                                         _targetColsIstrings+                                         tys+                  {-# LINE 11927 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 34, column 9)+              _backTree =+                  {-# LINE 34 "./TypeChecking/Dml.ag" #-}+                  Insert ann_ table_ _targetColsIannotatedTree+                         _insDataIannotatedTree _returningIannotatedTree+                  {-# LINE 11933 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 36, column 9)+              _envUpdates =+                  {-# LINE 36 "./TypeChecking/Dml.ag" #-}+                  []+                  {-# LINE 11938 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 42, column 9)+              _returningOlib =+                  {-# LINE 42 "./TypeChecking/Dml.ag" #-}+                  fromRight _lhsIlib $ do+                    atts <- envCompositeAttrs _lhsIenv relationComposites table_+                    updateBindings _lhsIlib _lhsIenv [LibStackIDs [("", atts)]]+                  {-# LINE 11945 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Insert ann_ table_ _targetColsIannotatedTree _insDataIannotatedTree _returningIannotatedTree+                  {-# LINE 11950 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Insert ann_ table_ _targetColsIoriginalTree _insDataIoriginalTree _returningIoriginalTree+                  {-# LINE 11955 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 11960 "AstInternal.hs" #-}+              -- copy rule (down)+              _targetColsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11965 "AstInternal.hs" #-}+              -- copy rule (down)+              _targetColsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11970 "AstInternal.hs" #-}+              -- copy rule (down)+              _insDataOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11975 "AstInternal.hs" #-}+              -- copy rule (down)+              _insDataOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 11980 "AstInternal.hs" #-}+              -- copy rule (down)+              _returningOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 11985 "AstInternal.hs" #-}+              ( _targetColsIannotatedTree,_targetColsIoriginalTree,_targetColsIstrings) =+                  (targetCols_ _targetColsOenv _targetColsOlib )+              ( _insDataIannotatedTree,_insDataIlibUpdates,_insDataIoriginalTree) =+                  (insData_ _insDataOenv _insDataOlib )+              ( _returningIannotatedTree,_returningIlistType,_returningIoriginalTree) =+                  (returning_ _returningOenv _returningOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_Notify :: Annotation ->+                        String ->+                        T_Statement +sem_Statement_Notify ann_ name_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12008 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12013 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12018 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Notify ann_ name_+                  {-# LINE 12023 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Notify ann_ name_+                  {-# LINE 12028 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 12033 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 12038 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_NullStatement :: Annotation ->+                               T_Statement +sem_Statement_NullStatement ann_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12054 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12059 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  NullStatement ann_+                  {-# LINE 12064 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  NullStatement ann_+                  {-# LINE 12069 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 12074 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 12079 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_Perform :: Annotation ->+                         T_Expression  ->+                         T_Statement +sem_Statement_Perform ann_ expr_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              _exprOenv :: Environment+              _exprOlib :: LocalIdentifierBindings+              _exprIannotatedTree :: Expression+              _exprIliftedColumnName :: String+              _exprIoriginalTree :: Expression+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12101 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12106 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Perform ann_ _exprIannotatedTree+                  {-# LINE 12111 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Perform ann_ _exprIoriginalTree+                  {-# LINE 12116 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 12121 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 12126 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12131 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 12136 "AstInternal.hs" #-}+              ( _exprIannotatedTree,_exprIliftedColumnName,_exprIoriginalTree) =+                  (expr_ _exprOenv _exprOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_Raise :: Annotation ->+                       T_RaiseType  ->+                       String ->+                       T_ExpressionList  ->+                       T_Statement +sem_Statement_Raise ann_ level_ message_ args_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              _levelOenv :: Environment+              _levelOlib :: LocalIdentifierBindings+              _argsOenv :: Environment+              _argsOlib :: LocalIdentifierBindings+              _levelIannotatedTree :: RaiseType+              _levelIoriginalTree :: RaiseType+              _argsIannotatedTree :: ExpressionList+              _argsIoriginalTree :: ExpressionList+              _argsItypeList :: ([Type])+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12166 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12171 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Raise ann_ _levelIannotatedTree message_ _argsIannotatedTree+                  {-# LINE 12176 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Raise ann_ _levelIoriginalTree message_ _argsIoriginalTree+                  {-# LINE 12181 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 12186 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 12191 "AstInternal.hs" #-}+              -- copy rule (down)+              _levelOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12196 "AstInternal.hs" #-}+              -- copy rule (down)+              _levelOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 12201 "AstInternal.hs" #-}+              -- copy rule (down)+              _argsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12206 "AstInternal.hs" #-}+              -- copy rule (down)+              _argsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 12211 "AstInternal.hs" #-}+              ( _levelIannotatedTree,_levelIoriginalTree) =+                  (level_ _levelOenv _levelOlib )+              ( _argsIannotatedTree,_argsIoriginalTree,_argsItypeList) =+                  (args_ _argsOenv _argsOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_Return :: Annotation ->+                        T_MaybeExpression  ->+                        T_Statement +sem_Statement_Return ann_ value_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _envUpdates :: ([EnvironmentUpdate])+              _lhsOoriginalTree :: Statement+              _valueOenv :: Environment+              _valueOlib :: LocalIdentifierBindings+              _valueIannotatedTree :: MaybeExpression+              _valueIoriginalTree :: MaybeExpression+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 12242 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 12247 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 12252 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12257 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 12, column 9)+              _tpe =+                  {-# LINE 12 "./TypeChecking/Plpgsql.ag" #-}+                  dependsOnRTpe [maybe typeBool+                                      getTypeAnnotation+                                      _valueIannotatedTree] $ Right $ Pseudo Void+                  {-# LINE 12264 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 16, column 9)+              _backTree =+                  {-# LINE 16 "./TypeChecking/Plpgsql.ag" #-}+                  Return ann_ _valueIannotatedTree+                  {-# LINE 12269 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 17, column 9)+              _envUpdates =+                  {-# LINE 17 "./TypeChecking/Plpgsql.ag" #-}+                  []+                  {-# LINE 12274 "AstInternal.hs" #-}+              -- "./TypeChecking/Plpgsql.ag"(line 18, column 9)+              _statementType =+                  {-# LINE 18 "./TypeChecking/Plpgsql.ag" #-}+                  []+                  {-# LINE 12279 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Return ann_ _valueIannotatedTree+                  {-# LINE 12284 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Return ann_ _valueIoriginalTree+                  {-# LINE 12289 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 12294 "AstInternal.hs" #-}+              -- copy rule (down)+              _valueOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12299 "AstInternal.hs" #-}+              -- copy rule (down)+              _valueOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 12304 "AstInternal.hs" #-}+              ( _valueIannotatedTree,_valueIoriginalTree) =+                  (value_ _valueOenv _valueOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_ReturnNext :: Annotation ->+                            T_Expression  ->+                            T_Statement +sem_Statement_ReturnNext ann_ expr_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              _exprOenv :: Environment+              _exprOlib :: LocalIdentifierBindings+              _exprIannotatedTree :: Expression+              _exprIliftedColumnName :: String+              _exprIoriginalTree :: Expression+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12328 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12333 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  ReturnNext ann_ _exprIannotatedTree+                  {-# LINE 12338 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  ReturnNext ann_ _exprIoriginalTree+                  {-# LINE 12343 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 12348 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 12353 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12358 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 12363 "AstInternal.hs" #-}+              ( _exprIannotatedTree,_exprIliftedColumnName,_exprIoriginalTree) =+                  (expr_ _exprOenv _exprOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_ReturnQuery :: Annotation ->+                             T_SelectExpression  ->+                             T_Statement +sem_Statement_ReturnQuery ann_ sel_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              _selOenv :: Environment+              _selOlib :: LocalIdentifierBindings+              _selIannotatedTree :: SelectExpression+              _selIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _selIoriginalTree :: SelectExpression+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12387 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12392 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  ReturnQuery ann_ _selIannotatedTree+                  {-# LINE 12397 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  ReturnQuery ann_ _selIoriginalTree+                  {-# LINE 12402 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 12407 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 12412 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12417 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 12422 "AstInternal.hs" #-}+              ( _selIannotatedTree,_selIlibUpdates,_selIoriginalTree) =+                  (sel_ _selOenv _selOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_SelectStatement :: Annotation ->+                                 T_SelectExpression  ->+                                 T_Statement +sem_Statement_SelectStatement ann_ ex_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _envUpdates :: ([EnvironmentUpdate])+              _lhsOoriginalTree :: Statement+              _exOenv :: Environment+              _exOlib :: LocalIdentifierBindings+              _exIannotatedTree :: SelectExpression+              _exIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _exIoriginalTree :: SelectExpression+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 12452 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 12457 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 12462 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 14, column 9)+              _tpe =+                  {-# LINE 14 "./TypeChecking/SelectStatement.ag" #-}+                  dependsOnRTpe [getTypeAnnotation _exIannotatedTree] $ Right $ Pseudo Void+                  {-# LINE 12467 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 15, column 9)+              _statementType =+                  {-# LINE 15 "./TypeChecking/SelectStatement.ag" #-}+                  [StatementType ph $ leftToEmpty id  $+                                      unwrapSetOfComposite $+                                      getTypeAnnotation _exIannotatedTree]+                  where+                    ph = flip map (getPlaceholders _exIannotatedTree)+                           $ const $ ScalarType "text"+                  {-# LINE 12477 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 21, column 9)+              _backTree =+                  {-# LINE 21 "./TypeChecking/SelectStatement.ag" #-}+                  SelectStatement ann_ _exIannotatedTree+                  {-# LINE 12482 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectStatement.ag"(line 22, column 9)+              _envUpdates =+                  {-# LINE 22 "./TypeChecking/SelectStatement.ag" #-}+                  []+                  {-# LINE 12487 "AstInternal.hs" #-}+              -- "./TypeChecking/SelectLists.ag"(line 79, column 9)+              _libUpdates =+                  {-# LINE 79 "./TypeChecking/SelectLists.ag" #-}+                  _exIlibUpdates+                  {-# LINE 12492 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  SelectStatement ann_ _exIannotatedTree+                  {-# LINE 12497 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  SelectStatement ann_ _exIoriginalTree+                  {-# LINE 12502 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 12507 "AstInternal.hs" #-}+              -- copy rule (down)+              _exOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12512 "AstInternal.hs" #-}+              -- copy rule (down)+              _exOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 12517 "AstInternal.hs" #-}+              ( _exIannotatedTree,_exIlibUpdates,_exIoriginalTree) =+                  (ex_ _exOenv _exOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_Set :: Annotation ->+                     String ->+                     ([SetValue]) ->+                     T_Statement +sem_Statement_Set ann_ name_ values_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12537 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12542 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12547 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Set ann_ name_ values_+                  {-# LINE 12552 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Set ann_ name_ values_+                  {-# LINE 12557 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 12562 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 12567 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_Truncate :: Annotation ->+                          T_StringList  ->+                          T_RestartIdentity  ->+                          T_Cascade  ->+                          T_Statement +sem_Statement_Truncate ann_ tables_ restartIdentity_ cascade_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              _tablesOenv :: Environment+              _tablesOlib :: LocalIdentifierBindings+              _restartIdentityOenv :: Environment+              _restartIdentityOlib :: LocalIdentifierBindings+              _cascadeOenv :: Environment+              _cascadeOlib :: LocalIdentifierBindings+              _tablesIannotatedTree :: StringList+              _tablesIoriginalTree :: StringList+              _tablesIstrings :: ([String])+              _restartIdentityIannotatedTree :: RestartIdentity+              _restartIdentityIoriginalTree :: RestartIdentity+              _cascadeIannotatedTree :: Cascade+              _cascadeIoriginalTree :: Cascade+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12599 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12604 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Truncate ann_ _tablesIannotatedTree _restartIdentityIannotatedTree _cascadeIannotatedTree+                  {-# LINE 12609 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Truncate ann_ _tablesIoriginalTree _restartIdentityIoriginalTree _cascadeIoriginalTree+                  {-# LINE 12614 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 12619 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 12624 "AstInternal.hs" #-}+              -- copy rule (down)+              _tablesOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12629 "AstInternal.hs" #-}+              -- copy rule (down)+              _tablesOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 12634 "AstInternal.hs" #-}+              -- copy rule (down)+              _restartIdentityOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12639 "AstInternal.hs" #-}+              -- copy rule (down)+              _restartIdentityOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 12644 "AstInternal.hs" #-}+              -- copy rule (down)+              _cascadeOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12649 "AstInternal.hs" #-}+              -- copy rule (down)+              _cascadeOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 12654 "AstInternal.hs" #-}+              ( _tablesIannotatedTree,_tablesIoriginalTree,_tablesIstrings) =+                  (tables_ _tablesOenv _tablesOlib )+              ( _restartIdentityIannotatedTree,_restartIdentityIoriginalTree) =+                  (restartIdentity_ _restartIdentityOenv _restartIdentityOlib )+              ( _cascadeIannotatedTree,_cascadeIoriginalTree) =+                  (cascade_ _cascadeOenv _cascadeOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_Update :: Annotation ->+                        String ->+                        T_SetClauseList  ->+                        T_MaybeBoolExpression  ->+                        T_MaybeSelectList  ->+                        T_Statement +sem_Statement_Update ann_ table_ assigns_ whr_ returning_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Statement+              _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tpe :: (Either [TypeError] Type)+              _envUpdates :: ([EnvironmentUpdate])+              _whrOlib :: LocalIdentifierBindings+              _assignsOlib :: LocalIdentifierBindings+              _returningOlib :: LocalIdentifierBindings+              _lhsOoriginalTree :: Statement+              _assignsOenv :: Environment+              _whrOenv :: Environment+              _returningOenv :: Environment+              _assignsIannotatedTree :: SetClauseList+              _assignsIoriginalTree :: SetClauseList+              _assignsIpairs :: ([(String,Type)])+              _assignsIrowSetErrors :: ([TypeError])+              _whrIannotatedTree :: MaybeBoolExpression+              _whrIoriginalTree :: MaybeBoolExpression+              _returningIannotatedTree :: MaybeSelectList+              _returningIlistType :: (Maybe [(String,Type)])+              _returningIoriginalTree :: MaybeSelectList+              -- "./TypeChecking/Statements.ag"(line 61, column 9)+              _lhsOannotatedTree =+                  {-# LINE 61 "./TypeChecking/Statements.ag" #-}+                  annTypesAndErrors _backTree+                    (tpeToT _tpe    )+                    (getErrors _tpe    )+                    $ Just (map StatementTypeA _statementType     +++                            [EnvUpdates _envUpdates    ])+                  {-# LINE 12701 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 67, column 9)+              _lhsOenvUpdates =+                  {-# LINE 67 "./TypeChecking/Statements.ag" #-}+                  _envUpdates+                  {-# LINE 12706 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 68, column 9)+              _lhsOlibUpdates =+                  {-# LINE 68 "./TypeChecking/Statements.ag" #-}+                  _libUpdates+                  {-# LINE 12711 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 73, column 9)+              _libUpdates =+                  {-# LINE 73 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12716 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 58, column 9)+              _tpe =+                  {-# LINE 58 "./TypeChecking/Dml.ag" #-}+                  do+                  checkRelationExists _lhsIenv table_+                  dependsOnRTpe (map snd _assignsIpairs) $ do+                    _columnTypes+                    liftErrors _assignsIrowSetErrors+                    return $ Pseudo Void+                  {-# LINE 12726 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 65, column 9)+              _statementType =+                  {-# LINE 65 "./TypeChecking/Dml.ag" #-}+                  leftToEmpty (\ct -> [StatementType [] (fromMaybe [] _returningIlistType)]) _columnTypes+                  {-# LINE 12731 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 68, column 9)+              _columnTypes =+                  {-# LINE 68 "./TypeChecking/Dml.ag" #-}+                  checkColumnConsistency _lhsIenv+                                         table_+                                         (map fst _assignsIpairs)+                                         _assignsIpairs+                  {-# LINE 12739 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 74, column 9)+              _backTree =+                  {-# LINE 74 "./TypeChecking/Dml.ag" #-}+                  Update ann_+                         table_+                         _assignsIannotatedTree+                         _whrIannotatedTree+                         _returningIannotatedTree+                  {-# LINE 12748 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 79, column 9)+              _envUpdates =+                  {-# LINE 79 "./TypeChecking/Dml.ag" #-}+                  []+                  {-# LINE 12753 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 87, column 9)+              _lib =+                  {-# LINE 87 "./TypeChecking/Dml.ag" #-}+                  fromRight _lhsIlib $ do+                  ct <- envCompositeAttrs _lhsIenv+                                          relationComposites+                                          table_+                  updateBindings _lhsIlib _lhsIenv [LibStackIDs [("", ct)]]+                  {-# LINE 12762 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 93, column 9)+              _whrOlib =+                  {-# LINE 93 "./TypeChecking/Dml.ag" #-}+                  _lib+                  {-# LINE 12767 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 94, column 9)+              _assignsOlib =+                  {-# LINE 94 "./TypeChecking/Dml.ag" #-}+                  _lib+                  {-# LINE 12772 "AstInternal.hs" #-}+              -- "./TypeChecking/Dml.ag"(line 95, column 9)+              _returningOlib =+                  {-# LINE 95 "./TypeChecking/Dml.ag" #-}+                  _lib+                  {-# LINE 12777 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Update ann_ table_ _assignsIannotatedTree _whrIannotatedTree _returningIannotatedTree+                  {-# LINE 12782 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Update ann_ table_ _assignsIoriginalTree _whrIoriginalTree _returningIoriginalTree+                  {-# LINE 12787 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 12792 "AstInternal.hs" #-}+              -- copy rule (down)+              _assignsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12797 "AstInternal.hs" #-}+              -- copy rule (down)+              _whrOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12802 "AstInternal.hs" #-}+              -- copy rule (down)+              _returningOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12807 "AstInternal.hs" #-}+              ( _assignsIannotatedTree,_assignsIoriginalTree,_assignsIpairs,_assignsIrowSetErrors) =+                  (assigns_ _assignsOenv _assignsOlib )+              ( _whrIannotatedTree,_whrIoriginalTree) =+                  (whr_ _whrOenv _whrOlib )+              ( _returningIannotatedTree,_returningIlistType,_returningIoriginalTree) =+                  (returning_ _returningOenv _returningOlib )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_Statement_WhileStatement :: Annotation ->+                                T_Expression  ->+                                T_StatementList  ->+                                T_Statement +sem_Statement_WhileStatement ann_ expr_ sts_  =+    (\ _lhsIenv+       _lhsIinProducedEnv+       _lhsIlib ->+         (let _lhsOenvUpdates :: ([EnvironmentUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _stsOenvUpdates :: ([EnvironmentUpdate])+              _stsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: Statement+              _lhsOoriginalTree :: Statement+              _exprOenv :: Environment+              _exprOlib :: LocalIdentifierBindings+              _stsOenv :: Environment+              _stsOlib :: LocalIdentifierBindings+              _exprIannotatedTree :: Expression+              _exprIliftedColumnName :: String+              _exprIoriginalTree :: Expression+              _stsIannotatedTree :: StatementList+              _stsIoriginalTree :: StatementList+              _stsIproducedEnv :: Environment+              _stsIproducedLib :: LocalIdentifierBindings+              -- "./TypeChecking/Statements.ag"(line 89, column 9)+              _lhsOenvUpdates =+                  {-# LINE 89 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12844 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 90, column 9)+              _lhsOlibUpdates =+                  {-# LINE 90 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12849 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 110, column 9)+              _stsOenvUpdates =+                  {-# LINE 110 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12854 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 111, column 9)+              _stsOlibUpdates =+                  {-# LINE 111 "./TypeChecking/Statements.ag" #-}+                  []+                  {-# LINE 12859 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  WhileStatement ann_ _exprIannotatedTree _stsIannotatedTree+                  {-# LINE 12864 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  WhileStatement ann_ _exprIoriginalTree _stsIoriginalTree+                  {-# LINE 12869 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 12874 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 12879 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12884 "AstInternal.hs" #-}+              -- copy rule (down)+              _exprOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 12889 "AstInternal.hs" #-}+              -- copy rule (down)+              _stsOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 12894 "AstInternal.hs" #-}+              -- copy rule (down)+              _stsOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 12899 "AstInternal.hs" #-}+              ( _exprIannotatedTree,_exprIliftedColumnName,_exprIoriginalTree) =+                  (expr_ _exprOenv _exprOlib )+              ( _stsIannotatedTree,_stsIoriginalTree,_stsIproducedEnv,_stsIproducedLib) =+                  (sts_ _stsOenv _stsOenvUpdates _stsOlib _stsOlibUpdates )+          in  ( _lhsOannotatedTree,_lhsOenvUpdates,_lhsOlibUpdates,_lhsOoriginalTree)))+-- StatementList -----------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         envUpdates           : [EnvironmentUpdate]+         lib                  : LocalIdentifierBindings+         libUpdates           : [LocalIdentifierBindingsUpdate]+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +         producedEnv          : Environment+         producedLib          : LocalIdentifierBindings+   alternatives:+      alternative Cons:+         child hd             : Statement +         child tl             : StatementList +         visit 0:+            local newEnv      : _+            local newLib      : _+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local newEnv      : _+            local newLib      : _+            local annotatedTree : _+            local originalTree : _+-}+type StatementList  = [(Statement)]+-- cata+sem_StatementList :: StatementList  ->+                     T_StatementList +sem_StatementList list  =+    (Prelude.foldr sem_StatementList_Cons sem_StatementList_Nil (Prelude.map sem_Statement list) )+-- semantic domain+type T_StatementList  = Environment ->+                        ([EnvironmentUpdate]) ->+                        LocalIdentifierBindings ->+                        ([LocalIdentifierBindingsUpdate]) ->+                        ( StatementList,StatementList,Environment,LocalIdentifierBindings)+data Inh_StatementList  = Inh_StatementList {env_Inh_StatementList :: Environment,envUpdates_Inh_StatementList :: [EnvironmentUpdate],lib_Inh_StatementList :: LocalIdentifierBindings,libUpdates_Inh_StatementList :: [LocalIdentifierBindingsUpdate]}+data Syn_StatementList  = Syn_StatementList {annotatedTree_Syn_StatementList :: StatementList,originalTree_Syn_StatementList :: StatementList,producedEnv_Syn_StatementList :: Environment,producedLib_Syn_StatementList :: LocalIdentifierBindings}+wrap_StatementList :: T_StatementList  ->+                      Inh_StatementList  ->+                      Syn_StatementList +wrap_StatementList sem (Inh_StatementList _lhsIenv _lhsIenvUpdates _lhsIlib _lhsIlibUpdates )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOproducedEnv,_lhsOproducedLib) =+             (sem _lhsIenv _lhsIenvUpdates _lhsIlib _lhsIlibUpdates )+     in  (Syn_StatementList _lhsOannotatedTree _lhsOoriginalTree _lhsOproducedEnv _lhsOproducedLib ))+sem_StatementList_Cons :: T_Statement  ->+                          T_StatementList  ->+                          T_StatementList +sem_StatementList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIenvUpdates+       _lhsIlib+       _lhsIlibUpdates ->+         (let _hdOenv :: Environment+              _tlOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOlib :: LocalIdentifierBindings+              _lhsOproducedEnv :: Environment+              _lhsOproducedLib :: LocalIdentifierBindings+              _tlOenvUpdates :: ([EnvironmentUpdate])+              _tlOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _hdOinProducedEnv :: Environment+              _lhsOannotatedTree :: StatementList+              _lhsOoriginalTree :: StatementList+              _hdIannotatedTree :: Statement+              _hdIenvUpdates :: ([EnvironmentUpdate])+              _hdIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _hdIoriginalTree :: Statement+              _tlIannotatedTree :: StatementList+              _tlIoriginalTree :: StatementList+              _tlIproducedEnv :: Environment+              _tlIproducedLib :: LocalIdentifierBindings+              -- "./TypeChecking/Statements.ag"(line 36, column 9)+              _newEnv =+                  {-# LINE 36 "./TypeChecking/Statements.ag" #-}+                  fromRight _lhsIenv $ updateEnvironment _lhsIenv _lhsIenvUpdates+                  {-# LINE 12986 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 37, column 9)+              _newLib =+                  {-# LINE 37 "./TypeChecking/Statements.ag" #-}+                  fromRight _lhsIlib $ updateBindings _lhsIlib _lhsIenv _lhsIlibUpdates+                  {-# LINE 12991 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 39, column 9)+              _hdOenv =+                  {-# LINE 39 "./TypeChecking/Statements.ag" #-}+                  _newEnv+                  {-# LINE 12996 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 40, column 9)+              _tlOenv =+                  {-# LINE 40 "./TypeChecking/Statements.ag" #-}+                  _newEnv+                  {-# LINE 13001 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 41, column 9)+              _hdOlib =+                  {-# LINE 41 "./TypeChecking/Statements.ag" #-}+                  _newLib+                  {-# LINE 13006 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 42, column 9)+              _tlOlib =+                  {-# LINE 42 "./TypeChecking/Statements.ag" #-}+                  _newLib+                  {-# LINE 13011 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 46, column 9)+              _lhsOproducedEnv =+                  {-# LINE 46 "./TypeChecking/Statements.ag" #-}+                  _tlIproducedEnv+                  {-# LINE 13016 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 47, column 9)+              _lhsOproducedLib =+                  {-# LINE 47 "./TypeChecking/Statements.ag" #-}+                  _tlIproducedLib+                  {-# LINE 13021 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 50, column 9)+              _tlOenvUpdates =+                  {-# LINE 50 "./TypeChecking/Statements.ag" #-}+                  _hdIenvUpdates+                  {-# LINE 13026 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 51, column 9)+              _tlOlibUpdates =+                  {-# LINE 51 "./TypeChecking/Statements.ag" #-}+                  _hdIlibUpdates+                  {-# LINE 13031 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 76, column 12)+              _hdOinProducedEnv =+                  {-# LINE 76 "./TypeChecking/Statements.ag" #-}+                  _tlIproducedEnv+                  {-# LINE 13036 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 13041 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 13046 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 13051 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 13056 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIenvUpdates,_hdIlibUpdates,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOinProducedEnv _hdOlib )+              ( _tlIannotatedTree,_tlIoriginalTree,_tlIproducedEnv,_tlIproducedLib) =+                  (tl_ _tlOenv _tlOenvUpdates _tlOlib _tlOlibUpdates )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOproducedEnv,_lhsOproducedLib)))+sem_StatementList_Nil :: T_StatementList +sem_StatementList_Nil  =+    (\ _lhsIenv+       _lhsIenvUpdates+       _lhsIlib+       _lhsIlibUpdates ->+         (let _lhsOproducedEnv :: Environment+              _lhsOproducedLib :: LocalIdentifierBindings+              _lhsOannotatedTree :: StatementList+              _lhsOoriginalTree :: StatementList+              -- "./TypeChecking/Statements.ag"(line 36, column 9)+              _newEnv =+                  {-# LINE 36 "./TypeChecking/Statements.ag" #-}+                  fromRight _lhsIenv $ updateEnvironment _lhsIenv _lhsIenvUpdates+                  {-# LINE 13076 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 37, column 9)+              _newLib =+                  {-# LINE 37 "./TypeChecking/Statements.ag" #-}+                  fromRight _lhsIlib $ updateBindings _lhsIlib _lhsIenv _lhsIlibUpdates+                  {-# LINE 13081 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 53, column 9)+              _lhsOproducedEnv =+                  {-# LINE 53 "./TypeChecking/Statements.ag" #-}+                  _newEnv+                  {-# LINE 13086 "AstInternal.hs" #-}+              -- "./TypeChecking/Statements.ag"(line 54, column 9)+              _lhsOproducedLib =+                  {-# LINE 54 "./TypeChecking/Statements.ag" #-}+                  _newLib+                  {-# LINE 13091 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 13096 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 13101 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 13106 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 13111 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOproducedEnv,_lhsOproducedLib)))+-- StringList --------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +         strings              : [String]+   alternatives:+      alternative Cons:+         child hd             : {String}+         child tl             : StringList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type StringList  = [(String)]+-- cata+sem_StringList :: StringList  ->+                  T_StringList +sem_StringList list  =+    (Prelude.foldr sem_StringList_Cons sem_StringList_Nil list )+-- semantic domain+type T_StringList  = Environment ->+                     LocalIdentifierBindings ->+                     ( StringList,StringList,([String]))+data Inh_StringList  = Inh_StringList {env_Inh_StringList :: Environment,lib_Inh_StringList :: LocalIdentifierBindings}+data Syn_StringList  = Syn_StringList {annotatedTree_Syn_StringList :: StringList,originalTree_Syn_StringList :: StringList,strings_Syn_StringList :: [String]}+wrap_StringList :: T_StringList  ->+                   Inh_StringList  ->+                   Syn_StringList +wrap_StringList sem (Inh_StringList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOstrings) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_StringList _lhsOannotatedTree _lhsOoriginalTree _lhsOstrings ))+sem_StringList_Cons :: String ->+                       T_StringList  ->+                       T_StringList +sem_StringList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOstrings :: ([String])+              _lhsOannotatedTree :: StringList+              _lhsOoriginalTree :: StringList+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _tlIannotatedTree :: StringList+              _tlIoriginalTree :: StringList+              _tlIstrings :: ([String])+              -- "./TypeChecking/Misc.ag"(line 67, column 10)+              _lhsOstrings =+                  {-# LINE 67 "./TypeChecking/Misc.ag" #-}+                  hd_ : _tlIstrings+                  {-# LINE 13172 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) hd_ _tlIannotatedTree+                  {-# LINE 13177 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) hd_ _tlIoriginalTree+                  {-# LINE 13182 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 13187 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 13192 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 13197 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 13202 "AstInternal.hs" #-}+              ( _tlIannotatedTree,_tlIoriginalTree,_tlIstrings) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOstrings)))+sem_StringList_Nil :: T_StringList +sem_StringList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOstrings :: ([String])+              _lhsOannotatedTree :: StringList+              _lhsOoriginalTree :: StringList+              -- "./TypeChecking/Misc.ag"(line 68, column 9)+              _lhsOstrings =+                  {-# LINE 68 "./TypeChecking/Misc.ag" #-}+                  []+                  {-# LINE 13217 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 13222 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 13227 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 13232 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 13237 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree,_lhsOstrings)))+-- StringTypeNameListPair --------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         fnSig                : (String,[Type])+         originalTree         : SELF +   alternatives:+      alternative Tuple:+         child x1             : {String}+         child x2             : TypeNameList +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type StringTypeNameListPair  = ( (String),(TypeNameList))+-- cata+sem_StringTypeNameListPair :: StringTypeNameListPair  ->+                              T_StringTypeNameListPair +sem_StringTypeNameListPair ( x1,x2)  =+    (sem_StringTypeNameListPair_Tuple x1 (sem_TypeNameList x2 ) )+-- semantic domain+type T_StringTypeNameListPair  = Environment ->+                                 LocalIdentifierBindings ->+                                 ( StringTypeNameListPair,((String,[Type])),StringTypeNameListPair)+data Inh_StringTypeNameListPair  = Inh_StringTypeNameListPair {env_Inh_StringTypeNameListPair :: Environment,lib_Inh_StringTypeNameListPair :: LocalIdentifierBindings}+data Syn_StringTypeNameListPair  = Syn_StringTypeNameListPair {annotatedTree_Syn_StringTypeNameListPair :: StringTypeNameListPair,fnSig_Syn_StringTypeNameListPair :: (String,[Type]),originalTree_Syn_StringTypeNameListPair :: StringTypeNameListPair}+wrap_StringTypeNameListPair :: T_StringTypeNameListPair  ->+                               Inh_StringTypeNameListPair  ->+                               Syn_StringTypeNameListPair +wrap_StringTypeNameListPair sem (Inh_StringTypeNameListPair _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOfnSig,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_StringTypeNameListPair _lhsOannotatedTree _lhsOfnSig _lhsOoriginalTree ))+sem_StringTypeNameListPair_Tuple :: String ->+                                    T_TypeNameList  ->+                                    T_StringTypeNameListPair +sem_StringTypeNameListPair_Tuple x1_ x2_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOfnSig :: ((String,[Type]))+              _lhsOannotatedTree :: StringTypeNameListPair+              _lhsOoriginalTree :: StringTypeNameListPair+              _x2Oenv :: Environment+              _x2Olib :: LocalIdentifierBindings+              _x2IannotatedTree :: TypeNameList+              _x2InamedTypes :: ([Type])+              _x2IoriginalTree :: TypeNameList+              -- "./TypeChecking/Drops.ag"(line 25, column 13)+              _lhsOfnSig =+                  {-# LINE 25 "./TypeChecking/Drops.ag" #-}+                  (x1_, _x2InamedTypes)+                  {-# LINE 13294 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (x1_,_x2IannotatedTree)+                  {-# LINE 13299 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (x1_,_x2IoriginalTree)+                  {-# LINE 13304 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 13309 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 13314 "AstInternal.hs" #-}+              -- copy rule (down)+              _x2Oenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 13319 "AstInternal.hs" #-}+              -- copy rule (down)+              _x2Olib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 13324 "AstInternal.hs" #-}+              ( _x2IannotatedTree,_x2InamedTypes,_x2IoriginalTree) =+                  (x2_ _x2Oenv _x2Olib )+          in  ( _lhsOannotatedTree,_lhsOfnSig,_lhsOoriginalTree)))+-- StringTypeNameListPairList ----------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         fnSigs               : [(String,[Type])]+         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : StringTypeNameListPair +         child tl             : StringTypeNameListPairList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type StringTypeNameListPairList  = [(StringTypeNameListPair)]+-- cata+sem_StringTypeNameListPairList :: StringTypeNameListPairList  ->+                                  T_StringTypeNameListPairList +sem_StringTypeNameListPairList list  =+    (Prelude.foldr sem_StringTypeNameListPairList_Cons sem_StringTypeNameListPairList_Nil (Prelude.map sem_StringTypeNameListPair list) )+-- semantic domain+type T_StringTypeNameListPairList  = Environment ->+                                     LocalIdentifierBindings ->+                                     ( StringTypeNameListPairList,([(String,[Type])]),StringTypeNameListPairList)+data Inh_StringTypeNameListPairList  = Inh_StringTypeNameListPairList {env_Inh_StringTypeNameListPairList :: Environment,lib_Inh_StringTypeNameListPairList :: LocalIdentifierBindings}+data Syn_StringTypeNameListPairList  = Syn_StringTypeNameListPairList {annotatedTree_Syn_StringTypeNameListPairList :: StringTypeNameListPairList,fnSigs_Syn_StringTypeNameListPairList :: [(String,[Type])],originalTree_Syn_StringTypeNameListPairList :: StringTypeNameListPairList}+wrap_StringTypeNameListPairList :: T_StringTypeNameListPairList  ->+                                   Inh_StringTypeNameListPairList  ->+                                   Syn_StringTypeNameListPairList +wrap_StringTypeNameListPairList sem (Inh_StringTypeNameListPairList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOfnSigs,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_StringTypeNameListPairList _lhsOannotatedTree _lhsOfnSigs _lhsOoriginalTree ))+sem_StringTypeNameListPairList_Cons :: T_StringTypeNameListPair  ->+                                       T_StringTypeNameListPairList  ->+                                       T_StringTypeNameListPairList +sem_StringTypeNameListPairList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOfnSigs :: ([(String,[Type])])+              _lhsOannotatedTree :: StringTypeNameListPairList+              _lhsOoriginalTree :: StringTypeNameListPairList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: StringTypeNameListPair+              _hdIfnSig :: ((String,[Type]))+              _hdIoriginalTree :: StringTypeNameListPair+              _tlIannotatedTree :: StringTypeNameListPairList+              _tlIfnSigs :: ([(String,[Type])])+              _tlIoriginalTree :: StringTypeNameListPairList+              -- "./TypeChecking/Drops.ag"(line 20, column 12)+              _lhsOfnSigs =+                  {-# LINE 20 "./TypeChecking/Drops.ag" #-}+                  _hdIfnSig : _tlIfnSigs+                  {-# LINE 13392 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 13397 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 13402 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 13407 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 13412 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 13417 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 13422 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 13427 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 13432 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIfnSig,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIfnSigs,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOfnSigs,_lhsOoriginalTree)))+sem_StringTypeNameListPairList_Nil :: T_StringTypeNameListPairList +sem_StringTypeNameListPairList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOfnSigs :: ([(String,[Type])])+              _lhsOannotatedTree :: StringTypeNameListPairList+              _lhsOoriginalTree :: StringTypeNameListPairList+              -- "./TypeChecking/Drops.ag"(line 21, column 11)+              _lhsOfnSigs =+                  {-# LINE 21 "./TypeChecking/Drops.ag" #-}+                  []+                  {-# LINE 13449 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 13454 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 13459 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 13464 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 13469 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOfnSigs,_lhsOoriginalTree)))+-- TableAlias --------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative FullAlias:+         child alias          : {String}+         child cols           : {[String]}+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative NoAlias:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative TableAlias:+         child alias          : {String}+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data TableAlias  = FullAlias (String) ([String]) +                 | NoAlias +                 | TableAlias (String) +                 deriving ( Data,Eq,Show,Typeable)+-- cata+sem_TableAlias :: TableAlias  ->+                  T_TableAlias +sem_TableAlias (FullAlias _alias _cols )  =+    (sem_TableAlias_FullAlias _alias _cols )+sem_TableAlias (NoAlias )  =+    (sem_TableAlias_NoAlias )+sem_TableAlias (TableAlias _alias )  =+    (sem_TableAlias_TableAlias _alias )+-- semantic domain+type T_TableAlias  = Environment ->+                     LocalIdentifierBindings ->+                     ( TableAlias,TableAlias)+data Inh_TableAlias  = Inh_TableAlias {env_Inh_TableAlias :: Environment,lib_Inh_TableAlias :: LocalIdentifierBindings}+data Syn_TableAlias  = Syn_TableAlias {annotatedTree_Syn_TableAlias :: TableAlias,originalTree_Syn_TableAlias :: TableAlias}+wrap_TableAlias :: T_TableAlias  ->+                   Inh_TableAlias  ->+                   Syn_TableAlias +wrap_TableAlias sem (Inh_TableAlias _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_TableAlias _lhsOannotatedTree _lhsOoriginalTree ))+sem_TableAlias_FullAlias :: String ->+                            ([String]) ->+                            T_TableAlias +sem_TableAlias_FullAlias alias_ cols_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: TableAlias+              _lhsOoriginalTree :: TableAlias+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  FullAlias alias_ cols_+                  {-# LINE 13535 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  FullAlias alias_ cols_+                  {-# LINE 13540 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 13545 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 13550 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_TableAlias_NoAlias :: T_TableAlias +sem_TableAlias_NoAlias  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: TableAlias+              _lhsOoriginalTree :: TableAlias+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  NoAlias+                  {-# LINE 13562 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  NoAlias+                  {-# LINE 13567 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 13572 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 13577 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_TableAlias_TableAlias :: String ->+                             T_TableAlias +sem_TableAlias_TableAlias alias_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: TableAlias+              _lhsOoriginalTree :: TableAlias+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  TableAlias alias_+                  {-# LINE 13590 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  TableAlias alias_+                  {-# LINE 13595 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 13600 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 13605 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- TableRef ----------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         jlibUpdates          : [LocalIdentifierBindingsUpdate]+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         idLookups            : [(String,Type)]+         libUpdates           : [LocalIdentifierBindingsUpdate]+         originalTree         : SELF +         qidLookups           : [(String,[(String,Type)])]+         qstarExpansion       : [(String,[(String,Type)])]+         starExpansion        : [(String,Type)]+   alternatives:+      alternative JoinedTref:+         child ann            : {Annotation}+         child tbl            : TableRef +         child nat            : Natural +         child joinType       : JoinType +         child tbl1           : TableRef +         child onExpr         : OnExpr +         child alias          : TableAlias +         visit 0:+            local libUpdates  : _+            local errs        : _+            local removeJoinAttrs : _+            local ejoinAttrs  : {Either [TypeError] [(String,Type)]}+            local joinNames   : _+            local joinAttrs   : _+            local idLookups   : {[(String,Type)]}+            local qidLookups  : {[(String,[(String,Type)])]}+            local starExpansion : {[(String,Type)]}+            local qstarExpansion : {[(String,[(String,Type)])]}+            local newLib      : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative SubTref:+         child ann            : {Annotation}+         child sel            : SelectExpression +         child alias          : TableAlias +         visit 0:+            local libUpdates  : _+            local errs        : _+            local selectAttrs : {Either [TypeError] [(String,Type)]}+            local idLookups   : {[(String,Type)]}+            local qidLookups  : {[(String,[(String,Type)])]}+            local starExpansion : {[(String,Type)]}+            local qstarExpansion : {[(String,[(String,Type)])]}+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative Tref:+         child ann            : {Annotation}+         child tbl            : {String}+         child alias          : TableAlias +         visit 0:+            local libUpdates  : _+            local errs        : _+            local relType     : {Either [TypeError] ([(String, Type)], [(String, Type)])}+            local relType1    : _+            local pAttrs      : _+            local sAttrs      : _+            local idLookups   : {[(String,Type)]}+            local alias       : _+            local qidLookups  : {[(String,[(String,Type)])]}+            local starExpansion : {[(String,Type)]}+            local qstarExpansion : {[(String,[(String,Type)])]}+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative TrefFun:+         child ann            : {Annotation}+         child fn             : Expression +         child alias          : TableAlias +         visit 0:+            local libUpdates  : _+            local errs        : _+            local eqfunIdens  : {Either [TypeError] (String,[(String,Type)])}+            local qfunIdens   : _+            local alias2      : _+            local funIdens    : _+            local alias       : _+            local idLookups   : {[(String,Type)]}+            local qidLookups  : {[(String,[(String,Type)])]}+            local starExpansion : {[(String,Type)]}+            local qstarExpansion : {[(String,[(String,Type)])]}+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+-}+data TableRef  = JoinedTref (Annotation) (TableRef) (Natural) (JoinType) (TableRef) (OnExpr) (TableAlias) +               | SubTref (Annotation) (SelectExpression) (TableAlias) +               | Tref (Annotation) (String) (TableAlias) +               | TrefFun (Annotation) (Expression) (TableAlias) +               deriving ( Data,Eq,Show,Typeable)+-- cata+sem_TableRef :: TableRef  ->+                T_TableRef +sem_TableRef (JoinedTref _ann _tbl _nat _joinType _tbl1 _onExpr _alias )  =+    (sem_TableRef_JoinedTref _ann (sem_TableRef _tbl ) (sem_Natural _nat ) (sem_JoinType _joinType ) (sem_TableRef _tbl1 ) (sem_OnExpr _onExpr ) (sem_TableAlias _alias ) )+sem_TableRef (SubTref _ann _sel _alias )  =+    (sem_TableRef_SubTref _ann (sem_SelectExpression _sel ) (sem_TableAlias _alias ) )+sem_TableRef (Tref _ann _tbl _alias )  =+    (sem_TableRef_Tref _ann _tbl (sem_TableAlias _alias ) )+sem_TableRef (TrefFun _ann _fn _alias )  =+    (sem_TableRef_TrefFun _ann (sem_Expression _fn ) (sem_TableAlias _alias ) )+-- semantic domain+type T_TableRef  = Environment ->+                   ([LocalIdentifierBindingsUpdate]) ->+                   LocalIdentifierBindings ->+                   ( TableRef,([(String,Type)]),([LocalIdentifierBindingsUpdate]),TableRef,([(String,[(String,Type)])]),([(String,[(String,Type)])]),([(String,Type)]))+data Inh_TableRef  = Inh_TableRef {env_Inh_TableRef :: Environment,jlibUpdates_Inh_TableRef :: [LocalIdentifierBindingsUpdate],lib_Inh_TableRef :: LocalIdentifierBindings}+data Syn_TableRef  = Syn_TableRef {annotatedTree_Syn_TableRef :: TableRef,idLookups_Syn_TableRef :: [(String,Type)],libUpdates_Syn_TableRef :: [LocalIdentifierBindingsUpdate],originalTree_Syn_TableRef :: TableRef,qidLookups_Syn_TableRef :: [(String,[(String,Type)])],qstarExpansion_Syn_TableRef :: [(String,[(String,Type)])],starExpansion_Syn_TableRef :: [(String,Type)]}+wrap_TableRef :: T_TableRef  ->+                 Inh_TableRef  ->+                 Syn_TableRef +wrap_TableRef sem (Inh_TableRef _lhsIenv _lhsIjlibUpdates _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOidLookups,_lhsOlibUpdates,_lhsOoriginalTree,_lhsOqidLookups,_lhsOqstarExpansion,_lhsOstarExpansion) =+             (sem _lhsIenv _lhsIjlibUpdates _lhsIlib )+     in  (Syn_TableRef _lhsOannotatedTree _lhsOidLookups _lhsOlibUpdates _lhsOoriginalTree _lhsOqidLookups _lhsOqstarExpansion _lhsOstarExpansion ))+sem_TableRef_JoinedTref :: Annotation ->+                           T_TableRef  ->+                           T_Natural  ->+                           T_JoinType  ->+                           T_TableRef  ->+                           T_OnExpr  ->+                           T_TableAlias  ->+                           T_TableRef +sem_TableRef_JoinedTref ann_ tbl_ nat_ joinType_ tbl1_ onExpr_ alias_  =+    (\ _lhsIenv+       _lhsIjlibUpdates+       _lhsIlib ->+         (let _lhsOannotatedTree :: TableRef+              _ejoinAttrs :: (Either [TypeError] [(String,Type)])+              _idLookups :: ([(String,Type)])+              _qidLookups :: ([(String,[(String,Type)])])+              _starExpansion :: ([(String,Type)])+              _qstarExpansion :: ([(String,[(String,Type)])])+              _onExprOlib :: LocalIdentifierBindings+              _tblOjlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tbl1OjlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOidLookups :: ([(String,Type)])+              _lhsOqidLookups :: ([(String,[(String,Type)])])+              _lhsOstarExpansion :: ([(String,Type)])+              _lhsOqstarExpansion :: ([(String,[(String,Type)])])+              _lhsOoriginalTree :: TableRef+              _tblOenv :: Environment+              _tblOlib :: LocalIdentifierBindings+              _natOenv :: Environment+              _natOlib :: LocalIdentifierBindings+              _joinTypeOenv :: Environment+              _joinTypeOlib :: LocalIdentifierBindings+              _tbl1Oenv :: Environment+              _tbl1Olib :: LocalIdentifierBindings+              _onExprOenv :: Environment+              _aliasOenv :: Environment+              _aliasOlib :: LocalIdentifierBindings+              _tblIannotatedTree :: TableRef+              _tblIidLookups :: ([(String,Type)])+              _tblIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tblIoriginalTree :: TableRef+              _tblIqidLookups :: ([(String,[(String,Type)])])+              _tblIqstarExpansion :: ([(String,[(String,Type)])])+              _tblIstarExpansion :: ([(String,Type)])+              _natIannotatedTree :: Natural+              _natIoriginalTree :: Natural+              _joinTypeIannotatedTree :: JoinType+              _joinTypeIoriginalTree :: JoinType+              _tbl1IannotatedTree :: TableRef+              _tbl1IidLookups :: ([(String,Type)])+              _tbl1IlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tbl1IoriginalTree :: TableRef+              _tbl1IqidLookups :: ([(String,[(String,Type)])])+              _tbl1IqstarExpansion :: ([(String,[(String,Type)])])+              _tbl1IstarExpansion :: ([(String,Type)])+              _onExprIannotatedTree :: OnExpr+              _onExprIoriginalTree :: OnExpr+              _aliasIannotatedTree :: TableAlias+              _aliasIoriginalTree :: TableAlias+              -- "./TypeChecking/TableRefs.ag"(line 33, column 9)+              _lhsOannotatedTree =+                  {-# LINE 33 "./TypeChecking/TableRefs.ag" #-}+                  updateAnnotation (map TypeErrorA _errs     ++) _backTree+                  {-# LINE 13794 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 75, column 9)+              _libUpdates =+                  {-# LINE 75 "./TypeChecking/TableRefs.ag" #-}+                  if null _errs+                    then [LibStackIDs $ ("", _idLookups    ): _qidLookups+                         ,LibSetStarExpansion $ ("", _starExpansion    ): _qstarExpansion    ]+                    else []+                  {-# LINE 13802 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 135, column 9)+              _errs =+                  {-# LINE 135 "./TypeChecking/TableRefs.ag" #-}+                  fromLeft [] _ejoinAttrs+                  {-# LINE 13807 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 136, column 9)+              _removeJoinAttrs =+                  {-# LINE 136 "./TypeChecking/TableRefs.ag" #-}+                  filter (\(n,_) -> n `notElem` _joinNames    )+                  {-# LINE 13812 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 146, column 9)+              _ejoinAttrs =+                  {-# LINE 146 "./TypeChecking/TableRefs.ag" #-}+                  do+                  let jns = case (_natIannotatedTree, _onExprIoriginalTree) of+                                (Natural, _) -> commonFieldNames+                                (_,Just (JoinUsing _ s)) -> s+                                _ -> []+                      tjtsm = map (flip lookup _tblIidLookups) jns+                      t1jtsm = map (flip lookup _tbl1IidLookups) jns+                  errorWhen (not $ null $ filter (==Nothing) $ tjtsm ++ t1jtsm)+                            [MissingJoinAttribute]+                  let tjts = catMaybes tjtsm+                      t1jts = catMaybes t1jtsm+                      resolvedTypes :: [Either [TypeError] Type]+                      resolvedTypes = map (\(a,b) -> resolveResultSetType _lhsIenv [a,b]) $ zip tjts t1jts+                  liftErrors $ concat $ lefts resolvedTypes+                  return $ zip jns $ rights resolvedTypes+                  where+                    commonFieldNames = intersect (f _tblIstarExpansion) (f _tbl1IstarExpansion)+                                       where f = map fst+                  {-# LINE 13834 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 170, column 9)+              _joinNames =+                  {-# LINE 170 "./TypeChecking/TableRefs.ag" #-}+                  map fst _joinAttrs+                  {-# LINE 13839 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 171, column 9)+              _joinAttrs =+                  {-# LINE 171 "./TypeChecking/TableRefs.ag" #-}+                  fromRight [] _ejoinAttrs+                  {-# LINE 13844 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 176, column 9)+              _idLookups =+                  {-# LINE 176 "./TypeChecking/TableRefs.ag" #-}+                  _joinAttrs     +++                    _removeJoinAttrs     _tblIidLookups +++                    _removeJoinAttrs     _tbl1IidLookups+                  {-# LINE 13851 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 179, column 9)+              _qidLookups =+                  {-# LINE 179 "./TypeChecking/TableRefs.ag" #-}+                  _tblIqidLookups ++ _tbl1IqidLookups+                  {-# LINE 13856 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 180, column 9)+              _starExpansion =+                  {-# LINE 180 "./TypeChecking/TableRefs.ag" #-}+                  _joinAttrs     +++                    _removeJoinAttrs     _tblIstarExpansion +++                    _removeJoinAttrs     _tbl1IstarExpansion+                  {-# LINE 13863 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 183, column 9)+              _qstarExpansion =+                  {-# LINE 183 "./TypeChecking/TableRefs.ag" #-}+                  _tblIqstarExpansion ++ _tbl1IqstarExpansion+                  {-# LINE 13868 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 187, column 9)+              _newLib =+                  {-# LINE 187 "./TypeChecking/TableRefs.ag" #-}+                  case updateBindings _lhsIlib _lhsIenv (_libUpdates     ++ _lhsIjlibUpdates) of+                    Left x -> error $ show x+                    Right e ->                                      e+                  {-# LINE 13875 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 190, column 9)+              _onExprOlib =+                  {-# LINE 190 "./TypeChecking/TableRefs.ag" #-}+                  _newLib+                  {-# LINE 13880 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 192, column 9)+              _tblOjlibUpdates =+                  {-# LINE 192 "./TypeChecking/TableRefs.ag" #-}+                  _libUpdates+                  {-# LINE 13885 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 193, column 9)+              _tbl1OjlibUpdates =+                  {-# LINE 193 "./TypeChecking/TableRefs.ag" #-}+                  _libUpdates+                  {-# LINE 13890 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 248, column 9)+              _lhsOlibUpdates =+                  {-# LINE 248 "./TypeChecking/TableRefs.ag" #-}+                  _libUpdates+                  {-# LINE 13895 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 249, column 9)+              _lhsOidLookups =+                  {-# LINE 249 "./TypeChecking/TableRefs.ag" #-}+                  _idLookups+                  {-# LINE 13900 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 250, column 9)+              _lhsOqidLookups =+                  {-# LINE 250 "./TypeChecking/TableRefs.ag" #-}+                  _qidLookups+                  {-# LINE 13905 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 251, column 9)+              _lhsOstarExpansion =+                  {-# LINE 251 "./TypeChecking/TableRefs.ag" #-}+                  _starExpansion+                  {-# LINE 13910 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 252, column 9)+              _lhsOqstarExpansion =+                  {-# LINE 252 "./TypeChecking/TableRefs.ag" #-}+                  _qstarExpansion+                  {-# LINE 13915 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 264, column 9)+              _backTree =+                  {-# LINE 264 "./TypeChecking/TableRefs.ag" #-}+                  JoinedTref ann_+                             _tblIannotatedTree+                             _natIannotatedTree+                             _joinTypeIannotatedTree+                             _tbl1IannotatedTree+                             _onExprIannotatedTree+                             _aliasIannotatedTree+                  {-# LINE 13926 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  JoinedTref ann_ _tblIannotatedTree _natIannotatedTree _joinTypeIannotatedTree _tbl1IannotatedTree _onExprIannotatedTree _aliasIannotatedTree+                  {-# LINE 13931 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  JoinedTref ann_ _tblIoriginalTree _natIoriginalTree _joinTypeIoriginalTree _tbl1IoriginalTree _onExprIoriginalTree _aliasIoriginalTree+                  {-# LINE 13936 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 13941 "AstInternal.hs" #-}+              -- copy rule (down)+              _tblOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 13946 "AstInternal.hs" #-}+              -- copy rule (down)+              _tblOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 13951 "AstInternal.hs" #-}+              -- copy rule (down)+              _natOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 13956 "AstInternal.hs" #-}+              -- copy rule (down)+              _natOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 13961 "AstInternal.hs" #-}+              -- copy rule (down)+              _joinTypeOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 13966 "AstInternal.hs" #-}+              -- copy rule (down)+              _joinTypeOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 13971 "AstInternal.hs" #-}+              -- copy rule (down)+              _tbl1Oenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 13976 "AstInternal.hs" #-}+              -- copy rule (down)+              _tbl1Olib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 13981 "AstInternal.hs" #-}+              -- copy rule (down)+              _onExprOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 13986 "AstInternal.hs" #-}+              -- copy rule (down)+              _aliasOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 13991 "AstInternal.hs" #-}+              -- copy rule (down)+              _aliasOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 13996 "AstInternal.hs" #-}+              ( _tblIannotatedTree,_tblIidLookups,_tblIlibUpdates,_tblIoriginalTree,_tblIqidLookups,_tblIqstarExpansion,_tblIstarExpansion) =+                  (tbl_ _tblOenv _tblOjlibUpdates _tblOlib )+              ( _natIannotatedTree,_natIoriginalTree) =+                  (nat_ _natOenv _natOlib )+              ( _joinTypeIannotatedTree,_joinTypeIoriginalTree) =+                  (joinType_ _joinTypeOenv _joinTypeOlib )+              ( _tbl1IannotatedTree,_tbl1IidLookups,_tbl1IlibUpdates,_tbl1IoriginalTree,_tbl1IqidLookups,_tbl1IqstarExpansion,_tbl1IstarExpansion) =+                  (tbl1_ _tbl1Oenv _tbl1OjlibUpdates _tbl1Olib )+              ( _onExprIannotatedTree,_onExprIoriginalTree) =+                  (onExpr_ _onExprOenv _onExprOlib )+              ( _aliasIannotatedTree,_aliasIoriginalTree) =+                  (alias_ _aliasOenv _aliasOlib )+          in  ( _lhsOannotatedTree,_lhsOidLookups,_lhsOlibUpdates,_lhsOoriginalTree,_lhsOqidLookups,_lhsOqstarExpansion,_lhsOstarExpansion)))+sem_TableRef_SubTref :: Annotation ->+                        T_SelectExpression  ->+                        T_TableAlias  ->+                        T_TableRef +sem_TableRef_SubTref ann_ sel_ alias_  =+    (\ _lhsIenv+       _lhsIjlibUpdates+       _lhsIlib ->+         (let _lhsOannotatedTree :: TableRef+              _selectAttrs :: (Either [TypeError] [(String,Type)])+              _idLookups :: ([(String,Type)])+              _qidLookups :: ([(String,[(String,Type)])])+              _starExpansion :: ([(String,Type)])+              _qstarExpansion :: ([(String,[(String,Type)])])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOidLookups :: ([(String,Type)])+              _lhsOqidLookups :: ([(String,[(String,Type)])])+              _lhsOstarExpansion :: ([(String,Type)])+              _lhsOqstarExpansion :: ([(String,[(String,Type)])])+              _lhsOoriginalTree :: TableRef+              _selOenv :: Environment+              _selOlib :: LocalIdentifierBindings+              _aliasOenv :: Environment+              _aliasOlib :: LocalIdentifierBindings+              _selIannotatedTree :: SelectExpression+              _selIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _selIoriginalTree :: SelectExpression+              _aliasIannotatedTree :: TableAlias+              _aliasIoriginalTree :: TableAlias+              -- "./TypeChecking/TableRefs.ag"(line 33, column 9)+              _lhsOannotatedTree =+                  {-# LINE 33 "./TypeChecking/TableRefs.ag" #-}+                  updateAnnotation (map TypeErrorA _errs     ++) _backTree+                  {-# LINE 14043 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 75, column 9)+              _libUpdates =+                  {-# LINE 75 "./TypeChecking/TableRefs.ag" #-}+                  if null _errs+                    then [LibStackIDs $ ("", _idLookups    ): _qidLookups+                         ,LibSetStarExpansion $ ("", _starExpansion    ): _qstarExpansion    ]+                    else []+                  {-# LINE 14051 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 92, column 9)+              _errs =+                  {-# LINE 92 "./TypeChecking/TableRefs.ag" #-}+                  case _selectAttrs     of+                          Left e -> e+                          Right _ -> []+                  {-# LINE 14058 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 96, column 9)+              _selectAttrs =+                  {-# LINE 96 "./TypeChecking/TableRefs.ag" #-}+                  unwrapSetOfComposite (getTypeAnnotation _selIannotatedTree)+                  {-# LINE 14063 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 98, column 9)+              _idLookups =+                  {-# LINE 98 "./TypeChecking/TableRefs.ag" #-}+                  fromRight [] _selectAttrs+                  {-# LINE 14068 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 99, column 9)+              _qidLookups =+                  {-# LINE 99 "./TypeChecking/TableRefs.ag" #-}+                  [(getAlias "" _aliasIannotatedTree, _idLookups    )]+                  {-# LINE 14073 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 100, column 9)+              _starExpansion =+                  {-# LINE 100 "./TypeChecking/TableRefs.ag" #-}+                  _idLookups+                  {-# LINE 14078 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 101, column 9)+              _qstarExpansion =+                  {-# LINE 101 "./TypeChecking/TableRefs.ag" #-}+                  _qidLookups+                  {-# LINE 14083 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 248, column 9)+              _lhsOlibUpdates =+                  {-# LINE 248 "./TypeChecking/TableRefs.ag" #-}+                  _libUpdates+                  {-# LINE 14088 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 249, column 9)+              _lhsOidLookups =+                  {-# LINE 249 "./TypeChecking/TableRefs.ag" #-}+                  _idLookups+                  {-# LINE 14093 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 250, column 9)+              _lhsOqidLookups =+                  {-# LINE 250 "./TypeChecking/TableRefs.ag" #-}+                  _qidLookups+                  {-# LINE 14098 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 251, column 9)+              _lhsOstarExpansion =+                  {-# LINE 251 "./TypeChecking/TableRefs.ag" #-}+                  _starExpansion+                  {-# LINE 14103 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 252, column 9)+              _lhsOqstarExpansion =+                  {-# LINE 252 "./TypeChecking/TableRefs.ag" #-}+                  _qstarExpansion+                  {-# LINE 14108 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 258, column 9)+              _backTree =+                  {-# LINE 258 "./TypeChecking/TableRefs.ag" #-}+                  SubTref ann_ _selIannotatedTree _aliasIannotatedTree+                  {-# LINE 14113 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  SubTref ann_ _selIannotatedTree _aliasIannotatedTree+                  {-# LINE 14118 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  SubTref ann_ _selIoriginalTree _aliasIoriginalTree+                  {-# LINE 14123 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 14128 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 14133 "AstInternal.hs" #-}+              -- copy rule (down)+              _selOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 14138 "AstInternal.hs" #-}+              -- copy rule (down)+              _aliasOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 14143 "AstInternal.hs" #-}+              -- copy rule (down)+              _aliasOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 14148 "AstInternal.hs" #-}+              ( _selIannotatedTree,_selIlibUpdates,_selIoriginalTree) =+                  (sel_ _selOenv _selOlib )+              ( _aliasIannotatedTree,_aliasIoriginalTree) =+                  (alias_ _aliasOenv _aliasOlib )+          in  ( _lhsOannotatedTree,_lhsOidLookups,_lhsOlibUpdates,_lhsOoriginalTree,_lhsOqidLookups,_lhsOqstarExpansion,_lhsOstarExpansion)))+sem_TableRef_Tref :: Annotation ->+                     String ->+                     T_TableAlias  ->+                     T_TableRef +sem_TableRef_Tref ann_ tbl_ alias_  =+    (\ _lhsIenv+       _lhsIjlibUpdates+       _lhsIlib ->+         (let _lhsOannotatedTree :: TableRef+              _relType :: (Either [TypeError] ([(String, Type)], [(String, Type)]))+              _idLookups :: ([(String,Type)])+              _qidLookups :: ([(String,[(String,Type)])])+              _starExpansion :: ([(String,Type)])+              _qstarExpansion :: ([(String,[(String,Type)])])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOidLookups :: ([(String,Type)])+              _lhsOqidLookups :: ([(String,[(String,Type)])])+              _lhsOstarExpansion :: ([(String,Type)])+              _lhsOqstarExpansion :: ([(String,[(String,Type)])])+              _lhsOoriginalTree :: TableRef+              _aliasOenv :: Environment+              _aliasOlib :: LocalIdentifierBindings+              _aliasIannotatedTree :: TableAlias+              _aliasIoriginalTree :: TableAlias+              -- "./TypeChecking/TableRefs.ag"(line 33, column 9)+              _lhsOannotatedTree =+                  {-# LINE 33 "./TypeChecking/TableRefs.ag" #-}+                  updateAnnotation (map TypeErrorA _errs     ++) _backTree+                  {-# LINE 14182 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 75, column 9)+              _libUpdates =+                  {-# LINE 75 "./TypeChecking/TableRefs.ag" #-}+                  if null _errs+                    then [LibStackIDs $ ("", _idLookups    ): _qidLookups+                         ,LibSetStarExpansion $ ("", _starExpansion    ): _qstarExpansion    ]+                    else []+                  {-# LINE 14190 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 104, column 9)+              _errs =+                  {-# LINE 104 "./TypeChecking/TableRefs.ag" #-}+                  case _relType     of+                    Left e -> e+                    Right _ -> []+                  {-# LINE 14197 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 108, column 9)+              _relType =+                  {-# LINE 108 "./TypeChecking/TableRefs.ag" #-}+                  envCompositeAttrsPair _lhsIenv [] tbl_+                  {-# LINE 14202 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 109, column 9)+              _relType1 =+                  {-# LINE 109 "./TypeChecking/TableRefs.ag" #-}+                  fromRight ([],[]) _relType+                  {-# LINE 14207 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 110, column 9)+              _pAttrs =+                  {-# LINE 110 "./TypeChecking/TableRefs.ag" #-}+                  fst _relType1+                  {-# LINE 14212 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 111, column 9)+              _sAttrs =+                  {-# LINE 111 "./TypeChecking/TableRefs.ag" #-}+                  snd _relType1+                  {-# LINE 14217 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 113, column 9)+              _idLookups =+                  {-# LINE 113 "./TypeChecking/TableRefs.ag" #-}+                  _pAttrs     ++ _sAttrs+                  {-# LINE 14222 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 114, column 9)+              _alias =+                  {-# LINE 114 "./TypeChecking/TableRefs.ag" #-}+                  getAlias tbl_ _aliasIannotatedTree+                  {-# LINE 14227 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 115, column 9)+              _qidLookups =+                  {-# LINE 115 "./TypeChecking/TableRefs.ag" #-}+                  [(_alias    , _idLookups    )]+                  {-# LINE 14232 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 116, column 9)+              _starExpansion =+                  {-# LINE 116 "./TypeChecking/TableRefs.ag" #-}+                  _pAttrs+                  {-# LINE 14237 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 117, column 9)+              _qstarExpansion =+                  {-# LINE 117 "./TypeChecking/TableRefs.ag" #-}+                  [(_alias    , _pAttrs    )]+                  {-# LINE 14242 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 248, column 9)+              _lhsOlibUpdates =+                  {-# LINE 248 "./TypeChecking/TableRefs.ag" #-}+                  _libUpdates+                  {-# LINE 14247 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 249, column 9)+              _lhsOidLookups =+                  {-# LINE 249 "./TypeChecking/TableRefs.ag" #-}+                  _idLookups+                  {-# LINE 14252 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 250, column 9)+              _lhsOqidLookups =+                  {-# LINE 250 "./TypeChecking/TableRefs.ag" #-}+                  _qidLookups+                  {-# LINE 14257 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 251, column 9)+              _lhsOstarExpansion =+                  {-# LINE 251 "./TypeChecking/TableRefs.ag" #-}+                  _starExpansion+                  {-# LINE 14262 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 252, column 9)+              _lhsOqstarExpansion =+                  {-# LINE 252 "./TypeChecking/TableRefs.ag" #-}+                  _qstarExpansion+                  {-# LINE 14267 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 260, column 9)+              _backTree =+                  {-# LINE 260 "./TypeChecking/TableRefs.ag" #-}+                  Tref ann_ tbl_ _aliasIannotatedTree+                  {-# LINE 14272 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Tref ann_ tbl_ _aliasIannotatedTree+                  {-# LINE 14277 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Tref ann_ tbl_ _aliasIoriginalTree+                  {-# LINE 14282 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 14287 "AstInternal.hs" #-}+              -- copy rule (down)+              _aliasOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 14292 "AstInternal.hs" #-}+              -- copy rule (down)+              _aliasOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 14297 "AstInternal.hs" #-}+              ( _aliasIannotatedTree,_aliasIoriginalTree) =+                  (alias_ _aliasOenv _aliasOlib )+          in  ( _lhsOannotatedTree,_lhsOidLookups,_lhsOlibUpdates,_lhsOoriginalTree,_lhsOqidLookups,_lhsOqstarExpansion,_lhsOstarExpansion)))+sem_TableRef_TrefFun :: Annotation ->+                        T_Expression  ->+                        T_TableAlias  ->+                        T_TableRef +sem_TableRef_TrefFun ann_ fn_ alias_  =+    (\ _lhsIenv+       _lhsIjlibUpdates+       _lhsIlib ->+         (let _lhsOannotatedTree :: TableRef+              _eqfunIdens :: (Either [TypeError] (String,[(String,Type)]))+              _idLookups :: ([(String,Type)])+              _qidLookups :: ([(String,[(String,Type)])])+              _starExpansion :: ([(String,Type)])+              _qstarExpansion :: ([(String,[(String,Type)])])+              _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOidLookups :: ([(String,Type)])+              _lhsOqidLookups :: ([(String,[(String,Type)])])+              _lhsOstarExpansion :: ([(String,Type)])+              _lhsOqstarExpansion :: ([(String,[(String,Type)])])+              _lhsOoriginalTree :: TableRef+              _fnOenv :: Environment+              _fnOlib :: LocalIdentifierBindings+              _aliasOenv :: Environment+              _aliasOlib :: LocalIdentifierBindings+              _fnIannotatedTree :: Expression+              _fnIliftedColumnName :: String+              _fnIoriginalTree :: Expression+              _aliasIannotatedTree :: TableAlias+              _aliasIoriginalTree :: TableAlias+              -- "./TypeChecking/TableRefs.ag"(line 33, column 9)+              _lhsOannotatedTree =+                  {-# LINE 33 "./TypeChecking/TableRefs.ag" #-}+                  updateAnnotation (map TypeErrorA _errs     ++) _backTree+                  {-# LINE 14334 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 75, column 9)+              _libUpdates =+                  {-# LINE 75 "./TypeChecking/TableRefs.ag" #-}+                  if null _errs+                    then [LibStackIDs $ ("", _idLookups    ): _qidLookups+                         ,LibSetStarExpansion $ ("", _starExpansion    ): _qstarExpansion    ]+                    else []+                  {-# LINE 14342 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 120, column 9)+              _errs =+                  {-# LINE 120 "./TypeChecking/TableRefs.ag" #-}+                  case _eqfunIdens of+                    Left e -> e+                    Right _ -> []+                  {-# LINE 14349 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 124, column 9)+              _eqfunIdens =+                  {-# LINE 124 "./TypeChecking/TableRefs.ag" #-}+                  funIdens _lhsIenv _alias     _fnIannotatedTree+                  {-# LINE 14354 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 125, column 9)+              _qfunIdens =+                  {-# LINE 125 "./TypeChecking/TableRefs.ag" #-}+                  fromRight ("",[]) _eqfunIdens+                  {-# LINE 14359 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 126, column 9)+              _alias2 =+                  {-# LINE 126 "./TypeChecking/TableRefs.ag" #-}+                  fst _qfunIdens+                  {-# LINE 14364 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 127, column 9)+              _funIdens =+                  {-# LINE 127 "./TypeChecking/TableRefs.ag" #-}+                  snd _qfunIdens+                  {-# LINE 14369 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 128, column 9)+              _alias =+                  {-# LINE 128 "./TypeChecking/TableRefs.ag" #-}+                  getAlias "" _aliasIannotatedTree+                  {-# LINE 14374 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 130, column 9)+              _idLookups =+                  {-# LINE 130 "./TypeChecking/TableRefs.ag" #-}+                  _funIdens+                  {-# LINE 14379 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 131, column 9)+              _qidLookups =+                  {-# LINE 131 "./TypeChecking/TableRefs.ag" #-}+                  [(_alias2, _idLookups    )]+                  {-# LINE 14384 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 132, column 9)+              _starExpansion =+                  {-# LINE 132 "./TypeChecking/TableRefs.ag" #-}+                  _idLookups+                  {-# LINE 14389 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 133, column 9)+              _qstarExpansion =+                  {-# LINE 133 "./TypeChecking/TableRefs.ag" #-}+                  _qidLookups+                  {-# LINE 14394 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 248, column 9)+              _lhsOlibUpdates =+                  {-# LINE 248 "./TypeChecking/TableRefs.ag" #-}+                  _libUpdates+                  {-# LINE 14399 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 249, column 9)+              _lhsOidLookups =+                  {-# LINE 249 "./TypeChecking/TableRefs.ag" #-}+                  _idLookups+                  {-# LINE 14404 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 250, column 9)+              _lhsOqidLookups =+                  {-# LINE 250 "./TypeChecking/TableRefs.ag" #-}+                  _qidLookups+                  {-# LINE 14409 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 251, column 9)+              _lhsOstarExpansion =+                  {-# LINE 251 "./TypeChecking/TableRefs.ag" #-}+                  _starExpansion+                  {-# LINE 14414 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 252, column 9)+              _lhsOqstarExpansion =+                  {-# LINE 252 "./TypeChecking/TableRefs.ag" #-}+                  _qstarExpansion+                  {-# LINE 14419 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 262, column 9)+              _backTree =+                  {-# LINE 262 "./TypeChecking/TableRefs.ag" #-}+                  TrefFun ann_ _fnIannotatedTree _aliasIannotatedTree+                  {-# LINE 14424 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  TrefFun ann_ _fnIannotatedTree _aliasIannotatedTree+                  {-# LINE 14429 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  TrefFun ann_ _fnIoriginalTree _aliasIoriginalTree+                  {-# LINE 14434 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 14439 "AstInternal.hs" #-}+              -- copy rule (down)+              _fnOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 14444 "AstInternal.hs" #-}+              -- copy rule (down)+              _fnOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 14449 "AstInternal.hs" #-}+              -- copy rule (down)+              _aliasOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 14454 "AstInternal.hs" #-}+              -- copy rule (down)+              _aliasOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 14459 "AstInternal.hs" #-}+              ( _fnIannotatedTree,_fnIliftedColumnName,_fnIoriginalTree) =+                  (fn_ _fnOenv _fnOlib )+              ( _aliasIannotatedTree,_aliasIoriginalTree) =+                  (alias_ _aliasOenv _aliasOlib )+          in  ( _lhsOannotatedTree,_lhsOidLookups,_lhsOlibUpdates,_lhsOoriginalTree,_lhsOqidLookups,_lhsOqstarExpansion,_lhsOstarExpansion)))+-- TableRefList ------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         libUpdates           : [LocalIdentifierBindingsUpdate]+         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : TableRef +         child tl             : TableRefList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type TableRefList  = [(TableRef)]+-- cata+sem_TableRefList :: TableRefList  ->+                    T_TableRefList +sem_TableRefList list  =+    (Prelude.foldr sem_TableRefList_Cons sem_TableRefList_Nil (Prelude.map sem_TableRef list) )+-- semantic domain+type T_TableRefList  = Environment ->+                       LocalIdentifierBindings ->+                       ( TableRefList,([LocalIdentifierBindingsUpdate]),TableRefList)+data Inh_TableRefList  = Inh_TableRefList {env_Inh_TableRefList :: Environment,lib_Inh_TableRefList :: LocalIdentifierBindings}+data Syn_TableRefList  = Syn_TableRefList {annotatedTree_Syn_TableRefList :: TableRefList,libUpdates_Syn_TableRefList :: [LocalIdentifierBindingsUpdate],originalTree_Syn_TableRefList :: TableRefList}+wrap_TableRefList :: T_TableRefList  ->+                     Inh_TableRefList  ->+                     Syn_TableRefList +wrap_TableRefList sem (Inh_TableRefList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOlibUpdates,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_TableRefList _lhsOannotatedTree _lhsOlibUpdates _lhsOoriginalTree ))+sem_TableRefList_Cons :: T_TableRef  ->+                         T_TableRefList  ->+                         T_TableRefList +sem_TableRefList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _hdOjlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: TableRefList+              _lhsOoriginalTree :: TableRefList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: TableRef+              _hdIidLookups :: ([(String,Type)])+              _hdIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _hdIoriginalTree :: TableRef+              _hdIqidLookups :: ([(String,[(String,Type)])])+              _hdIqstarExpansion :: ([(String,[(String,Type)])])+              _hdIstarExpansion :: ([(String,Type)])+              _tlIannotatedTree :: TableRefList+              _tlIlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _tlIoriginalTree :: TableRefList+              -- "./TypeChecking/TableRefs.ag"(line 40, column 9)+              _lhsOlibUpdates =+                  {-# LINE 40 "./TypeChecking/TableRefs.ag" #-}+                  _hdIlibUpdates+                  {-# LINE 14534 "AstInternal.hs" #-}+              -- "./TypeChecking/TableRefs.ag"(line 197, column 12)+              _hdOjlibUpdates =+                  {-# LINE 197 "./TypeChecking/TableRefs.ag" #-}+                  []+                  {-# LINE 14539 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 14544 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 14549 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 14554 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 14559 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 14564 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 14569 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 14574 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 14579 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIidLookups,_hdIlibUpdates,_hdIoriginalTree,_hdIqidLookups,_hdIqstarExpansion,_hdIstarExpansion) =+                  (hd_ _hdOenv _hdOjlibUpdates _hdOlib )+              ( _tlIannotatedTree,_tlIlibUpdates,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOlibUpdates,_lhsOoriginalTree)))+sem_TableRefList_Nil :: T_TableRefList +sem_TableRefList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOlibUpdates :: ([LocalIdentifierBindingsUpdate])+              _lhsOannotatedTree :: TableRefList+              _lhsOoriginalTree :: TableRefList+              -- "./TypeChecking/TableRefs.ag"(line 38, column 9)+              _lhsOlibUpdates =+                  {-# LINE 38 "./TypeChecking/TableRefs.ag" #-}+                  []+                  {-# LINE 14596 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 14601 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 14606 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 14611 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 14616 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOlibUpdates,_lhsOoriginalTree)))+-- TriggerEvent ------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative TDelete:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative TInsert:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative TUpdate:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data TriggerEvent  = TDelete +                   | TInsert +                   | TUpdate +                   deriving ( Data,Eq,Show,Typeable)+-- cata+sem_TriggerEvent :: TriggerEvent  ->+                    T_TriggerEvent +sem_TriggerEvent (TDelete )  =+    (sem_TriggerEvent_TDelete )+sem_TriggerEvent (TInsert )  =+    (sem_TriggerEvent_TInsert )+sem_TriggerEvent (TUpdate )  =+    (sem_TriggerEvent_TUpdate )+-- semantic domain+type T_TriggerEvent  = Environment ->+                       LocalIdentifierBindings ->+                       ( TriggerEvent,TriggerEvent)+data Inh_TriggerEvent  = Inh_TriggerEvent {env_Inh_TriggerEvent :: Environment,lib_Inh_TriggerEvent :: LocalIdentifierBindings}+data Syn_TriggerEvent  = Syn_TriggerEvent {annotatedTree_Syn_TriggerEvent :: TriggerEvent,originalTree_Syn_TriggerEvent :: TriggerEvent}+wrap_TriggerEvent :: T_TriggerEvent  ->+                     Inh_TriggerEvent  ->+                     Syn_TriggerEvent +wrap_TriggerEvent sem (Inh_TriggerEvent _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_TriggerEvent _lhsOannotatedTree _lhsOoriginalTree ))+sem_TriggerEvent_TDelete :: T_TriggerEvent +sem_TriggerEvent_TDelete  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: TriggerEvent+              _lhsOoriginalTree :: TriggerEvent+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  TDelete+                  {-# LINE 14677 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  TDelete+                  {-# LINE 14682 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 14687 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 14692 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_TriggerEvent_TInsert :: T_TriggerEvent +sem_TriggerEvent_TInsert  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: TriggerEvent+              _lhsOoriginalTree :: TriggerEvent+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  TInsert+                  {-# LINE 14704 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  TInsert+                  {-# LINE 14709 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 14714 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 14719 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_TriggerEvent_TUpdate :: T_TriggerEvent +sem_TriggerEvent_TUpdate  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: TriggerEvent+              _lhsOoriginalTree :: TriggerEvent+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  TUpdate+                  {-# LINE 14731 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  TUpdate+                  {-# LINE 14736 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 14741 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 14746 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- TriggerFire -------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative EachRow:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative EachStatement:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data TriggerFire  = EachRow +                  | EachStatement +                  deriving ( Data,Eq,Show,Typeable)+-- cata+sem_TriggerFire :: TriggerFire  ->+                   T_TriggerFire +sem_TriggerFire (EachRow )  =+    (sem_TriggerFire_EachRow )+sem_TriggerFire (EachStatement )  =+    (sem_TriggerFire_EachStatement )+-- semantic domain+type T_TriggerFire  = Environment ->+                      LocalIdentifierBindings ->+                      ( TriggerFire,TriggerFire)+data Inh_TriggerFire  = Inh_TriggerFire {env_Inh_TriggerFire :: Environment,lib_Inh_TriggerFire :: LocalIdentifierBindings}+data Syn_TriggerFire  = Syn_TriggerFire {annotatedTree_Syn_TriggerFire :: TriggerFire,originalTree_Syn_TriggerFire :: TriggerFire}+wrap_TriggerFire :: T_TriggerFire  ->+                    Inh_TriggerFire  ->+                    Syn_TriggerFire +wrap_TriggerFire sem (Inh_TriggerFire _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_TriggerFire _lhsOannotatedTree _lhsOoriginalTree ))+sem_TriggerFire_EachRow :: T_TriggerFire +sem_TriggerFire_EachRow  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: TriggerFire+              _lhsOoriginalTree :: TriggerFire+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  EachRow+                  {-# LINE 14800 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  EachRow+                  {-# LINE 14805 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 14810 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 14815 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_TriggerFire_EachStatement :: T_TriggerFire +sem_TriggerFire_EachStatement  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: TriggerFire+              _lhsOoriginalTree :: TriggerFire+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  EachStatement+                  {-# LINE 14827 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  EachStatement+                  {-# LINE 14832 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 14837 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 14842 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- TriggerWhen -------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative TriggerAfter:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative TriggerBefore:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data TriggerWhen  = TriggerAfter +                  | TriggerBefore +                  deriving ( Data,Eq,Show,Typeable)+-- cata+sem_TriggerWhen :: TriggerWhen  ->+                   T_TriggerWhen +sem_TriggerWhen (TriggerAfter )  =+    (sem_TriggerWhen_TriggerAfter )+sem_TriggerWhen (TriggerBefore )  =+    (sem_TriggerWhen_TriggerBefore )+-- semantic domain+type T_TriggerWhen  = Environment ->+                      LocalIdentifierBindings ->+                      ( TriggerWhen,TriggerWhen)+data Inh_TriggerWhen  = Inh_TriggerWhen {env_Inh_TriggerWhen :: Environment,lib_Inh_TriggerWhen :: LocalIdentifierBindings}+data Syn_TriggerWhen  = Syn_TriggerWhen {annotatedTree_Syn_TriggerWhen :: TriggerWhen,originalTree_Syn_TriggerWhen :: TriggerWhen}+wrap_TriggerWhen :: T_TriggerWhen  ->+                    Inh_TriggerWhen  ->+                    Syn_TriggerWhen +wrap_TriggerWhen sem (Inh_TriggerWhen _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_TriggerWhen _lhsOannotatedTree _lhsOoriginalTree ))+sem_TriggerWhen_TriggerAfter :: T_TriggerWhen +sem_TriggerWhen_TriggerAfter  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: TriggerWhen+              _lhsOoriginalTree :: TriggerWhen+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  TriggerAfter+                  {-# LINE 14896 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  TriggerAfter+                  {-# LINE 14901 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 14906 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 14911 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_TriggerWhen_TriggerBefore :: T_TriggerWhen +sem_TriggerWhen_TriggerBefore  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: TriggerWhen+              _lhsOoriginalTree :: TriggerWhen+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  TriggerBefore+                  {-# LINE 14923 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  TriggerBefore+                  {-# LINE 14928 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 14933 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 14938 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+-- TypeAttributeDef --------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         attrName             : String+         namedType            : Type+         originalTree         : SELF +   alternatives:+      alternative TypeAttDef:+         child ann            : {Annotation}+         child name           : {String}+         child typ            : TypeName +         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data TypeAttributeDef  = TypeAttDef (Annotation) (String) (TypeName) +                       deriving ( Data,Eq,Show,Typeable)+-- cata+sem_TypeAttributeDef :: TypeAttributeDef  ->+                        T_TypeAttributeDef +sem_TypeAttributeDef (TypeAttDef _ann _name _typ )  =+    (sem_TypeAttributeDef_TypeAttDef _ann _name (sem_TypeName _typ ) )+-- semantic domain+type T_TypeAttributeDef  = Environment ->+                           LocalIdentifierBindings ->+                           ( TypeAttributeDef,String,Type,TypeAttributeDef)+data Inh_TypeAttributeDef  = Inh_TypeAttributeDef {env_Inh_TypeAttributeDef :: Environment,lib_Inh_TypeAttributeDef :: LocalIdentifierBindings}+data Syn_TypeAttributeDef  = Syn_TypeAttributeDef {annotatedTree_Syn_TypeAttributeDef :: TypeAttributeDef,attrName_Syn_TypeAttributeDef :: String,namedType_Syn_TypeAttributeDef :: Type,originalTree_Syn_TypeAttributeDef :: TypeAttributeDef}+wrap_TypeAttributeDef :: T_TypeAttributeDef  ->+                         Inh_TypeAttributeDef  ->+                         Syn_TypeAttributeDef +wrap_TypeAttributeDef sem (Inh_TypeAttributeDef _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOattrName,_lhsOnamedType,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_TypeAttributeDef _lhsOannotatedTree _lhsOattrName _lhsOnamedType _lhsOoriginalTree ))+sem_TypeAttributeDef_TypeAttDef :: Annotation ->+                                   String ->+                                   T_TypeName  ->+                                   T_TypeAttributeDef +sem_TypeAttributeDef_TypeAttDef ann_ name_ typ_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOattrName :: String+              _lhsOnamedType :: Type+              _lhsOannotatedTree :: TypeAttributeDef+              _lhsOoriginalTree :: TypeAttributeDef+              _typOenv :: Environment+              _typOlib :: LocalIdentifierBindings+              _typIannotatedTree :: TypeName+              _typInamedType :: Type+              _typIoriginalTree :: TypeName+              -- "./TypeChecking/MiscCreates.ag"(line 40, column 9)+              _lhsOattrName =+                  {-# LINE 40 "./TypeChecking/MiscCreates.ag" #-}+                  name_+                  {-# LINE 15000 "AstInternal.hs" #-}+              -- "./TypeChecking/MiscCreates.ag"(line 41, column 9)+              _lhsOnamedType =+                  {-# LINE 41 "./TypeChecking/MiscCreates.ag" #-}+                  _typInamedType+                  {-# LINE 15005 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  TypeAttDef ann_ name_ _typIannotatedTree+                  {-# LINE 15010 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  TypeAttDef ann_ name_ _typIoriginalTree+                  {-# LINE 15015 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 15020 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15025 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 15030 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 15035 "AstInternal.hs" #-}+              ( _typIannotatedTree,_typInamedType,_typIoriginalTree) =+                  (typ_ _typOenv _typOlib )+          in  ( _lhsOannotatedTree,_lhsOattrName,_lhsOnamedType,_lhsOoriginalTree)))+-- TypeAttributeDefList ----------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         attrs                : [(String, Type)]+         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : TypeAttributeDef +         child tl             : TypeAttributeDefList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type TypeAttributeDefList  = [(TypeAttributeDef)]+-- cata+sem_TypeAttributeDefList :: TypeAttributeDefList  ->+                            T_TypeAttributeDefList +sem_TypeAttributeDefList list  =+    (Prelude.foldr sem_TypeAttributeDefList_Cons sem_TypeAttributeDefList_Nil (Prelude.map sem_TypeAttributeDef list) )+-- semantic domain+type T_TypeAttributeDefList  = Environment ->+                               LocalIdentifierBindings ->+                               ( TypeAttributeDefList,([(String, Type)]),TypeAttributeDefList)+data Inh_TypeAttributeDefList  = Inh_TypeAttributeDefList {env_Inh_TypeAttributeDefList :: Environment,lib_Inh_TypeAttributeDefList :: LocalIdentifierBindings}+data Syn_TypeAttributeDefList  = Syn_TypeAttributeDefList {annotatedTree_Syn_TypeAttributeDefList :: TypeAttributeDefList,attrs_Syn_TypeAttributeDefList :: [(String, Type)],originalTree_Syn_TypeAttributeDefList :: TypeAttributeDefList}+wrap_TypeAttributeDefList :: T_TypeAttributeDefList  ->+                             Inh_TypeAttributeDefList  ->+                             Syn_TypeAttributeDefList +wrap_TypeAttributeDefList sem (Inh_TypeAttributeDefList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOattrs,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_TypeAttributeDefList _lhsOannotatedTree _lhsOattrs _lhsOoriginalTree ))+sem_TypeAttributeDefList_Cons :: T_TypeAttributeDef  ->+                                 T_TypeAttributeDefList  ->+                                 T_TypeAttributeDefList +sem_TypeAttributeDefList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOattrs :: ([(String, Type)])+              _lhsOannotatedTree :: TypeAttributeDefList+              _lhsOoriginalTree :: TypeAttributeDefList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: TypeAttributeDef+              _hdIattrName :: String+              _hdInamedType :: Type+              _hdIoriginalTree :: TypeAttributeDef+              _tlIannotatedTree :: TypeAttributeDefList+              _tlIattrs :: ([(String, Type)])+              _tlIoriginalTree :: TypeAttributeDefList+              -- "./TypeChecking/MiscCreates.ag"(line 46, column 12)+              _lhsOattrs =+                  {-# LINE 46 "./TypeChecking/MiscCreates.ag" #-}+                  (_hdIattrName, _hdInamedType) : _tlIattrs+                  {-# LINE 15104 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 15109 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 15114 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 15119 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15124 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 15129 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 15134 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 15139 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 15144 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIattrName,_hdInamedType,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIattrs,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOattrs,_lhsOoriginalTree)))+sem_TypeAttributeDefList_Nil :: T_TypeAttributeDefList +sem_TypeAttributeDefList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOattrs :: ([(String, Type)])+              _lhsOannotatedTree :: TypeAttributeDefList+              _lhsOoriginalTree :: TypeAttributeDefList+              -- "./TypeChecking/MiscCreates.ag"(line 47, column 11)+              _lhsOattrs =+                  {-# LINE 47 "./TypeChecking/MiscCreates.ag" #-}+                  []+                  {-# LINE 15161 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 15166 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 15171 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 15176 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15181 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOattrs,_lhsOoriginalTree)))+-- TypeName ----------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         namedType            : Type+         originalTree         : SELF +   alternatives:+      alternative ArrayTypeName:+         child ann            : {Annotation}+         child typ            : TypeName +         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative PrecTypeName:+         child ann            : {Annotation}+         child tn             : {String}+         child prec           : {Integer}+         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative SetOfTypeName:+         child ann            : {Annotation}+         child typ            : TypeName +         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+      alternative SimpleTypeName:+         child ann            : {Annotation}+         child tn             : {String}+         visit 0:+            local tpe         : _+            local backTree    : _+            local annotatedTree : _+            local originalTree : _+-}+data TypeName  = ArrayTypeName (Annotation) (TypeName) +               | PrecTypeName (Annotation) (String) (Integer) +               | SetOfTypeName (Annotation) (TypeName) +               | SimpleTypeName (Annotation) (String) +               deriving ( Data,Eq,Show,Typeable)+-- cata+sem_TypeName :: TypeName  ->+                T_TypeName +sem_TypeName (ArrayTypeName _ann _typ )  =+    (sem_TypeName_ArrayTypeName _ann (sem_TypeName _typ ) )+sem_TypeName (PrecTypeName _ann _tn _prec )  =+    (sem_TypeName_PrecTypeName _ann _tn _prec )+sem_TypeName (SetOfTypeName _ann _typ )  =+    (sem_TypeName_SetOfTypeName _ann (sem_TypeName _typ ) )+sem_TypeName (SimpleTypeName _ann _tn )  =+    (sem_TypeName_SimpleTypeName _ann _tn )+-- semantic domain+type T_TypeName  = Environment ->+                   LocalIdentifierBindings ->+                   ( TypeName,Type,TypeName)+data Inh_TypeName  = Inh_TypeName {env_Inh_TypeName :: Environment,lib_Inh_TypeName :: LocalIdentifierBindings}+data Syn_TypeName  = Syn_TypeName {annotatedTree_Syn_TypeName :: TypeName,namedType_Syn_TypeName :: Type,originalTree_Syn_TypeName :: TypeName}+wrap_TypeName :: T_TypeName  ->+                 Inh_TypeName  ->+                 Syn_TypeName +wrap_TypeName sem (Inh_TypeName _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOnamedType,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_TypeName _lhsOannotatedTree _lhsOnamedType _lhsOoriginalTree ))+sem_TypeName_ArrayTypeName :: Annotation ->+                              T_TypeName  ->+                              T_TypeName +sem_TypeName_ArrayTypeName ann_ typ_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOnamedType :: Type+              _lhsOannotatedTree :: TypeName+              _lhsOoriginalTree :: TypeName+              _typOenv :: Environment+              _typOlib :: LocalIdentifierBindings+              _typIannotatedTree :: TypeName+              _typInamedType :: Type+              _typIoriginalTree :: TypeName+              -- "./TypeChecking/Misc.ag"(line 19, column 10)+              _lhsOnamedType =+                  {-# LINE 19 "./TypeChecking/Misc.ag" #-}+                  tpeToT _tpe+                  {-# LINE 15275 "AstInternal.hs" #-}+              -- "./TypeChecking/Misc.ag"(line 20, column 10)+              _lhsOannotatedTree =+                  {-# LINE 20 "./TypeChecking/Misc.ag" #-}+                  updateAnnotation+                    ((map TypeErrorA $ getErrors _tpe    ) ++)+                    _backTree+                  {-# LINE 15282 "AstInternal.hs" #-}+              -- "./TypeChecking/Misc.ag"(line 30, column 9)+              _tpe =+                  {-# LINE 30 "./TypeChecking/Misc.ag" #-}+                  dependsOnRTpe [_typInamedType] $ Right $ ArrayType _typInamedType+                  {-# LINE 15287 "AstInternal.hs" #-}+              -- "./TypeChecking/Misc.ag"(line 31, column 9)+              _backTree =+                  {-# LINE 31 "./TypeChecking/Misc.ag" #-}+                  ArrayTypeName ann_ _typIannotatedTree+                  {-# LINE 15292 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  ArrayTypeName ann_ _typIannotatedTree+                  {-# LINE 15297 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  ArrayTypeName ann_ _typIoriginalTree+                  {-# LINE 15302 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15307 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 15312 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 15317 "AstInternal.hs" #-}+              ( _typIannotatedTree,_typInamedType,_typIoriginalTree) =+                  (typ_ _typOenv _typOlib )+          in  ( _lhsOannotatedTree,_lhsOnamedType,_lhsOoriginalTree)))+sem_TypeName_PrecTypeName :: Annotation ->+                             String ->+                             Integer ->+                             T_TypeName +sem_TypeName_PrecTypeName ann_ tn_ prec_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOnamedType :: Type+              _lhsOannotatedTree :: TypeName+              _lhsOoriginalTree :: TypeName+              -- "./TypeChecking/Misc.ag"(line 19, column 10)+              _lhsOnamedType =+                  {-# LINE 19 "./TypeChecking/Misc.ag" #-}+                  tpeToT _tpe+                  {-# LINE 15335 "AstInternal.hs" #-}+              -- "./TypeChecking/Misc.ag"(line 20, column 10)+              _lhsOannotatedTree =+                  {-# LINE 20 "./TypeChecking/Misc.ag" #-}+                  updateAnnotation+                    ((map TypeErrorA $ getErrors _tpe    ) ++)+                    _backTree+                  {-# LINE 15342 "AstInternal.hs" #-}+              -- "./TypeChecking/Misc.ag"(line 36, column 9)+              _tpe =+                  {-# LINE 36 "./TypeChecking/Misc.ag" #-}+                  envLookupType _lhsIenv $ canonicalizeTypeName tn_+                  {-# LINE 15347 "AstInternal.hs" #-}+              -- "./TypeChecking/Misc.ag"(line 37, column 9)+              _backTree =+                  {-# LINE 37 "./TypeChecking/Misc.ag" #-}+                  PrecTypeName ann_ tn_ prec_+                  {-# LINE 15352 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  PrecTypeName ann_ tn_ prec_+                  {-# LINE 15357 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  PrecTypeName ann_ tn_ prec_+                  {-# LINE 15362 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15367 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOnamedType,_lhsOoriginalTree)))+sem_TypeName_SetOfTypeName :: Annotation ->+                              T_TypeName  ->+                              T_TypeName +sem_TypeName_SetOfTypeName ann_ typ_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOnamedType :: Type+              _lhsOannotatedTree :: TypeName+              _lhsOoriginalTree :: TypeName+              _typOenv :: Environment+              _typOlib :: LocalIdentifierBindings+              _typIannotatedTree :: TypeName+              _typInamedType :: Type+              _typIoriginalTree :: TypeName+              -- "./TypeChecking/Misc.ag"(line 19, column 10)+              _lhsOnamedType =+                  {-# LINE 19 "./TypeChecking/Misc.ag" #-}+                  tpeToT _tpe+                  {-# LINE 15387 "AstInternal.hs" #-}+              -- "./TypeChecking/Misc.ag"(line 20, column 10)+              _lhsOannotatedTree =+                  {-# LINE 20 "./TypeChecking/Misc.ag" #-}+                  updateAnnotation+                    ((map TypeErrorA $ getErrors _tpe    ) ++)+                    _backTree+                  {-# LINE 15394 "AstInternal.hs" #-}+              -- "./TypeChecking/Misc.ag"(line 33, column 9)+              _tpe =+                  {-# LINE 33 "./TypeChecking/Misc.ag" #-}+                  dependsOnRTpe [_typInamedType] $ Right $ SetOfType _typInamedType+                  {-# LINE 15399 "AstInternal.hs" #-}+              -- "./TypeChecking/Misc.ag"(line 34, column 9)+              _backTree =+                  {-# LINE 34 "./TypeChecking/Misc.ag" #-}+                  SetOfTypeName ann_ _typIannotatedTree+                  {-# LINE 15404 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  SetOfTypeName ann_ _typIannotatedTree+                  {-# LINE 15409 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  SetOfTypeName ann_ _typIoriginalTree+                  {-# LINE 15414 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15419 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 15424 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 15429 "AstInternal.hs" #-}+              ( _typIannotatedTree,_typInamedType,_typIoriginalTree) =+                  (typ_ _typOenv _typOlib )+          in  ( _lhsOannotatedTree,_lhsOnamedType,_lhsOoriginalTree)))+sem_TypeName_SimpleTypeName :: Annotation ->+                               String ->+                               T_TypeName +sem_TypeName_SimpleTypeName ann_ tn_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOnamedType :: Type+              _lhsOannotatedTree :: TypeName+              _lhsOoriginalTree :: TypeName+              -- "./TypeChecking/Misc.ag"(line 19, column 10)+              _lhsOnamedType =+                  {-# LINE 19 "./TypeChecking/Misc.ag" #-}+                  tpeToT _tpe+                  {-# LINE 15446 "AstInternal.hs" #-}+              -- "./TypeChecking/Misc.ag"(line 20, column 10)+              _lhsOannotatedTree =+                  {-# LINE 20 "./TypeChecking/Misc.ag" #-}+                  updateAnnotation+                    ((map TypeErrorA $ getErrors _tpe    ) ++)+                    _backTree+                  {-# LINE 15453 "AstInternal.hs" #-}+              -- "./TypeChecking/Misc.ag"(line 27, column 9)+              _tpe =+                  {-# LINE 27 "./TypeChecking/Misc.ag" #-}+                  envLookupType _lhsIenv $ canonicalizeTypeName tn_+                  {-# LINE 15458 "AstInternal.hs" #-}+              -- "./TypeChecking/Misc.ag"(line 28, column 9)+              _backTree =+                  {-# LINE 28 "./TypeChecking/Misc.ag" #-}+                  SimpleTypeName ann_ tn_+                  {-# LINE 15463 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  SimpleTypeName ann_ tn_+                  {-# LINE 15468 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  SimpleTypeName ann_ tn_+                  {-# LINE 15473 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15478 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOnamedType,_lhsOoriginalTree)))+-- TypeNameList ------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         namedTypes           : [Type]+         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : TypeName +         child tl             : TypeNameList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type TypeNameList  = [(TypeName)]+-- cata+sem_TypeNameList :: TypeNameList  ->+                    T_TypeNameList +sem_TypeNameList list  =+    (Prelude.foldr sem_TypeNameList_Cons sem_TypeNameList_Nil (Prelude.map sem_TypeName list) )+-- semantic domain+type T_TypeNameList  = Environment ->+                       LocalIdentifierBindings ->+                       ( TypeNameList,([Type]),TypeNameList)+data Inh_TypeNameList  = Inh_TypeNameList {env_Inh_TypeNameList :: Environment,lib_Inh_TypeNameList :: LocalIdentifierBindings}+data Syn_TypeNameList  = Syn_TypeNameList {annotatedTree_Syn_TypeNameList :: TypeNameList,namedTypes_Syn_TypeNameList :: [Type],originalTree_Syn_TypeNameList :: TypeNameList}+wrap_TypeNameList :: T_TypeNameList  ->+                     Inh_TypeNameList  ->+                     Syn_TypeNameList +wrap_TypeNameList sem (Inh_TypeNameList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOnamedTypes,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_TypeNameList _lhsOannotatedTree _lhsOnamedTypes _lhsOoriginalTree ))+sem_TypeNameList_Cons :: T_TypeName  ->+                         T_TypeNameList  ->+                         T_TypeNameList +sem_TypeNameList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOnamedTypes :: ([Type])+              _lhsOannotatedTree :: TypeNameList+              _lhsOoriginalTree :: TypeNameList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: TypeName+              _hdInamedType :: Type+              _hdIoriginalTree :: TypeName+              _tlIannotatedTree :: TypeNameList+              _tlInamedTypes :: ([Type])+              _tlIoriginalTree :: TypeNameList+              -- "./TypeChecking/Drops.ag"(line 30, column 12)+              _lhsOnamedTypes =+                  {-# LINE 30 "./TypeChecking/Drops.ag" #-}+                  _hdInamedType : _tlInamedTypes+                  {-# LINE 15544 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 15549 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 15554 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 15559 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15564 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 15569 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 15574 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 15579 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 15584 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdInamedType,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlInamedTypes,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOnamedTypes,_lhsOoriginalTree)))+sem_TypeNameList_Nil :: T_TypeNameList +sem_TypeNameList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOnamedTypes :: ([Type])+              _lhsOannotatedTree :: TypeNameList+              _lhsOoriginalTree :: TypeNameList+              -- "./TypeChecking/Drops.ag"(line 31, column 11)+              _lhsOnamedTypes =+                  {-# LINE 31 "./TypeChecking/Drops.ag" #-}+                  []+                  {-# LINE 15601 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 15606 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 15611 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 15616 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15621 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOnamedTypes,_lhsOoriginalTree)))+-- VarDef ------------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         def                  : (String,Type)+         originalTree         : SELF +   alternatives:+      alternative VarDef:+         child ann            : {Annotation}+         child name           : {String}+         child typ            : TypeName +         child value          : {Maybe Expression}+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data VarDef  = VarDef (Annotation) (String) (TypeName) (Maybe Expression) +             deriving ( Data,Eq,Show,Typeable)+-- cata+sem_VarDef :: VarDef  ->+              T_VarDef +sem_VarDef (VarDef _ann _name _typ _value )  =+    (sem_VarDef_VarDef _ann _name (sem_TypeName _typ ) _value )+-- semantic domain+type T_VarDef  = Environment ->+                 LocalIdentifierBindings ->+                 ( VarDef,((String,Type)),VarDef)+data Inh_VarDef  = Inh_VarDef {env_Inh_VarDef :: Environment,lib_Inh_VarDef :: LocalIdentifierBindings}+data Syn_VarDef  = Syn_VarDef {annotatedTree_Syn_VarDef :: VarDef,def_Syn_VarDef :: (String,Type),originalTree_Syn_VarDef :: VarDef}+wrap_VarDef :: T_VarDef  ->+               Inh_VarDef  ->+               Syn_VarDef +wrap_VarDef sem (Inh_VarDef _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOdef,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_VarDef _lhsOannotatedTree _lhsOdef _lhsOoriginalTree ))+sem_VarDef_VarDef :: Annotation ->+                     String ->+                     T_TypeName  ->+                     (Maybe Expression) ->+                     T_VarDef +sem_VarDef_VarDef ann_ name_ typ_ value_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOdef :: ((String,Type))+              _lhsOannotatedTree :: VarDef+              _lhsOoriginalTree :: VarDef+              _typOenv :: Environment+              _typOlib :: LocalIdentifierBindings+              _typIannotatedTree :: TypeName+              _typInamedType :: Type+              _typIoriginalTree :: TypeName+              -- "./TypeChecking/CreateFunction.ag"(line 131, column 14)+              _lhsOdef =+                  {-# LINE 131 "./TypeChecking/CreateFunction.ag" #-}+                  (name_, if _typInamedType == Pseudo Record then PgRecord Nothing else _typInamedType)+                  {-# LINE 15683 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  VarDef ann_ name_ _typIannotatedTree value_+                  {-# LINE 15688 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  VarDef ann_ name_ _typIoriginalTree value_+                  {-# LINE 15693 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 15698 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15703 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 15708 "AstInternal.hs" #-}+              -- copy rule (down)+              _typOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 15713 "AstInternal.hs" #-}+              ( _typIannotatedTree,_typInamedType,_typIoriginalTree) =+                  (typ_ _typOenv _typOlib )+          in  ( _lhsOannotatedTree,_lhsOdef,_lhsOoriginalTree)))+-- VarDefList --------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         defs                 : [(String,Type)]+         originalTree         : SELF +   alternatives:+      alternative Cons:+         child hd             : VarDef +         child tl             : VarDefList +         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Nil:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+type VarDefList  = [(VarDef)]+-- cata+sem_VarDefList :: VarDefList  ->+                  T_VarDefList +sem_VarDefList list  =+    (Prelude.foldr sem_VarDefList_Cons sem_VarDefList_Nil (Prelude.map sem_VarDef list) )+-- semantic domain+type T_VarDefList  = Environment ->+                     LocalIdentifierBindings ->+                     ( VarDefList,([(String,Type)]),VarDefList)+data Inh_VarDefList  = Inh_VarDefList {env_Inh_VarDefList :: Environment,lib_Inh_VarDefList :: LocalIdentifierBindings}+data Syn_VarDefList  = Syn_VarDefList {annotatedTree_Syn_VarDefList :: VarDefList,defs_Syn_VarDefList :: [(String,Type)],originalTree_Syn_VarDefList :: VarDefList}+wrap_VarDefList :: T_VarDefList  ->+                   Inh_VarDefList  ->+                   Syn_VarDefList +wrap_VarDefList sem (Inh_VarDefList _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOdefs,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_VarDefList _lhsOannotatedTree _lhsOdefs _lhsOoriginalTree ))+sem_VarDefList_Cons :: T_VarDef  ->+                       T_VarDefList  ->+                       T_VarDefList +sem_VarDefList_Cons hd_ tl_  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOdefs :: ([(String,Type)])+              _lhsOannotatedTree :: VarDefList+              _lhsOoriginalTree :: VarDefList+              _hdOenv :: Environment+              _hdOlib :: LocalIdentifierBindings+              _tlOenv :: Environment+              _tlOlib :: LocalIdentifierBindings+              _hdIannotatedTree :: VarDef+              _hdIdef :: ((String,Type))+              _hdIoriginalTree :: VarDef+              _tlIannotatedTree :: VarDefList+              _tlIdefs :: ([(String,Type)])+              _tlIoriginalTree :: VarDefList+              -- "./TypeChecking/CreateFunction.ag"(line 134, column 12)+              _lhsOdefs =+                  {-# LINE 134 "./TypeChecking/CreateFunction.ag" #-}+                  _hdIdef : _tlIdefs+                  {-# LINE 15781 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIannotatedTree _tlIannotatedTree+                  {-# LINE 15786 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  (:) _hdIoriginalTree _tlIoriginalTree+                  {-# LINE 15791 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 15796 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15801 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 15806 "AstInternal.hs" #-}+              -- copy rule (down)+              _hdOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 15811 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOenv =+                  {-# LINE 56 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIenv+                  {-# LINE 15816 "AstInternal.hs" #-}+              -- copy rule (down)+              _tlOlib =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _lhsIlib+                  {-# LINE 15821 "AstInternal.hs" #-}+              ( _hdIannotatedTree,_hdIdef,_hdIoriginalTree) =+                  (hd_ _hdOenv _hdOlib )+              ( _tlIannotatedTree,_tlIdefs,_tlIoriginalTree) =+                  (tl_ _tlOenv _tlOlib )+          in  ( _lhsOannotatedTree,_lhsOdefs,_lhsOoriginalTree)))+sem_VarDefList_Nil :: T_VarDefList +sem_VarDefList_Nil  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOdefs :: ([(String,Type)])+              _lhsOannotatedTree :: VarDefList+              _lhsOoriginalTree :: VarDefList+              -- "./TypeChecking/CreateFunction.ag"(line 135, column 11)+              _lhsOdefs =+                  {-# LINE 135 "./TypeChecking/CreateFunction.ag" #-}+                  []+                  {-# LINE 15838 "AstInternal.hs" #-}+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 15843 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  []+                  {-# LINE 15848 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 15853 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15858 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOdefs,_lhsOoriginalTree)))+-- Volatility --------------------------------------------------+{-+   visit 0:+      inherited attributes:+         env                  : Environment+         lib                  : LocalIdentifierBindings+      synthesized attributes:+         annotatedTree        : SELF +         originalTree         : SELF +   alternatives:+      alternative Immutable:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Stable:+         visit 0:+            local annotatedTree : _+            local originalTree : _+      alternative Volatile:+         visit 0:+            local annotatedTree : _+            local originalTree : _+-}+data Volatility  = Immutable +                 | Stable +                 | Volatile +                 deriving ( Data,Eq,Show,Typeable)+-- cata+sem_Volatility :: Volatility  ->+                  T_Volatility +sem_Volatility (Immutable )  =+    (sem_Volatility_Immutable )+sem_Volatility (Stable )  =+    (sem_Volatility_Stable )+sem_Volatility (Volatile )  =+    (sem_Volatility_Volatile )+-- semantic domain+type T_Volatility  = Environment ->+                     LocalIdentifierBindings ->+                     ( Volatility,Volatility)+data Inh_Volatility  = Inh_Volatility {env_Inh_Volatility :: Environment,lib_Inh_Volatility :: LocalIdentifierBindings}+data Syn_Volatility  = Syn_Volatility {annotatedTree_Syn_Volatility :: Volatility,originalTree_Syn_Volatility :: Volatility}+wrap_Volatility :: T_Volatility  ->+                   Inh_Volatility  ->+                   Syn_Volatility +wrap_Volatility sem (Inh_Volatility _lhsIenv _lhsIlib )  =+    (let ( _lhsOannotatedTree,_lhsOoriginalTree) =+             (sem _lhsIenv _lhsIlib )+     in  (Syn_Volatility _lhsOannotatedTree _lhsOoriginalTree ))+sem_Volatility_Immutable :: T_Volatility +sem_Volatility_Immutable  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Volatility+              _lhsOoriginalTree :: Volatility+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Immutable+                  {-# LINE 15919 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Immutable+                  {-# LINE 15924 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 15929 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15934 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_Volatility_Stable :: T_Volatility +sem_Volatility_Stable  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Volatility+              _lhsOoriginalTree :: Volatility+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Stable+                  {-# LINE 15946 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Stable+                  {-# LINE 15951 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 15956 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15961 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))+sem_Volatility_Volatile :: T_Volatility +sem_Volatility_Volatile  =+    (\ _lhsIenv+       _lhsIlib ->+         (let _lhsOannotatedTree :: Volatility+              _lhsOoriginalTree :: Volatility+              -- self rule+              _annotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  Volatile+                  {-# LINE 15973 "AstInternal.hs" #-}+              -- self rule+              _originalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  Volatile+                  {-# LINE 15978 "AstInternal.hs" #-}+              -- self rule+              _lhsOannotatedTree =+                  {-# LINE 57 "./TypeChecking/TypeChecking.ag" #-}+                  _annotatedTree+                  {-# LINE 15983 "AstInternal.hs" #-}+              -- self rule+              _lhsOoriginalTree =+                  {-# LINE 63 "./TypeChecking/TypeChecking.ag" #-}+                  _originalTree+                  {-# LINE 15988 "AstInternal.hs" #-}+          in  ( _lhsOannotatedTree,_lhsOoriginalTree)))
− Database/HsSqlPpp/AstInternals/AstUtils.lhs
@@ -1,62 +0,0 @@-Copyright 2009 Jake Wheat--This file contains a bunch of small low level utilities to help with-type checking.--> {-# OPTIONS_HADDOCK hide #-}--> module Database.HsSqlPpp.AstInternals.AstUtils->     (->      --checkTypes->      chainTypeCheckFailed->     ,errorToTypeFail->     ,errorToTypeFailF->     ,checkErrorList->     ,getErrors->     ) where--> import Data.List--> import Database.HsSqlPpp.AstInternals.TypeType--================================================================================--= type checking utils--== checkErrors--if we find a typecheckfailed in the list, then propagate that, else-use the final argument.--> chainTypeCheckFailed :: [Type] -> Either a Type -> Either a Type-> chainTypeCheckFailed a b =->   if any (==TypeCheckFailed) a->     then Right TypeCheckFailed->     else b--convert an 'either [typeerror] type' to a type--> errorToTypeFail :: Either [TypeError] Type -> Type-> errorToTypeFail tpe = case tpe of->                         Left _ -> TypeCheckFailed->                         Right t -> t--convert an 'either [typeerror] x' to a type, using an x->type function--> errorToTypeFailF :: (t -> Type) -> Either [TypeError] t -> Type-> errorToTypeFailF f tpe = case tpe of->                                   Left _ -> TypeCheckFailed->                                   Right t -> f t--used to pass a regular type on iff the list of errors is null--> checkErrorList :: [TypeError] -> Type -> Either [TypeError] Type-> checkErrorList es t = if null es->                         then Right t->                         else Left es--extract errors from an either, gives empty list if right--> getErrors :: Either [TypeError] Type -> [TypeError]-> getErrors = either id (const [])-
− Database/HsSqlPpp/AstInternals/DefaultTemplate1Environment.lhs
@@ -1,19 +0,0 @@--Copyright 2009 Jake Wheat--This file contains--> {-# OPTIONS_HADDOCK hide  #-}--> module Database.HsSqlPpp.AstInternals.DefaultTemplate1Environment->     (defaultTemplate1Environment->      ) where--> import Database.HsSqlPpp.AstInternals.EnvironmentInternal-> import Database.HsSqlPpp.AstInternals.TypeType--> defaultTemplate1Environment :: Environment-> defaultTemplate1Environment = (\l -> case l of->                                       Left x -> error $ show x->                                       Right e -> e)->                                 $ updateEnvironment defaultEnvironment [EnvCreateScalar (ScalarType "bool") "B" True,EnvCreateScalar (ScalarType "bytea") "U" False,EnvCreateScalar (ScalarType "char") "S" False,EnvCreateScalar (ScalarType "name") "S" False,EnvCreateScalar (ScalarType "int8") "N" False,EnvCreateScalar (ScalarType "int2") "N" False,EnvCreateScalar (ScalarType "int2vector") "A" False,EnvCreateScalar (ScalarType "int4") "N" False,EnvCreateScalar (ScalarType "regproc") "N" False,EnvCreateScalar (ScalarType "text") "S" True,EnvCreateScalar (ScalarType "oid") "N" True,EnvCreateScalar (ScalarType "tid") "U" False,EnvCreateScalar (ScalarType "xid") "U" False,EnvCreateScalar (ScalarType "cid") "U" False,EnvCreateScalar (ScalarType "oidvector") "A" False,EnvCreateScalar (ScalarType "xml") "U" False,EnvCreateScalar (ScalarType "point") "G" False,EnvCreateScalar (ScalarType "lseg") "G" False,EnvCreateScalar (ScalarType "path") "G" False,EnvCreateScalar (ScalarType "box") "G" False,EnvCreateScalar (ScalarType "polygon") "G" False,EnvCreateScalar (ScalarType "line") "G" False,EnvCreateScalar (ScalarType "float4") "N" False,EnvCreateScalar (ScalarType "float8") "N" True,EnvCreateScalar (ScalarType "abstime") "D" False,EnvCreateScalar (ScalarType "reltime") "T" False,EnvCreateScalar (ScalarType "tinterval") "T" False,EnvCreateScalar (ScalarType "circle") "G" False,EnvCreateScalar (ScalarType "money") "N" False,EnvCreateScalar (ScalarType "macaddr") "U" False,EnvCreateScalar (ScalarType "inet") "I" True,EnvCreateScalar (ScalarType "cidr") "I" False,EnvCreateScalar (ScalarType "aclitem") "U" False,EnvCreateScalar (ScalarType "bpchar") "S" False,EnvCreateScalar (ScalarType "varchar") "S" False,EnvCreateScalar (ScalarType "date") "D" False,EnvCreateScalar (ScalarType "time") "D" False,EnvCreateScalar (ScalarType "timestamp") "D" False,EnvCreateScalar (ScalarType "timestamptz") "D" True,EnvCreateScalar (ScalarType "interval") "T" True,EnvCreateScalar (ScalarType "timetz") "D" False,EnvCreateScalar (ScalarType "bit") "V" False,EnvCreateScalar (ScalarType "varbit") "V" True,EnvCreateScalar (ScalarType "numeric") "N" False,EnvCreateScalar (ScalarType "refcursor") "U" False,EnvCreateScalar (ScalarType "regprocedure") "N" False,EnvCreateScalar (ScalarType "regoper") "N" False,EnvCreateScalar (ScalarType "regoperator") "N" False,EnvCreateScalar (ScalarType "regclass") "N" False,EnvCreateScalar (ScalarType "regtype") "N" False,EnvCreateScalar (ScalarType "uuid") "U" False,EnvCreateScalar (ScalarType "tsvector") "U" False,EnvCreateScalar (ScalarType "gtsvector") "U" False,EnvCreateScalar (ScalarType "tsquery") "U" False,EnvCreateScalar (ScalarType "regconfig") "N" False,EnvCreateScalar (ScalarType "regdictionary") "N" False,EnvCreateScalar (ScalarType "txid_snapshot") "U" False,EnvCreateCast (ScalarType "int8") (ScalarType "int2") AssignmentCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "int4") AssignmentCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "float4") ImplicitCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "float8") ImplicitCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "numeric") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "int8") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "int4") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "float4") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "float8") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "numeric") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "int8") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "int2") AssignmentCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "float4") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "float8") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "numeric") ImplicitCastContext,EnvCreateCast (ScalarType "float4") (ScalarType "int8") AssignmentCastContext,EnvCreateCast (ScalarType "float4") (ScalarType "int2") AssignmentCastContext,EnvCreateCast (ScalarType "float4") (ScalarType "int4") AssignmentCastContext,EnvCreateCast (ScalarType "float4") (ScalarType "float8") ImplicitCastContext,EnvCreateCast (ScalarType "float4") (ScalarType "numeric") AssignmentCastContext,EnvCreateCast (ScalarType "float8") (ScalarType "int8") AssignmentCastContext,EnvCreateCast (ScalarType "float8") (ScalarType "int2") AssignmentCastContext,EnvCreateCast (ScalarType "float8") (ScalarType "int4") AssignmentCastContext,EnvCreateCast (ScalarType "float8") (ScalarType "float4") AssignmentCastContext,EnvCreateCast (ScalarType "float8") (ScalarType "numeric") AssignmentCastContext,EnvCreateCast (ScalarType "numeric") (ScalarType "int8") AssignmentCastContext,EnvCreateCast (ScalarType "numeric") (ScalarType "int2") AssignmentCastContext,EnvCreateCast (ScalarType "numeric") (ScalarType "int4") AssignmentCastContext,EnvCreateCast (ScalarType "numeric") (ScalarType "float4") ImplicitCastContext,EnvCreateCast (ScalarType "numeric") (ScalarType "float8") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "bool") ExplicitCastContext,EnvCreateCast (ScalarType "bool") (ScalarType "int4") ExplicitCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "oid") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "oid") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "oid") ImplicitCastContext,EnvCreateCast (ScalarType "oid") (ScalarType "int8") AssignmentCastContext,EnvCreateCast (ScalarType "oid") (ScalarType "int4") AssignmentCastContext,EnvCreateCast (ScalarType "oid") (ScalarType "regproc") ImplicitCastContext,EnvCreateCast (ScalarType "regproc") (ScalarType "oid") ImplicitCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "regproc") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "regproc") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "regproc") ImplicitCastContext,EnvCreateCast (ScalarType "regproc") (ScalarType "int8") AssignmentCastContext,EnvCreateCast (ScalarType "regproc") (ScalarType "int4") AssignmentCastContext,EnvCreateCast (ScalarType "regproc") (ScalarType "regprocedure") ImplicitCastContext,EnvCreateCast (ScalarType "regprocedure") (ScalarType "regproc") ImplicitCastContext,EnvCreateCast (ScalarType "oid") (ScalarType "regprocedure") ImplicitCastContext,EnvCreateCast (ScalarType "regprocedure") (ScalarType "oid") ImplicitCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "regprocedure") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "regprocedure") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "regprocedure") ImplicitCastContext,EnvCreateCast (ScalarType "regprocedure") (ScalarType "int8") AssignmentCastContext,EnvCreateCast (ScalarType "regprocedure") (ScalarType "int4") AssignmentCastContext,EnvCreateCast (ScalarType "oid") (ScalarType "regoper") ImplicitCastContext,EnvCreateCast (ScalarType "regoper") (ScalarType "oid") ImplicitCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "regoper") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "regoper") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "regoper") ImplicitCastContext,EnvCreateCast (ScalarType "regoper") (ScalarType "int8") AssignmentCastContext,EnvCreateCast (ScalarType "regoper") (ScalarType "int4") AssignmentCastContext,EnvCreateCast (ScalarType "regoper") (ScalarType "regoperator") ImplicitCastContext,EnvCreateCast (ScalarType "regoperator") (ScalarType "regoper") ImplicitCastContext,EnvCreateCast (ScalarType "oid") (ScalarType "regoperator") ImplicitCastContext,EnvCreateCast (ScalarType "regoperator") (ScalarType "oid") ImplicitCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "regoperator") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "regoperator") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "regoperator") ImplicitCastContext,EnvCreateCast (ScalarType "regoperator") (ScalarType "int8") AssignmentCastContext,EnvCreateCast (ScalarType "regoperator") (ScalarType "int4") AssignmentCastContext,EnvCreateCast (ScalarType "oid") (ScalarType "regclass") ImplicitCastContext,EnvCreateCast (ScalarType "regclass") (ScalarType "oid") ImplicitCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "regclass") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "regclass") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "regclass") ImplicitCastContext,EnvCreateCast (ScalarType "regclass") (ScalarType "int8") AssignmentCastContext,EnvCreateCast (ScalarType "regclass") (ScalarType "int4") AssignmentCastContext,EnvCreateCast (ScalarType "oid") (ScalarType "regtype") ImplicitCastContext,EnvCreateCast (ScalarType "regtype") (ScalarType "oid") ImplicitCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "regtype") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "regtype") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "regtype") ImplicitCastContext,EnvCreateCast (ScalarType "regtype") (ScalarType "int8") AssignmentCastContext,EnvCreateCast (ScalarType "regtype") (ScalarType "int4") AssignmentCastContext,EnvCreateCast (ScalarType "oid") (ScalarType "regconfig") ImplicitCastContext,EnvCreateCast (ScalarType "regconfig") (ScalarType "oid") ImplicitCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "regconfig") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "regconfig") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "regconfig") ImplicitCastContext,EnvCreateCast (ScalarType "regconfig") (ScalarType "int8") AssignmentCastContext,EnvCreateCast (ScalarType "regconfig") (ScalarType "int4") AssignmentCastContext,EnvCreateCast (ScalarType "oid") (ScalarType "regdictionary") ImplicitCastContext,EnvCreateCast (ScalarType "regdictionary") (ScalarType "oid") ImplicitCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "regdictionary") ImplicitCastContext,EnvCreateCast (ScalarType "int2") (ScalarType "regdictionary") ImplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "regdictionary") ImplicitCastContext,EnvCreateCast (ScalarType "regdictionary") (ScalarType "int8") AssignmentCastContext,EnvCreateCast (ScalarType "regdictionary") (ScalarType "int4") AssignmentCastContext,EnvCreateCast (ScalarType "text") (ScalarType "regclass") ImplicitCastContext,EnvCreateCast (ScalarType "varchar") (ScalarType "regclass") ImplicitCastContext,EnvCreateCast (ScalarType "text") (ScalarType "bpchar") ImplicitCastContext,EnvCreateCast (ScalarType "text") (ScalarType "varchar") ImplicitCastContext,EnvCreateCast (ScalarType "bpchar") (ScalarType "text") ImplicitCastContext,EnvCreateCast (ScalarType "bpchar") (ScalarType "varchar") ImplicitCastContext,EnvCreateCast (ScalarType "varchar") (ScalarType "text") ImplicitCastContext,EnvCreateCast (ScalarType "varchar") (ScalarType "bpchar") ImplicitCastContext,EnvCreateCast (ScalarType "char") (ScalarType "text") ImplicitCastContext,EnvCreateCast (ScalarType "char") (ScalarType "bpchar") AssignmentCastContext,EnvCreateCast (ScalarType "char") (ScalarType "varchar") AssignmentCastContext,EnvCreateCast (ScalarType "name") (ScalarType "text") ImplicitCastContext,EnvCreateCast (ScalarType "name") (ScalarType "bpchar") AssignmentCastContext,EnvCreateCast (ScalarType "name") (ScalarType "varchar") AssignmentCastContext,EnvCreateCast (ScalarType "text") (ScalarType "char") AssignmentCastContext,EnvCreateCast (ScalarType "bpchar") (ScalarType "char") AssignmentCastContext,EnvCreateCast (ScalarType "varchar") (ScalarType "char") AssignmentCastContext,EnvCreateCast (ScalarType "text") (ScalarType "name") ImplicitCastContext,EnvCreateCast (ScalarType "bpchar") (ScalarType "name") ImplicitCastContext,EnvCreateCast (ScalarType "varchar") (ScalarType "name") ImplicitCastContext,EnvCreateCast (ScalarType "char") (ScalarType "int4") ExplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "char") ExplicitCastContext,EnvCreateCast (ScalarType "abstime") (ScalarType "date") AssignmentCastContext,EnvCreateCast (ScalarType "abstime") (ScalarType "time") AssignmentCastContext,EnvCreateCast (ScalarType "abstime") (ScalarType "timestamp") ImplicitCastContext,EnvCreateCast (ScalarType "abstime") (ScalarType "timestamptz") ImplicitCastContext,EnvCreateCast (ScalarType "reltime") (ScalarType "interval") ImplicitCastContext,EnvCreateCast (ScalarType "date") (ScalarType "timestamp") ImplicitCastContext,EnvCreateCast (ScalarType "date") (ScalarType "timestamptz") ImplicitCastContext,EnvCreateCast (ScalarType "time") (ScalarType "interval") ImplicitCastContext,EnvCreateCast (ScalarType "time") (ScalarType "timetz") ImplicitCastContext,EnvCreateCast (ScalarType "timestamp") (ScalarType "abstime") AssignmentCastContext,EnvCreateCast (ScalarType "timestamp") (ScalarType "date") AssignmentCastContext,EnvCreateCast (ScalarType "timestamp") (ScalarType "time") AssignmentCastContext,EnvCreateCast (ScalarType "timestamp") (ScalarType "timestamptz") ImplicitCastContext,EnvCreateCast (ScalarType "timestamptz") (ScalarType "abstime") AssignmentCastContext,EnvCreateCast (ScalarType "timestamptz") (ScalarType "date") AssignmentCastContext,EnvCreateCast (ScalarType "timestamptz") (ScalarType "time") AssignmentCastContext,EnvCreateCast (ScalarType "timestamptz") (ScalarType "timestamp") AssignmentCastContext,EnvCreateCast (ScalarType "timestamptz") (ScalarType "timetz") AssignmentCastContext,EnvCreateCast (ScalarType "interval") (ScalarType "reltime") AssignmentCastContext,EnvCreateCast (ScalarType "interval") (ScalarType "time") AssignmentCastContext,EnvCreateCast (ScalarType "timetz") (ScalarType "time") AssignmentCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "abstime") ExplicitCastContext,EnvCreateCast (ScalarType "abstime") (ScalarType "int4") ExplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "reltime") ExplicitCastContext,EnvCreateCast (ScalarType "reltime") (ScalarType "int4") ExplicitCastContext,EnvCreateCast (ScalarType "lseg") (ScalarType "point") ExplicitCastContext,EnvCreateCast (ScalarType "path") (ScalarType "point") ExplicitCastContext,EnvCreateCast (ScalarType "path") (ScalarType "polygon") AssignmentCastContext,EnvCreateCast (ScalarType "box") (ScalarType "point") ExplicitCastContext,EnvCreateCast (ScalarType "box") (ScalarType "lseg") ExplicitCastContext,EnvCreateCast (ScalarType "box") (ScalarType "polygon") AssignmentCastContext,EnvCreateCast (ScalarType "box") (ScalarType "circle") ExplicitCastContext,EnvCreateCast (ScalarType "polygon") (ScalarType "point") ExplicitCastContext,EnvCreateCast (ScalarType "polygon") (ScalarType "path") AssignmentCastContext,EnvCreateCast (ScalarType "polygon") (ScalarType "box") ExplicitCastContext,EnvCreateCast (ScalarType "polygon") (ScalarType "circle") ExplicitCastContext,EnvCreateCast (ScalarType "circle") (ScalarType "point") ExplicitCastContext,EnvCreateCast (ScalarType "circle") (ScalarType "box") ExplicitCastContext,EnvCreateCast (ScalarType "circle") (ScalarType "polygon") ExplicitCastContext,EnvCreateCast (ScalarType "cidr") (ScalarType "inet") ImplicitCastContext,EnvCreateCast (ScalarType "inet") (ScalarType "cidr") AssignmentCastContext,EnvCreateCast (ScalarType "bit") (ScalarType "varbit") ImplicitCastContext,EnvCreateCast (ScalarType "varbit") (ScalarType "bit") ImplicitCastContext,EnvCreateCast (ScalarType "int8") (ScalarType "bit") ExplicitCastContext,EnvCreateCast (ScalarType "int4") (ScalarType "bit") ExplicitCastContext,EnvCreateCast (ScalarType "bit") (ScalarType "int8") ExplicitCastContext,EnvCreateCast (ScalarType "bit") (ScalarType "int4") ExplicitCastContext,EnvCreateCast (ScalarType "cidr") (ScalarType "text") AssignmentCastContext,EnvCreateCast (ScalarType "inet") (ScalarType "text") AssignmentCastContext,EnvCreateCast (ScalarType "bool") (ScalarType "text") AssignmentCastContext,EnvCreateCast (ScalarType "xml") (ScalarType "text") AssignmentCastContext,EnvCreateCast (ScalarType "text") (ScalarType "xml") ExplicitCastContext,EnvCreateCast (ScalarType "cidr") (ScalarType "varchar") AssignmentCastContext,EnvCreateCast (ScalarType "inet") (ScalarType "varchar") AssignmentCastContext,EnvCreateCast (ScalarType "bool") (ScalarType "varchar") AssignmentCastContext,EnvCreateCast (ScalarType "xml") (ScalarType "varchar") AssignmentCastContext,EnvCreateCast (ScalarType "varchar") (ScalarType "xml") ExplicitCastContext,EnvCreateCast (ScalarType "cidr") (ScalarType "bpchar") AssignmentCastContext,EnvCreateCast (ScalarType "inet") (ScalarType "bpchar") AssignmentCastContext,EnvCreateCast (ScalarType "bool") (ScalarType "bpchar") AssignmentCastContext,EnvCreateCast (ScalarType "xml") (ScalarType "bpchar") AssignmentCastContext,EnvCreateCast (ScalarType "bpchar") (ScalarType "xml") ExplicitCastContext,EnvCreateCast (ScalarType "bpchar") (ScalarType "bpchar") ImplicitCastContext,EnvCreateCast (ScalarType "varchar") (ScalarType "varchar") ImplicitCastContext,EnvCreateCast (ScalarType "time") (ScalarType "time") ImplicitCastContext,EnvCreateCast (ScalarType "timestamp") (ScalarType "timestamp") ImplicitCastContext,EnvCreateCast (ScalarType "timestamptz") (ScalarType "timestamptz") ImplicitCastContext,EnvCreateCast (ScalarType "interval") (ScalarType "interval") ImplicitCastContext,EnvCreateCast (ScalarType "timetz") (ScalarType "timetz") ImplicitCastContext,EnvCreateCast (ScalarType "bit") (ScalarType "bit") ImplicitCastContext,EnvCreateCast (ScalarType "varbit") (ScalarType "varbit") ImplicitCastContext,EnvCreateCast (ScalarType "numeric") (ScalarType "numeric") ImplicitCastContext,EnvCreateFunction FunPrefix "~" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunPrefix "~" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunPrefix "~" [ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunPrefix "~" [ScalarType "bit"] (ScalarType "bit"),EnvCreateFunction FunPrefix "~" [ScalarType "inet"] (ScalarType "inet"),EnvCreateFunction FunPrefix "||/" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunPrefix "|/" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunPrefix "|" [ScalarType "tinterval"] (ScalarType "abstime"),EnvCreateFunction FunPrefix "@@" [ScalarType "circle"] (ScalarType "point"),EnvCreateFunction FunPrefix "@@" [ScalarType "lseg"] (ScalarType "point"),EnvCreateFunction FunPrefix "@@" [ScalarType "path"] (ScalarType "point"),EnvCreateFunction FunPrefix "@@" [ScalarType "polygon"] (ScalarType "point"),EnvCreateFunction FunPrefix "@@" [ScalarType "box"] (ScalarType "point"),EnvCreateFunction FunPrefix "@-@" [ScalarType "path"] (ScalarType "float8"),EnvCreateFunction FunPrefix "@-@" [ScalarType "lseg"] (ScalarType "float8"),EnvCreateFunction FunPrefix "@" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunPrefix "@" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunPrefix "@" [ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunPrefix "@" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunPrefix "@" [ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunPrefix "@" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunPrefix "?|" [ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunPrefix "?|" [ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunPrefix "?-" [ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunPrefix "?-" [ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunPrefix "-" [ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunPrefix "-" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunPrefix "-" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunPrefix "-" [ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunPrefix "-" [ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunPrefix "-" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunPrefix "-" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunPrefix "+" [ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunPrefix "+" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunPrefix "+" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunPrefix "+" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunPrefix "+" [ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunPrefix "+" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunPrefix "#" [ScalarType "path"] (ScalarType "int4"),EnvCreateFunction FunPrefix "#" [ScalarType "polygon"] (ScalarType "int4"),EnvCreateFunction FunPrefix "!!" [ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunPrefix "!!" [ScalarType "tsquery"] (ScalarType "tsquery"),EnvCreateFunction FunPostfix "!" [ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunBinary "~~*" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~~*" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~~*" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~~" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~~" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunBinary "~~" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~~" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~>~" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~>~" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunBinary "~>=~" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunBinary "~>=~" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~=" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "~=" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunBinary "~=" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary "~=" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "~=" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary "~<~" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunBinary "~<~" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~<=~" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunBinary "~<=~" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~*" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~*" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~*" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "~" [ArrayType (ScalarType "aclitem"),ScalarType "aclitem"] (ScalarType "bool"),EnvCreateFunction FunBinary "~" [ScalarType "circle",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary "~" [ScalarType "polygon",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary "~" [ScalarType "path",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary "~" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "~" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "~" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary "~" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "||" [Pseudo AnyArray,Pseudo AnyArray] (Pseudo AnyArray),EnvCreateFunction FunBinary "||" [ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunBinary "||" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "varbit"),EnvCreateFunction FunBinary "||" [Pseudo AnyElement,Pseudo AnyArray] (Pseudo AnyArray),EnvCreateFunction FunBinary "||" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "tsquery"),EnvCreateFunction FunBinary "||" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bytea"),EnvCreateFunction FunBinary "||" [Pseudo AnyNonArray,ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunBinary "||" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "tsvector"),EnvCreateFunction FunBinary "||" [Pseudo AnyArray,Pseudo AnyElement] (Pseudo AnyArray),EnvCreateFunction FunBinary "||" [ScalarType "text",Pseudo AnyNonArray] (ScalarType "text"),EnvCreateFunction FunBinary "|>>" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "|>>" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary "|>>" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "|&>" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "|&>" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "|&>" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary "|" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "|" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary "|" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunBinary "|" [ScalarType "inet",ScalarType "inet"] (ScalarType "inet"),EnvCreateFunction FunBinary "|" [ScalarType "bit",ScalarType "bit"] (ScalarType "bit"),EnvCreateFunction FunBinary "^" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunBinary "^" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunBinary "@@@" [ScalarType "tsquery",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunBinary "@@@" [ScalarType "tsvector",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunBinary "@@" [ScalarType "text",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunBinary "@@" [ScalarType "tsquery",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunBinary "@@" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "@@" [ScalarType "tsvector",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunBinary "@>" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunBinary "@>" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "@>" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunBinary "@>" [ScalarType "polygon",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary "@>" [ScalarType "path",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary "@>" [ArrayType (ScalarType "aclitem"),ScalarType "aclitem"] (ScalarType "bool"),EnvCreateFunction FunBinary "@>" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "@>" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary "@>" [ScalarType "circle",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary "?||" [ScalarType "line",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunBinary "?||" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunBinary "?|" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary "?-|" [ScalarType "line",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunBinary "?-|" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunBinary "?-" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary "?#" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunBinary "?#" [ScalarType "path",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunBinary "?#" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "?#" [ScalarType "lseg",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunBinary "?#" [ScalarType "line",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunBinary "?#" [ScalarType "lseg",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "?#" [ScalarType "line",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary ">^" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary ">^" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary ">>=" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunBinary ">>" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary ">>" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary ">>" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary ">>" [ScalarType "int8",ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunBinary ">>" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary ">>" [ScalarType "int2",ScalarType "int4"] (ScalarType "int2"),EnvCreateFunction FunBinary ">>" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary ">>" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunBinary ">>" [ScalarType "bit",ScalarType "int4"] (ScalarType "bit"),EnvCreateFunction FunBinary ">=" [ScalarType "uuid",ScalarType "uuid"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "macaddr",ScalarType "macaddr"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "char",ScalarType "char"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "int2",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [Pseudo AnyEnum,Pseudo AnyEnum] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "timestamp",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "date",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "float4",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "int4",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "name",ScalarType "name"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "date",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "float8",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "float8",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [Pseudo Record,Pseudo Record] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "int2",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "timestamptz",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "bit",ScalarType "bit"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "timestamp",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "path",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "timestamptz",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "int8",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "int2",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "int8",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "oid",ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "date",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "tid",ScalarType "tid"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "money",ScalarType "money"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "oidvector",ScalarType "oidvector"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "interval",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "reltime",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "int4",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "int8",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary ">=" [ScalarType "float4",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "macaddr",ScalarType "macaddr"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "int4",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "int8",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "char",ScalarType "char"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "int4",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "interval",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [Pseudo AnyEnum,Pseudo AnyEnum] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "reltime",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "timestamptz",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "int2",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "date",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "int8",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "timestamp",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "uuid",ScalarType "uuid"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "bit",ScalarType "bit"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "name",ScalarType "name"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "float4",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "oidvector",ScalarType "oidvector"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "path",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [Pseudo Record,Pseudo Record] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "int2",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "timestamp",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "oid",ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "float8",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "int2",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "date",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "date",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "float8",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "timestamptz",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "money",ScalarType "money"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "float4",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "tid",ScalarType "tid"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "int8",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary ">" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "int4",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "reltime",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "int2",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "date",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "oid",ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "interval",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "date",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "oidvector",ScalarType "oidvector"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "float4",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "int8",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "timestamp",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "int2",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "float8",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "timestamptz",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "timestamp",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "path",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "bit",ScalarType "bit"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "timestamptz",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "int8",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "int8",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "money",ScalarType "money"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "tid",ScalarType "tid"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "aclitem",ScalarType "aclitem"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "uuid",ScalarType "uuid"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "int2vector",ScalarType "int2vector"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [Pseudo Record,Pseudo Record] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "cid",ScalarType "cid"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "xid",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "macaddr",ScalarType "macaddr"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "line",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [Pseudo AnyEnum,Pseudo AnyEnum] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "xid",ScalarType "xid"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "date",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "float4",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "float8",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "int4",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "int2",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "name",ScalarType "name"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "char",ScalarType "char"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary "=" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "bool"),EnvCreateFunction FunBinary "<^" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary "<^" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "<@" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunBinary "<@" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunBinary "<@" [ScalarType "lseg",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "<@" [ScalarType "lseg",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunBinary "<@" [ScalarType "point",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunBinary "<@" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "<@" [ScalarType "point",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "<@" [ScalarType "point",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary "<@" [ScalarType "point",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunBinary "<@" [ScalarType "point",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "<@" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "<@" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary "<@" [ScalarType "point",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunBinary "<?>" [ScalarType "abstime",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "float4",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "reltime",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "int4",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "int8",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "interval",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "date",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "oidvector",ScalarType "oidvector"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "int4",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "char",ScalarType "char"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "int2",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "oid",ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "int8",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "date",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "int8",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "bit",ScalarType "bit"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "int2",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "date",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "name",ScalarType "name"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "int2",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "timestamp",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "money",ScalarType "money"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "float8",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [Pseudo AnyEnum,Pseudo AnyEnum] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "timestamptz",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "timestamp",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "uuid",ScalarType "uuid"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "tid",ScalarType "tid"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "float4",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "float8",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "timestamptz",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [Pseudo Record,Pseudo Record] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunBinary "<>" [ScalarType "macaddr",ScalarType "macaddr"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "oidvector",ScalarType "oidvector"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "oid",ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "reltime",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [Pseudo AnyEnum,Pseudo AnyEnum] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "float8",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "uuid",ScalarType "uuid"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "float4",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "tid",ScalarType "tid"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "int8",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "interval",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "int8",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "date",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "macaddr",ScalarType "macaddr"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "timestamptz",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "timestamp",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "timestamptz",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "money",ScalarType "money"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "timestamp",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [Pseudo Record,Pseudo Record] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "int4",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "date",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "path",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "bit",ScalarType "bit"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "int2",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "date",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "int2",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "int4",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "float8",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "name",ScalarType "name"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "int2",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "char",ScalarType "char"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "int8",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "float4",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "bool"),EnvCreateFunction FunBinary "<=" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunBinary "<<|" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary "<<|" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "<<|" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "<<=" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunBinary "<<" [ScalarType "int2",ScalarType "int4"] (ScalarType "int2"),EnvCreateFunction FunBinary "<<" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunBinary "<<" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunBinary "<<" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "<<" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "<<" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary "<<" [ScalarType "int8",ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunBinary "<<" [ScalarType "bit",ScalarType "int4"] (ScalarType "bit"),EnvCreateFunction FunBinary "<<" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary "<<" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunBinary "<->" [ScalarType "point",ScalarType "point"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "circle",ScalarType "polygon"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "point",ScalarType "line"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "point",ScalarType "path"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "circle",ScalarType "circle"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "point",ScalarType "circle"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "lseg",ScalarType "box"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "point",ScalarType "lseg"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "lseg",ScalarType "line"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "point",ScalarType "box"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "box",ScalarType "box"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "line",ScalarType "line"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "path",ScalarType "path"] (ScalarType "float8"),EnvCreateFunction FunBinary "<->" [ScalarType "line",ScalarType "box"] (ScalarType "float8"),EnvCreateFunction FunBinary "<#>" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "tinterval"),EnvCreateFunction FunBinary "<" [ScalarType "oidvector",ScalarType "oidvector"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "money",ScalarType "money"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "float8",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "timestamptz",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [Pseudo AnyEnum,Pseudo AnyEnum] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "float8",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "timestamp",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "int8",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "float4",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "path",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "bit",ScalarType "bit"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "date",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "char",ScalarType "char"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [Pseudo Record,Pseudo Record] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "name",ScalarType "name"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "interval",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "date",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "int8",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "int2",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "int2",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "int8",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "macaddr",ScalarType "macaddr"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "tid",ScalarType "tid"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "float4",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "timestamptz",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "int4",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "uuid",ScalarType "uuid"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "timestamp",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "oid",ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "date",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "int2",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "int4",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "reltime",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunBinary "<" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunBinary "/" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary "/" [ScalarType "int2",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "/" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunBinary "/" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunBinary "/" [ScalarType "money",ScalarType "float4"] (ScalarType "money"),EnvCreateFunction FunBinary "/" [ScalarType "int8",ScalarType "int2"] (ScalarType "int8"),EnvCreateFunction FunBinary "/" [ScalarType "int4",ScalarType "int2"] (ScalarType "int4"),EnvCreateFunction FunBinary "/" [ScalarType "point",ScalarType "point"] (ScalarType "point"),EnvCreateFunction FunBinary "/" [ScalarType "circle",ScalarType "point"] (ScalarType "circle"),EnvCreateFunction FunBinary "/" [ScalarType "int4",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "/" [ScalarType "float8",ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunBinary "/" [ScalarType "money",ScalarType "int4"] (ScalarType "money"),EnvCreateFunction FunBinary "/" [ScalarType "path",ScalarType "point"] (ScalarType "path"),EnvCreateFunction FunBinary "/" [ScalarType "interval",ScalarType "float8"] (ScalarType "interval"),EnvCreateFunction FunBinary "/" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "/" [ScalarType "int8",ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunBinary "/" [ScalarType "int2",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary "/" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunBinary "/" [ScalarType "float4",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunBinary "/" [ScalarType "money",ScalarType "int2"] (ScalarType "money"),EnvCreateFunction FunBinary "/" [ScalarType "float4",ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunBinary "/" [ScalarType "money",ScalarType "float8"] (ScalarType "money"),EnvCreateFunction FunBinary "/" [ScalarType "box",ScalarType "point"] (ScalarType "box"),EnvCreateFunction FunBinary "-" [ScalarType "interval",ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunBinary "-" [ScalarType "timestamptz",ScalarType "interval"] (ScalarType "timestamptz"),EnvCreateFunction FunBinary "-" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "interval"),EnvCreateFunction FunBinary "-" [ScalarType "circle",ScalarType "point"] (ScalarType "circle"),EnvCreateFunction FunBinary "-" [ScalarType "float8",ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunBinary "-" [ScalarType "float4",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunBinary "-" [ScalarType "date",ScalarType "int4"] (ScalarType "date"),EnvCreateFunction FunBinary "-" [ScalarType "date",ScalarType "date"] (ScalarType "int4"),EnvCreateFunction FunBinary "-" [ScalarType "date",ScalarType "interval"] (ScalarType "timestamp"),EnvCreateFunction FunBinary "-" [ArrayType (ScalarType "aclitem"),ScalarType "aclitem"] (ArrayType (ScalarType "aclitem")),EnvCreateFunction FunBinary "-" [ScalarType "money",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunBinary "-" [ScalarType "inet",ScalarType "int8"] (ScalarType "inet"),EnvCreateFunction FunBinary "-" [ScalarType "inet",ScalarType "inet"] (ScalarType "int8"),EnvCreateFunction FunBinary "-" [ScalarType "box",ScalarType "point"] (ScalarType "box"),EnvCreateFunction FunBinary "-" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunBinary "-" [ScalarType "path",ScalarType "point"] (ScalarType "path"),EnvCreateFunction FunBinary "-" [ScalarType "point",ScalarType "point"] (ScalarType "point"),EnvCreateFunction FunBinary "-" [ScalarType "int2",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "-" [ScalarType "int8",ScalarType "int2"] (ScalarType "int8"),EnvCreateFunction FunBinary "-" [ScalarType "int4",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "-" [ScalarType "int8",ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunBinary "-" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "-" [ScalarType "time",ScalarType "interval"] (ScalarType "time"),EnvCreateFunction FunBinary "-" [ScalarType "timetz",ScalarType "interval"] (ScalarType "timetz"),EnvCreateFunction FunBinary "-" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunBinary "-" [ScalarType "float4",ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunBinary "-" [ScalarType "abstime",ScalarType "reltime"] (ScalarType "abstime"),EnvCreateFunction FunBinary "-" [ScalarType "int4",ScalarType "int2"] (ScalarType "int4"),EnvCreateFunction FunBinary "-" [ScalarType "int2",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary "-" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary "-" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunBinary "-" [ScalarType "timestamp",ScalarType "interval"] (ScalarType "timestamp"),EnvCreateFunction FunBinary "-" [ScalarType "time",ScalarType "time"] (ScalarType "interval"),EnvCreateFunction FunBinary "-" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "interval"),EnvCreateFunction FunBinary "+" [ScalarType "interval",ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunBinary "+" [ScalarType "date",ScalarType "time"] (ScalarType "timestamp"),EnvCreateFunction FunBinary "+" [ScalarType "int4",ScalarType "int2"] (ScalarType "int4"),EnvCreateFunction FunBinary "+" [ScalarType "int2",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary "+" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary "+" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunBinary "+" [ScalarType "timetz",ScalarType "interval"] (ScalarType "timetz"),EnvCreateFunction FunBinary "+" [ScalarType "time",ScalarType "interval"] (ScalarType "time"),EnvCreateFunction FunBinary "+" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "+" [ScalarType "int8",ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunBinary "+" [ScalarType "int4",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "+" [ScalarType "timestamp",ScalarType "interval"] (ScalarType "timestamp"),EnvCreateFunction FunBinary "+" [ScalarType "time",ScalarType "date"] (ScalarType "timestamp"),EnvCreateFunction FunBinary "+" [ScalarType "int8",ScalarType "int2"] (ScalarType "int8"),EnvCreateFunction FunBinary "+" [ScalarType "date",ScalarType "timetz"] (ScalarType "timestamptz"),EnvCreateFunction FunBinary "+" [ScalarType "int2",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "+" [ScalarType "point",ScalarType "point"] (ScalarType "point"),EnvCreateFunction FunBinary "+" [ScalarType "path",ScalarType "path"] (ScalarType "path"),EnvCreateFunction FunBinary "+" [ScalarType "path",ScalarType "point"] (ScalarType "path"),EnvCreateFunction FunBinary "+" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunBinary "+" [ScalarType "box",ScalarType "point"] (ScalarType "box"),EnvCreateFunction FunBinary "+" [ScalarType "money",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunBinary "+" [ScalarType "int8",ScalarType "inet"] (ScalarType "inet"),EnvCreateFunction FunBinary "+" [ArrayType (ScalarType "aclitem"),ScalarType "aclitem"] (ArrayType (ScalarType "aclitem")),EnvCreateFunction FunBinary "+" [ScalarType "inet",ScalarType "int8"] (ScalarType "inet"),EnvCreateFunction FunBinary "+" [ScalarType "interval",ScalarType "date"] (ScalarType "timestamp"),EnvCreateFunction FunBinary "+" [ScalarType "date",ScalarType "interval"] (ScalarType "timestamp"),EnvCreateFunction FunBinary "+" [ScalarType "timetz",ScalarType "date"] (ScalarType "timestamptz"),EnvCreateFunction FunBinary "+" [ScalarType "interval",ScalarType "timetz"] (ScalarType "timetz"),EnvCreateFunction FunBinary "+" [ScalarType "interval",ScalarType "timestamp"] (ScalarType "timestamp"),EnvCreateFunction FunBinary "+" [ScalarType "date",ScalarType "int4"] (ScalarType "date"),EnvCreateFunction FunBinary "+" [ScalarType "interval",ScalarType "timestamptz"] (ScalarType "timestamptz"),EnvCreateFunction FunBinary "+" [ScalarType "int4",ScalarType "date"] (ScalarType "date"),EnvCreateFunction FunBinary "+" [ScalarType "float4",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunBinary "+" [ScalarType "float8",ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunBinary "+" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunBinary "+" [ScalarType "float4",ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunBinary "+" [ScalarType "circle",ScalarType "point"] (ScalarType "circle"),EnvCreateFunction FunBinary "+" [ScalarType "timestamptz",ScalarType "interval"] (ScalarType "timestamptz"),EnvCreateFunction FunBinary "+" [ScalarType "abstime",ScalarType "reltime"] (ScalarType "abstime"),EnvCreateFunction FunBinary "+" [ScalarType "interval",ScalarType "time"] (ScalarType "time"),EnvCreateFunction FunBinary "*" [ScalarType "point",ScalarType "point"] (ScalarType "point"),EnvCreateFunction FunBinary "*" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunBinary "*" [ScalarType "path",ScalarType "point"] (ScalarType "path"),EnvCreateFunction FunBinary "*" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunBinary "*" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary "*" [ScalarType "box",ScalarType "point"] (ScalarType "box"),EnvCreateFunction FunBinary "*" [ScalarType "money",ScalarType "float4"] (ScalarType "money"),EnvCreateFunction FunBinary "*" [ScalarType "float4",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunBinary "*" [ScalarType "money",ScalarType "float8"] (ScalarType "money"),EnvCreateFunction FunBinary "*" [ScalarType "money",ScalarType "int4"] (ScalarType "money"),EnvCreateFunction FunBinary "*" [ScalarType "money",ScalarType "int2"] (ScalarType "money"),EnvCreateFunction FunBinary "*" [ScalarType "float8",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunBinary "*" [ScalarType "int4",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunBinary "*" [ScalarType "int2",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunBinary "*" [ScalarType "circle",ScalarType "point"] (ScalarType "circle"),EnvCreateFunction FunBinary "*" [ScalarType "float4",ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunBinary "*" [ScalarType "float8",ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunBinary "*" [ScalarType "interval",ScalarType "float8"] (ScalarType "interval"),EnvCreateFunction FunBinary "*" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunBinary "*" [ScalarType "int4",ScalarType "int2"] (ScalarType "int4"),EnvCreateFunction FunBinary "*" [ScalarType "int2",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary "*" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "*" [ScalarType "int8",ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunBinary "*" [ScalarType "float4",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunBinary "*" [ScalarType "int4",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "*" [ScalarType "int8",ScalarType "int2"] (ScalarType "int8"),EnvCreateFunction FunBinary "*" [ScalarType "int2",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "*" [ScalarType "float8",ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunBinary "&>" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "&>" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "&>" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary "&<|" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary "&<|" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "&<|" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "&<" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary "&<" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "&<" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "&&" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunBinary "&&" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunBinary "&&" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunBinary "&&" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunBinary "&&" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunBinary "&&" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "tsquery"),EnvCreateFunction FunBinary "&" [ScalarType "inet",ScalarType "inet"] (ScalarType "inet"),EnvCreateFunction FunBinary "&" [ScalarType "bit",ScalarType "bit"] (ScalarType "bit"),EnvCreateFunction FunBinary "&" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "&" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary "&" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunBinary "%" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunBinary "%" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunBinary "%" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary "%" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "#>=" [ScalarType "tinterval",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunBinary "#>" [ScalarType "tinterval",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunBinary "#=" [ScalarType "tinterval",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunBinary "#<>" [ScalarType "tinterval",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunBinary "#<=" [ScalarType "tinterval",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunBinary "#<" [ScalarType "tinterval",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunBinary "##" [ScalarType "line",ScalarType "lseg"] (ScalarType "point"),EnvCreateFunction FunBinary "##" [ScalarType "lseg",ScalarType "line"] (ScalarType "point"),EnvCreateFunction FunBinary "##" [ScalarType "point",ScalarType "box"] (ScalarType "point"),EnvCreateFunction FunBinary "##" [ScalarType "lseg",ScalarType "box"] (ScalarType "point"),EnvCreateFunction FunBinary "##" [ScalarType "line",ScalarType "box"] (ScalarType "point"),EnvCreateFunction FunBinary "##" [ScalarType "point",ScalarType "line"] (ScalarType "point"),EnvCreateFunction FunBinary "##" [ScalarType "point",ScalarType "lseg"] (ScalarType "point"),EnvCreateFunction FunBinary "##" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "point"),EnvCreateFunction FunBinary "#" [ScalarType "bit",ScalarType "bit"] (ScalarType "bit"),EnvCreateFunction FunBinary "#" [ScalarType "line",ScalarType "line"] (ScalarType "point"),EnvCreateFunction FunBinary "#" [ScalarType "box",ScalarType "box"] (ScalarType "box"),EnvCreateFunction FunBinary "#" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunBinary "#" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunBinary "#" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunBinary "#" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "point"),EnvCreateFunction FunBinary "!~~*" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "!~~*" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "!~~*" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "!~~" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunBinary "!~~" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "!~~" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "!~~" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "!~*" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "!~*" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "!~*" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "!~" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "!~" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunBinary "!~" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "RI_FKey_cascade_del" [] (Pseudo Trigger),EnvCreateFunction FunName "RI_FKey_cascade_upd" [] (Pseudo Trigger),EnvCreateFunction FunName "RI_FKey_check_ins" [] (Pseudo Trigger),EnvCreateFunction FunName "RI_FKey_check_upd" [] (Pseudo Trigger),EnvCreateFunction FunName "RI_FKey_noaction_del" [] (Pseudo Trigger),EnvCreateFunction FunName "RI_FKey_noaction_upd" [] (Pseudo Trigger),EnvCreateFunction FunName "RI_FKey_restrict_del" [] (Pseudo Trigger),EnvCreateFunction FunName "RI_FKey_restrict_upd" [] (Pseudo Trigger),EnvCreateFunction FunName "RI_FKey_setdefault_del" [] (Pseudo Trigger),EnvCreateFunction FunName "RI_FKey_setdefault_upd" [] (Pseudo Trigger),EnvCreateFunction FunName "RI_FKey_setnull_del" [] (Pseudo Trigger),EnvCreateFunction FunName "RI_FKey_setnull_upd" [] (Pseudo Trigger),EnvCreateFunction FunName "abbrev" [ScalarType "cidr"] (ScalarType "text"),EnvCreateFunction FunName "abbrev" [ScalarType "inet"] (ScalarType "text"),EnvCreateFunction FunName "abs" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "abs" [ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "abs" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "abs" [ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunName "abs" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "abs" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "abstime" [ScalarType "timestamp"] (ScalarType "abstime"),EnvCreateFunction FunName "abstime" [ScalarType "timestamptz"] (ScalarType "abstime"),EnvCreateFunction FunName "abstimeeq" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "bool"),EnvCreateFunction FunName "abstimege" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "bool"),EnvCreateFunction FunName "abstimegt" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "bool"),EnvCreateFunction FunName "abstimein" [Pseudo Cstring] (ScalarType "abstime"),EnvCreateFunction FunName "abstimele" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "bool"),EnvCreateFunction FunName "abstimelt" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "bool"),EnvCreateFunction FunName "abstimene" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "bool"),EnvCreateFunction FunName "abstimeout" [ScalarType "abstime"] (Pseudo Cstring),EnvCreateFunction FunName "abstimerecv" [Pseudo Internal] (ScalarType "abstime"),EnvCreateFunction FunName "abstimesend" [ScalarType "abstime"] (ScalarType "bytea"),EnvCreateFunction FunName "aclcontains" [ArrayType (ScalarType "aclitem"),ScalarType "aclitem"] (ScalarType "bool"),EnvCreateFunction FunName "aclinsert" [ArrayType (ScalarType "aclitem"),ScalarType "aclitem"] (ArrayType (ScalarType "aclitem")),EnvCreateFunction FunName "aclitemeq" [ScalarType "aclitem",ScalarType "aclitem"] (ScalarType "bool"),EnvCreateFunction FunName "aclitemin" [Pseudo Cstring] (ScalarType "aclitem"),EnvCreateFunction FunName "aclitemout" [ScalarType "aclitem"] (Pseudo Cstring),EnvCreateFunction FunName "aclremove" [ArrayType (ScalarType "aclitem"),ScalarType "aclitem"] (ArrayType (ScalarType "aclitem")),EnvCreateFunction FunName "acos" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "age" [ScalarType "xid"] (ScalarType "int4"),EnvCreateFunction FunName "age" [ScalarType "timestamp"] (ScalarType "interval"),EnvCreateFunction FunName "age" [ScalarType "timestamptz"] (ScalarType "interval"),EnvCreateFunction FunName "age" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "interval"),EnvCreateFunction FunName "age" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "interval"),EnvCreateFunction FunName "any_in" [Pseudo Cstring] (Pseudo Any),EnvCreateFunction FunName "any_out" [Pseudo Any] (Pseudo Cstring),EnvCreateFunction FunName "anyarray_in" [Pseudo Cstring] (Pseudo AnyArray),EnvCreateFunction FunName "anyarray_out" [Pseudo AnyArray] (Pseudo Cstring),EnvCreateFunction FunName "anyarray_recv" [Pseudo Internal] (Pseudo AnyArray),EnvCreateFunction FunName "anyarray_send" [Pseudo AnyArray] (ScalarType "bytea"),EnvCreateFunction FunName "anyelement_in" [Pseudo Cstring] (Pseudo AnyElement),EnvCreateFunction FunName "anyelement_out" [Pseudo AnyElement] (Pseudo Cstring),EnvCreateFunction FunName "anyenum_in" [Pseudo Cstring] (Pseudo AnyEnum),EnvCreateFunction FunName "anyenum_out" [Pseudo AnyEnum] (Pseudo Cstring),EnvCreateFunction FunName "anynonarray_in" [Pseudo Cstring] (Pseudo AnyNonArray),EnvCreateFunction FunName "anynonarray_out" [Pseudo AnyNonArray] (Pseudo Cstring),EnvCreateFunction FunName "anytextcat" [Pseudo AnyNonArray,ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "area" [ScalarType "path"] (ScalarType "float8"),EnvCreateFunction FunName "area" [ScalarType "box"] (ScalarType "float8"),EnvCreateFunction FunName "area" [ScalarType "circle"] (ScalarType "float8"),EnvCreateFunction FunName "areajoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "areasel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "array_agg_finalfn" [Pseudo Internal] (Pseudo AnyArray),EnvCreateFunction FunName "array_agg_transfn" [Pseudo Internal,Pseudo AnyElement] (Pseudo Internal),EnvCreateFunction FunName "array_append" [Pseudo AnyArray,Pseudo AnyElement] (Pseudo AnyArray),EnvCreateFunction FunName "array_cat" [Pseudo AnyArray,Pseudo AnyArray] (Pseudo AnyArray),EnvCreateFunction FunName "array_dims" [Pseudo AnyArray] (ScalarType "text"),EnvCreateFunction FunName "array_eq" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunName "array_fill" [Pseudo AnyElement,ArrayType (ScalarType "int4")] (Pseudo AnyArray),EnvCreateFunction FunName "array_fill" [Pseudo AnyElement,ArrayType (ScalarType "int4"),ArrayType (ScalarType "int4")] (Pseudo AnyArray),EnvCreateFunction FunName "array_ge" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunName "array_gt" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunName "array_in" [Pseudo Cstring,ScalarType "oid",ScalarType "int4"] (Pseudo AnyArray),EnvCreateFunction FunName "array_larger" [Pseudo AnyArray,Pseudo AnyArray] (Pseudo AnyArray),EnvCreateFunction FunName "array_le" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunName "array_length" [Pseudo AnyArray,ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "array_lower" [Pseudo AnyArray,ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "array_lt" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunName "array_ndims" [Pseudo AnyArray] (ScalarType "int4"),EnvCreateFunction FunName "array_ne" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunName "array_out" [Pseudo AnyArray] (Pseudo Cstring),EnvCreateFunction FunName "array_prepend" [Pseudo AnyElement,Pseudo AnyArray] (Pseudo AnyArray),EnvCreateFunction FunName "array_recv" [Pseudo Internal,ScalarType "oid",ScalarType "int4"] (Pseudo AnyArray),EnvCreateFunction FunName "array_send" [Pseudo AnyArray] (ScalarType "bytea"),EnvCreateFunction FunName "array_smaller" [Pseudo AnyArray,Pseudo AnyArray] (Pseudo AnyArray),EnvCreateFunction FunName "array_to_string" [Pseudo AnyArray,ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "array_upper" [Pseudo AnyArray,ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "arraycontained" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunName "arraycontains" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunName "arrayoverlap" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "bool"),EnvCreateFunction FunName "ascii" [ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "ascii_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "ascii_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "asin" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "atan" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "atan2" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "big5_to_euc_tw" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "big5_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "big5_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "bit" [ScalarType "int8",ScalarType "int4"] (ScalarType "bit"),EnvCreateFunction FunName "bit" [ScalarType "int4",ScalarType "int4"] (ScalarType "bit"),EnvCreateFunction FunName "bit" [ScalarType "bit",ScalarType "int4",ScalarType "bool"] (ScalarType "bit"),EnvCreateFunction FunName "bit_in" [Pseudo Cstring,ScalarType "oid",ScalarType "int4"] (ScalarType "bit"),EnvCreateFunction FunName "bit_length" [ScalarType "bytea"] (ScalarType "int4"),EnvCreateFunction FunName "bit_length" [ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "bit_length" [ScalarType "bit"] (ScalarType "int4"),EnvCreateFunction FunName "bit_out" [ScalarType "bit"] (Pseudo Cstring),EnvCreateFunction FunName "bit_recv" [Pseudo Internal,ScalarType "oid",ScalarType "int4"] (ScalarType "bit"),EnvCreateFunction FunName "bit_send" [ScalarType "bit"] (ScalarType "bytea"),EnvCreateFunction FunName "bitand" [ScalarType "bit",ScalarType "bit"] (ScalarType "bit"),EnvCreateFunction FunName "bitcat" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "varbit"),EnvCreateFunction FunName "bitcmp" [ScalarType "bit",ScalarType "bit"] (ScalarType "int4"),EnvCreateFunction FunName "biteq" [ScalarType "bit",ScalarType "bit"] (ScalarType "bool"),EnvCreateFunction FunName "bitge" [ScalarType "bit",ScalarType "bit"] (ScalarType "bool"),EnvCreateFunction FunName "bitgt" [ScalarType "bit",ScalarType "bit"] (ScalarType "bool"),EnvCreateFunction FunName "bitle" [ScalarType "bit",ScalarType "bit"] (ScalarType "bool"),EnvCreateFunction FunName "bitlt" [ScalarType "bit",ScalarType "bit"] (ScalarType "bool"),EnvCreateFunction FunName "bitne" [ScalarType "bit",ScalarType "bit"] (ScalarType "bool"),EnvCreateFunction FunName "bitnot" [ScalarType "bit"] (ScalarType "bit"),EnvCreateFunction FunName "bitor" [ScalarType "bit",ScalarType "bit"] (ScalarType "bit"),EnvCreateFunction FunName "bitshiftleft" [ScalarType "bit",ScalarType "int4"] (ScalarType "bit"),EnvCreateFunction FunName "bitshiftright" [ScalarType "bit",ScalarType "int4"] (ScalarType "bit"),EnvCreateFunction FunName "bittypmodin" [ArrayType (Pseudo Cstring)] (ScalarType "int4"),EnvCreateFunction FunName "bittypmodout" [ScalarType "int4"] (Pseudo Cstring),EnvCreateFunction FunName "bitxor" [ScalarType "bit",ScalarType "bit"] (ScalarType "bit"),EnvCreateFunction FunName "bool" [ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "booland_statefunc" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunName "booleq" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunName "boolge" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunName "boolgt" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunName "boolin" [Pseudo Cstring] (ScalarType "bool"),EnvCreateFunction FunName "boolle" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunName "boollt" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunName "boolne" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunName "boolor_statefunc" [ScalarType "bool",ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunName "boolout" [ScalarType "bool"] (Pseudo Cstring),EnvCreateFunction FunName "boolrecv" [Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "boolsend" [ScalarType "bool"] (ScalarType "bytea"),EnvCreateFunction FunName "box" [ScalarType "polygon"] (ScalarType "box"),EnvCreateFunction FunName "box" [ScalarType "circle"] (ScalarType "box"),EnvCreateFunction FunName "box" [ScalarType "point",ScalarType "point"] (ScalarType "box"),EnvCreateFunction FunName "box_above" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_above_eq" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_add" [ScalarType "box",ScalarType "point"] (ScalarType "box"),EnvCreateFunction FunName "box_below" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_below_eq" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_center" [ScalarType "box"] (ScalarType "point"),EnvCreateFunction FunName "box_contain" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_contained" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_distance" [ScalarType "box",ScalarType "box"] (ScalarType "float8"),EnvCreateFunction FunName "box_div" [ScalarType "box",ScalarType "point"] (ScalarType "box"),EnvCreateFunction FunName "box_eq" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_ge" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_gt" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_in" [Pseudo Cstring] (ScalarType "box"),EnvCreateFunction FunName "box_intersect" [ScalarType "box",ScalarType "box"] (ScalarType "box"),EnvCreateFunction FunName "box_le" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_left" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_lt" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_mul" [ScalarType "box",ScalarType "point"] (ScalarType "box"),EnvCreateFunction FunName "box_out" [ScalarType "box"] (Pseudo Cstring),EnvCreateFunction FunName "box_overabove" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_overbelow" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_overlap" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_overleft" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_overright" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_recv" [Pseudo Internal] (ScalarType "box"),EnvCreateFunction FunName "box_right" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_same" [ScalarType "box",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "box_send" [ScalarType "box"] (ScalarType "bytea"),EnvCreateFunction FunName "box_sub" [ScalarType "box",ScalarType "point"] (ScalarType "box"),EnvCreateFunction FunName "bpchar" [ScalarType "char"] (ScalarType "bpchar"),EnvCreateFunction FunName "bpchar" [ScalarType "name"] (ScalarType "bpchar"),EnvCreateFunction FunName "bpchar" [ScalarType "bpchar",ScalarType "int4",ScalarType "bool"] (ScalarType "bpchar"),EnvCreateFunction FunName "bpchar_larger" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bpchar"),EnvCreateFunction FunName "bpchar_pattern_ge" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunName "bpchar_pattern_gt" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunName "bpchar_pattern_le" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunName "bpchar_pattern_lt" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunName "bpchar_smaller" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bpchar"),EnvCreateFunction FunName "bpcharcmp" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "int4"),EnvCreateFunction FunName "bpchareq" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunName "bpcharge" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunName "bpchargt" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunName "bpchariclike" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "bpcharicnlike" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "bpcharicregexeq" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "bpcharicregexne" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "bpcharin" [Pseudo Cstring,ScalarType "oid",ScalarType "int4"] (ScalarType "bpchar"),EnvCreateFunction FunName "bpcharle" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunName "bpcharlike" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "bpcharlt" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunName "bpcharne" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "bool"),EnvCreateFunction FunName "bpcharnlike" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "bpcharout" [ScalarType "bpchar"] (Pseudo Cstring),EnvCreateFunction FunName "bpcharrecv" [Pseudo Internal,ScalarType "oid",ScalarType "int4"] (ScalarType "bpchar"),EnvCreateFunction FunName "bpcharregexeq" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "bpcharregexne" [ScalarType "bpchar",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "bpcharsend" [ScalarType "bpchar"] (ScalarType "bytea"),EnvCreateFunction FunName "bpchartypmodin" [ArrayType (Pseudo Cstring)] (ScalarType "int4"),EnvCreateFunction FunName "bpchartypmodout" [ScalarType "int4"] (Pseudo Cstring),EnvCreateFunction FunName "broadcast" [ScalarType "inet"] (ScalarType "inet"),EnvCreateFunction FunName "btabstimecmp" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "int4"),EnvCreateFunction FunName "btarraycmp" [Pseudo AnyArray,Pseudo AnyArray] (ScalarType "int4"),EnvCreateFunction FunName "btbeginscan" [Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "btboolcmp" [ScalarType "bool",ScalarType "bool"] (ScalarType "int4"),EnvCreateFunction FunName "btbpchar_pattern_cmp" [ScalarType "bpchar",ScalarType "bpchar"] (ScalarType "int4"),EnvCreateFunction FunName "btbuild" [Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "btbulkdelete" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "btcharcmp" [ScalarType "char",ScalarType "char"] (ScalarType "int4"),EnvCreateFunction FunName "btcostestimate" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "btendscan" [Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "btfloat48cmp" [ScalarType "float4",ScalarType "float8"] (ScalarType "int4"),EnvCreateFunction FunName "btfloat4cmp" [ScalarType "float4",ScalarType "float4"] (ScalarType "int4"),EnvCreateFunction FunName "btfloat84cmp" [ScalarType "float8",ScalarType "float4"] (ScalarType "int4"),EnvCreateFunction FunName "btfloat8cmp" [ScalarType "float8",ScalarType "float8"] (ScalarType "int4"),EnvCreateFunction FunName "btgetbitmap" [Pseudo Internal,Pseudo Internal] (ScalarType "int8"),EnvCreateFunction FunName "btgettuple" [Pseudo Internal,Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "btinsert" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "btint24cmp" [ScalarType "int2",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "btint28cmp" [ScalarType "int2",ScalarType "int8"] (ScalarType "int4"),EnvCreateFunction FunName "btint2cmp" [ScalarType "int2",ScalarType "int2"] (ScalarType "int4"),EnvCreateFunction FunName "btint42cmp" [ScalarType "int4",ScalarType "int2"] (ScalarType "int4"),EnvCreateFunction FunName "btint48cmp" [ScalarType "int4",ScalarType "int8"] (ScalarType "int4"),EnvCreateFunction FunName "btint4cmp" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "btint82cmp" [ScalarType "int8",ScalarType "int2"] (ScalarType "int4"),EnvCreateFunction FunName "btint84cmp" [ScalarType "int8",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "btint8cmp" [ScalarType "int8",ScalarType "int8"] (ScalarType "int4"),EnvCreateFunction FunName "btmarkpos" [Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "btnamecmp" [ScalarType "name",ScalarType "name"] (ScalarType "int4"),EnvCreateFunction FunName "btoidcmp" [ScalarType "oid",ScalarType "oid"] (ScalarType "int4"),EnvCreateFunction FunName "btoidvectorcmp" [ScalarType "oidvector",ScalarType "oidvector"] (ScalarType "int4"),EnvCreateFunction FunName "btoptions" [ArrayType (ScalarType "text"),ScalarType "bool"] (ScalarType "bytea"),EnvCreateFunction FunName "btrecordcmp" [Pseudo Record,Pseudo Record] (ScalarType "int4"),EnvCreateFunction FunName "btreltimecmp" [ScalarType "reltime",ScalarType "reltime"] (ScalarType "int4"),EnvCreateFunction FunName "btrescan" [Pseudo Internal,Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "btrestrpos" [Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "btrim" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "btrim" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bytea"),EnvCreateFunction FunName "btrim" [ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "bttext_pattern_cmp" [ScalarType "text",ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "bttextcmp" [ScalarType "text",ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "bttidcmp" [ScalarType "tid",ScalarType "tid"] (ScalarType "int4"),EnvCreateFunction FunName "bttintervalcmp" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "int4"),EnvCreateFunction FunName "btvacuumcleanup" [Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "byteacat" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bytea"),EnvCreateFunction FunName "byteacmp" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "int4"),EnvCreateFunction FunName "byteaeq" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunName "byteage" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunName "byteagt" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunName "byteain" [Pseudo Cstring] (ScalarType "bytea"),EnvCreateFunction FunName "byteale" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunName "bytealike" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunName "bytealt" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunName "byteane" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunName "byteanlike" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunName "byteaout" [ScalarType "bytea"] (Pseudo Cstring),EnvCreateFunction FunName "bytearecv" [Pseudo Internal] (ScalarType "bytea"),EnvCreateFunction FunName "byteasend" [ScalarType "bytea"] (ScalarType "bytea"),EnvCreateFunction FunName "cash_cmp" [ScalarType "money",ScalarType "money"] (ScalarType "int4"),EnvCreateFunction FunName "cash_div_flt4" [ScalarType "money",ScalarType "float4"] (ScalarType "money"),EnvCreateFunction FunName "cash_div_flt8" [ScalarType "money",ScalarType "float8"] (ScalarType "money"),EnvCreateFunction FunName "cash_div_int2" [ScalarType "money",ScalarType "int2"] (ScalarType "money"),EnvCreateFunction FunName "cash_div_int4" [ScalarType "money",ScalarType "int4"] (ScalarType "money"),EnvCreateFunction FunName "cash_eq" [ScalarType "money",ScalarType "money"] (ScalarType "bool"),EnvCreateFunction FunName "cash_ge" [ScalarType "money",ScalarType "money"] (ScalarType "bool"),EnvCreateFunction FunName "cash_gt" [ScalarType "money",ScalarType "money"] (ScalarType "bool"),EnvCreateFunction FunName "cash_in" [Pseudo Cstring] (ScalarType "money"),EnvCreateFunction FunName "cash_le" [ScalarType "money",ScalarType "money"] (ScalarType "bool"),EnvCreateFunction FunName "cash_lt" [ScalarType "money",ScalarType "money"] (ScalarType "bool"),EnvCreateFunction FunName "cash_mi" [ScalarType "money",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunName "cash_mul_flt4" [ScalarType "money",ScalarType "float4"] (ScalarType "money"),EnvCreateFunction FunName "cash_mul_flt8" [ScalarType "money",ScalarType "float8"] (ScalarType "money"),EnvCreateFunction FunName "cash_mul_int2" [ScalarType "money",ScalarType "int2"] (ScalarType "money"),EnvCreateFunction FunName "cash_mul_int4" [ScalarType "money",ScalarType "int4"] (ScalarType "money"),EnvCreateFunction FunName "cash_ne" [ScalarType "money",ScalarType "money"] (ScalarType "bool"),EnvCreateFunction FunName "cash_out" [ScalarType "money"] (Pseudo Cstring),EnvCreateFunction FunName "cash_pl" [ScalarType "money",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunName "cash_recv" [Pseudo Internal] (ScalarType "money"),EnvCreateFunction FunName "cash_send" [ScalarType "money"] (ScalarType "bytea"),EnvCreateFunction FunName "cash_words" [ScalarType "money"] (ScalarType "text"),EnvCreateFunction FunName "cashlarger" [ScalarType "money",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunName "cashsmaller" [ScalarType "money",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunName "cbrt" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "ceil" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "ceil" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "ceiling" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "ceiling" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "center" [ScalarType "box"] (ScalarType "point"),EnvCreateFunction FunName "center" [ScalarType "circle"] (ScalarType "point"),EnvCreateFunction FunName "char" [ScalarType "int4"] (ScalarType "char"),EnvCreateFunction FunName "char" [ScalarType "text"] (ScalarType "char"),EnvCreateFunction FunName "char_length" [ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "char_length" [ScalarType "bpchar"] (ScalarType "int4"),EnvCreateFunction FunName "character_length" [ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "character_length" [ScalarType "bpchar"] (ScalarType "int4"),EnvCreateFunction FunName "chareq" [ScalarType "char",ScalarType "char"] (ScalarType "bool"),EnvCreateFunction FunName "charge" [ScalarType "char",ScalarType "char"] (ScalarType "bool"),EnvCreateFunction FunName "chargt" [ScalarType "char",ScalarType "char"] (ScalarType "bool"),EnvCreateFunction FunName "charin" [Pseudo Cstring] (ScalarType "char"),EnvCreateFunction FunName "charle" [ScalarType "char",ScalarType "char"] (ScalarType "bool"),EnvCreateFunction FunName "charlt" [ScalarType "char",ScalarType "char"] (ScalarType "bool"),EnvCreateFunction FunName "charne" [ScalarType "char",ScalarType "char"] (ScalarType "bool"),EnvCreateFunction FunName "charout" [ScalarType "char"] (Pseudo Cstring),EnvCreateFunction FunName "charrecv" [Pseudo Internal] (ScalarType "char"),EnvCreateFunction FunName "charsend" [ScalarType "char"] (ScalarType "bytea"),EnvCreateFunction FunName "chr" [ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "cideq" [ScalarType "cid",ScalarType "cid"] (ScalarType "bool"),EnvCreateFunction FunName "cidin" [Pseudo Cstring] (ScalarType "cid"),EnvCreateFunction FunName "cidout" [ScalarType "cid"] (Pseudo Cstring),EnvCreateFunction FunName "cidr" [ScalarType "inet"] (ScalarType "cidr"),EnvCreateFunction FunName "cidr_in" [Pseudo Cstring] (ScalarType "cidr"),EnvCreateFunction FunName "cidr_out" [ScalarType "cidr"] (Pseudo Cstring),EnvCreateFunction FunName "cidr_recv" [Pseudo Internal] (ScalarType "cidr"),EnvCreateFunction FunName "cidr_send" [ScalarType "cidr"] (ScalarType "bytea"),EnvCreateFunction FunName "cidrecv" [Pseudo Internal] (ScalarType "cid"),EnvCreateFunction FunName "cidsend" [ScalarType "cid"] (ScalarType "bytea"),EnvCreateFunction FunName "circle" [ScalarType "box"] (ScalarType "circle"),EnvCreateFunction FunName "circle" [ScalarType "polygon"] (ScalarType "circle"),EnvCreateFunction FunName "circle" [ScalarType "point",ScalarType "float8"] (ScalarType "circle"),EnvCreateFunction FunName "circle_above" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_add_pt" [ScalarType "circle",ScalarType "point"] (ScalarType "circle"),EnvCreateFunction FunName "circle_below" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_center" [ScalarType "circle"] (ScalarType "point"),EnvCreateFunction FunName "circle_contain" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_contain_pt" [ScalarType "circle",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunName "circle_contained" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_distance" [ScalarType "circle",ScalarType "circle"] (ScalarType "float8"),EnvCreateFunction FunName "circle_div_pt" [ScalarType "circle",ScalarType "point"] (ScalarType "circle"),EnvCreateFunction FunName "circle_eq" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_ge" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_gt" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_in" [Pseudo Cstring] (ScalarType "circle"),EnvCreateFunction FunName "circle_le" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_left" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_lt" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_mul_pt" [ScalarType "circle",ScalarType "point"] (ScalarType "circle"),EnvCreateFunction FunName "circle_ne" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_out" [ScalarType "circle"] (Pseudo Cstring),EnvCreateFunction FunName "circle_overabove" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_overbelow" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_overlap" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_overleft" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_overright" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_recv" [Pseudo Internal] (ScalarType "circle"),EnvCreateFunction FunName "circle_right" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_same" [ScalarType "circle",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "circle_send" [ScalarType "circle"] (ScalarType "bytea"),EnvCreateFunction FunName "circle_sub_pt" [ScalarType "circle",ScalarType "point"] (ScalarType "circle"),EnvCreateFunction FunName "clock_timestamp" [] (ScalarType "timestamptz"),EnvCreateFunction FunName "close_lb" [ScalarType "line",ScalarType "box"] (ScalarType "point"),EnvCreateFunction FunName "close_ls" [ScalarType "line",ScalarType "lseg"] (ScalarType "point"),EnvCreateFunction FunName "close_lseg" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "point"),EnvCreateFunction FunName "close_pb" [ScalarType "point",ScalarType "box"] (ScalarType "point"),EnvCreateFunction FunName "close_pl" [ScalarType "point",ScalarType "line"] (ScalarType "point"),EnvCreateFunction FunName "close_ps" [ScalarType "point",ScalarType "lseg"] (ScalarType "point"),EnvCreateFunction FunName "close_sb" [ScalarType "lseg",ScalarType "box"] (ScalarType "point"),EnvCreateFunction FunName "close_sl" [ScalarType "lseg",ScalarType "line"] (ScalarType "point"),EnvCreateFunction FunName "col_description" [ScalarType "oid",ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "contjoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "contsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "convert" [ScalarType "bytea",ScalarType "name",ScalarType "name"] (ScalarType "bytea"),EnvCreateFunction FunName "convert_from" [ScalarType "bytea",ScalarType "name"] (ScalarType "text"),EnvCreateFunction FunName "convert_to" [ScalarType "text",ScalarType "name"] (ScalarType "bytea"),EnvCreateFunction FunName "cos" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "cot" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "cstring_in" [Pseudo Cstring] (Pseudo Cstring),EnvCreateFunction FunName "cstring_out" [Pseudo Cstring] (Pseudo Cstring),EnvCreateFunction FunName "cstring_recv" [Pseudo Internal] (Pseudo Cstring),EnvCreateFunction FunName "cstring_send" [Pseudo Cstring] (ScalarType "bytea"),EnvCreateFunction FunName "current_database" [] (ScalarType "name"),EnvCreateFunction FunName "current_query" [] (ScalarType "text"),EnvCreateFunction FunName "current_schema" [] (ScalarType "name"),EnvCreateFunction FunName "current_schemas" [ScalarType "bool"] (ArrayType (ScalarType "name")),EnvCreateFunction FunName "current_setting" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "current_user" [] (ScalarType "name"),EnvCreateFunction FunName "currtid" [ScalarType "oid",ScalarType "tid"] (ScalarType "tid"),EnvCreateFunction FunName "currtid2" [ScalarType "text",ScalarType "tid"] (ScalarType "tid"),EnvCreateFunction FunName "currval" [ScalarType "regclass"] (ScalarType "int8"),EnvCreateFunction FunName "cursor_to_xml" [ScalarType "refcursor",ScalarType "int4",ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "cursor_to_xmlschema" [ScalarType "refcursor",ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "database_to_xml" [ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "database_to_xml_and_xmlschema" [ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "database_to_xmlschema" [ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "date" [ScalarType "abstime"] (ScalarType "date"),EnvCreateFunction FunName "date" [ScalarType "timestamp"] (ScalarType "date"),EnvCreateFunction FunName "date" [ScalarType "timestamptz"] (ScalarType "date"),EnvCreateFunction FunName "date_cmp" [ScalarType "date",ScalarType "date"] (ScalarType "int4"),EnvCreateFunction FunName "date_cmp_timestamp" [ScalarType "date",ScalarType "timestamp"] (ScalarType "int4"),EnvCreateFunction FunName "date_cmp_timestamptz" [ScalarType "date",ScalarType "timestamptz"] (ScalarType "int4"),EnvCreateFunction FunName "date_eq" [ScalarType "date",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "date_eq_timestamp" [ScalarType "date",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "date_eq_timestamptz" [ScalarType "date",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "date_ge" [ScalarType "date",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "date_ge_timestamp" [ScalarType "date",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "date_ge_timestamptz" [ScalarType "date",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "date_gt" [ScalarType "date",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "date_gt_timestamp" [ScalarType "date",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "date_gt_timestamptz" [ScalarType "date",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "date_in" [Pseudo Cstring] (ScalarType "date"),EnvCreateFunction FunName "date_larger" [ScalarType "date",ScalarType "date"] (ScalarType "date"),EnvCreateFunction FunName "date_le" [ScalarType "date",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "date_le_timestamp" [ScalarType "date",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "date_le_timestamptz" [ScalarType "date",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "date_lt" [ScalarType "date",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "date_lt_timestamp" [ScalarType "date",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "date_lt_timestamptz" [ScalarType "date",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "date_mi" [ScalarType "date",ScalarType "date"] (ScalarType "int4"),EnvCreateFunction FunName "date_mi_interval" [ScalarType "date",ScalarType "interval"] (ScalarType "timestamp"),EnvCreateFunction FunName "date_mii" [ScalarType "date",ScalarType "int4"] (ScalarType "date"),EnvCreateFunction FunName "date_ne" [ScalarType "date",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "date_ne_timestamp" [ScalarType "date",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "date_ne_timestamptz" [ScalarType "date",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "date_out" [ScalarType "date"] (Pseudo Cstring),EnvCreateFunction FunName "date_part" [ScalarType "text",ScalarType "abstime"] (ScalarType "float8"),EnvCreateFunction FunName "date_part" [ScalarType "text",ScalarType "reltime"] (ScalarType "float8"),EnvCreateFunction FunName "date_part" [ScalarType "text",ScalarType "date"] (ScalarType "float8"),EnvCreateFunction FunName "date_part" [ScalarType "text",ScalarType "time"] (ScalarType "float8"),EnvCreateFunction FunName "date_part" [ScalarType "text",ScalarType "timestamp"] (ScalarType "float8"),EnvCreateFunction FunName "date_part" [ScalarType "text",ScalarType "timestamptz"] (ScalarType "float8"),EnvCreateFunction FunName "date_part" [ScalarType "text",ScalarType "interval"] (ScalarType "float8"),EnvCreateFunction FunName "date_part" [ScalarType "text",ScalarType "timetz"] (ScalarType "float8"),EnvCreateFunction FunName "date_pl_interval" [ScalarType "date",ScalarType "interval"] (ScalarType "timestamp"),EnvCreateFunction FunName "date_pli" [ScalarType "date",ScalarType "int4"] (ScalarType "date"),EnvCreateFunction FunName "date_recv" [Pseudo Internal] (ScalarType "date"),EnvCreateFunction FunName "date_send" [ScalarType "date"] (ScalarType "bytea"),EnvCreateFunction FunName "date_smaller" [ScalarType "date",ScalarType "date"] (ScalarType "date"),EnvCreateFunction FunName "date_trunc" [ScalarType "text",ScalarType "timestamp"] (ScalarType "timestamp"),EnvCreateFunction FunName "date_trunc" [ScalarType "text",ScalarType "timestamptz"] (ScalarType "timestamptz"),EnvCreateFunction FunName "date_trunc" [ScalarType "text",ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunName "datetime_pl" [ScalarType "date",ScalarType "time"] (ScalarType "timestamp"),EnvCreateFunction FunName "datetimetz_pl" [ScalarType "date",ScalarType "timetz"] (ScalarType "timestamptz"),EnvCreateFunction FunName "dcbrt" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "decode" [ScalarType "text",ScalarType "text"] (ScalarType "bytea"),EnvCreateFunction FunName "degrees" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "dexp" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "diagonal" [ScalarType "box"] (ScalarType "lseg"),EnvCreateFunction FunName "diameter" [ScalarType "circle"] (ScalarType "float8"),EnvCreateFunction FunName "dispell_init" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "dispell_lexize" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "dist_cpoly" [ScalarType "circle",ScalarType "polygon"] (ScalarType "float8"),EnvCreateFunction FunName "dist_lb" [ScalarType "line",ScalarType "box"] (ScalarType "float8"),EnvCreateFunction FunName "dist_pb" [ScalarType "point",ScalarType "box"] (ScalarType "float8"),EnvCreateFunction FunName "dist_pc" [ScalarType "point",ScalarType "circle"] (ScalarType "float8"),EnvCreateFunction FunName "dist_pl" [ScalarType "point",ScalarType "line"] (ScalarType "float8"),EnvCreateFunction FunName "dist_ppath" [ScalarType "point",ScalarType "path"] (ScalarType "float8"),EnvCreateFunction FunName "dist_ps" [ScalarType "point",ScalarType "lseg"] (ScalarType "float8"),EnvCreateFunction FunName "dist_sb" [ScalarType "lseg",ScalarType "box"] (ScalarType "float8"),EnvCreateFunction FunName "dist_sl" [ScalarType "lseg",ScalarType "line"] (ScalarType "float8"),EnvCreateFunction FunName "div" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "dlog1" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "dlog10" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "domain_in" [Pseudo Cstring,ScalarType "oid",ScalarType "int4"] (Pseudo Any),EnvCreateFunction FunName "domain_recv" [Pseudo Internal,ScalarType "oid",ScalarType "int4"] (Pseudo Any),EnvCreateFunction FunName "dpow" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "dround" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "dsimple_init" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "dsimple_lexize" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "dsnowball_init" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "dsnowball_lexize" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "dsqrt" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "dsynonym_init" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "dsynonym_lexize" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "dtrunc" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "encode" [ScalarType "bytea",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "enum_cmp" [Pseudo AnyEnum,Pseudo AnyEnum] (ScalarType "int4"),EnvCreateFunction FunName "enum_eq" [Pseudo AnyEnum,Pseudo AnyEnum] (ScalarType "bool"),EnvCreateFunction FunName "enum_first" [Pseudo AnyEnum] (Pseudo AnyEnum),EnvCreateFunction FunName "enum_ge" [Pseudo AnyEnum,Pseudo AnyEnum] (ScalarType "bool"),EnvCreateFunction FunName "enum_gt" [Pseudo AnyEnum,Pseudo AnyEnum] (ScalarType "bool"),EnvCreateFunction FunName "enum_in" [Pseudo Cstring,ScalarType "oid"] (Pseudo AnyEnum),EnvCreateFunction FunName "enum_larger" [Pseudo AnyEnum,Pseudo AnyEnum] (Pseudo AnyEnum),EnvCreateFunction FunName "enum_last" [Pseudo AnyEnum] (Pseudo AnyEnum),EnvCreateFunction FunName "enum_le" [Pseudo AnyEnum,Pseudo AnyEnum] (ScalarType "bool"),EnvCreateFunction FunName "enum_lt" [Pseudo AnyEnum,Pseudo AnyEnum] (ScalarType "bool"),EnvCreateFunction FunName "enum_ne" [Pseudo AnyEnum,Pseudo AnyEnum] (ScalarType "bool"),EnvCreateFunction FunName "enum_out" [Pseudo AnyEnum] (Pseudo Cstring),EnvCreateFunction FunName "enum_range" [Pseudo AnyEnum] (Pseudo AnyArray),EnvCreateFunction FunName "enum_range" [Pseudo AnyEnum,Pseudo AnyEnum] (Pseudo AnyArray),EnvCreateFunction FunName "enum_recv" [Pseudo Cstring,ScalarType "oid"] (Pseudo AnyEnum),EnvCreateFunction FunName "enum_send" [Pseudo AnyEnum] (ScalarType "bytea"),EnvCreateFunction FunName "enum_smaller" [Pseudo AnyEnum,Pseudo AnyEnum] (Pseudo AnyEnum),EnvCreateFunction FunName "eqjoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "eqsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "euc_cn_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "euc_cn_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "euc_jis_2004_to_shift_jis_2004" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "euc_jis_2004_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "euc_jp_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "euc_jp_to_sjis" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "euc_jp_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "euc_kr_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "euc_kr_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "euc_tw_to_big5" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "euc_tw_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "euc_tw_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "exp" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "exp" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "factorial" [ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunName "family" [ScalarType "inet"] (ScalarType "int4"),EnvCreateFunction FunName "flatfile_update_trigger" [] (Pseudo Trigger),EnvCreateFunction FunName "float4" [ScalarType "int8"] (ScalarType "float4"),EnvCreateFunction FunName "float4" [ScalarType "int2"] (ScalarType "float4"),EnvCreateFunction FunName "float4" [ScalarType "int4"] (ScalarType "float4"),EnvCreateFunction FunName "float4" [ScalarType "float8"] (ScalarType "float4"),EnvCreateFunction FunName "float4" [ScalarType "numeric"] (ScalarType "float4"),EnvCreateFunction FunName "float48div" [ScalarType "float4",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "float48eq" [ScalarType "float4",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunName "float48ge" [ScalarType "float4",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunName "float48gt" [ScalarType "float4",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunName "float48le" [ScalarType "float4",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunName "float48lt" [ScalarType "float4",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunName "float48mi" [ScalarType "float4",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "float48mul" [ScalarType "float4",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "float48ne" [ScalarType "float4",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunName "float48pl" [ScalarType "float4",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "float4_accum" [ArrayType (ScalarType "float8"),ScalarType "float4"] (ArrayType (ScalarType "float8")),EnvCreateFunction FunName "float4abs" [ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunName "float4div" [ScalarType "float4",ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunName "float4eq" [ScalarType "float4",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunName "float4ge" [ScalarType "float4",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunName "float4gt" [ScalarType "float4",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunName "float4in" [Pseudo Cstring] (ScalarType "float4"),EnvCreateFunction FunName "float4larger" [ScalarType "float4",ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunName "float4le" [ScalarType "float4",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunName "float4lt" [ScalarType "float4",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunName "float4mi" [ScalarType "float4",ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunName "float4mul" [ScalarType "float4",ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunName "float4ne" [ScalarType "float4",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunName "float4out" [ScalarType "float4"] (Pseudo Cstring),EnvCreateFunction FunName "float4pl" [ScalarType "float4",ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunName "float4recv" [Pseudo Internal] (ScalarType "float4"),EnvCreateFunction FunName "float4send" [ScalarType "float4"] (ScalarType "bytea"),EnvCreateFunction FunName "float4smaller" [ScalarType "float4",ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunName "float4um" [ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunName "float4up" [ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunName "float8" [ScalarType "int8"] (ScalarType "float8"),EnvCreateFunction FunName "float8" [ScalarType "int2"] (ScalarType "float8"),EnvCreateFunction FunName "float8" [ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "float8" [ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunName "float8" [ScalarType "numeric"] (ScalarType "float8"),EnvCreateFunction FunName "float84div" [ScalarType "float8",ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunName "float84eq" [ScalarType "float8",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunName "float84ge" [ScalarType "float8",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunName "float84gt" [ScalarType "float8",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunName "float84le" [ScalarType "float8",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunName "float84lt" [ScalarType "float8",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunName "float84mi" [ScalarType "float8",ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunName "float84mul" [ScalarType "float8",ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunName "float84ne" [ScalarType "float8",ScalarType "float4"] (ScalarType "bool"),EnvCreateFunction FunName "float84pl" [ScalarType "float8",ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunName "float8_accum" [ArrayType (ScalarType "float8"),ScalarType "float8"] (ArrayType (ScalarType "float8")),EnvCreateFunction FunName "float8_avg" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_corr" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_covar_pop" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_covar_samp" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_regr_accum" [ArrayType (ScalarType "float8"),ScalarType "float8",ScalarType "float8"] (ArrayType (ScalarType "float8")),EnvCreateFunction FunName "float8_regr_avgx" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_regr_avgy" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_regr_intercept" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_regr_r2" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_regr_slope" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_regr_sxx" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_regr_sxy" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_regr_syy" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_stddev_pop" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_stddev_samp" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_var_pop" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8_var_samp" [ArrayType (ScalarType "float8")] (ScalarType "float8"),EnvCreateFunction FunName "float8abs" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "float8div" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "float8eq" [ScalarType "float8",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunName "float8ge" [ScalarType "float8",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunName "float8gt" [ScalarType "float8",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunName "float8in" [Pseudo Cstring] (ScalarType "float8"),EnvCreateFunction FunName "float8larger" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "float8le" [ScalarType "float8",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunName "float8lt" [ScalarType "float8",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunName "float8mi" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "float8mul" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "float8ne" [ScalarType "float8",ScalarType "float8"] (ScalarType "bool"),EnvCreateFunction FunName "float8out" [ScalarType "float8"] (Pseudo Cstring),EnvCreateFunction FunName "float8pl" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "float8recv" [Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "float8send" [ScalarType "float8"] (ScalarType "bytea"),EnvCreateFunction FunName "float8smaller" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "float8um" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "float8up" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "floor" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "floor" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "flt4_mul_cash" [ScalarType "float4",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunName "flt8_mul_cash" [ScalarType "float8",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunName "fmgr_c_validator" [ScalarType "oid"] (Pseudo Void),EnvCreateFunction FunName "fmgr_internal_validator" [ScalarType "oid"] (Pseudo Void),EnvCreateFunction FunName "fmgr_sql_validator" [ScalarType "oid"] (Pseudo Void),EnvCreateFunction FunName "format_type" [ScalarType "oid",ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "gb18030_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "gbk_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "generate_series" [ScalarType "int8",ScalarType "int8"] (SetOfType (ScalarType "int8")),EnvCreateFunction FunName "generate_series" [ScalarType "int4",ScalarType "int4"] (SetOfType (ScalarType "int4")),EnvCreateFunction FunName "generate_series" [ScalarType "int8",ScalarType "int8",ScalarType "int8"] (SetOfType (ScalarType "int8")),EnvCreateFunction FunName "generate_series" [ScalarType "int4",ScalarType "int4",ScalarType "int4"] (SetOfType (ScalarType "int4")),EnvCreateFunction FunName "generate_series" [ScalarType "timestamp",ScalarType "timestamp",ScalarType "interval"] (SetOfType (ScalarType "timestamp")),EnvCreateFunction FunName "generate_series" [ScalarType "timestamptz",ScalarType "timestamptz",ScalarType "interval"] (SetOfType (ScalarType "timestamptz")),EnvCreateFunction FunName "generate_subscripts" [Pseudo AnyArray,ScalarType "int4"] (SetOfType (ScalarType "int4")),EnvCreateFunction FunName "generate_subscripts" [Pseudo AnyArray,ScalarType "int4",ScalarType "bool"] (SetOfType (ScalarType "int4")),EnvCreateFunction FunName "get_bit" [ScalarType "bytea",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "get_byte" [ScalarType "bytea",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "get_current_ts_config" [] (ScalarType "regconfig"),EnvCreateFunction FunName "getdatabaseencoding" [] (ScalarType "name"),EnvCreateFunction FunName "getpgusername" [] (ScalarType "name"),EnvCreateFunction FunName "gin_cmp_prefix" [ScalarType "text",ScalarType "text",ScalarType "int2",Pseudo Internal] (ScalarType "int4"),EnvCreateFunction FunName "gin_cmp_tslexeme" [ScalarType "text",ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "gin_extract_tsquery" [ScalarType "tsquery",Pseudo Internal,ScalarType "int2",Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gin_extract_tsvector" [ScalarType "tsvector",Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gin_tsquery_consistent" [Pseudo Internal,ScalarType "int2",ScalarType "tsquery",ScalarType "int4",Pseudo Internal,Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "ginarrayconsistent" [Pseudo Internal,ScalarType "int2",Pseudo AnyArray,ScalarType "int4",Pseudo Internal,Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "ginarrayextract" [Pseudo AnyArray,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "ginbeginscan" [Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "ginbuild" [Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "ginbulkdelete" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gincostestimate" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "ginendscan" [Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "gingetbitmap" [Pseudo Internal,Pseudo Internal] (ScalarType "int8"),EnvCreateFunction FunName "gininsert" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "ginmarkpos" [Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "ginoptions" [ArrayType (ScalarType "text"),ScalarType "bool"] (ScalarType "bytea"),EnvCreateFunction FunName "ginqueryarrayextract" [Pseudo AnyArray,Pseudo Internal,ScalarType "int2",Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "ginrescan" [Pseudo Internal,Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "ginrestrpos" [Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "ginvacuumcleanup" [Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gist_box_compress" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gist_box_consistent" [Pseudo Internal,ScalarType "box",ScalarType "int4",ScalarType "oid",Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "gist_box_decompress" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gist_box_penalty" [Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gist_box_picksplit" [Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gist_box_same" [ScalarType "box",ScalarType "box",Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gist_box_union" [Pseudo Internal,Pseudo Internal] (ScalarType "box"),EnvCreateFunction FunName "gist_circle_compress" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gist_circle_consistent" [Pseudo Internal,ScalarType "circle",ScalarType "int4",ScalarType "oid",Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "gist_poly_compress" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gist_poly_consistent" [Pseudo Internal,ScalarType "polygon",ScalarType "int4",ScalarType "oid",Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "gistbeginscan" [Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gistbuild" [Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gistbulkdelete" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gistcostestimate" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "gistendscan" [Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "gistgetbitmap" [Pseudo Internal,Pseudo Internal] (ScalarType "int8"),EnvCreateFunction FunName "gistgettuple" [Pseudo Internal,Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "gistinsert" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "gistmarkpos" [Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "gistoptions" [ArrayType (ScalarType "text"),ScalarType "bool"] (ScalarType "bytea"),EnvCreateFunction FunName "gistrescan" [Pseudo Internal,Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "gistrestrpos" [Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "gistvacuumcleanup" [Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gtsquery_compress" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gtsquery_consistent" [Pseudo Internal,Pseudo Internal,ScalarType "int4",ScalarType "oid",Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "gtsquery_decompress" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gtsquery_penalty" [Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gtsquery_picksplit" [Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gtsquery_same" [ScalarType "int8",ScalarType "int8",Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gtsquery_union" [Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gtsvector_compress" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gtsvector_consistent" [Pseudo Internal,ScalarType "gtsvector",ScalarType "int4",ScalarType "oid",Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "gtsvector_decompress" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gtsvector_penalty" [Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gtsvector_picksplit" [Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gtsvector_same" [ScalarType "gtsvector",ScalarType "gtsvector",Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gtsvector_union" [Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "gtsvectorin" [Pseudo Cstring] (ScalarType "gtsvector"),EnvCreateFunction FunName "gtsvectorout" [ScalarType "gtsvector"] (Pseudo Cstring),EnvCreateFunction FunName "has_any_column_privilege" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_any_column_privilege" [ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_any_column_privilege" [ScalarType "name",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_any_column_privilege" [ScalarType "name",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_any_column_privilege" [ScalarType "oid",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_any_column_privilege" [ScalarType "oid",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_column_privilege" [ScalarType "text",ScalarType "int2",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_column_privilege" [ScalarType "text",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_column_privilege" [ScalarType "oid",ScalarType "int2",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_column_privilege" [ScalarType "oid",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_column_privilege" [ScalarType "name",ScalarType "text",ScalarType "int2",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_column_privilege" [ScalarType "name",ScalarType "text",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_column_privilege" [ScalarType "name",ScalarType "oid",ScalarType "int2",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_column_privilege" [ScalarType "name",ScalarType "oid",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_column_privilege" [ScalarType "oid",ScalarType "text",ScalarType "int2",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_column_privilege" [ScalarType "oid",ScalarType "text",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_column_privilege" [ScalarType "oid",ScalarType "oid",ScalarType "int2",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_column_privilege" [ScalarType "oid",ScalarType "oid",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_database_privilege" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_database_privilege" [ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_database_privilege" [ScalarType "name",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_database_privilege" [ScalarType "name",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_database_privilege" [ScalarType "oid",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_database_privilege" [ScalarType "oid",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_foreign_data_wrapper_privilege" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_foreign_data_wrapper_privilege" [ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_foreign_data_wrapper_privilege" [ScalarType "name",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_foreign_data_wrapper_privilege" [ScalarType "name",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_foreign_data_wrapper_privilege" [ScalarType "oid",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_foreign_data_wrapper_privilege" [ScalarType "oid",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_function_privilege" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_function_privilege" [ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_function_privilege" [ScalarType "name",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_function_privilege" [ScalarType "name",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_function_privilege" [ScalarType "oid",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_function_privilege" [ScalarType "oid",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_language_privilege" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_language_privilege" [ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_language_privilege" [ScalarType "name",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_language_privilege" [ScalarType "name",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_language_privilege" [ScalarType "oid",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_language_privilege" [ScalarType "oid",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_schema_privilege" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_schema_privilege" [ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_schema_privilege" [ScalarType "name",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_schema_privilege" [ScalarType "name",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_schema_privilege" [ScalarType "oid",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_schema_privilege" [ScalarType "oid",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_server_privilege" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_server_privilege" [ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_server_privilege" [ScalarType "name",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_server_privilege" [ScalarType "name",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_server_privilege" [ScalarType "oid",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_server_privilege" [ScalarType "oid",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_table_privilege" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_table_privilege" [ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_table_privilege" [ScalarType "name",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_table_privilege" [ScalarType "name",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_table_privilege" [ScalarType "oid",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_table_privilege" [ScalarType "oid",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_tablespace_privilege" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_tablespace_privilege" [ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_tablespace_privilege" [ScalarType "name",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_tablespace_privilege" [ScalarType "name",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_tablespace_privilege" [ScalarType "oid",ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "has_tablespace_privilege" [ScalarType "oid",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "hash_aclitem" [ScalarType "aclitem"] (ScalarType "int4"),EnvCreateFunction FunName "hash_numeric" [ScalarType "numeric"] (ScalarType "int4"),EnvCreateFunction FunName "hashbeginscan" [Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "hashbpchar" [ScalarType "bpchar"] (ScalarType "int4"),EnvCreateFunction FunName "hashbuild" [Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "hashbulkdelete" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "hashchar" [ScalarType "char"] (ScalarType "int4"),EnvCreateFunction FunName "hashcostestimate" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "hashendscan" [Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "hashenum" [Pseudo AnyEnum] (ScalarType "int4"),EnvCreateFunction FunName "hashfloat4" [ScalarType "float4"] (ScalarType "int4"),EnvCreateFunction FunName "hashfloat8" [ScalarType "float8"] (ScalarType "int4"),EnvCreateFunction FunName "hashgetbitmap" [Pseudo Internal,Pseudo Internal] (ScalarType "int8"),EnvCreateFunction FunName "hashgettuple" [Pseudo Internal,Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "hashinet" [ScalarType "inet"] (ScalarType "int4"),EnvCreateFunction FunName "hashinsert" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "hashint2" [ScalarType "int2"] (ScalarType "int4"),EnvCreateFunction FunName "hashint2vector" [ScalarType "int2vector"] (ScalarType "int4"),EnvCreateFunction FunName "hashint4" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "hashint8" [ScalarType "int8"] (ScalarType "int4"),EnvCreateFunction FunName "hashmacaddr" [ScalarType "macaddr"] (ScalarType "int4"),EnvCreateFunction FunName "hashmarkpos" [Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "hashname" [ScalarType "name"] (ScalarType "int4"),EnvCreateFunction FunName "hashoid" [ScalarType "oid"] (ScalarType "int4"),EnvCreateFunction FunName "hashoidvector" [ScalarType "oidvector"] (ScalarType "int4"),EnvCreateFunction FunName "hashoptions" [ArrayType (ScalarType "text"),ScalarType "bool"] (ScalarType "bytea"),EnvCreateFunction FunName "hashrescan" [Pseudo Internal,Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "hashrestrpos" [Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "hashtext" [ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "hashvacuumcleanup" [Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "hashvarlena" [Pseudo Internal] (ScalarType "int4"),EnvCreateFunction FunName "height" [ScalarType "box"] (ScalarType "float8"),EnvCreateFunction FunName "host" [ScalarType "inet"] (ScalarType "text"),EnvCreateFunction FunName "hostmask" [ScalarType "inet"] (ScalarType "inet"),EnvCreateFunction FunName "iclikejoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "iclikesel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "icnlikejoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "icnlikesel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "icregexeqjoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "icregexeqsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "icregexnejoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "icregexnesel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "inet_client_addr" [] (ScalarType "inet"),EnvCreateFunction FunName "inet_client_port" [] (ScalarType "int4"),EnvCreateFunction FunName "inet_in" [Pseudo Cstring] (ScalarType "inet"),EnvCreateFunction FunName "inet_out" [ScalarType "inet"] (Pseudo Cstring),EnvCreateFunction FunName "inet_recv" [Pseudo Internal] (ScalarType "inet"),EnvCreateFunction FunName "inet_send" [ScalarType "inet"] (ScalarType "bytea"),EnvCreateFunction FunName "inet_server_addr" [] (ScalarType "inet"),EnvCreateFunction FunName "inet_server_port" [] (ScalarType "int4"),EnvCreateFunction FunName "inetand" [ScalarType "inet",ScalarType "inet"] (ScalarType "inet"),EnvCreateFunction FunName "inetmi" [ScalarType "inet",ScalarType "inet"] (ScalarType "int8"),EnvCreateFunction FunName "inetmi_int8" [ScalarType "inet",ScalarType "int8"] (ScalarType "inet"),EnvCreateFunction FunName "inetnot" [ScalarType "inet"] (ScalarType "inet"),EnvCreateFunction FunName "inetor" [ScalarType "inet",ScalarType "inet"] (ScalarType "inet"),EnvCreateFunction FunName "inetpl" [ScalarType "inet",ScalarType "int8"] (ScalarType "inet"),EnvCreateFunction FunName "initcap" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "int2" [ScalarType "int8"] (ScalarType "int2"),EnvCreateFunction FunName "int2" [ScalarType "int4"] (ScalarType "int2"),EnvCreateFunction FunName "int2" [ScalarType "float4"] (ScalarType "int2"),EnvCreateFunction FunName "int2" [ScalarType "float8"] (ScalarType "int2"),EnvCreateFunction FunName "int2" [ScalarType "numeric"] (ScalarType "int2"),EnvCreateFunction FunName "int24div" [ScalarType "int2",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int24eq" [ScalarType "int2",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int24ge" [ScalarType "int2",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int24gt" [ScalarType "int2",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int24le" [ScalarType "int2",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int24lt" [ScalarType "int2",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int24mi" [ScalarType "int2",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int24mul" [ScalarType "int2",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int24ne" [ScalarType "int2",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int24pl" [ScalarType "int2",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int28div" [ScalarType "int2",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int28eq" [ScalarType "int2",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int28ge" [ScalarType "int2",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int28gt" [ScalarType "int2",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int28le" [ScalarType "int2",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int28lt" [ScalarType "int2",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int28mi" [ScalarType "int2",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int28mul" [ScalarType "int2",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int28ne" [ScalarType "int2",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int28pl" [ScalarType "int2",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int2_accum" [ArrayType (ScalarType "numeric"),ScalarType "int2"] (ArrayType (ScalarType "numeric")),EnvCreateFunction FunName "int2_avg_accum" [ArrayType (ScalarType "int8"),ScalarType "int2"] (ArrayType (ScalarType "int8")),EnvCreateFunction FunName "int2_mul_cash" [ScalarType "int2",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunName "int2_sum" [ScalarType "int8",ScalarType "int2"] (ScalarType "int8"),EnvCreateFunction FunName "int2abs" [ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int2and" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int2div" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int2eq" [ScalarType "int2",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int2ge" [ScalarType "int2",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int2gt" [ScalarType "int2",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int2in" [Pseudo Cstring] (ScalarType "int2"),EnvCreateFunction FunName "int2larger" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int2le" [ScalarType "int2",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int2lt" [ScalarType "int2",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int2mi" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int2mod" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int2mul" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int2ne" [ScalarType "int2",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int2not" [ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int2or" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int2out" [ScalarType "int2"] (Pseudo Cstring),EnvCreateFunction FunName "int2pl" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int2recv" [Pseudo Internal] (ScalarType "int2"),EnvCreateFunction FunName "int2send" [ScalarType "int2"] (ScalarType "bytea"),EnvCreateFunction FunName "int2shl" [ScalarType "int2",ScalarType "int4"] (ScalarType "int2"),EnvCreateFunction FunName "int2shr" [ScalarType "int2",ScalarType "int4"] (ScalarType "int2"),EnvCreateFunction FunName "int2smaller" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int2um" [ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int2up" [ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int2vectoreq" [ScalarType "int2vector",ScalarType "int2vector"] (ScalarType "bool"),EnvCreateFunction FunName "int2vectorin" [Pseudo Cstring] (ScalarType "int2vector"),EnvCreateFunction FunName "int2vectorout" [ScalarType "int2vector"] (Pseudo Cstring),EnvCreateFunction FunName "int2vectorrecv" [Pseudo Internal] (ScalarType "int2vector"),EnvCreateFunction FunName "int2vectorsend" [ScalarType "int2vector"] (ScalarType "bytea"),EnvCreateFunction FunName "int2xor" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "int4" [ScalarType "bool"] (ScalarType "int4"),EnvCreateFunction FunName "int4" [ScalarType "char"] (ScalarType "int4"),EnvCreateFunction FunName "int4" [ScalarType "int8"] (ScalarType "int4"),EnvCreateFunction FunName "int4" [ScalarType "int2"] (ScalarType "int4"),EnvCreateFunction FunName "int4" [ScalarType "float4"] (ScalarType "int4"),EnvCreateFunction FunName "int4" [ScalarType "float8"] (ScalarType "int4"),EnvCreateFunction FunName "int4" [ScalarType "bit"] (ScalarType "int4"),EnvCreateFunction FunName "int4" [ScalarType "numeric"] (ScalarType "int4"),EnvCreateFunction FunName "int42div" [ScalarType "int4",ScalarType "int2"] (ScalarType "int4"),EnvCreateFunction FunName "int42eq" [ScalarType "int4",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int42ge" [ScalarType "int4",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int42gt" [ScalarType "int4",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int42le" [ScalarType "int4",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int42lt" [ScalarType "int4",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int42mi" [ScalarType "int4",ScalarType "int2"] (ScalarType "int4"),EnvCreateFunction FunName "int42mul" [ScalarType "int4",ScalarType "int2"] (ScalarType "int4"),EnvCreateFunction FunName "int42ne" [ScalarType "int4",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int42pl" [ScalarType "int4",ScalarType "int2"] (ScalarType "int4"),EnvCreateFunction FunName "int48div" [ScalarType "int4",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int48eq" [ScalarType "int4",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int48ge" [ScalarType "int4",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int48gt" [ScalarType "int4",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int48le" [ScalarType "int4",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int48lt" [ScalarType "int4",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int48mi" [ScalarType "int4",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int48mul" [ScalarType "int4",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int48ne" [ScalarType "int4",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int48pl" [ScalarType "int4",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int4_accum" [ArrayType (ScalarType "numeric"),ScalarType "int4"] (ArrayType (ScalarType "numeric")),EnvCreateFunction FunName "int4_avg_accum" [ArrayType (ScalarType "int8"),ScalarType "int4"] (ArrayType (ScalarType "int8")),EnvCreateFunction FunName "int4_mul_cash" [ScalarType "int4",ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunName "int4_sum" [ScalarType "int8",ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunName "int4abs" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4and" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4div" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4eq" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int4ge" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int4gt" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int4in" [Pseudo Cstring] (ScalarType "int4"),EnvCreateFunction FunName "int4inc" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4larger" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4le" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int4lt" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int4mi" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4mod" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4mul" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4ne" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int4not" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4or" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4out" [ScalarType "int4"] (Pseudo Cstring),EnvCreateFunction FunName "int4pl" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4recv" [Pseudo Internal] (ScalarType "int4"),EnvCreateFunction FunName "int4send" [ScalarType "int4"] (ScalarType "bytea"),EnvCreateFunction FunName "int4shl" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4shr" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4smaller" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4um" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4up" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int4xor" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "int8" [ScalarType "int2"] (ScalarType "int8"),EnvCreateFunction FunName "int8" [ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunName "int8" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "int8" [ScalarType "float4"] (ScalarType "int8"),EnvCreateFunction FunName "int8" [ScalarType "float8"] (ScalarType "int8"),EnvCreateFunction FunName "int8" [ScalarType "bit"] (ScalarType "int8"),EnvCreateFunction FunName "int8" [ScalarType "numeric"] (ScalarType "int8"),EnvCreateFunction FunName "int82div" [ScalarType "int8",ScalarType "int2"] (ScalarType "int8"),EnvCreateFunction FunName "int82eq" [ScalarType "int8",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int82ge" [ScalarType "int8",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int82gt" [ScalarType "int8",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int82le" [ScalarType "int8",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int82lt" [ScalarType "int8",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int82mi" [ScalarType "int8",ScalarType "int2"] (ScalarType "int8"),EnvCreateFunction FunName "int82mul" [ScalarType "int8",ScalarType "int2"] (ScalarType "int8"),EnvCreateFunction FunName "int82ne" [ScalarType "int8",ScalarType "int2"] (ScalarType "bool"),EnvCreateFunction FunName "int82pl" [ScalarType "int8",ScalarType "int2"] (ScalarType "int8"),EnvCreateFunction FunName "int84div" [ScalarType "int8",ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunName "int84eq" [ScalarType "int8",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int84ge" [ScalarType "int8",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int84gt" [ScalarType "int8",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int84le" [ScalarType "int8",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int84lt" [ScalarType "int8",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int84mi" [ScalarType "int8",ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunName "int84mul" [ScalarType "int8",ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunName "int84ne" [ScalarType "int8",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "int84pl" [ScalarType "int8",ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunName "int8_accum" [ArrayType (ScalarType "numeric"),ScalarType "int8"] (ArrayType (ScalarType "numeric")),EnvCreateFunction FunName "int8_avg" [ArrayType (ScalarType "int8")] (ScalarType "numeric"),EnvCreateFunction FunName "int8_avg_accum" [ArrayType (ScalarType "numeric"),ScalarType "int8"] (ArrayType (ScalarType "numeric")),EnvCreateFunction FunName "int8_sum" [ScalarType "numeric",ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunName "int8abs" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8and" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8div" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8eq" [ScalarType "int8",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int8ge" [ScalarType "int8",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int8gt" [ScalarType "int8",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int8in" [Pseudo Cstring] (ScalarType "int8"),EnvCreateFunction FunName "int8inc" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8inc_any" [ScalarType "int8",Pseudo Any] (ScalarType "int8"),EnvCreateFunction FunName "int8inc_float8_float8" [ScalarType "int8",ScalarType "float8",ScalarType "float8"] (ScalarType "int8"),EnvCreateFunction FunName "int8larger" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8le" [ScalarType "int8",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int8lt" [ScalarType "int8",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int8mi" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8mod" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8mul" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8ne" [ScalarType "int8",ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "int8not" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8or" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8out" [ScalarType "int8"] (Pseudo Cstring),EnvCreateFunction FunName "int8pl" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8pl_inet" [ScalarType "int8",ScalarType "inet"] (ScalarType "inet"),EnvCreateFunction FunName "int8recv" [Pseudo Internal] (ScalarType "int8"),EnvCreateFunction FunName "int8send" [ScalarType "int8"] (ScalarType "bytea"),EnvCreateFunction FunName "int8shl" [ScalarType "int8",ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunName "int8shr" [ScalarType "int8",ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunName "int8smaller" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8um" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8up" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "int8xor" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "integer_pl_date" [ScalarType "int4",ScalarType "date"] (ScalarType "date"),EnvCreateFunction FunName "inter_lb" [ScalarType "line",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "inter_sb" [ScalarType "lseg",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "inter_sl" [ScalarType "lseg",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunName "internal_in" [Pseudo Cstring] (Pseudo Internal),EnvCreateFunction FunName "internal_out" [Pseudo Internal] (Pseudo Cstring),EnvCreateFunction FunName "interval" [ScalarType "reltime"] (ScalarType "interval"),EnvCreateFunction FunName "interval" [ScalarType "time"] (ScalarType "interval"),EnvCreateFunction FunName "interval" [ScalarType "interval",ScalarType "int4"] (ScalarType "interval"),EnvCreateFunction FunName "interval_accum" [ArrayType (ScalarType "interval"),ScalarType "interval"] (ArrayType (ScalarType "interval")),EnvCreateFunction FunName "interval_avg" [ArrayType (ScalarType "interval")] (ScalarType "interval"),EnvCreateFunction FunName "interval_cmp" [ScalarType "interval",ScalarType "interval"] (ScalarType "int4"),EnvCreateFunction FunName "interval_div" [ScalarType "interval",ScalarType "float8"] (ScalarType "interval"),EnvCreateFunction FunName "interval_eq" [ScalarType "interval",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunName "interval_ge" [ScalarType "interval",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunName "interval_gt" [ScalarType "interval",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunName "interval_hash" [ScalarType "interval"] (ScalarType "int4"),EnvCreateFunction FunName "interval_in" [Pseudo Cstring,ScalarType "oid",ScalarType "int4"] (ScalarType "interval"),EnvCreateFunction FunName "interval_larger" [ScalarType "interval",ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunName "interval_le" [ScalarType "interval",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunName "interval_lt" [ScalarType "interval",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunName "interval_mi" [ScalarType "interval",ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunName "interval_mul" [ScalarType "interval",ScalarType "float8"] (ScalarType "interval"),EnvCreateFunction FunName "interval_ne" [ScalarType "interval",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunName "interval_out" [ScalarType "interval"] (Pseudo Cstring),EnvCreateFunction FunName "interval_pl" [ScalarType "interval",ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunName "interval_pl_date" [ScalarType "interval",ScalarType "date"] (ScalarType "timestamp"),EnvCreateFunction FunName "interval_pl_time" [ScalarType "interval",ScalarType "time"] (ScalarType "time"),EnvCreateFunction FunName "interval_pl_timestamp" [ScalarType "interval",ScalarType "timestamp"] (ScalarType "timestamp"),EnvCreateFunction FunName "interval_pl_timestamptz" [ScalarType "interval",ScalarType "timestamptz"] (ScalarType "timestamptz"),EnvCreateFunction FunName "interval_pl_timetz" [ScalarType "interval",ScalarType "timetz"] (ScalarType "timetz"),EnvCreateFunction FunName "interval_recv" [Pseudo Internal,ScalarType "oid",ScalarType "int4"] (ScalarType "interval"),EnvCreateFunction FunName "interval_send" [ScalarType "interval"] (ScalarType "bytea"),EnvCreateFunction FunName "interval_smaller" [ScalarType "interval",ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunName "interval_um" [ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunName "intervaltypmodin" [ArrayType (Pseudo Cstring)] (ScalarType "int4"),EnvCreateFunction FunName "intervaltypmodout" [ScalarType "int4"] (Pseudo Cstring),EnvCreateFunction FunName "intinterval" [ScalarType "abstime",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunName "isclosed" [ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunName "isfinite" [ScalarType "abstime"] (ScalarType "bool"),EnvCreateFunction FunName "isfinite" [ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "isfinite" [ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "isfinite" [ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "isfinite" [ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunName "ishorizontal" [ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "ishorizontal" [ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunName "ishorizontal" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunName "iso8859_1_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "iso8859_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "iso_to_koi8r" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "iso_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "iso_to_win1251" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "iso_to_win866" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "isopen" [ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunName "isparallel" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "isparallel" [ScalarType "line",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunName "isperp" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "isperp" [ScalarType "line",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunName "isvertical" [ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "isvertical" [ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunName "isvertical" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunName "johab_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "justify_days" [ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunName "justify_hours" [ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunName "justify_interval" [ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunName "koi8r_to_iso" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "koi8r_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "koi8r_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "koi8r_to_win1251" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "koi8r_to_win866" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "koi8u_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "language_handler_in" [Pseudo Cstring] (Pseudo LanguageHandler),EnvCreateFunction FunName "language_handler_out" [Pseudo LanguageHandler] (Pseudo Cstring),EnvCreateFunction FunName "lastval" [] (ScalarType "int8"),EnvCreateFunction FunName "latin1_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "latin2_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "latin2_to_win1250" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "latin3_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "latin4_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "length" [ScalarType "bytea"] (ScalarType "int4"),EnvCreateFunction FunName "length" [ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "length" [ScalarType "lseg"] (ScalarType "float8"),EnvCreateFunction FunName "length" [ScalarType "path"] (ScalarType "float8"),EnvCreateFunction FunName "length" [ScalarType "bpchar"] (ScalarType "int4"),EnvCreateFunction FunName "length" [ScalarType "bit"] (ScalarType "int4"),EnvCreateFunction FunName "length" [ScalarType "tsvector"] (ScalarType "int4"),EnvCreateFunction FunName "length" [ScalarType "bytea",ScalarType "name"] (ScalarType "int4"),EnvCreateFunction FunName "like" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunName "like" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "like" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "like_escape" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bytea"),EnvCreateFunction FunName "like_escape" [ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "likejoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "likesel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "line" [ScalarType "point",ScalarType "point"] (ScalarType "line"),EnvCreateFunction FunName "line_distance" [ScalarType "line",ScalarType "line"] (ScalarType "float8"),EnvCreateFunction FunName "line_eq" [ScalarType "line",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunName "line_horizontal" [ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunName "line_in" [Pseudo Cstring] (ScalarType "line"),EnvCreateFunction FunName "line_interpt" [ScalarType "line",ScalarType "line"] (ScalarType "point"),EnvCreateFunction FunName "line_intersect" [ScalarType "line",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunName "line_out" [ScalarType "line"] (Pseudo Cstring),EnvCreateFunction FunName "line_parallel" [ScalarType "line",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunName "line_perp" [ScalarType "line",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunName "line_recv" [Pseudo Internal] (ScalarType "line"),EnvCreateFunction FunName "line_send" [ScalarType "line"] (ScalarType "bytea"),EnvCreateFunction FunName "line_vertical" [ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunName "ln" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "ln" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "lo_close" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "lo_creat" [ScalarType "int4"] (ScalarType "oid"),EnvCreateFunction FunName "lo_create" [ScalarType "oid"] (ScalarType "oid"),EnvCreateFunction FunName "lo_export" [ScalarType "oid",ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "lo_import" [ScalarType "text"] (ScalarType "oid"),EnvCreateFunction FunName "lo_import" [ScalarType "text",ScalarType "oid"] (ScalarType "oid"),EnvCreateFunction FunName "lo_lseek" [ScalarType "int4",ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "lo_open" [ScalarType "oid",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "lo_tell" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "lo_truncate" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "lo_unlink" [ScalarType "oid"] (ScalarType "int4"),EnvCreateFunction FunName "log" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "log" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "log" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "loread" [ScalarType "int4",ScalarType "int4"] (ScalarType "bytea"),EnvCreateFunction FunName "lower" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "lowrite" [ScalarType "int4",ScalarType "bytea"] (ScalarType "int4"),EnvCreateFunction FunName "lpad" [ScalarType "text",ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "lpad" [ScalarType "text",ScalarType "int4",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "lseg" [ScalarType "box"] (ScalarType "lseg"),EnvCreateFunction FunName "lseg" [ScalarType "point",ScalarType "point"] (ScalarType "lseg"),EnvCreateFunction FunName "lseg_center" [ScalarType "lseg"] (ScalarType "point"),EnvCreateFunction FunName "lseg_distance" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "float8"),EnvCreateFunction FunName "lseg_eq" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "lseg_ge" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "lseg_gt" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "lseg_horizontal" [ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "lseg_in" [Pseudo Cstring] (ScalarType "lseg"),EnvCreateFunction FunName "lseg_interpt" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "point"),EnvCreateFunction FunName "lseg_intersect" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "lseg_le" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "lseg_length" [ScalarType "lseg"] (ScalarType "float8"),EnvCreateFunction FunName "lseg_lt" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "lseg_ne" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "lseg_out" [ScalarType "lseg"] (Pseudo Cstring),EnvCreateFunction FunName "lseg_parallel" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "lseg_perp" [ScalarType "lseg",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "lseg_recv" [Pseudo Internal] (ScalarType "lseg"),EnvCreateFunction FunName "lseg_send" [ScalarType "lseg"] (ScalarType "bytea"),EnvCreateFunction FunName "lseg_vertical" [ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "ltrim" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "ltrim" [ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "macaddr_cmp" [ScalarType "macaddr",ScalarType "macaddr"] (ScalarType "int4"),EnvCreateFunction FunName "macaddr_eq" [ScalarType "macaddr",ScalarType "macaddr"] (ScalarType "bool"),EnvCreateFunction FunName "macaddr_ge" [ScalarType "macaddr",ScalarType "macaddr"] (ScalarType "bool"),EnvCreateFunction FunName "macaddr_gt" [ScalarType "macaddr",ScalarType "macaddr"] (ScalarType "bool"),EnvCreateFunction FunName "macaddr_in" [Pseudo Cstring] (ScalarType "macaddr"),EnvCreateFunction FunName "macaddr_le" [ScalarType "macaddr",ScalarType "macaddr"] (ScalarType "bool"),EnvCreateFunction FunName "macaddr_lt" [ScalarType "macaddr",ScalarType "macaddr"] (ScalarType "bool"),EnvCreateFunction FunName "macaddr_ne" [ScalarType "macaddr",ScalarType "macaddr"] (ScalarType "bool"),EnvCreateFunction FunName "macaddr_out" [ScalarType "macaddr"] (Pseudo Cstring),EnvCreateFunction FunName "macaddr_recv" [Pseudo Internal] (ScalarType "macaddr"),EnvCreateFunction FunName "macaddr_send" [ScalarType "macaddr"] (ScalarType "bytea"),EnvCreateFunction FunName "makeaclitem" [ScalarType "oid",ScalarType "oid",ScalarType "text",ScalarType "bool"] (ScalarType "aclitem"),EnvCreateFunction FunName "masklen" [ScalarType "inet"] (ScalarType "int4"),EnvCreateFunction FunName "md5" [ScalarType "bytea"] (ScalarType "text"),EnvCreateFunction FunName "md5" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "mic_to_ascii" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_big5" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_euc_cn" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_euc_jp" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_euc_kr" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_euc_tw" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_iso" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_koi8r" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_latin1" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_latin2" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_latin3" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_latin4" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_sjis" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_win1250" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_win1251" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mic_to_win866" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "mktinterval" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "tinterval"),EnvCreateFunction FunName "mod" [ScalarType "int8",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "mod" [ScalarType "int2",ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunName "mod" [ScalarType "int4",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "mod" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "mul_d_interval" [ScalarType "float8",ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunName "name" [ScalarType "text"] (ScalarType "name"),EnvCreateFunction FunName "name" [ScalarType "bpchar"] (ScalarType "name"),EnvCreateFunction FunName "name" [ScalarType "varchar"] (ScalarType "name"),EnvCreateFunction FunName "nameeq" [ScalarType "name",ScalarType "name"] (ScalarType "bool"),EnvCreateFunction FunName "namege" [ScalarType "name",ScalarType "name"] (ScalarType "bool"),EnvCreateFunction FunName "namegt" [ScalarType "name",ScalarType "name"] (ScalarType "bool"),EnvCreateFunction FunName "nameiclike" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "nameicnlike" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "nameicregexeq" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "nameicregexne" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "namein" [Pseudo Cstring] (ScalarType "name"),EnvCreateFunction FunName "namele" [ScalarType "name",ScalarType "name"] (ScalarType "bool"),EnvCreateFunction FunName "namelike" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "namelt" [ScalarType "name",ScalarType "name"] (ScalarType "bool"),EnvCreateFunction FunName "namene" [ScalarType "name",ScalarType "name"] (ScalarType "bool"),EnvCreateFunction FunName "namenlike" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "nameout" [ScalarType "name"] (Pseudo Cstring),EnvCreateFunction FunName "namerecv" [Pseudo Internal] (ScalarType "name"),EnvCreateFunction FunName "nameregexeq" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "nameregexne" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "namesend" [ScalarType "name"] (ScalarType "bytea"),EnvCreateFunction FunName "neqjoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "neqsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "netmask" [ScalarType "inet"] (ScalarType "inet"),EnvCreateFunction FunName "network" [ScalarType "inet"] (ScalarType "cidr"),EnvCreateFunction FunName "network_cmp" [ScalarType "inet",ScalarType "inet"] (ScalarType "int4"),EnvCreateFunction FunName "network_eq" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunName "network_ge" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunName "network_gt" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunName "network_le" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunName "network_lt" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunName "network_ne" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunName "network_sub" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunName "network_subeq" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunName "network_sup" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunName "network_supeq" [ScalarType "inet",ScalarType "inet"] (ScalarType "bool"),EnvCreateFunction FunName "nextval" [ScalarType "regclass"] (ScalarType "int8"),EnvCreateFunction FunName "nlikejoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "nlikesel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "notlike" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "bool"),EnvCreateFunction FunName "notlike" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "notlike" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "now" [] (ScalarType "timestamptz"),EnvCreateFunction FunName "npoints" [ScalarType "path"] (ScalarType "int4"),EnvCreateFunction FunName "npoints" [ScalarType "polygon"] (ScalarType "int4"),EnvCreateFunction FunName "numeric" [ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric" [ScalarType "int2"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric" [ScalarType "int4"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric" [ScalarType "float4"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric" [ScalarType "float8"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric" [ScalarType "numeric",ScalarType "int4"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_abs" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_accum" [ArrayType (ScalarType "numeric"),ScalarType "numeric"] (ArrayType (ScalarType "numeric")),EnvCreateFunction FunName "numeric_add" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_avg" [ArrayType (ScalarType "numeric")] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_avg_accum" [ArrayType (ScalarType "numeric"),ScalarType "numeric"] (ArrayType (ScalarType "numeric")),EnvCreateFunction FunName "numeric_cmp" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "int4"),EnvCreateFunction FunName "numeric_div" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_div_trunc" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_eq" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "bool"),EnvCreateFunction FunName "numeric_exp" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_fac" [ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_ge" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "bool"),EnvCreateFunction FunName "numeric_gt" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "bool"),EnvCreateFunction FunName "numeric_in" [Pseudo Cstring,ScalarType "oid",ScalarType "int4"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_inc" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_larger" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_le" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "bool"),EnvCreateFunction FunName "numeric_ln" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_log" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_lt" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "bool"),EnvCreateFunction FunName "numeric_mod" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_mul" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_ne" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "bool"),EnvCreateFunction FunName "numeric_out" [ScalarType "numeric"] (Pseudo Cstring),EnvCreateFunction FunName "numeric_power" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_recv" [Pseudo Internal,ScalarType "oid",ScalarType "int4"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_send" [ScalarType "numeric"] (ScalarType "bytea"),EnvCreateFunction FunName "numeric_smaller" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_sqrt" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_stddev_pop" [ArrayType (ScalarType "numeric")] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_stddev_samp" [ArrayType (ScalarType "numeric")] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_sub" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_uminus" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_uplus" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_var_pop" [ArrayType (ScalarType "numeric")] (ScalarType "numeric"),EnvCreateFunction FunName "numeric_var_samp" [ArrayType (ScalarType "numeric")] (ScalarType "numeric"),EnvCreateFunction FunName "numerictypmodin" [ArrayType (Pseudo Cstring)] (ScalarType "int4"),EnvCreateFunction FunName "numerictypmodout" [ScalarType "int4"] (Pseudo Cstring),EnvCreateFunction FunName "numnode" [ScalarType "tsquery"] (ScalarType "int4"),EnvCreateFunction FunName "obj_description" [ScalarType "oid"] (ScalarType "text"),EnvCreateFunction FunName "obj_description" [ScalarType "oid",ScalarType "name"] (ScalarType "text"),EnvCreateFunction FunName "octet_length" [ScalarType "bytea"] (ScalarType "int4"),EnvCreateFunction FunName "octet_length" [ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "octet_length" [ScalarType "bpchar"] (ScalarType "int4"),EnvCreateFunction FunName "octet_length" [ScalarType "bit"] (ScalarType "int4"),EnvCreateFunction FunName "oid" [ScalarType "int8"] (ScalarType "oid"),EnvCreateFunction FunName "oideq" [ScalarType "oid",ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "oidge" [ScalarType "oid",ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "oidgt" [ScalarType "oid",ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "oidin" [Pseudo Cstring] (ScalarType "oid"),EnvCreateFunction FunName "oidlarger" [ScalarType "oid",ScalarType "oid"] (ScalarType "oid"),EnvCreateFunction FunName "oidle" [ScalarType "oid",ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "oidlt" [ScalarType "oid",ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "oidne" [ScalarType "oid",ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "oidout" [ScalarType "oid"] (Pseudo Cstring),EnvCreateFunction FunName "oidrecv" [Pseudo Internal] (ScalarType "oid"),EnvCreateFunction FunName "oidsend" [ScalarType "oid"] (ScalarType "bytea"),EnvCreateFunction FunName "oidsmaller" [ScalarType "oid",ScalarType "oid"] (ScalarType "oid"),EnvCreateFunction FunName "oidvectoreq" [ScalarType "oidvector",ScalarType "oidvector"] (ScalarType "bool"),EnvCreateFunction FunName "oidvectorge" [ScalarType "oidvector",ScalarType "oidvector"] (ScalarType "bool"),EnvCreateFunction FunName "oidvectorgt" [ScalarType "oidvector",ScalarType "oidvector"] (ScalarType "bool"),EnvCreateFunction FunName "oidvectorin" [Pseudo Cstring] (ScalarType "oidvector"),EnvCreateFunction FunName "oidvectorle" [ScalarType "oidvector",ScalarType "oidvector"] (ScalarType "bool"),EnvCreateFunction FunName "oidvectorlt" [ScalarType "oidvector",ScalarType "oidvector"] (ScalarType "bool"),EnvCreateFunction FunName "oidvectorne" [ScalarType "oidvector",ScalarType "oidvector"] (ScalarType "bool"),EnvCreateFunction FunName "oidvectorout" [ScalarType "oidvector"] (Pseudo Cstring),EnvCreateFunction FunName "oidvectorrecv" [Pseudo Internal] (ScalarType "oidvector"),EnvCreateFunction FunName "oidvectorsend" [ScalarType "oidvector"] (ScalarType "bytea"),EnvCreateFunction FunName "oidvectortypes" [ScalarType "oidvector"] (ScalarType "text"),EnvCreateFunction FunName "on_pb" [ScalarType "point",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "on_pl" [ScalarType "point",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunName "on_ppath" [ScalarType "point",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunName "on_ps" [ScalarType "point",ScalarType "lseg"] (ScalarType "bool"),EnvCreateFunction FunName "on_sb" [ScalarType "lseg",ScalarType "box"] (ScalarType "bool"),EnvCreateFunction FunName "on_sl" [ScalarType "lseg",ScalarType "line"] (ScalarType "bool"),EnvCreateFunction FunName "opaque_in" [Pseudo Cstring] (Pseudo Opaque),EnvCreateFunction FunName "opaque_out" [Pseudo Opaque] (Pseudo Cstring),EnvCreateFunction FunName "overlaps" [ScalarType "time",ScalarType "time",ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunName "overlaps" [ScalarType "time",ScalarType "time",ScalarType "time",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunName "overlaps" [ScalarType "time",ScalarType "interval",ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunName "overlaps" [ScalarType "time",ScalarType "interval",ScalarType "time",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunName "overlaps" [ScalarType "timestamp",ScalarType "timestamp",ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "overlaps" [ScalarType "timestamp",ScalarType "timestamp",ScalarType "timestamp",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunName "overlaps" [ScalarType "timestamp",ScalarType "interval",ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "overlaps" [ScalarType "timestamp",ScalarType "interval",ScalarType "timestamp",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunName "overlaps" [ScalarType "timestamptz",ScalarType "timestamptz",ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "overlaps" [ScalarType "timestamptz",ScalarType "timestamptz",ScalarType "timestamptz",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunName "overlaps" [ScalarType "timestamptz",ScalarType "interval",ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "overlaps" [ScalarType "timestamptz",ScalarType "interval",ScalarType "timestamptz",ScalarType "interval"] (ScalarType "bool"),EnvCreateFunction FunName "overlaps" [ScalarType "timetz",ScalarType "timetz",ScalarType "timetz",ScalarType "timetz"] (ScalarType "bool"),EnvCreateFunction FunName "overlay" [ScalarType "text",ScalarType "text",ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "overlay" [ScalarType "text",ScalarType "text",ScalarType "int4",ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "path" [ScalarType "polygon"] (ScalarType "path"),EnvCreateFunction FunName "path_add" [ScalarType "path",ScalarType "path"] (ScalarType "path"),EnvCreateFunction FunName "path_add_pt" [ScalarType "path",ScalarType "point"] (ScalarType "path"),EnvCreateFunction FunName "path_center" [ScalarType "path"] (ScalarType "point"),EnvCreateFunction FunName "path_contain_pt" [ScalarType "path",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunName "path_distance" [ScalarType "path",ScalarType "path"] (ScalarType "float8"),EnvCreateFunction FunName "path_div_pt" [ScalarType "path",ScalarType "point"] (ScalarType "path"),EnvCreateFunction FunName "path_in" [Pseudo Cstring] (ScalarType "path"),EnvCreateFunction FunName "path_inter" [ScalarType "path",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunName "path_length" [ScalarType "path"] (ScalarType "float8"),EnvCreateFunction FunName "path_mul_pt" [ScalarType "path",ScalarType "point"] (ScalarType "path"),EnvCreateFunction FunName "path_n_eq" [ScalarType "path",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunName "path_n_ge" [ScalarType "path",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunName "path_n_gt" [ScalarType "path",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunName "path_n_le" [ScalarType "path",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunName "path_n_lt" [ScalarType "path",ScalarType "path"] (ScalarType "bool"),EnvCreateFunction FunName "path_npoints" [ScalarType "path"] (ScalarType "int4"),EnvCreateFunction FunName "path_out" [ScalarType "path"] (Pseudo Cstring),EnvCreateFunction FunName "path_recv" [Pseudo Internal] (ScalarType "path"),EnvCreateFunction FunName "path_send" [ScalarType "path"] (ScalarType "bytea"),EnvCreateFunction FunName "path_sub_pt" [ScalarType "path",ScalarType "point"] (ScalarType "path"),EnvCreateFunction FunName "pclose" [ScalarType "path"] (ScalarType "path"),EnvCreateFunction FunName "pg_advisory_lock" [ScalarType "int8"] (Pseudo Void),EnvCreateFunction FunName "pg_advisory_lock" [ScalarType "int4",ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "pg_advisory_lock_shared" [ScalarType "int8"] (Pseudo Void),EnvCreateFunction FunName "pg_advisory_lock_shared" [ScalarType "int4",ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "pg_advisory_unlock" [ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "pg_advisory_unlock" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "pg_advisory_unlock_all" [] (Pseudo Void),EnvCreateFunction FunName "pg_advisory_unlock_shared" [ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "pg_advisory_unlock_shared" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "pg_backend_pid" [] (ScalarType "int4"),EnvCreateFunction FunName "pg_cancel_backend" [ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "pg_char_to_encoding" [ScalarType "name"] (ScalarType "int4"),EnvCreateFunction FunName "pg_client_encoding" [] (ScalarType "name"),EnvCreateFunction FunName "pg_column_size" [Pseudo Any] (ScalarType "int4"),EnvCreateFunction FunName "pg_conf_load_time" [] (ScalarType "timestamptz"),EnvCreateFunction FunName "pg_conversion_is_visible" [ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "pg_current_xlog_insert_location" [] (ScalarType "text"),EnvCreateFunction FunName "pg_current_xlog_location" [] (ScalarType "text"),EnvCreateFunction FunName "pg_cursor" [] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "pg_database_size" [ScalarType "name"] (ScalarType "int8"),EnvCreateFunction FunName "pg_database_size" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_encoding_to_char" [ScalarType "int4"] (ScalarType "name"),EnvCreateFunction FunName "pg_function_is_visible" [ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "pg_get_constraintdef" [ScalarType "oid"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_constraintdef" [ScalarType "oid",ScalarType "bool"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_expr" [ScalarType "text",ScalarType "oid"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_expr" [ScalarType "text",ScalarType "oid",ScalarType "bool"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_function_arguments" [ScalarType "oid"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_function_identity_arguments" [ScalarType "oid"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_function_result" [ScalarType "oid"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_functiondef" [ScalarType "oid"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_indexdef" [ScalarType "oid"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_indexdef" [ScalarType "oid",ScalarType "int4",ScalarType "bool"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_keywords" [] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "pg_get_ruledef" [ScalarType "oid"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_ruledef" [ScalarType "oid",ScalarType "bool"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_serial_sequence" [ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_triggerdef" [ScalarType "oid"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_userbyid" [ScalarType "oid"] (ScalarType "name"),EnvCreateFunction FunName "pg_get_viewdef" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_viewdef" [ScalarType "oid"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_viewdef" [ScalarType "text",ScalarType "bool"] (ScalarType "text"),EnvCreateFunction FunName "pg_get_viewdef" [ScalarType "oid",ScalarType "bool"] (ScalarType "text"),EnvCreateFunction FunName "pg_has_role" [ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "pg_has_role" [ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "pg_has_role" [ScalarType "name",ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "pg_has_role" [ScalarType "name",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "pg_has_role" [ScalarType "oid",ScalarType "name",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "pg_has_role" [ScalarType "oid",ScalarType "oid",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "pg_is_other_temp_schema" [ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "pg_lock_status" [] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "pg_ls_dir" [ScalarType "text"] (SetOfType (ScalarType "text")),EnvCreateFunction FunName "pg_my_temp_schema" [] (ScalarType "oid"),EnvCreateFunction FunName "pg_opclass_is_visible" [ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "pg_operator_is_visible" [ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "pg_options_to_table" [ArrayType (ScalarType "text")] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "pg_postmaster_start_time" [] (ScalarType "timestamptz"),EnvCreateFunction FunName "pg_prepared_statement" [] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "pg_prepared_xact" [] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "pg_read_file" [ScalarType "text",ScalarType "int8",ScalarType "int8"] (ScalarType "text"),EnvCreateFunction FunName "pg_relation_size" [ScalarType "regclass"] (ScalarType "int8"),EnvCreateFunction FunName "pg_relation_size" [ScalarType "regclass",ScalarType "text"] (ScalarType "int8"),EnvCreateFunction FunName "pg_reload_conf" [] (ScalarType "bool"),EnvCreateFunction FunName "pg_rotate_logfile" [] (ScalarType "bool"),EnvCreateFunction FunName "pg_show_all_settings" [] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "pg_size_pretty" [ScalarType "int8"] (ScalarType "text"),EnvCreateFunction FunName "pg_sleep" [ScalarType "float8"] (Pseudo Void),EnvCreateFunction FunName "pg_start_backup" [ScalarType "text",ScalarType "bool"] (ScalarType "text"),EnvCreateFunction FunName "pg_stat_clear_snapshot" [] (Pseudo Void),EnvCreateFunction FunName "pg_stat_file" [ScalarType "text"] (Pseudo Record),EnvCreateFunction FunName "pg_stat_get_activity" [ScalarType "int4"] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "pg_stat_get_backend_activity" [ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "pg_stat_get_backend_activity_start" [ScalarType "int4"] (ScalarType "timestamptz"),EnvCreateFunction FunName "pg_stat_get_backend_client_addr" [ScalarType "int4"] (ScalarType "inet"),EnvCreateFunction FunName "pg_stat_get_backend_client_port" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "pg_stat_get_backend_dbid" [ScalarType "int4"] (ScalarType "oid"),EnvCreateFunction FunName "pg_stat_get_backend_idset" [] (SetOfType (ScalarType "int4")),EnvCreateFunction FunName "pg_stat_get_backend_pid" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "pg_stat_get_backend_start" [ScalarType "int4"] (ScalarType "timestamptz"),EnvCreateFunction FunName "pg_stat_get_backend_userid" [ScalarType "int4"] (ScalarType "oid"),EnvCreateFunction FunName "pg_stat_get_backend_waiting" [ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "pg_stat_get_backend_xact_start" [ScalarType "int4"] (ScalarType "timestamptz"),EnvCreateFunction FunName "pg_stat_get_bgwriter_buf_written_checkpoints" [] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_bgwriter_buf_written_clean" [] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_bgwriter_maxwritten_clean" [] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_bgwriter_requested_checkpoints" [] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_bgwriter_timed_checkpoints" [] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_blocks_fetched" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_blocks_hit" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_buf_alloc" [] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_buf_written_backend" [] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_db_blocks_fetched" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_db_blocks_hit" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_db_numbackends" [ScalarType "oid"] (ScalarType "int4"),EnvCreateFunction FunName "pg_stat_get_db_tuples_deleted" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_db_tuples_fetched" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_db_tuples_inserted" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_db_tuples_returned" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_db_tuples_updated" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_db_xact_commit" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_db_xact_rollback" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_dead_tuples" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_function_calls" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_function_self_time" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_function_time" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_last_analyze_time" [ScalarType "oid"] (ScalarType "timestamptz"),EnvCreateFunction FunName "pg_stat_get_last_autoanalyze_time" [ScalarType "oid"] (ScalarType "timestamptz"),EnvCreateFunction FunName "pg_stat_get_last_autovacuum_time" [ScalarType "oid"] (ScalarType "timestamptz"),EnvCreateFunction FunName "pg_stat_get_last_vacuum_time" [ScalarType "oid"] (ScalarType "timestamptz"),EnvCreateFunction FunName "pg_stat_get_live_tuples" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_numscans" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_tuples_deleted" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_tuples_fetched" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_tuples_hot_updated" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_tuples_inserted" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_tuples_returned" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_get_tuples_updated" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_stat_reset" [] (Pseudo Void),EnvCreateFunction FunName "pg_stop_backup" [] (ScalarType "text"),EnvCreateFunction FunName "pg_switch_xlog" [] (ScalarType "text"),EnvCreateFunction FunName "pg_table_is_visible" [ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "pg_tablespace_databases" [ScalarType "oid"] (SetOfType (ScalarType "oid")),EnvCreateFunction FunName "pg_tablespace_size" [ScalarType "name"] (ScalarType "int8"),EnvCreateFunction FunName "pg_tablespace_size" [ScalarType "oid"] (ScalarType "int8"),EnvCreateFunction FunName "pg_terminate_backend" [ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "pg_timezone_abbrevs" [] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "pg_timezone_names" [] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "pg_total_relation_size" [ScalarType "regclass"] (ScalarType "int8"),EnvCreateFunction FunName "pg_try_advisory_lock" [ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "pg_try_advisory_lock" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "pg_try_advisory_lock_shared" [ScalarType "int8"] (ScalarType "bool"),EnvCreateFunction FunName "pg_try_advisory_lock_shared" [ScalarType "int4",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "pg_ts_config_is_visible" [ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "pg_ts_dict_is_visible" [ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "pg_ts_parser_is_visible" [ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "pg_ts_template_is_visible" [ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "pg_type_is_visible" [ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "pg_typeof" [Pseudo Any] (ScalarType "regtype"),EnvCreateFunction FunName "pg_xlogfile_name" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "pg_xlogfile_name_offset" [ScalarType "text"] (Pseudo Record),EnvCreateFunction FunName "pi" [] (ScalarType "float8"),EnvCreateFunction FunName "plainto_tsquery" [ScalarType "text"] (ScalarType "tsquery"),EnvCreateFunction FunName "plainto_tsquery" [ScalarType "regconfig",ScalarType "text"] (ScalarType "tsquery"),EnvCreateFunction FunName "point" [ScalarType "lseg"] (ScalarType "point"),EnvCreateFunction FunName "point" [ScalarType "path"] (ScalarType "point"),EnvCreateFunction FunName "point" [ScalarType "box"] (ScalarType "point"),EnvCreateFunction FunName "point" [ScalarType "polygon"] (ScalarType "point"),EnvCreateFunction FunName "point" [ScalarType "circle"] (ScalarType "point"),EnvCreateFunction FunName "point" [ScalarType "float8",ScalarType "float8"] (ScalarType "point"),EnvCreateFunction FunName "point_above" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunName "point_add" [ScalarType "point",ScalarType "point"] (ScalarType "point"),EnvCreateFunction FunName "point_below" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunName "point_distance" [ScalarType "point",ScalarType "point"] (ScalarType "float8"),EnvCreateFunction FunName "point_div" [ScalarType "point",ScalarType "point"] (ScalarType "point"),EnvCreateFunction FunName "point_eq" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunName "point_horiz" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunName "point_in" [Pseudo Cstring] (ScalarType "point"),EnvCreateFunction FunName "point_left" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunName "point_mul" [ScalarType "point",ScalarType "point"] (ScalarType "point"),EnvCreateFunction FunName "point_ne" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunName "point_out" [ScalarType "point"] (Pseudo Cstring),EnvCreateFunction FunName "point_recv" [Pseudo Internal] (ScalarType "point"),EnvCreateFunction FunName "point_right" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunName "point_send" [ScalarType "point"] (ScalarType "bytea"),EnvCreateFunction FunName "point_sub" [ScalarType "point",ScalarType "point"] (ScalarType "point"),EnvCreateFunction FunName "point_vert" [ScalarType "point",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunName "poly_above" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunName "poly_below" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunName "poly_center" [ScalarType "polygon"] (ScalarType "point"),EnvCreateFunction FunName "poly_contain" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunName "poly_contain_pt" [ScalarType "polygon",ScalarType "point"] (ScalarType "bool"),EnvCreateFunction FunName "poly_contained" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunName "poly_distance" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "float8"),EnvCreateFunction FunName "poly_in" [Pseudo Cstring] (ScalarType "polygon"),EnvCreateFunction FunName "poly_left" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunName "poly_npoints" [ScalarType "polygon"] (ScalarType "int4"),EnvCreateFunction FunName "poly_out" [ScalarType "polygon"] (Pseudo Cstring),EnvCreateFunction FunName "poly_overabove" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunName "poly_overbelow" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunName "poly_overlap" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunName "poly_overleft" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunName "poly_overright" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunName "poly_recv" [Pseudo Internal] (ScalarType "polygon"),EnvCreateFunction FunName "poly_right" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunName "poly_same" [ScalarType "polygon",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunName "poly_send" [ScalarType "polygon"] (ScalarType "bytea"),EnvCreateFunction FunName "polygon" [ScalarType "path"] (ScalarType "polygon"),EnvCreateFunction FunName "polygon" [ScalarType "box"] (ScalarType "polygon"),EnvCreateFunction FunName "polygon" [ScalarType "circle"] (ScalarType "polygon"),EnvCreateFunction FunName "polygon" [ScalarType "int4",ScalarType "circle"] (ScalarType "polygon"),EnvCreateFunction FunName "popen" [ScalarType "path"] (ScalarType "path"),EnvCreateFunction FunName "position" [ScalarType "bytea",ScalarType "bytea"] (ScalarType "int4"),EnvCreateFunction FunName "position" [ScalarType "text",ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "position" [ScalarType "bit",ScalarType "bit"] (ScalarType "int4"),EnvCreateFunction FunName "positionjoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "positionsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "postgresql_fdw_validator" [ArrayType (ScalarType "text"),ScalarType "oid"] (ScalarType "bool"),EnvCreateFunction FunName "pow" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "pow" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "power" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "power" [ScalarType "numeric",ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "prsd_end" [Pseudo Internal] (Pseudo Void),EnvCreateFunction FunName "prsd_headline" [Pseudo Internal,Pseudo Internal,ScalarType "tsquery"] (Pseudo Internal),EnvCreateFunction FunName "prsd_lextype" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "prsd_nexttoken" [Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "prsd_start" [Pseudo Internal,ScalarType "int4"] (Pseudo Internal),EnvCreateFunction FunName "pt_contained_circle" [ScalarType "point",ScalarType "circle"] (ScalarType "bool"),EnvCreateFunction FunName "pt_contained_poly" [ScalarType "point",ScalarType "polygon"] (ScalarType "bool"),EnvCreateFunction FunName "query_to_xml" [ScalarType "text",ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "query_to_xml_and_xmlschema" [ScalarType "text",ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "query_to_xmlschema" [ScalarType "text",ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "querytree" [ScalarType "tsquery"] (ScalarType "text"),EnvCreateFunction FunName "quote_ident" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "quote_literal" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "quote_literal" [Pseudo AnyElement] (ScalarType "text"),EnvCreateFunction FunName "quote_nullable" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "quote_nullable" [Pseudo AnyElement] (ScalarType "text"),EnvCreateFunction FunName "radians" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "radius" [ScalarType "circle"] (ScalarType "float8"),EnvCreateFunction FunName "random" [] (ScalarType "float8"),EnvCreateFunction FunName "record_eq" [Pseudo Record,Pseudo Record] (ScalarType "bool"),EnvCreateFunction FunName "record_ge" [Pseudo Record,Pseudo Record] (ScalarType "bool"),EnvCreateFunction FunName "record_gt" [Pseudo Record,Pseudo Record] (ScalarType "bool"),EnvCreateFunction FunName "record_in" [Pseudo Cstring,ScalarType "oid",ScalarType "int4"] (Pseudo Record),EnvCreateFunction FunName "record_le" [Pseudo Record,Pseudo Record] (ScalarType "bool"),EnvCreateFunction FunName "record_lt" [Pseudo Record,Pseudo Record] (ScalarType "bool"),EnvCreateFunction FunName "record_ne" [Pseudo Record,Pseudo Record] (ScalarType "bool"),EnvCreateFunction FunName "record_out" [Pseudo Record] (Pseudo Cstring),EnvCreateFunction FunName "record_recv" [Pseudo Internal,ScalarType "oid",ScalarType "int4"] (Pseudo Record),EnvCreateFunction FunName "record_send" [Pseudo Record] (ScalarType "bytea"),EnvCreateFunction FunName "regclass" [ScalarType "text"] (ScalarType "regclass"),EnvCreateFunction FunName "regclassin" [Pseudo Cstring] (ScalarType "regclass"),EnvCreateFunction FunName "regclassout" [ScalarType "regclass"] (Pseudo Cstring),EnvCreateFunction FunName "regclassrecv" [Pseudo Internal] (ScalarType "regclass"),EnvCreateFunction FunName "regclasssend" [ScalarType "regclass"] (ScalarType "bytea"),EnvCreateFunction FunName "regconfigin" [Pseudo Cstring] (ScalarType "regconfig"),EnvCreateFunction FunName "regconfigout" [ScalarType "regconfig"] (Pseudo Cstring),EnvCreateFunction FunName "regconfigrecv" [Pseudo Internal] (ScalarType "regconfig"),EnvCreateFunction FunName "regconfigsend" [ScalarType "regconfig"] (ScalarType "bytea"),EnvCreateFunction FunName "regdictionaryin" [Pseudo Cstring] (ScalarType "regdictionary"),EnvCreateFunction FunName "regdictionaryout" [ScalarType "regdictionary"] (Pseudo Cstring),EnvCreateFunction FunName "regdictionaryrecv" [Pseudo Internal] (ScalarType "regdictionary"),EnvCreateFunction FunName "regdictionarysend" [ScalarType "regdictionary"] (ScalarType "bytea"),EnvCreateFunction FunName "regexeqjoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "regexeqsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "regexnejoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "regexnesel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "regexp_matches" [ScalarType "text",ScalarType "text"] (SetOfType (ArrayType (ScalarType "text"))),EnvCreateFunction FunName "regexp_matches" [ScalarType "text",ScalarType "text",ScalarType "text"] (SetOfType (ArrayType (ScalarType "text"))),EnvCreateFunction FunName "regexp_replace" [ScalarType "text",ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "regexp_replace" [ScalarType "text",ScalarType "text",ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "regexp_split_to_array" [ScalarType "text",ScalarType "text"] (ArrayType (ScalarType "text")),EnvCreateFunction FunName "regexp_split_to_array" [ScalarType "text",ScalarType "text",ScalarType "text"] (ArrayType (ScalarType "text")),EnvCreateFunction FunName "regexp_split_to_table" [ScalarType "text",ScalarType "text"] (SetOfType (ScalarType "text")),EnvCreateFunction FunName "regexp_split_to_table" [ScalarType "text",ScalarType "text",ScalarType "text"] (SetOfType (ScalarType "text")),EnvCreateFunction FunName "regoperatorin" [Pseudo Cstring] (ScalarType "regoperator"),EnvCreateFunction FunName "regoperatorout" [ScalarType "regoperator"] (Pseudo Cstring),EnvCreateFunction FunName "regoperatorrecv" [Pseudo Internal] (ScalarType "regoperator"),EnvCreateFunction FunName "regoperatorsend" [ScalarType "regoperator"] (ScalarType "bytea"),EnvCreateFunction FunName "regoperin" [Pseudo Cstring] (ScalarType "regoper"),EnvCreateFunction FunName "regoperout" [ScalarType "regoper"] (Pseudo Cstring),EnvCreateFunction FunName "regoperrecv" [Pseudo Internal] (ScalarType "regoper"),EnvCreateFunction FunName "regopersend" [ScalarType "regoper"] (ScalarType "bytea"),EnvCreateFunction FunName "regprocedurein" [Pseudo Cstring] (ScalarType "regprocedure"),EnvCreateFunction FunName "regprocedureout" [ScalarType "regprocedure"] (Pseudo Cstring),EnvCreateFunction FunName "regprocedurerecv" [Pseudo Internal] (ScalarType "regprocedure"),EnvCreateFunction FunName "regproceduresend" [ScalarType "regprocedure"] (ScalarType "bytea"),EnvCreateFunction FunName "regprocin" [Pseudo Cstring] (ScalarType "regproc"),EnvCreateFunction FunName "regprocout" [ScalarType "regproc"] (Pseudo Cstring),EnvCreateFunction FunName "regprocrecv" [Pseudo Internal] (ScalarType "regproc"),EnvCreateFunction FunName "regprocsend" [ScalarType "regproc"] (ScalarType "bytea"),EnvCreateFunction FunName "regtypein" [Pseudo Cstring] (ScalarType "regtype"),EnvCreateFunction FunName "regtypeout" [ScalarType "regtype"] (Pseudo Cstring),EnvCreateFunction FunName "regtyperecv" [Pseudo Internal] (ScalarType "regtype"),EnvCreateFunction FunName "regtypesend" [ScalarType "regtype"] (ScalarType "bytea"),EnvCreateFunction FunName "reltime" [ScalarType "interval"] (ScalarType "reltime"),EnvCreateFunction FunName "reltimeeq" [ScalarType "reltime",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunName "reltimege" [ScalarType "reltime",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunName "reltimegt" [ScalarType "reltime",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunName "reltimein" [Pseudo Cstring] (ScalarType "reltime"),EnvCreateFunction FunName "reltimele" [ScalarType "reltime",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunName "reltimelt" [ScalarType "reltime",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunName "reltimene" [ScalarType "reltime",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunName "reltimeout" [ScalarType "reltime"] (Pseudo Cstring),EnvCreateFunction FunName "reltimerecv" [Pseudo Internal] (ScalarType "reltime"),EnvCreateFunction FunName "reltimesend" [ScalarType "reltime"] (ScalarType "bytea"),EnvCreateFunction FunName "repeat" [ScalarType "text",ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "replace" [ScalarType "text",ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "round" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "round" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "round" [ScalarType "numeric",ScalarType "int4"] (ScalarType "numeric"),EnvCreateFunction FunName "rpad" [ScalarType "text",ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "rpad" [ScalarType "text",ScalarType "int4",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "rtrim" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "rtrim" [ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "scalargtjoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "scalargtsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "scalarltjoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "scalarltsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "schema_to_xml" [ScalarType "name",ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "schema_to_xml_and_xmlschema" [ScalarType "name",ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "schema_to_xmlschema" [ScalarType "name",ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "session_user" [] (ScalarType "name"),EnvCreateFunction FunName "set_bit" [ScalarType "bytea",ScalarType "int4",ScalarType "int4"] (ScalarType "bytea"),EnvCreateFunction FunName "set_byte" [ScalarType "bytea",ScalarType "int4",ScalarType "int4"] (ScalarType "bytea"),EnvCreateFunction FunName "set_config" [ScalarType "text",ScalarType "text",ScalarType "bool"] (ScalarType "text"),EnvCreateFunction FunName "set_masklen" [ScalarType "cidr",ScalarType "int4"] (ScalarType "cidr"),EnvCreateFunction FunName "set_masklen" [ScalarType "inet",ScalarType "int4"] (ScalarType "inet"),EnvCreateFunction FunName "setseed" [ScalarType "float8"] (Pseudo Void),EnvCreateFunction FunName "setval" [ScalarType "regclass",ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunName "setval" [ScalarType "regclass",ScalarType "int8",ScalarType "bool"] (ScalarType "int8"),EnvCreateFunction FunName "setweight" [ScalarType "tsvector",ScalarType "char"] (ScalarType "tsvector"),EnvCreateFunction FunName "shell_in" [Pseudo Cstring] (Pseudo Opaque),EnvCreateFunction FunName "shell_out" [Pseudo Opaque] (Pseudo Cstring),EnvCreateFunction FunName "shift_jis_2004_to_euc_jis_2004" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "shift_jis_2004_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "shobj_description" [ScalarType "oid",ScalarType "name"] (ScalarType "text"),EnvCreateFunction FunName "sign" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "sign" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "similar_escape" [ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "sin" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "sjis_to_euc_jp" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "sjis_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "sjis_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "slope" [ScalarType "point",ScalarType "point"] (ScalarType "float8"),EnvCreateFunction FunName "smgreq" [ScalarType "smgr",ScalarType "smgr"] (ScalarType "bool"),EnvCreateFunction FunName "smgrin" [Pseudo Cstring] (ScalarType "smgr"),EnvCreateFunction FunName "smgrne" [ScalarType "smgr",ScalarType "smgr"] (ScalarType "bool"),EnvCreateFunction FunName "smgrout" [ScalarType "smgr"] (Pseudo Cstring),EnvCreateFunction FunName "split_part" [ScalarType "text",ScalarType "text",ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "sqrt" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "sqrt" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "statement_timestamp" [] (ScalarType "timestamptz"),EnvCreateFunction FunName "string_to_array" [ScalarType "text",ScalarType "text"] (ArrayType (ScalarType "text")),EnvCreateFunction FunName "strip" [ScalarType "tsvector"] (ScalarType "tsvector"),EnvCreateFunction FunName "strpos" [ScalarType "text",ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "substr" [ScalarType "bytea",ScalarType "int4"] (ScalarType "bytea"),EnvCreateFunction FunName "substr" [ScalarType "text",ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "substr" [ScalarType "bytea",ScalarType "int4",ScalarType "int4"] (ScalarType "bytea"),EnvCreateFunction FunName "substr" [ScalarType "text",ScalarType "int4",ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "substring" [ScalarType "bytea",ScalarType "int4"] (ScalarType "bytea"),EnvCreateFunction FunName "substring" [ScalarType "text",ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "substring" [ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "substring" [ScalarType "bit",ScalarType "int4"] (ScalarType "bit"),EnvCreateFunction FunName "substring" [ScalarType "bytea",ScalarType "int4",ScalarType "int4"] (ScalarType "bytea"),EnvCreateFunction FunName "substring" [ScalarType "text",ScalarType "int4",ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "substring" [ScalarType "text",ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "substring" [ScalarType "bit",ScalarType "int4",ScalarType "int4"] (ScalarType "bit"),EnvCreateFunction FunName "suppress_redundant_updates_trigger" [] (Pseudo Trigger),EnvCreateFunction FunName "table_to_xml" [ScalarType "regclass",ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "table_to_xml_and_xmlschema" [ScalarType "regclass",ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "table_to_xmlschema" [ScalarType "regclass",ScalarType "bool",ScalarType "bool",ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "tan" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "text" [ScalarType "bool"] (ScalarType "text"),EnvCreateFunction FunName "text" [ScalarType "char"] (ScalarType "text"),EnvCreateFunction FunName "text" [ScalarType "name"] (ScalarType "text"),EnvCreateFunction FunName "text" [ScalarType "xml"] (ScalarType "text"),EnvCreateFunction FunName "text" [ScalarType "inet"] (ScalarType "text"),EnvCreateFunction FunName "text" [ScalarType "bpchar"] (ScalarType "text"),EnvCreateFunction FunName "text_ge" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "text_gt" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "text_larger" [ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "text_le" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "text_lt" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "text_pattern_ge" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "text_pattern_gt" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "text_pattern_le" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "text_pattern_lt" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "text_smaller" [ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "textanycat" [ScalarType "text",Pseudo AnyNonArray] (ScalarType "text"),EnvCreateFunction FunName "textcat" [ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "texteq" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "texticlike" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "texticnlike" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "texticregexeq" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "texticregexne" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "textin" [Pseudo Cstring] (ScalarType "text"),EnvCreateFunction FunName "textlen" [ScalarType "text"] (ScalarType "int4"),EnvCreateFunction FunName "textlike" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "textne" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "textnlike" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "textout" [ScalarType "text"] (Pseudo Cstring),EnvCreateFunction FunName "textrecv" [Pseudo Internal] (ScalarType "text"),EnvCreateFunction FunName "textregexeq" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "textregexne" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "textsend" [ScalarType "text"] (ScalarType "bytea"),EnvCreateFunction FunName "thesaurus_init" [Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "thesaurus_lexize" [Pseudo Internal,Pseudo Internal,Pseudo Internal,Pseudo Internal] (Pseudo Internal),EnvCreateFunction FunName "tideq" [ScalarType "tid",ScalarType "tid"] (ScalarType "bool"),EnvCreateFunction FunName "tidge" [ScalarType "tid",ScalarType "tid"] (ScalarType "bool"),EnvCreateFunction FunName "tidgt" [ScalarType "tid",ScalarType "tid"] (ScalarType "bool"),EnvCreateFunction FunName "tidin" [Pseudo Cstring] (ScalarType "tid"),EnvCreateFunction FunName "tidlarger" [ScalarType "tid",ScalarType "tid"] (ScalarType "tid"),EnvCreateFunction FunName "tidle" [ScalarType "tid",ScalarType "tid"] (ScalarType "bool"),EnvCreateFunction FunName "tidlt" [ScalarType "tid",ScalarType "tid"] (ScalarType "bool"),EnvCreateFunction FunName "tidne" [ScalarType "tid",ScalarType "tid"] (ScalarType "bool"),EnvCreateFunction FunName "tidout" [ScalarType "tid"] (Pseudo Cstring),EnvCreateFunction FunName "tidrecv" [Pseudo Internal] (ScalarType "tid"),EnvCreateFunction FunName "tidsend" [ScalarType "tid"] (ScalarType "bytea"),EnvCreateFunction FunName "tidsmaller" [ScalarType "tid",ScalarType "tid"] (ScalarType "tid"),EnvCreateFunction FunName "time" [ScalarType "abstime"] (ScalarType "time"),EnvCreateFunction FunName "time" [ScalarType "timestamp"] (ScalarType "time"),EnvCreateFunction FunName "time" [ScalarType "timestamptz"] (ScalarType "time"),EnvCreateFunction FunName "time" [ScalarType "interval"] (ScalarType "time"),EnvCreateFunction FunName "time" [ScalarType "timetz"] (ScalarType "time"),EnvCreateFunction FunName "time" [ScalarType "time",ScalarType "int4"] (ScalarType "time"),EnvCreateFunction FunName "time_cmp" [ScalarType "time",ScalarType "time"] (ScalarType "int4"),EnvCreateFunction FunName "time_eq" [ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunName "time_ge" [ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunName "time_gt" [ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunName "time_hash" [ScalarType "time"] (ScalarType "int4"),EnvCreateFunction FunName "time_in" [Pseudo Cstring,ScalarType "oid",ScalarType "int4"] (ScalarType "time"),EnvCreateFunction FunName "time_larger" [ScalarType "time",ScalarType "time"] (ScalarType "time"),EnvCreateFunction FunName "time_le" [ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunName "time_lt" [ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunName "time_mi_interval" [ScalarType "time",ScalarType "interval"] (ScalarType "time"),EnvCreateFunction FunName "time_mi_time" [ScalarType "time",ScalarType "time"] (ScalarType "interval"),EnvCreateFunction FunName "time_ne" [ScalarType "time",ScalarType "time"] (ScalarType "bool"),EnvCreateFunction FunName "time_out" [ScalarType "time"] (Pseudo Cstring),EnvCreateFunction FunName "time_pl_interval" [ScalarType "time",ScalarType "interval"] (ScalarType "time"),EnvCreateFunction FunName "time_recv" [Pseudo Internal,ScalarType "oid",ScalarType "int4"] (ScalarType "time"),EnvCreateFunction FunName "time_send" [ScalarType "time"] (ScalarType "bytea"),EnvCreateFunction FunName "time_smaller" [ScalarType "time",ScalarType "time"] (ScalarType "time"),EnvCreateFunction FunName "timedate_pl" [ScalarType "time",ScalarType "date"] (ScalarType "timestamp"),EnvCreateFunction FunName "timemi" [ScalarType "abstime",ScalarType "reltime"] (ScalarType "abstime"),EnvCreateFunction FunName "timenow" [] (ScalarType "abstime"),EnvCreateFunction FunName "timeofday" [] (ScalarType "text"),EnvCreateFunction FunName "timepl" [ScalarType "abstime",ScalarType "reltime"] (ScalarType "abstime"),EnvCreateFunction FunName "timestamp" [ScalarType "abstime"] (ScalarType "timestamp"),EnvCreateFunction FunName "timestamp" [ScalarType "date"] (ScalarType "timestamp"),EnvCreateFunction FunName "timestamp" [ScalarType "timestamptz"] (ScalarType "timestamp"),EnvCreateFunction FunName "timestamp" [ScalarType "date",ScalarType "time"] (ScalarType "timestamp"),EnvCreateFunction FunName "timestamp" [ScalarType "timestamp",ScalarType "int4"] (ScalarType "timestamp"),EnvCreateFunction FunName "timestamp_cmp" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "int4"),EnvCreateFunction FunName "timestamp_cmp_date" [ScalarType "timestamp",ScalarType "date"] (ScalarType "int4"),EnvCreateFunction FunName "timestamp_cmp_timestamptz" [ScalarType "timestamp",ScalarType "timestamptz"] (ScalarType "int4"),EnvCreateFunction FunName "timestamp_eq" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_eq_date" [ScalarType "timestamp",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_eq_timestamptz" [ScalarType "timestamp",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_ge" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_ge_date" [ScalarType "timestamp",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_ge_timestamptz" [ScalarType "timestamp",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_gt" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_gt_date" [ScalarType "timestamp",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_gt_timestamptz" [ScalarType "timestamp",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_hash" [ScalarType "timestamp"] (ScalarType "int4"),EnvCreateFunction FunName "timestamp_in" [Pseudo Cstring,ScalarType "oid",ScalarType "int4"] (ScalarType "timestamp"),EnvCreateFunction FunName "timestamp_larger" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "timestamp"),EnvCreateFunction FunName "timestamp_le" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_le_date" [ScalarType "timestamp",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_le_timestamptz" [ScalarType "timestamp",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_lt" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_lt_date" [ScalarType "timestamp",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_lt_timestamptz" [ScalarType "timestamp",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_mi" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "interval"),EnvCreateFunction FunName "timestamp_mi_interval" [ScalarType "timestamp",ScalarType "interval"] (ScalarType "timestamp"),EnvCreateFunction FunName "timestamp_ne" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_ne_date" [ScalarType "timestamp",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_ne_timestamptz" [ScalarType "timestamp",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "timestamp_out" [ScalarType "timestamp"] (Pseudo Cstring),EnvCreateFunction FunName "timestamp_pl_interval" [ScalarType "timestamp",ScalarType "interval"] (ScalarType "timestamp"),EnvCreateFunction FunName "timestamp_recv" [Pseudo Internal,ScalarType "oid",ScalarType "int4"] (ScalarType "timestamp"),EnvCreateFunction FunName "timestamp_send" [ScalarType "timestamp"] (ScalarType "bytea"),EnvCreateFunction FunName "timestamp_smaller" [ScalarType "timestamp",ScalarType "timestamp"] (ScalarType "timestamp"),EnvCreateFunction FunName "timestamptypmodin" [ArrayType (Pseudo Cstring)] (ScalarType "int4"),EnvCreateFunction FunName "timestamptypmodout" [ScalarType "int4"] (Pseudo Cstring),EnvCreateFunction FunName "timestamptz" [ScalarType "abstime"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timestamptz" [ScalarType "date"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timestamptz" [ScalarType "timestamp"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timestamptz" [ScalarType "date",ScalarType "time"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timestamptz" [ScalarType "date",ScalarType "timetz"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timestamptz" [ScalarType "timestamptz",ScalarType "int4"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timestamptz_cmp" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "int4"),EnvCreateFunction FunName "timestamptz_cmp_date" [ScalarType "timestamptz",ScalarType "date"] (ScalarType "int4"),EnvCreateFunction FunName "timestamptz_cmp_timestamp" [ScalarType "timestamptz",ScalarType "timestamp"] (ScalarType "int4"),EnvCreateFunction FunName "timestamptz_eq" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_eq_date" [ScalarType "timestamptz",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_eq_timestamp" [ScalarType "timestamptz",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_ge" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_ge_date" [ScalarType "timestamptz",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_ge_timestamp" [ScalarType "timestamptz",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_gt" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_gt_date" [ScalarType "timestamptz",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_gt_timestamp" [ScalarType "timestamptz",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_in" [Pseudo Cstring,ScalarType "oid",ScalarType "int4"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timestamptz_larger" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timestamptz_le" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_le_date" [ScalarType "timestamptz",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_le_timestamp" [ScalarType "timestamptz",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_lt" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_lt_date" [ScalarType "timestamptz",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_lt_timestamp" [ScalarType "timestamptz",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_mi" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "interval"),EnvCreateFunction FunName "timestamptz_mi_interval" [ScalarType "timestamptz",ScalarType "interval"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timestamptz_ne" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_ne_date" [ScalarType "timestamptz",ScalarType "date"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_ne_timestamp" [ScalarType "timestamptz",ScalarType "timestamp"] (ScalarType "bool"),EnvCreateFunction FunName "timestamptz_out" [ScalarType "timestamptz"] (Pseudo Cstring),EnvCreateFunction FunName "timestamptz_pl_interval" [ScalarType "timestamptz",ScalarType "interval"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timestamptz_recv" [Pseudo Internal,ScalarType "oid",ScalarType "int4"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timestamptz_send" [ScalarType "timestamptz"] (ScalarType "bytea"),EnvCreateFunction FunName "timestamptz_smaller" [ScalarType "timestamptz",ScalarType "timestamptz"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timestamptztypmodin" [ArrayType (Pseudo Cstring)] (ScalarType "int4"),EnvCreateFunction FunName "timestamptztypmodout" [ScalarType "int4"] (Pseudo Cstring),EnvCreateFunction FunName "timetypmodin" [ArrayType (Pseudo Cstring)] (ScalarType "int4"),EnvCreateFunction FunName "timetypmodout" [ScalarType "int4"] (Pseudo Cstring),EnvCreateFunction FunName "timetz" [ScalarType "time"] (ScalarType "timetz"),EnvCreateFunction FunName "timetz" [ScalarType "timestamptz"] (ScalarType "timetz"),EnvCreateFunction FunName "timetz" [ScalarType "timetz",ScalarType "int4"] (ScalarType "timetz"),EnvCreateFunction FunName "timetz_cmp" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "int4"),EnvCreateFunction FunName "timetz_eq" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "bool"),EnvCreateFunction FunName "timetz_ge" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "bool"),EnvCreateFunction FunName "timetz_gt" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "bool"),EnvCreateFunction FunName "timetz_hash" [ScalarType "timetz"] (ScalarType "int4"),EnvCreateFunction FunName "timetz_in" [Pseudo Cstring,ScalarType "oid",ScalarType "int4"] (ScalarType "timetz"),EnvCreateFunction FunName "timetz_larger" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "timetz"),EnvCreateFunction FunName "timetz_le" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "bool"),EnvCreateFunction FunName "timetz_lt" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "bool"),EnvCreateFunction FunName "timetz_mi_interval" [ScalarType "timetz",ScalarType "interval"] (ScalarType "timetz"),EnvCreateFunction FunName "timetz_ne" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "bool"),EnvCreateFunction FunName "timetz_out" [ScalarType "timetz"] (Pseudo Cstring),EnvCreateFunction FunName "timetz_pl_interval" [ScalarType "timetz",ScalarType "interval"] (ScalarType "timetz"),EnvCreateFunction FunName "timetz_recv" [Pseudo Internal,ScalarType "oid",ScalarType "int4"] (ScalarType "timetz"),EnvCreateFunction FunName "timetz_send" [ScalarType "timetz"] (ScalarType "bytea"),EnvCreateFunction FunName "timetz_smaller" [ScalarType "timetz",ScalarType "timetz"] (ScalarType "timetz"),EnvCreateFunction FunName "timetzdate_pl" [ScalarType "timetz",ScalarType "date"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timetztypmodin" [ArrayType (Pseudo Cstring)] (ScalarType "int4"),EnvCreateFunction FunName "timetztypmodout" [ScalarType "int4"] (Pseudo Cstring),EnvCreateFunction FunName "timezone" [ScalarType "text",ScalarType "timestamp"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timezone" [ScalarType "text",ScalarType "timestamptz"] (ScalarType "timestamp"),EnvCreateFunction FunName "timezone" [ScalarType "text",ScalarType "timetz"] (ScalarType "timetz"),EnvCreateFunction FunName "timezone" [ScalarType "interval",ScalarType "timestamp"] (ScalarType "timestamptz"),EnvCreateFunction FunName "timezone" [ScalarType "interval",ScalarType "timestamptz"] (ScalarType "timestamp"),EnvCreateFunction FunName "timezone" [ScalarType "interval",ScalarType "timetz"] (ScalarType "timetz"),EnvCreateFunction FunName "tinterval" [ScalarType "abstime",ScalarType "abstime"] (ScalarType "tinterval"),EnvCreateFunction FunName "tintervalct" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunName "tintervalend" [ScalarType "tinterval"] (ScalarType "abstime"),EnvCreateFunction FunName "tintervaleq" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunName "tintervalge" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunName "tintervalgt" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunName "tintervalin" [Pseudo Cstring] (ScalarType "tinterval"),EnvCreateFunction FunName "tintervalle" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunName "tintervalleneq" [ScalarType "tinterval",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunName "tintervallenge" [ScalarType "tinterval",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunName "tintervallengt" [ScalarType "tinterval",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunName "tintervallenle" [ScalarType "tinterval",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunName "tintervallenlt" [ScalarType "tinterval",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunName "tintervallenne" [ScalarType "tinterval",ScalarType "reltime"] (ScalarType "bool"),EnvCreateFunction FunName "tintervallt" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunName "tintervalne" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunName "tintervalout" [ScalarType "tinterval"] (Pseudo Cstring),EnvCreateFunction FunName "tintervalov" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunName "tintervalrecv" [Pseudo Internal] (ScalarType "tinterval"),EnvCreateFunction FunName "tintervalrel" [ScalarType "tinterval"] (ScalarType "reltime"),EnvCreateFunction FunName "tintervalsame" [ScalarType "tinterval",ScalarType "tinterval"] (ScalarType "bool"),EnvCreateFunction FunName "tintervalsend" [ScalarType "tinterval"] (ScalarType "bytea"),EnvCreateFunction FunName "tintervalstart" [ScalarType "tinterval"] (ScalarType "abstime"),EnvCreateFunction FunName "to_ascii" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "to_ascii" [ScalarType "text",ScalarType "name"] (ScalarType "text"),EnvCreateFunction FunName "to_ascii" [ScalarType "text",ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "to_char" [ScalarType "int8",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "to_char" [ScalarType "int4",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "to_char" [ScalarType "float4",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "to_char" [ScalarType "float8",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "to_char" [ScalarType "timestamp",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "to_char" [ScalarType "timestamptz",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "to_char" [ScalarType "interval",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "to_char" [ScalarType "numeric",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "to_date" [ScalarType "text",ScalarType "text"] (ScalarType "date"),EnvCreateFunction FunName "to_hex" [ScalarType "int8"] (ScalarType "text"),EnvCreateFunction FunName "to_hex" [ScalarType "int4"] (ScalarType "text"),EnvCreateFunction FunName "to_number" [ScalarType "text",ScalarType "text"] (ScalarType "numeric"),EnvCreateFunction FunName "to_timestamp" [ScalarType "float8"] (ScalarType "timestamptz"),EnvCreateFunction FunName "to_timestamp" [ScalarType "text",ScalarType "text"] (ScalarType "timestamptz"),EnvCreateFunction FunName "to_tsquery" [ScalarType "text"] (ScalarType "tsquery"),EnvCreateFunction FunName "to_tsquery" [ScalarType "regconfig",ScalarType "text"] (ScalarType "tsquery"),EnvCreateFunction FunName "to_tsvector" [ScalarType "text"] (ScalarType "tsvector"),EnvCreateFunction FunName "to_tsvector" [ScalarType "regconfig",ScalarType "text"] (ScalarType "tsvector"),EnvCreateFunction FunName "transaction_timestamp" [] (ScalarType "timestamptz"),EnvCreateFunction FunName "translate" [ScalarType "text",ScalarType "text",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "trigger_in" [Pseudo Cstring] (Pseudo Trigger),EnvCreateFunction FunName "trigger_out" [Pseudo Trigger] (Pseudo Cstring),EnvCreateFunction FunName "trunc" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunName "trunc" [ScalarType "macaddr"] (ScalarType "macaddr"),EnvCreateFunction FunName "trunc" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunName "trunc" [ScalarType "numeric",ScalarType "int4"] (ScalarType "numeric"),EnvCreateFunction FunName "ts_debug" [ScalarType "text"] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "ts_debug" [ScalarType "regconfig",ScalarType "text"] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "ts_headline" [ScalarType "text",ScalarType "tsquery"] (ScalarType "text"),EnvCreateFunction FunName "ts_headline" [ScalarType "text",ScalarType "tsquery",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "ts_headline" [ScalarType "regconfig",ScalarType "text",ScalarType "tsquery"] (ScalarType "text"),EnvCreateFunction FunName "ts_headline" [ScalarType "regconfig",ScalarType "text",ScalarType "tsquery",ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "ts_lexize" [ScalarType "regdictionary",ScalarType "text"] (ArrayType (ScalarType "text")),EnvCreateFunction FunName "ts_match_qv" [ScalarType "tsquery",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunName "ts_match_tq" [ScalarType "text",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunName "ts_match_tt" [ScalarType "text",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "ts_match_vq" [ScalarType "tsvector",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunName "ts_parse" [ScalarType "text",ScalarType "text"] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "ts_parse" [ScalarType "oid",ScalarType "text"] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "ts_rank" [ScalarType "tsvector",ScalarType "tsquery"] (ScalarType "float4"),EnvCreateFunction FunName "ts_rank" [ArrayType (ScalarType "float4"),ScalarType "tsvector",ScalarType "tsquery"] (ScalarType "float4"),EnvCreateFunction FunName "ts_rank" [ScalarType "tsvector",ScalarType "tsquery",ScalarType "int4"] (ScalarType "float4"),EnvCreateFunction FunName "ts_rank" [ArrayType (ScalarType "float4"),ScalarType "tsvector",ScalarType "tsquery",ScalarType "int4"] (ScalarType "float4"),EnvCreateFunction FunName "ts_rank_cd" [ScalarType "tsvector",ScalarType "tsquery"] (ScalarType "float4"),EnvCreateFunction FunName "ts_rank_cd" [ArrayType (ScalarType "float4"),ScalarType "tsvector",ScalarType "tsquery"] (ScalarType "float4"),EnvCreateFunction FunName "ts_rank_cd" [ScalarType "tsvector",ScalarType "tsquery",ScalarType "int4"] (ScalarType "float4"),EnvCreateFunction FunName "ts_rank_cd" [ArrayType (ScalarType "float4"),ScalarType "tsvector",ScalarType "tsquery",ScalarType "int4"] (ScalarType "float4"),EnvCreateFunction FunName "ts_rewrite" [ScalarType "tsquery",ScalarType "text"] (ScalarType "tsquery"),EnvCreateFunction FunName "ts_rewrite" [ScalarType "tsquery",ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "tsquery"),EnvCreateFunction FunName "ts_stat" [ScalarType "text"] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "ts_stat" [ScalarType "text",ScalarType "text"] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "ts_token_type" [ScalarType "text"] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "ts_token_type" [ScalarType "oid"] (SetOfType (Pseudo Record)),EnvCreateFunction FunName "ts_typanalyze" [Pseudo Internal] (ScalarType "bool"),EnvCreateFunction FunName "tsmatchjoinsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int2",Pseudo Internal] (ScalarType "float8"),EnvCreateFunction FunName "tsmatchsel" [Pseudo Internal,ScalarType "oid",Pseudo Internal,ScalarType "int4"] (ScalarType "float8"),EnvCreateFunction FunName "tsq_mcontained" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunName "tsq_mcontains" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunName "tsquery_and" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "tsquery"),EnvCreateFunction FunName "tsquery_cmp" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "int4"),EnvCreateFunction FunName "tsquery_eq" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunName "tsquery_ge" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunName "tsquery_gt" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunName "tsquery_le" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunName "tsquery_lt" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunName "tsquery_ne" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "bool"),EnvCreateFunction FunName "tsquery_not" [ScalarType "tsquery"] (ScalarType "tsquery"),EnvCreateFunction FunName "tsquery_or" [ScalarType "tsquery",ScalarType "tsquery"] (ScalarType "tsquery"),EnvCreateFunction FunName "tsqueryin" [Pseudo Cstring] (ScalarType "tsquery"),EnvCreateFunction FunName "tsqueryout" [ScalarType "tsquery"] (Pseudo Cstring),EnvCreateFunction FunName "tsqueryrecv" [Pseudo Internal] (ScalarType "tsquery"),EnvCreateFunction FunName "tsquerysend" [ScalarType "tsquery"] (ScalarType "bytea"),EnvCreateFunction FunName "tsvector_cmp" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "int4"),EnvCreateFunction FunName "tsvector_concat" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "tsvector"),EnvCreateFunction FunName "tsvector_eq" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunName "tsvector_ge" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunName "tsvector_gt" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunName "tsvector_le" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunName "tsvector_lt" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunName "tsvector_ne" [ScalarType "tsvector",ScalarType "tsvector"] (ScalarType "bool"),EnvCreateFunction FunName "tsvector_update_trigger" [] (Pseudo Trigger),EnvCreateFunction FunName "tsvector_update_trigger_column" [] (Pseudo Trigger),EnvCreateFunction FunName "tsvectorin" [Pseudo Cstring] (ScalarType "tsvector"),EnvCreateFunction FunName "tsvectorout" [ScalarType "tsvector"] (Pseudo Cstring),EnvCreateFunction FunName "tsvectorrecv" [Pseudo Internal] (ScalarType "tsvector"),EnvCreateFunction FunName "tsvectorsend" [ScalarType "tsvector"] (ScalarType "bytea"),EnvCreateFunction FunName "txid_current" [] (ScalarType "int8"),EnvCreateFunction FunName "txid_current_snapshot" [] (ScalarType "txid_snapshot"),EnvCreateFunction FunName "txid_snapshot_in" [Pseudo Cstring] (ScalarType "txid_snapshot"),EnvCreateFunction FunName "txid_snapshot_out" [ScalarType "txid_snapshot"] (Pseudo Cstring),EnvCreateFunction FunName "txid_snapshot_recv" [Pseudo Internal] (ScalarType "txid_snapshot"),EnvCreateFunction FunName "txid_snapshot_send" [ScalarType "txid_snapshot"] (ScalarType "bytea"),EnvCreateFunction FunName "txid_snapshot_xip" [ScalarType "txid_snapshot"] (SetOfType (ScalarType "int8")),EnvCreateFunction FunName "txid_snapshot_xmax" [ScalarType "txid_snapshot"] (ScalarType "int8"),EnvCreateFunction FunName "txid_snapshot_xmin" [ScalarType "txid_snapshot"] (ScalarType "int8"),EnvCreateFunction FunName "txid_visible_in_snapshot" [ScalarType "int8",ScalarType "txid_snapshot"] (ScalarType "bool"),EnvCreateFunction FunName "uhc_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "unknownin" [Pseudo Cstring] (ScalarType "unknown"),EnvCreateFunction FunName "unknownout" [ScalarType "unknown"] (Pseudo Cstring),EnvCreateFunction FunName "unknownrecv" [Pseudo Internal] (ScalarType "unknown"),EnvCreateFunction FunName "unknownsend" [ScalarType "unknown"] (ScalarType "bytea"),EnvCreateFunction FunName "unnest" [Pseudo AnyArray] (SetOfType (Pseudo AnyElement)),EnvCreateFunction FunName "upper" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunName "utf8_to_ascii" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_big5" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_euc_cn" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_euc_jis_2004" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_euc_jp" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_euc_kr" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_euc_tw" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_gb18030" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_gbk" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_iso8859" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_iso8859_1" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_johab" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_koi8r" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_koi8u" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_shift_jis_2004" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_sjis" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_uhc" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "utf8_to_win" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "uuid_cmp" [ScalarType "uuid",ScalarType "uuid"] (ScalarType "int4"),EnvCreateFunction FunName "uuid_eq" [ScalarType "uuid",ScalarType "uuid"] (ScalarType "bool"),EnvCreateFunction FunName "uuid_ge" [ScalarType "uuid",ScalarType "uuid"] (ScalarType "bool"),EnvCreateFunction FunName "uuid_gt" [ScalarType "uuid",ScalarType "uuid"] (ScalarType "bool"),EnvCreateFunction FunName "uuid_hash" [ScalarType "uuid"] (ScalarType "int4"),EnvCreateFunction FunName "uuid_in" [Pseudo Cstring] (ScalarType "uuid"),EnvCreateFunction FunName "uuid_le" [ScalarType "uuid",ScalarType "uuid"] (ScalarType "bool"),EnvCreateFunction FunName "uuid_lt" [ScalarType "uuid",ScalarType "uuid"] (ScalarType "bool"),EnvCreateFunction FunName "uuid_ne" [ScalarType "uuid",ScalarType "uuid"] (ScalarType "bool"),EnvCreateFunction FunName "uuid_out" [ScalarType "uuid"] (Pseudo Cstring),EnvCreateFunction FunName "uuid_recv" [Pseudo Internal] (ScalarType "uuid"),EnvCreateFunction FunName "uuid_send" [ScalarType "uuid"] (ScalarType "bytea"),EnvCreateFunction FunName "varbit" [ScalarType "varbit",ScalarType "int4",ScalarType "bool"] (ScalarType "varbit"),EnvCreateFunction FunName "varbit_in" [Pseudo Cstring,ScalarType "oid",ScalarType "int4"] (ScalarType "varbit"),EnvCreateFunction FunName "varbit_out" [ScalarType "varbit"] (Pseudo Cstring),EnvCreateFunction FunName "varbit_recv" [Pseudo Internal,ScalarType "oid",ScalarType "int4"] (ScalarType "varbit"),EnvCreateFunction FunName "varbit_send" [ScalarType "varbit"] (ScalarType "bytea"),EnvCreateFunction FunName "varbitcmp" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "int4"),EnvCreateFunction FunName "varbiteq" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "bool"),EnvCreateFunction FunName "varbitge" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "bool"),EnvCreateFunction FunName "varbitgt" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "bool"),EnvCreateFunction FunName "varbitle" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "bool"),EnvCreateFunction FunName "varbitlt" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "bool"),EnvCreateFunction FunName "varbitne" [ScalarType "varbit",ScalarType "varbit"] (ScalarType "bool"),EnvCreateFunction FunName "varbittypmodin" [ArrayType (Pseudo Cstring)] (ScalarType "int4"),EnvCreateFunction FunName "varbittypmodout" [ScalarType "int4"] (Pseudo Cstring),EnvCreateFunction FunName "varchar" [ScalarType "name"] (ScalarType "varchar"),EnvCreateFunction FunName "varchar" [ScalarType "varchar",ScalarType "int4",ScalarType "bool"] (ScalarType "varchar"),EnvCreateFunction FunName "varcharin" [Pseudo Cstring,ScalarType "oid",ScalarType "int4"] (ScalarType "varchar"),EnvCreateFunction FunName "varcharout" [ScalarType "varchar"] (Pseudo Cstring),EnvCreateFunction FunName "varcharrecv" [Pseudo Internal,ScalarType "oid",ScalarType "int4"] (ScalarType "varchar"),EnvCreateFunction FunName "varcharsend" [ScalarType "varchar"] (ScalarType "bytea"),EnvCreateFunction FunName "varchartypmodin" [ArrayType (Pseudo Cstring)] (ScalarType "int4"),EnvCreateFunction FunName "varchartypmodout" [ScalarType "int4"] (Pseudo Cstring),EnvCreateFunction FunName "version" [] (ScalarType "text"),EnvCreateFunction FunName "void_in" [Pseudo Cstring] (Pseudo Void),EnvCreateFunction FunName "void_out" [Pseudo Void] (Pseudo Cstring),EnvCreateFunction FunName "width" [ScalarType "box"] (ScalarType "float8"),EnvCreateFunction FunName "width_bucket" [ScalarType "float8",ScalarType "float8",ScalarType "float8",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "width_bucket" [ScalarType "numeric",ScalarType "numeric",ScalarType "numeric",ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunName "win1250_to_latin2" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "win1250_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "win1251_to_iso" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "win1251_to_koi8r" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "win1251_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "win1251_to_win866" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "win866_to_iso" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "win866_to_koi8r" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "win866_to_mic" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "win866_to_win1251" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "win_to_utf8" [ScalarType "int4",ScalarType "int4",Pseudo Cstring,Pseudo Internal,ScalarType "int4"] (Pseudo Void),EnvCreateFunction FunName "xideq" [ScalarType "xid",ScalarType "xid"] (ScalarType "bool"),EnvCreateFunction FunName "xideqint4" [ScalarType "xid",ScalarType "int4"] (ScalarType "bool"),EnvCreateFunction FunName "xidin" [Pseudo Cstring] (ScalarType "xid"),EnvCreateFunction FunName "xidout" [ScalarType "xid"] (Pseudo Cstring),EnvCreateFunction FunName "xidrecv" [Pseudo Internal] (ScalarType "xid"),EnvCreateFunction FunName "xidsend" [ScalarType "xid"] (ScalarType "bytea"),EnvCreateFunction FunName "xml" [ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "xml_in" [Pseudo Cstring] (ScalarType "xml"),EnvCreateFunction FunName "xml_out" [ScalarType "xml"] (Pseudo Cstring),EnvCreateFunction FunName "xml_recv" [Pseudo Internal] (ScalarType "xml"),EnvCreateFunction FunName "xml_send" [ScalarType "xml"] (ScalarType "bytea"),EnvCreateFunction FunName "xmlcomment" [ScalarType "text"] (ScalarType "xml"),EnvCreateFunction FunName "xmlconcat2" [ScalarType "xml",ScalarType "xml"] (ScalarType "xml"),EnvCreateFunction FunName "xmlvalidate" [ScalarType "xml",ScalarType "text"] (ScalarType "bool"),EnvCreateFunction FunName "xpath" [ScalarType "text",ScalarType "xml"] (ArrayType (ScalarType "xml")),EnvCreateFunction FunName "xpath" [ScalarType "text",ScalarType "xml",ArrayType (ScalarType "text")] (ArrayType (ScalarType "xml")),EnvCreateFunction FunAgg "array_agg" [Pseudo AnyElement] (Pseudo AnyArray),EnvCreateFunction FunAgg "avg" [ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunAgg "avg" [ScalarType "int2"] (ScalarType "numeric"),EnvCreateFunction FunAgg "avg" [ScalarType "int4"] (ScalarType "numeric"),EnvCreateFunction FunAgg "avg" [ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunAgg "avg" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "avg" [ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunAgg "avg" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunAgg "bit_and" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunAgg "bit_and" [ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunAgg "bit_and" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunAgg "bit_and" [ScalarType "bit"] (ScalarType "bit"),EnvCreateFunction FunAgg "bit_or" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunAgg "bit_or" [ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunAgg "bit_or" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunAgg "bit_or" [ScalarType "bit"] (ScalarType "bit"),EnvCreateFunction FunAgg "bool_and" [ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunAgg "bool_or" [ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunAgg "corr" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "count" [] (ScalarType "int8"),EnvCreateFunction FunAgg "count" [Pseudo Any] (ScalarType "int8"),EnvCreateFunction FunAgg "covar_pop" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "covar_samp" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "every" [ScalarType "bool"] (ScalarType "bool"),EnvCreateFunction FunAgg "max" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunAgg "max" [ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunAgg "max" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunAgg "max" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunAgg "max" [ScalarType "oid"] (ScalarType "oid"),EnvCreateFunction FunAgg "max" [ScalarType "tid"] (ScalarType "tid"),EnvCreateFunction FunAgg "max" [ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunAgg "max" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "max" [ScalarType "abstime"] (ScalarType "abstime"),EnvCreateFunction FunAgg "max" [ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunAgg "max" [ScalarType "bpchar"] (ScalarType "bpchar"),EnvCreateFunction FunAgg "max" [ScalarType "date"] (ScalarType "date"),EnvCreateFunction FunAgg "max" [ScalarType "time"] (ScalarType "time"),EnvCreateFunction FunAgg "max" [ScalarType "timestamp"] (ScalarType "timestamp"),EnvCreateFunction FunAgg "max" [ScalarType "timestamptz"] (ScalarType "timestamptz"),EnvCreateFunction FunAgg "max" [ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunAgg "max" [ScalarType "timetz"] (ScalarType "timetz"),EnvCreateFunction FunAgg "max" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunAgg "max" [Pseudo AnyArray] (Pseudo AnyArray),EnvCreateFunction FunAgg "max" [Pseudo AnyEnum] (Pseudo AnyEnum),EnvCreateFunction FunAgg "min" [ScalarType "int8"] (ScalarType "int8"),EnvCreateFunction FunAgg "min" [ScalarType "int2"] (ScalarType "int2"),EnvCreateFunction FunAgg "min" [ScalarType "int4"] (ScalarType "int4"),EnvCreateFunction FunAgg "min" [ScalarType "text"] (ScalarType "text"),EnvCreateFunction FunAgg "min" [ScalarType "oid"] (ScalarType "oid"),EnvCreateFunction FunAgg "min" [ScalarType "tid"] (ScalarType "tid"),EnvCreateFunction FunAgg "min" [ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunAgg "min" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "min" [ScalarType "abstime"] (ScalarType "abstime"),EnvCreateFunction FunAgg "min" [ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunAgg "min" [ScalarType "bpchar"] (ScalarType "bpchar"),EnvCreateFunction FunAgg "min" [ScalarType "date"] (ScalarType "date"),EnvCreateFunction FunAgg "min" [ScalarType "time"] (ScalarType "time"),EnvCreateFunction FunAgg "min" [ScalarType "timestamp"] (ScalarType "timestamp"),EnvCreateFunction FunAgg "min" [ScalarType "timestamptz"] (ScalarType "timestamptz"),EnvCreateFunction FunAgg "min" [ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunAgg "min" [ScalarType "timetz"] (ScalarType "timetz"),EnvCreateFunction FunAgg "min" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunAgg "min" [Pseudo AnyArray] (Pseudo AnyArray),EnvCreateFunction FunAgg "min" [Pseudo AnyEnum] (Pseudo AnyEnum),EnvCreateFunction FunAgg "regr_avgx" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "regr_avgy" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "regr_count" [ScalarType "float8",ScalarType "float8"] (ScalarType "int8"),EnvCreateFunction FunAgg "regr_intercept" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "regr_r2" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "regr_slope" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "regr_sxx" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "regr_sxy" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "regr_syy" [ScalarType "float8",ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "stddev" [ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunAgg "stddev" [ScalarType "int2"] (ScalarType "numeric"),EnvCreateFunction FunAgg "stddev" [ScalarType "int4"] (ScalarType "numeric"),EnvCreateFunction FunAgg "stddev" [ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunAgg "stddev" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "stddev" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunAgg "stddev_pop" [ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunAgg "stddev_pop" [ScalarType "int2"] (ScalarType "numeric"),EnvCreateFunction FunAgg "stddev_pop" [ScalarType "int4"] (ScalarType "numeric"),EnvCreateFunction FunAgg "stddev_pop" [ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunAgg "stddev_pop" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "stddev_pop" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunAgg "stddev_samp" [ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunAgg "stddev_samp" [ScalarType "int2"] (ScalarType "numeric"),EnvCreateFunction FunAgg "stddev_samp" [ScalarType "int4"] (ScalarType "numeric"),EnvCreateFunction FunAgg "stddev_samp" [ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunAgg "stddev_samp" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "stddev_samp" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunAgg "sum" [ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunAgg "sum" [ScalarType "int2"] (ScalarType "int8"),EnvCreateFunction FunAgg "sum" [ScalarType "int4"] (ScalarType "int8"),EnvCreateFunction FunAgg "sum" [ScalarType "float4"] (ScalarType "float4"),EnvCreateFunction FunAgg "sum" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "sum" [ScalarType "money"] (ScalarType "money"),EnvCreateFunction FunAgg "sum" [ScalarType "interval"] (ScalarType "interval"),EnvCreateFunction FunAgg "sum" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunAgg "var_pop" [ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunAgg "var_pop" [ScalarType "int2"] (ScalarType "numeric"),EnvCreateFunction FunAgg "var_pop" [ScalarType "int4"] (ScalarType "numeric"),EnvCreateFunction FunAgg "var_pop" [ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunAgg "var_pop" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "var_pop" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunAgg "var_samp" [ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunAgg "var_samp" [ScalarType "int2"] (ScalarType "numeric"),EnvCreateFunction FunAgg "var_samp" [ScalarType "int4"] (ScalarType "numeric"),EnvCreateFunction FunAgg "var_samp" [ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunAgg "var_samp" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "var_samp" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunAgg "variance" [ScalarType "int8"] (ScalarType "numeric"),EnvCreateFunction FunAgg "variance" [ScalarType "int2"] (ScalarType "numeric"),EnvCreateFunction FunAgg "variance" [ScalarType "int4"] (ScalarType "numeric"),EnvCreateFunction FunAgg "variance" [ScalarType "float4"] (ScalarType "float8"),EnvCreateFunction FunAgg "variance" [ScalarType "float8"] (ScalarType "float8"),EnvCreateFunction FunAgg "variance" [ScalarType "numeric"] (ScalarType "numeric"),EnvCreateFunction FunAgg "xmlagg" [ScalarType "xml"] (ScalarType "xml"),EnvCreateTable "pg_aggregate" [("aggfnoid",ScalarType "regproc"),("aggtransfn",ScalarType "regproc"),("aggfinalfn",ScalarType "regproc"),("aggsortop",ScalarType "oid"),("aggtranstype",ScalarType "oid"),("agginitval",ScalarType "text")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_am" [("amname",ScalarType "name"),("amstrategies",ScalarType "int2"),("amsupport",ScalarType "int2"),("amcanorder",ScalarType "bool"),("amcanbackward",ScalarType "bool"),("amcanunique",ScalarType "bool"),("amcanmulticol",ScalarType "bool"),("amoptionalkey",ScalarType "bool"),("amindexnulls",ScalarType "bool"),("amsearchnulls",ScalarType "bool"),("amstorage",ScalarType "bool"),("amclusterable",ScalarType "bool"),("amkeytype",ScalarType "oid"),("aminsert",ScalarType "regproc"),("ambeginscan",ScalarType "regproc"),("amgettuple",ScalarType "regproc"),("amgetbitmap",ScalarType "regproc"),("amrescan",ScalarType "regproc"),("amendscan",ScalarType "regproc"),("ammarkpos",ScalarType "regproc"),("amrestrpos",ScalarType "regproc"),("ambuild",ScalarType "regproc"),("ambulkdelete",ScalarType "regproc"),("amvacuumcleanup",ScalarType "regproc"),("amcostestimate",ScalarType "regproc"),("amoptions",ScalarType "regproc")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_amop" [("amopfamily",ScalarType "oid"),("amoplefttype",ScalarType "oid"),("amoprighttype",ScalarType "oid"),("amopstrategy",ScalarType "int2"),("amopopr",ScalarType "oid"),("amopmethod",ScalarType "oid")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_amproc" [("amprocfamily",ScalarType "oid"),("amproclefttype",ScalarType "oid"),("amprocrighttype",ScalarType "oid"),("amprocnum",ScalarType "int2"),("amproc",ScalarType "regproc")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_attrdef" [("adrelid",ScalarType "oid"),("adnum",ScalarType "int2"),("adbin",ScalarType "text"),("adsrc",ScalarType "text")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_attribute" [("attrelid",ScalarType "oid"),("attname",ScalarType "name"),("atttypid",ScalarType "oid"),("attstattarget",ScalarType "int4"),("attlen",ScalarType "int2"),("attnum",ScalarType "int2"),("attndims",ScalarType "int4"),("attcacheoff",ScalarType "int4"),("atttypmod",ScalarType "int4"),("attbyval",ScalarType "bool"),("attstorage",ScalarType "char"),("attalign",ScalarType "char"),("attnotnull",ScalarType "bool"),("atthasdef",ScalarType "bool"),("attisdropped",ScalarType "bool"),("attislocal",ScalarType "bool"),("attinhcount",ScalarType "int4"),("attacl",ArrayType (ScalarType "aclitem"))] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_auth_members" [("roleid",ScalarType "oid"),("member",ScalarType "oid"),("grantor",ScalarType "oid"),("admin_option",ScalarType "bool")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_authid" [("rolname",ScalarType "name"),("rolsuper",ScalarType "bool"),("rolinherit",ScalarType "bool"),("rolcreaterole",ScalarType "bool"),("rolcreatedb",ScalarType "bool"),("rolcatupdate",ScalarType "bool"),("rolcanlogin",ScalarType "bool"),("rolconnlimit",ScalarType "int4"),("rolpassword",ScalarType "text"),("rolvaliduntil",ScalarType "timestamptz"),("rolconfig",ArrayType (ScalarType "text"))] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_cast" [("castsource",ScalarType "oid"),("casttarget",ScalarType "oid"),("castfunc",ScalarType "oid"),("castcontext",ScalarType "char"),("castmethod",ScalarType "char")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_class" [("relname",ScalarType "name"),("relnamespace",ScalarType "oid"),("reltype",ScalarType "oid"),("relowner",ScalarType "oid"),("relam",ScalarType "oid"),("relfilenode",ScalarType "oid"),("reltablespace",ScalarType "oid"),("relpages",ScalarType "int4"),("reltuples",ScalarType "float4"),("reltoastrelid",ScalarType "oid"),("reltoastidxid",ScalarType "oid"),("relhasindex",ScalarType "bool"),("relisshared",ScalarType "bool"),("relistemp",ScalarType "bool"),("relkind",ScalarType "char"),("relnatts",ScalarType "int2"),("relchecks",ScalarType "int2"),("relhasoids",ScalarType "bool"),("relhaspkey",ScalarType "bool"),("relhasrules",ScalarType "bool"),("relhastriggers",ScalarType "bool"),("relhassubclass",ScalarType "bool"),("relfrozenxid",ScalarType "xid"),("relacl",ArrayType (ScalarType "aclitem")),("reloptions",ArrayType (ScalarType "text"))] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_constraint" [("conname",ScalarType "name"),("connamespace",ScalarType "oid"),("contype",ScalarType "char"),("condeferrable",ScalarType "bool"),("condeferred",ScalarType "bool"),("conrelid",ScalarType "oid"),("contypid",ScalarType "oid"),("confrelid",ScalarType "oid"),("confupdtype",ScalarType "char"),("confdeltype",ScalarType "char"),("confmatchtype",ScalarType "char"),("conislocal",ScalarType "bool"),("coninhcount",ScalarType "int4"),("conkey",ArrayType (ScalarType "int2")),("confkey",ArrayType (ScalarType "int2")),("conpfeqop",ArrayType (ScalarType "oid")),("conppeqop",ArrayType (ScalarType "oid")),("conffeqop",ArrayType (ScalarType "oid")),("conbin",ScalarType "text"),("consrc",ScalarType "text")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_conversion" [("conname",ScalarType "name"),("connamespace",ScalarType "oid"),("conowner",ScalarType "oid"),("conforencoding",ScalarType "int4"),("contoencoding",ScalarType "int4"),("conproc",ScalarType "regproc"),("condefault",ScalarType "bool")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_database" [("datname",ScalarType "name"),("datdba",ScalarType "oid"),("encoding",ScalarType "int4"),("datcollate",ScalarType "name"),("datctype",ScalarType "name"),("datistemplate",ScalarType "bool"),("datallowconn",ScalarType "bool"),("datconnlimit",ScalarType "int4"),("datlastsysoid",ScalarType "oid"),("datfrozenxid",ScalarType "xid"),("dattablespace",ScalarType "oid"),("datconfig",ArrayType (ScalarType "text")),("datacl",ArrayType (ScalarType "aclitem"))] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_depend" [("classid",ScalarType "oid"),("objid",ScalarType "oid"),("objsubid",ScalarType "int4"),("refclassid",ScalarType "oid"),("refobjid",ScalarType "oid"),("refobjsubid",ScalarType "int4"),("deptype",ScalarType "char")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_description" [("objoid",ScalarType "oid"),("classoid",ScalarType "oid"),("objsubid",ScalarType "int4"),("description",ScalarType "text")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_enum" [("enumtypid",ScalarType "oid"),("enumlabel",ScalarType "name")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_foreign_data_wrapper" [("fdwname",ScalarType "name"),("fdwowner",ScalarType "oid"),("fdwvalidator",ScalarType "oid"),("fdwacl",ArrayType (ScalarType "aclitem")),("fdwoptions",ArrayType (ScalarType "text"))] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_foreign_server" [("srvname",ScalarType "name"),("srvowner",ScalarType "oid"),("srvfdw",ScalarType "oid"),("srvtype",ScalarType "text"),("srvversion",ScalarType "text"),("srvacl",ArrayType (ScalarType "aclitem")),("srvoptions",ArrayType (ScalarType "text"))] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_index" [("indexrelid",ScalarType "oid"),("indrelid",ScalarType "oid"),("indnatts",ScalarType "int2"),("indisunique",ScalarType "bool"),("indisprimary",ScalarType "bool"),("indisclustered",ScalarType "bool"),("indisvalid",ScalarType "bool"),("indcheckxmin",ScalarType "bool"),("indisready",ScalarType "bool"),("indkey",ScalarType "int2vector"),("indclass",ScalarType "oidvector"),("indoption",ScalarType "int2vector"),("indexprs",ScalarType "text"),("indpred",ScalarType "text")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_inherits" [("inhrelid",ScalarType "oid"),("inhparent",ScalarType "oid"),("inhseqno",ScalarType "int4")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_language" [("lanname",ScalarType "name"),("lanowner",ScalarType "oid"),("lanispl",ScalarType "bool"),("lanpltrusted",ScalarType "bool"),("lanplcallfoid",ScalarType "oid"),("lanvalidator",ScalarType "oid"),("lanacl",ArrayType (ScalarType "aclitem"))] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_largeobject" [("loid",ScalarType "oid"),("pageno",ScalarType "int4"),("data",ScalarType "bytea")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_listener" [("relname",ScalarType "name"),("listenerpid",ScalarType "int4"),("notification",ScalarType "int4")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_namespace" [("nspname",ScalarType "name"),("nspowner",ScalarType "oid"),("nspacl",ArrayType (ScalarType "aclitem"))] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_opclass" [("opcmethod",ScalarType "oid"),("opcname",ScalarType "name"),("opcnamespace",ScalarType "oid"),("opcowner",ScalarType "oid"),("opcfamily",ScalarType "oid"),("opcintype",ScalarType "oid"),("opcdefault",ScalarType "bool"),("opckeytype",ScalarType "oid")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_operator" [("oprname",ScalarType "name"),("oprnamespace",ScalarType "oid"),("oprowner",ScalarType "oid"),("oprkind",ScalarType "char"),("oprcanmerge",ScalarType "bool"),("oprcanhash",ScalarType "bool"),("oprleft",ScalarType "oid"),("oprright",ScalarType "oid"),("oprresult",ScalarType "oid"),("oprcom",ScalarType "oid"),("oprnegate",ScalarType "oid"),("oprcode",ScalarType "regproc"),("oprrest",ScalarType "regproc"),("oprjoin",ScalarType "regproc")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_opfamily" [("opfmethod",ScalarType "oid"),("opfname",ScalarType "name"),("opfnamespace",ScalarType "oid"),("opfowner",ScalarType "oid")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_pltemplate" [("tmplname",ScalarType "name"),("tmpltrusted",ScalarType "bool"),("tmpldbacreate",ScalarType "bool"),("tmplhandler",ScalarType "text"),("tmplvalidator",ScalarType "text"),("tmpllibrary",ScalarType "text"),("tmplacl",ArrayType (ScalarType "aclitem"))] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_proc" [("proname",ScalarType "name"),("pronamespace",ScalarType "oid"),("proowner",ScalarType "oid"),("prolang",ScalarType "oid"),("procost",ScalarType "float4"),("prorows",ScalarType "float4"),("provariadic",ScalarType "oid"),("proisagg",ScalarType "bool"),("proiswindow",ScalarType "bool"),("prosecdef",ScalarType "bool"),("proisstrict",ScalarType "bool"),("proretset",ScalarType "bool"),("provolatile",ScalarType "char"),("pronargs",ScalarType "int2"),("pronargdefaults",ScalarType "int2"),("prorettype",ScalarType "oid"),("proargtypes",ScalarType "oidvector"),("proallargtypes",ArrayType (ScalarType "oid")),("proargmodes",ArrayType (ScalarType "char")),("proargnames",ArrayType (ScalarType "text")),("proargdefaults",ScalarType "text"),("prosrc",ScalarType "text"),("probin",ScalarType "bytea"),("proconfig",ArrayType (ScalarType "text")),("proacl",ArrayType (ScalarType "aclitem"))] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_rewrite" [("rulename",ScalarType "name"),("ev_class",ScalarType "oid"),("ev_attr",ScalarType "int2"),("ev_type",ScalarType "char"),("ev_enabled",ScalarType "char"),("is_instead",ScalarType "bool"),("ev_qual",ScalarType "text"),("ev_action",ScalarType "text")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_shdepend" [("dbid",ScalarType "oid"),("classid",ScalarType "oid"),("objid",ScalarType "oid"),("objsubid",ScalarType "int4"),("refclassid",ScalarType "oid"),("refobjid",ScalarType "oid"),("deptype",ScalarType "char")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_shdescription" [("objoid",ScalarType "oid"),("classoid",ScalarType "oid"),("description",ScalarType "text")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_statistic" [("starelid",ScalarType "oid"),("staattnum",ScalarType "int2"),("stanullfrac",ScalarType "float4"),("stawidth",ScalarType "int4"),("stadistinct",ScalarType "float4"),("stakind1",ScalarType "int2"),("stakind2",ScalarType "int2"),("stakind3",ScalarType "int2"),("stakind4",ScalarType "int2"),("staop1",ScalarType "oid"),("staop2",ScalarType "oid"),("staop3",ScalarType "oid"),("staop4",ScalarType "oid"),("stanumbers1",ArrayType (ScalarType "float4")),("stanumbers2",ArrayType (ScalarType "float4")),("stanumbers3",ArrayType (ScalarType "float4")),("stanumbers4",ArrayType (ScalarType "float4")),("stavalues1",Pseudo AnyArray),("stavalues2",Pseudo AnyArray),("stavalues3",Pseudo AnyArray),("stavalues4",Pseudo AnyArray)] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_tablespace" [("spcname",ScalarType "name"),("spcowner",ScalarType "oid"),("spclocation",ScalarType "text"),("spcacl",ArrayType (ScalarType "aclitem"))] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_trigger" [("tgrelid",ScalarType "oid"),("tgname",ScalarType "name"),("tgfoid",ScalarType "oid"),("tgtype",ScalarType "int2"),("tgenabled",ScalarType "char"),("tgisconstraint",ScalarType "bool"),("tgconstrname",ScalarType "name"),("tgconstrrelid",ScalarType "oid"),("tgconstraint",ScalarType "oid"),("tgdeferrable",ScalarType "bool"),("tginitdeferred",ScalarType "bool"),("tgnargs",ScalarType "int2"),("tgattr",ScalarType "int2vector"),("tgargs",ScalarType "bytea")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_ts_config" [("cfgname",ScalarType "name"),("cfgnamespace",ScalarType "oid"),("cfgowner",ScalarType "oid"),("cfgparser",ScalarType "oid")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_ts_config_map" [("mapcfg",ScalarType "oid"),("maptokentype",ScalarType "int4"),("mapseqno",ScalarType "int4"),("mapdict",ScalarType "oid")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_ts_dict" [("dictname",ScalarType "name"),("dictnamespace",ScalarType "oid"),("dictowner",ScalarType "oid"),("dicttemplate",ScalarType "oid"),("dictinitoption",ScalarType "text")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_ts_parser" [("prsname",ScalarType "name"),("prsnamespace",ScalarType "oid"),("prsstart",ScalarType "regproc"),("prstoken",ScalarType "regproc"),("prsend",ScalarType "regproc"),("prsheadline",ScalarType "regproc"),("prslextype",ScalarType "regproc")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_ts_template" [("tmplname",ScalarType "name"),("tmplnamespace",ScalarType "oid"),("tmplinit",ScalarType "regproc"),("tmpllexize",ScalarType "regproc")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_type" [("typname",ScalarType "name"),("typnamespace",ScalarType "oid"),("typowner",ScalarType "oid"),("typlen",ScalarType "int2"),("typbyval",ScalarType "bool"),("typtype",ScalarType "char"),("typcategory",ScalarType "char"),("typispreferred",ScalarType "bool"),("typisdefined",ScalarType "bool"),("typdelim",ScalarType "char"),("typrelid",ScalarType "oid"),("typelem",ScalarType "oid"),("typarray",ScalarType "oid"),("typinput",ScalarType "regproc"),("typoutput",ScalarType "regproc"),("typreceive",ScalarType "regproc"),("typsend",ScalarType "regproc"),("typmodin",ScalarType "regproc"),("typmodout",ScalarType "regproc"),("typanalyze",ScalarType "regproc"),("typalign",ScalarType "char"),("typstorage",ScalarType "char"),("typnotnull",ScalarType "bool"),("typbasetype",ScalarType "oid"),("typtypmod",ScalarType "int4"),("typndims",ScalarType "int4"),("typdefaultbin",ScalarType "text"),("typdefault",ScalarType "text")] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateTable "pg_user_mapping" [("umuser",ScalarType "oid"),("umserver",ScalarType "oid"),("umoptions",ArrayType (ScalarType "text"))] [("tableoid",ScalarType "oid"),("cmax",ScalarType "cid"),("xmax",ScalarType "xid"),("cmin",ScalarType "cid"),("xmin",ScalarType "xid"),("oid",ScalarType "oid"),("ctid",ScalarType "tid")],EnvCreateView "pg_cursors" [("name",ScalarType "text"),("statement",ScalarType "text"),("is_holdable",ScalarType "bool"),("is_binary",ScalarType "bool"),("is_scrollable",ScalarType "bool"),("creation_time",ScalarType "timestamptz")],EnvCreateView "pg_group" [("groname",ScalarType "name"),("grosysid",ScalarType "oid"),("grolist",ArrayType (ScalarType "oid"))],EnvCreateView "pg_indexes" [("schemaname",ScalarType "name"),("tablename",ScalarType "name"),("indexname",ScalarType "name"),("tablespace",ScalarType "name"),("indexdef",ScalarType "text")],EnvCreateView "pg_locks" [("locktype",ScalarType "text"),("database",ScalarType "oid"),("relation",ScalarType "oid"),("page",ScalarType "int4"),("tuple",ScalarType "int2"),("virtualxid",ScalarType "text"),("transactionid",ScalarType "xid"),("classid",ScalarType "oid"),("objid",ScalarType "oid"),("objsubid",ScalarType "int2"),("virtualtransaction",ScalarType "text"),("pid",ScalarType "int4"),("mode",ScalarType "text"),("granted",ScalarType "bool")],EnvCreateView "pg_prepared_statements" [("name",ScalarType "text"),("statement",ScalarType "text"),("prepare_time",ScalarType "timestamptz"),("parameter_types",ArrayType (ScalarType "regtype")),("from_sql",ScalarType "bool")],EnvCreateView "pg_prepared_xacts" [("transaction",ScalarType "xid"),("gid",ScalarType "text"),("prepared",ScalarType "timestamptz"),("owner",ScalarType "name"),("database",ScalarType "name")],EnvCreateView "pg_roles" [("rolname",ScalarType "name"),("rolsuper",ScalarType "bool"),("rolinherit",ScalarType "bool"),("rolcreaterole",ScalarType "bool"),("rolcreatedb",ScalarType "bool"),("rolcatupdate",ScalarType "bool"),("rolcanlogin",ScalarType "bool"),("rolconnlimit",ScalarType "int4"),("rolpassword",ScalarType "text"),("rolvaliduntil",ScalarType "timestamptz"),("rolconfig",ArrayType (ScalarType "text")),("oid",ScalarType "oid")],EnvCreateView "pg_rules" [("schemaname",ScalarType "name"),("tablename",ScalarType "name"),("rulename",ScalarType "name"),("definition",ScalarType "text")],EnvCreateView "pg_settings" [("name",ScalarType "text"),("setting",ScalarType "text"),("unit",ScalarType "text"),("category",ScalarType "text"),("short_desc",ScalarType "text"),("extra_desc",ScalarType "text"),("context",ScalarType "text"),("vartype",ScalarType "text"),("source",ScalarType "text"),("min_val",ScalarType "text"),("max_val",ScalarType "text"),("enumvals",ArrayType (ScalarType "text")),("boot_val",ScalarType "text"),("reset_val",ScalarType "text"),("sourcefile",ScalarType "text"),("sourceline",ScalarType "int4")],EnvCreateView "pg_shadow" [("usename",ScalarType "name"),("usesysid",ScalarType "oid"),("usecreatedb",ScalarType "bool"),("usesuper",ScalarType "bool"),("usecatupd",ScalarType "bool"),("passwd",ScalarType "text"),("valuntil",ScalarType "abstime"),("useconfig",ArrayType (ScalarType "text"))],EnvCreateView "pg_stat_activity" [("datid",ScalarType "oid"),("datname",ScalarType "name"),("procpid",ScalarType "int4"),("usesysid",ScalarType "oid"),("usename",ScalarType "name"),("current_query",ScalarType "text"),("waiting",ScalarType "bool"),("xact_start",ScalarType "timestamptz"),("query_start",ScalarType "timestamptz"),("backend_start",ScalarType "timestamptz"),("client_addr",ScalarType "inet"),("client_port",ScalarType "int4")],EnvCreateView "pg_stat_all_indexes" [("relid",ScalarType "oid"),("indexrelid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("indexrelname",ScalarType "name"),("idx_scan",ScalarType "int8"),("idx_tup_read",ScalarType "int8"),("idx_tup_fetch",ScalarType "int8")],EnvCreateView "pg_stat_all_tables" [("relid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("seq_scan",ScalarType "int8"),("seq_tup_read",ScalarType "int8"),("idx_scan",ScalarType "int8"),("idx_tup_fetch",ScalarType "int8"),("n_tup_ins",ScalarType "int8"),("n_tup_upd",ScalarType "int8"),("n_tup_del",ScalarType "int8"),("n_tup_hot_upd",ScalarType "int8"),("n_live_tup",ScalarType "int8"),("n_dead_tup",ScalarType "int8"),("last_vacuum",ScalarType "timestamptz"),("last_autovacuum",ScalarType "timestamptz"),("last_analyze",ScalarType "timestamptz"),("last_autoanalyze",ScalarType "timestamptz")],EnvCreateView "pg_stat_bgwriter" [("checkpoints_timed",ScalarType "int8"),("checkpoints_req",ScalarType "int8"),("buffers_checkpoint",ScalarType "int8"),("buffers_clean",ScalarType "int8"),("maxwritten_clean",ScalarType "int8"),("buffers_backend",ScalarType "int8"),("buffers_alloc",ScalarType "int8")],EnvCreateView "pg_stat_database" [("datid",ScalarType "oid"),("datname",ScalarType "name"),("numbackends",ScalarType "int4"),("xact_commit",ScalarType "int8"),("xact_rollback",ScalarType "int8"),("blks_read",ScalarType "int8"),("blks_hit",ScalarType "int8"),("tup_returned",ScalarType "int8"),("tup_fetched",ScalarType "int8"),("tup_inserted",ScalarType "int8"),("tup_updated",ScalarType "int8"),("tup_deleted",ScalarType "int8")],EnvCreateView "pg_stat_sys_indexes" [("relid",ScalarType "oid"),("indexrelid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("indexrelname",ScalarType "name"),("idx_scan",ScalarType "int8"),("idx_tup_read",ScalarType "int8"),("idx_tup_fetch",ScalarType "int8")],EnvCreateView "pg_stat_sys_tables" [("relid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("seq_scan",ScalarType "int8"),("seq_tup_read",ScalarType "int8"),("idx_scan",ScalarType "int8"),("idx_tup_fetch",ScalarType "int8"),("n_tup_ins",ScalarType "int8"),("n_tup_upd",ScalarType "int8"),("n_tup_del",ScalarType "int8"),("n_tup_hot_upd",ScalarType "int8"),("n_live_tup",ScalarType "int8"),("n_dead_tup",ScalarType "int8"),("last_vacuum",ScalarType "timestamptz"),("last_autovacuum",ScalarType "timestamptz"),("last_analyze",ScalarType "timestamptz"),("last_autoanalyze",ScalarType "timestamptz")],EnvCreateView "pg_stat_user_functions" [("funcid",ScalarType "oid"),("schemaname",ScalarType "name"),("funcname",ScalarType "name"),("calls",ScalarType "int8"),("total_time",ScalarType "int8"),("self_time",ScalarType "int8")],EnvCreateView "pg_stat_user_indexes" [("relid",ScalarType "oid"),("indexrelid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("indexrelname",ScalarType "name"),("idx_scan",ScalarType "int8"),("idx_tup_read",ScalarType "int8"),("idx_tup_fetch",ScalarType "int8")],EnvCreateView "pg_stat_user_tables" [("relid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("seq_scan",ScalarType "int8"),("seq_tup_read",ScalarType "int8"),("idx_scan",ScalarType "int8"),("idx_tup_fetch",ScalarType "int8"),("n_tup_ins",ScalarType "int8"),("n_tup_upd",ScalarType "int8"),("n_tup_del",ScalarType "int8"),("n_tup_hot_upd",ScalarType "int8"),("n_live_tup",ScalarType "int8"),("n_dead_tup",ScalarType "int8"),("last_vacuum",ScalarType "timestamptz"),("last_autovacuum",ScalarType "timestamptz"),("last_analyze",ScalarType "timestamptz"),("last_autoanalyze",ScalarType "timestamptz")],EnvCreateView "pg_statio_all_indexes" [("relid",ScalarType "oid"),("indexrelid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("indexrelname",ScalarType "name"),("idx_blks_read",ScalarType "int8"),("idx_blks_hit",ScalarType "int8")],EnvCreateView "pg_statio_all_sequences" [("relid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("blks_read",ScalarType "int8"),("blks_hit",ScalarType "int8")],EnvCreateView "pg_statio_all_tables" [("relid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("heap_blks_read",ScalarType "int8"),("heap_blks_hit",ScalarType "int8"),("idx_blks_read",ScalarType "int8"),("idx_blks_hit",ScalarType "int8"),("toast_blks_read",ScalarType "int8"),("toast_blks_hit",ScalarType "int8"),("tidx_blks_read",ScalarType "int8"),("tidx_blks_hit",ScalarType "int8")],EnvCreateView "pg_statio_sys_indexes" [("relid",ScalarType "oid"),("indexrelid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("indexrelname",ScalarType "name"),("idx_blks_read",ScalarType "int8"),("idx_blks_hit",ScalarType "int8")],EnvCreateView "pg_statio_sys_sequences" [("relid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("blks_read",ScalarType "int8"),("blks_hit",ScalarType "int8")],EnvCreateView "pg_statio_sys_tables" [("relid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("heap_blks_read",ScalarType "int8"),("heap_blks_hit",ScalarType "int8"),("idx_blks_read",ScalarType "int8"),("idx_blks_hit",ScalarType "int8"),("toast_blks_read",ScalarType "int8"),("toast_blks_hit",ScalarType "int8"),("tidx_blks_read",ScalarType "int8"),("tidx_blks_hit",ScalarType "int8")],EnvCreateView "pg_statio_user_indexes" [("relid",ScalarType "oid"),("indexrelid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("indexrelname",ScalarType "name"),("idx_blks_read",ScalarType "int8"),("idx_blks_hit",ScalarType "int8")],EnvCreateView "pg_statio_user_sequences" [("relid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("blks_read",ScalarType "int8"),("blks_hit",ScalarType "int8")],EnvCreateView "pg_statio_user_tables" [("relid",ScalarType "oid"),("schemaname",ScalarType "name"),("relname",ScalarType "name"),("heap_blks_read",ScalarType "int8"),("heap_blks_hit",ScalarType "int8"),("idx_blks_read",ScalarType "int8"),("idx_blks_hit",ScalarType "int8"),("toast_blks_read",ScalarType "int8"),("toast_blks_hit",ScalarType "int8"),("tidx_blks_read",ScalarType "int8"),("tidx_blks_hit",ScalarType "int8")],EnvCreateView "pg_stats" [("schemaname",ScalarType "name"),("tablename",ScalarType "name"),("attname",ScalarType "name"),("null_frac",ScalarType "float4"),("avg_width",ScalarType "int4"),("n_distinct",ScalarType "float4"),("most_common_vals",Pseudo AnyArray),("most_common_freqs",ArrayType (ScalarType "float4")),("histogram_bounds",Pseudo AnyArray),("correlation",ScalarType "float4")],EnvCreateView "pg_tables" [("schemaname",ScalarType "name"),("tablename",ScalarType "name"),("tableowner",ScalarType "name"),("tablespace",ScalarType "name"),("hasindexes",ScalarType "bool"),("hasrules",ScalarType "bool"),("hastriggers",ScalarType "bool")],EnvCreateView "pg_timezone_abbrevs" [("abbrev",ScalarType "text"),("utc_offset",ScalarType "interval"),("is_dst",ScalarType "bool")],EnvCreateView "pg_timezone_names" [("name",ScalarType "text"),("abbrev",ScalarType "text"),("utc_offset",ScalarType "interval"),("is_dst",ScalarType "bool")],EnvCreateView "pg_user" [("usename",ScalarType "name"),("usesysid",ScalarType "oid"),("usecreatedb",ScalarType "bool"),("usesuper",ScalarType "bool"),("usecatupd",ScalarType "bool"),("passwd",ScalarType "text"),("valuntil",ScalarType "abstime"),("useconfig",ArrayType (ScalarType "text"))],EnvCreateView "pg_user_mappings" [("umid",ScalarType "oid"),("srvid",ScalarType "oid"),("srvname",ScalarType "name"),("umuser",ScalarType "oid"),("usename",ScalarType "name"),("umoptions",ArrayType (ScalarType "text"))],EnvCreateView "pg_views" [("schemaname",ScalarType "name"),("viewname",ScalarType "name"),("viewowner",ScalarType "name"),("definition",ScalarType "text")]]
+ Database/HsSqlPpp/AstInternals/Environment/DefaultTemplate1Environment.lhs view
@@ -0,0 +1,29027 @@++Copyright 2009 Jake Wheat++This file contains++> {-# OPTIONS_HADDOCK hide  #-}++> module Database.HsSqlPpp.AstInternals.Environment.DefaultTemplate1Environment+>     (defaultTemplate1Environment+>      ) where++> import Database.HsSqlPpp.AstInternals.Environment.EnvironmentInternal+> import Database.HsSqlPpp.AstInternals.TypeType++> defaultTemplate1Environment :: Environment+> defaultTemplate1Environment =+>    (\l -> case l of+>             Left x -> error $ show x+>             Right e -> e) $+>     updateEnvironment defaultEnvironment+>        [ EnvCreateScalar (+>            ScalarType "bool" )+>            "B"+>            True+>        , EnvCreateScalar (+>            ScalarType "bytea" )+>            "U"+>            False+>        , EnvCreateScalar (+>            ScalarType "char" )+>            "S"+>            False+>        , EnvCreateScalar (+>            ScalarType "name" )+>            "S"+>            False+>        , EnvCreateScalar (+>            ScalarType "int8" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "int2" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "int2vector" )+>            "A"+>            False+>        , EnvCreateScalar (+>            ScalarType "int4" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "regproc" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "text" )+>            "S"+>            True+>        , EnvCreateScalar (+>            ScalarType "oid" )+>            "N"+>            True+>        , EnvCreateScalar (+>            ScalarType "tid" )+>            "U"+>            False+>        , EnvCreateScalar (+>            ScalarType "xid" )+>            "U"+>            False+>        , EnvCreateScalar (+>            ScalarType "cid" )+>            "U"+>            False+>        , EnvCreateScalar (+>            ScalarType "oidvector" )+>            "A"+>            False+>        , EnvCreateScalar (+>            ScalarType "xml" )+>            "U"+>            False+>        , EnvCreateScalar (+>            ScalarType "point" )+>            "G"+>            False+>        , EnvCreateScalar (+>            ScalarType "lseg" )+>            "G"+>            False+>        , EnvCreateScalar (+>            ScalarType "path" )+>            "G"+>            False+>        , EnvCreateScalar (+>            ScalarType "box" )+>            "G"+>            False+>        , EnvCreateScalar (+>            ScalarType "polygon" )+>            "G"+>            False+>        , EnvCreateScalar (+>            ScalarType "line" )+>            "G"+>            False+>        , EnvCreateScalar (+>            ScalarType "float4" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "float8" )+>            "N"+>            True+>        , EnvCreateScalar (+>            ScalarType "abstime" )+>            "D"+>            False+>        , EnvCreateScalar (+>            ScalarType "reltime" )+>            "T"+>            False+>        , EnvCreateScalar (+>            ScalarType "tinterval" )+>            "T"+>            False+>        , EnvCreateScalar (+>            ScalarType "circle" )+>            "G"+>            False+>        , EnvCreateScalar (+>            ScalarType "money" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "macaddr" )+>            "U"+>            False+>        , EnvCreateScalar (+>            ScalarType "inet" )+>            "I"+>            True+>        , EnvCreateScalar (+>            ScalarType "cidr" )+>            "I"+>            False+>        , EnvCreateScalar (+>            ScalarType "aclitem" )+>            "U"+>            False+>        , EnvCreateScalar (+>            ScalarType "bpchar" )+>            "S"+>            False+>        , EnvCreateScalar (+>            ScalarType "varchar" )+>            "S"+>            False+>        , EnvCreateScalar (+>            ScalarType "date" )+>            "D"+>            False+>        , EnvCreateScalar (+>            ScalarType "time" )+>            "D"+>            False+>        , EnvCreateScalar (+>            ScalarType "timestamp" )+>            "D"+>            False+>        , EnvCreateScalar (+>            ScalarType "timestamptz" )+>            "D"+>            True+>        , EnvCreateScalar (+>            ScalarType "interval" )+>            "T"+>            True+>        , EnvCreateScalar (+>            ScalarType "timetz" )+>            "D"+>            False+>        , EnvCreateScalar (+>            ScalarType "bit" )+>            "V"+>            False+>        , EnvCreateScalar (+>            ScalarType "varbit" )+>            "V"+>            True+>        , EnvCreateScalar (+>            ScalarType "numeric" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "refcursor" )+>            "U"+>            False+>        , EnvCreateScalar (+>            ScalarType "regprocedure" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "regoper" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "regoperator" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "regclass" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "regtype" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "uuid" )+>            "U"+>            False+>        , EnvCreateScalar (+>            ScalarType "tsvector" )+>            "U"+>            False+>        , EnvCreateScalar (+>            ScalarType "gtsvector" )+>            "U"+>            False+>        , EnvCreateScalar (+>            ScalarType "tsquery" )+>            "U"+>            False+>        , EnvCreateScalar (+>            ScalarType "regconfig" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "regdictionary" )+>            "N"+>            False+>        , EnvCreateScalar (+>            ScalarType "txid_snapshot" )+>            "U"+>            False+>        , EnvCreateDomain (+>            DomainType "information_schema.cardinal_number" ) (+>            ScalarType "int4" )+>        , EnvCreateDomain (+>            DomainType "information_schema.character_data" ) (+>            ScalarType "varchar" )+>        , EnvCreateDomain (+>            DomainType "information_schema.sql_identifier" ) (+>            ScalarType "varchar" )+>        , EnvCreateDomain (+>            DomainType "information_schema.time_stamp" ) (+>            ScalarType "timestamptz" )+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "int2" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "int4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "float4" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "float8" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "numeric" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "int8" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "int4" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "float4" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "float8" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "numeric" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "int8" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "int2" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "float4" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "float8" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "numeric" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "float4" ) (+>            ScalarType "int8" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "float4" ) (+>            ScalarType "int2" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "float4" ) (+>            ScalarType "int4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "float4" ) (+>            ScalarType "float8" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "float4" ) (+>            ScalarType "numeric" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "float8" ) (+>            ScalarType "int8" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "float8" ) (+>            ScalarType "int2" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "float8" ) (+>            ScalarType "int4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "float8" ) (+>            ScalarType "float4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "float8" ) (+>            ScalarType "numeric" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "numeric" ) (+>            ScalarType "int8" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "numeric" ) (+>            ScalarType "int2" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "numeric" ) (+>            ScalarType "int4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "numeric" ) (+>            ScalarType "float4" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "numeric" ) (+>            ScalarType "float8" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "bool" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "bool" ) (+>            ScalarType "int4" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "oid" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "oid" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "oid" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "oid" ) (+>            ScalarType "int8" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "oid" ) (+>            ScalarType "int4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "oid" ) (+>            ScalarType "regproc" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regproc" ) (+>            ScalarType "oid" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "regproc" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "regproc" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "regproc" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regproc" ) (+>            ScalarType "int8" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "regproc" ) (+>            ScalarType "int4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "regproc" ) (+>            ScalarType "regprocedure" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regprocedure" ) (+>            ScalarType "regproc" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "oid" ) (+>            ScalarType "regprocedure" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regprocedure" ) (+>            ScalarType "oid" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "regprocedure" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "regprocedure" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "regprocedure" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regprocedure" ) (+>            ScalarType "int8" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "regprocedure" ) (+>            ScalarType "int4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "oid" ) (+>            ScalarType "regoper" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regoper" ) (+>            ScalarType "oid" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "regoper" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "regoper" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "regoper" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regoper" ) (+>            ScalarType "int8" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "regoper" ) (+>            ScalarType "int4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "regoper" ) (+>            ScalarType "regoperator" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regoperator" ) (+>            ScalarType "regoper" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "oid" ) (+>            ScalarType "regoperator" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regoperator" ) (+>            ScalarType "oid" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "regoperator" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "regoperator" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "regoperator" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regoperator" ) (+>            ScalarType "int8" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "regoperator" ) (+>            ScalarType "int4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "oid" ) (+>            ScalarType "regclass" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regclass" ) (+>            ScalarType "oid" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "regclass" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "regclass" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "regclass" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regclass" ) (+>            ScalarType "int8" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "regclass" ) (+>            ScalarType "int4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "oid" ) (+>            ScalarType "regtype" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regtype" ) (+>            ScalarType "oid" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "regtype" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "regtype" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "regtype" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regtype" ) (+>            ScalarType "int8" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "regtype" ) (+>            ScalarType "int4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "oid" ) (+>            ScalarType "regconfig" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regconfig" ) (+>            ScalarType "oid" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "regconfig" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "regconfig" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "regconfig" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regconfig" ) (+>            ScalarType "int8" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "regconfig" ) (+>            ScalarType "int4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "oid" ) (+>            ScalarType "regdictionary" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regdictionary" ) (+>            ScalarType "oid" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "regdictionary" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int2" ) (+>            ScalarType "regdictionary" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "regdictionary" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "regdictionary" ) (+>            ScalarType "int8" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "regdictionary" ) (+>            ScalarType "int4" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "text" ) (+>            ScalarType "regclass" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "varchar" ) (+>            ScalarType "regclass" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "text" ) (+>            ScalarType "bpchar" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "text" ) (+>            ScalarType "varchar" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "bpchar" ) (+>            ScalarType "text" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "bpchar" ) (+>            ScalarType "varchar" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "varchar" ) (+>            ScalarType "text" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "varchar" ) (+>            ScalarType "bpchar" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "char" ) (+>            ScalarType "text" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "char" ) (+>            ScalarType "bpchar" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "char" ) (+>            ScalarType "varchar" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "name" ) (+>            ScalarType "text" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "name" ) (+>            ScalarType "bpchar" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "name" ) (+>            ScalarType "varchar" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "text" ) (+>            ScalarType "char" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "bpchar" ) (+>            ScalarType "char" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "varchar" ) (+>            ScalarType "char" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "text" ) (+>            ScalarType "name" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "bpchar" ) (+>            ScalarType "name" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "varchar" ) (+>            ScalarType "name" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "char" ) (+>            ScalarType "int4" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "char" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "abstime" ) (+>            ScalarType "date" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "abstime" ) (+>            ScalarType "time" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "abstime" ) (+>            ScalarType "timestamp" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "abstime" ) (+>            ScalarType "timestamptz" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "reltime" ) (+>            ScalarType "interval" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "date" ) (+>            ScalarType "timestamp" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "date" ) (+>            ScalarType "timestamptz" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "time" ) (+>            ScalarType "interval" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "time" ) (+>            ScalarType "timetz" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "timestamp" ) (+>            ScalarType "abstime" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "timestamp" ) (+>            ScalarType "date" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "timestamp" ) (+>            ScalarType "time" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "timestamp" ) (+>            ScalarType "timestamptz" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "timestamptz" ) (+>            ScalarType "abstime" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "timestamptz" ) (+>            ScalarType "date" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "timestamptz" ) (+>            ScalarType "time" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "timestamptz" ) (+>            ScalarType "timestamp" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "timestamptz" ) (+>            ScalarType "timetz" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "interval" ) (+>            ScalarType "reltime" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "interval" ) (+>            ScalarType "time" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "timetz" ) (+>            ScalarType "time" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "abstime" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "abstime" ) (+>            ScalarType "int4" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "reltime" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "reltime" ) (+>            ScalarType "int4" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "lseg" ) (+>            ScalarType "point" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "path" ) (+>            ScalarType "point" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "path" ) (+>            ScalarType "polygon" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "box" ) (+>            ScalarType "point" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "box" ) (+>            ScalarType "lseg" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "box" ) (+>            ScalarType "polygon" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "box" ) (+>            ScalarType "circle" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "polygon" ) (+>            ScalarType "point" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "polygon" ) (+>            ScalarType "path" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "polygon" ) (+>            ScalarType "box" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "polygon" ) (+>            ScalarType "circle" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "circle" ) (+>            ScalarType "point" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "circle" ) (+>            ScalarType "box" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "circle" ) (+>            ScalarType "polygon" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "cidr" ) (+>            ScalarType "inet" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "inet" ) (+>            ScalarType "cidr" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "bit" ) (+>            ScalarType "varbit" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "varbit" ) (+>            ScalarType "bit" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int8" ) (+>            ScalarType "bit" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "int4" ) (+>            ScalarType "bit" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "bit" ) (+>            ScalarType "int8" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "bit" ) (+>            ScalarType "int4" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "cidr" ) (+>            ScalarType "text" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "inet" ) (+>            ScalarType "text" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "bool" ) (+>            ScalarType "text" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "xml" ) (+>            ScalarType "text" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "text" ) (+>            ScalarType "xml" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "cidr" ) (+>            ScalarType "varchar" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "inet" ) (+>            ScalarType "varchar" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "bool" ) (+>            ScalarType "varchar" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "xml" ) (+>            ScalarType "varchar" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "varchar" ) (+>            ScalarType "xml" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "cidr" ) (+>            ScalarType "bpchar" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "inet" ) (+>            ScalarType "bpchar" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "bool" ) (+>            ScalarType "bpchar" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "xml" ) (+>            ScalarType "bpchar" )+>            AssignmentCastContext+>        , EnvCreateCast (+>            ScalarType "bpchar" ) (+>            ScalarType "xml" )+>            ExplicitCastContext+>        , EnvCreateCast (+>            ScalarType "bpchar" ) (+>            ScalarType "bpchar" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "varchar" ) (+>            ScalarType "varchar" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "time" ) (+>            ScalarType "time" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "timestamp" ) (+>            ScalarType "timestamp" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "timestamptz" ) (+>            ScalarType "timestamptz" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "interval" ) (+>            ScalarType "interval" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "timetz" ) (+>            ScalarType "timetz" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "bit" ) (+>            ScalarType "bit" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "varbit" ) (+>            ScalarType "varbit" )+>            ImplicitCastContext+>        , EnvCreateCast (+>            ScalarType "numeric" ) (+>            ScalarType "numeric" )+>            ImplicitCastContext+>        , EnvCreateFunction+>            FunPrefix+>            "~"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "~"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "~"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "~"+>            [ ScalarType "bit"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "~"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "||/"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "|/"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "|"+>            [ ScalarType "tinterval"+>            ] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "@@"+>            [ ScalarType "circle"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "@@"+>            [ ScalarType "lseg"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "@@"+>            [ ScalarType "path"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "@@"+>            [ ScalarType "polygon"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "@@"+>            [ ScalarType "box"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "@-@"+>            [ ScalarType "path"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "@-@"+>            [ ScalarType "lseg"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "@"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "@"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "@"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "@"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "@"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "@"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "?|"+>            [ ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "?|"+>            [ ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "?-"+>            [ ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "?-"+>            [ ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "-"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "-"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "-"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "-"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "-"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "-"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "-"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "+"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "+"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "+"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "+"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "+"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "+"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "#"+>            [ ScalarType "path"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "#"+>            [ ScalarType "polygon"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "!!"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunPrefix+>            "!!"+>            [ ScalarType "tsquery"+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunPostfix+>            "!"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~~*"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~~*"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~~*"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~~"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~~"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~~"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~~"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~>~"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~>~"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~>=~"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~>=~"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~="+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~="+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~="+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~="+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~="+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~<~"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~<~"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~<=~"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~<=~"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~*"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~*"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~*"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~"+>            [ ArrayType ( ScalarType "aclitem" )+>            , ScalarType "aclitem"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~"+>            [ ScalarType "circle"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~"+>            [ ScalarType "polygon"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~"+>            [ ScalarType "path"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "~"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "||"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "||"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "||"+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "varbit" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "||"+>            [ Pseudo AnyElement+>            , Pseudo AnyArray+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "||"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "||"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "||"+>            [ Pseudo AnyNonArray+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "||"+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "tsvector" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "||"+>            [ Pseudo AnyArray+>            , Pseudo AnyElement+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "||"+>            [ ScalarType "text"+>            , Pseudo AnyNonArray+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "|>>"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "|>>"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "|>>"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "|&>"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "|&>"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "|&>"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "|"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "|"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "|"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "|"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "|"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "^"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "^"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@@@"+>            [ ScalarType "tsquery"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@@@"+>            [ ScalarType "tsvector"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@@"+>            [ ScalarType "text"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@@"+>            [ ScalarType "tsquery"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@@"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@@"+>            [ ScalarType "tsvector"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@>"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@>"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@>"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@>"+>            [ ScalarType "polygon"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@>"+>            [ ScalarType "path"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@>"+>            [ ArrayType ( ScalarType "aclitem" )+>            , ScalarType "aclitem"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@>"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@>"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "@>"+>            [ ScalarType "circle"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "?||"+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "?||"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "?|"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "?-|"+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "?-|"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "?-"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "?#"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "?#"+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "?#"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "?#"+>            [ ScalarType "lseg"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "?#"+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "?#"+>            [ ScalarType "lseg"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "?#"+>            [ ScalarType "line"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">^"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">^"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">>="+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">>"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">>"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">>"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">>"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">>"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">>"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">>"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">>"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">>"+>            [ ScalarType "bit"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "uuid"+>            , ScalarType "uuid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "macaddr"+>            , ScalarType "macaddr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "char"+>            , ScalarType "char"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "timestamp"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "date"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ Pseudo Record+>            , Pseudo Record+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "timestamptz"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "timestamp"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "date"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "oidvector"+>            , ScalarType "oidvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "reltime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">="+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "macaddr"+>            , ScalarType "macaddr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "char"+>            , ScalarType "char"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "reltime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "timestamptz"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "timestamp"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "uuid"+>            , ScalarType "uuid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "oidvector"+>            , ScalarType "oidvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ Pseudo Record+>            , Pseudo Record+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "date"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "date"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            ">"+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "reltime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "date"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "date"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "oidvector"+>            , ScalarType "oidvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "timestamp"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "timestamptz"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "timestamp"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "aclitem"+>            , ScalarType "aclitem"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "uuid"+>            , ScalarType "uuid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "int2vector"+>            , ScalarType "int2vector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ Pseudo Record+>            , Pseudo Record+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "cid"+>            , ScalarType "cid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "xid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "macaddr"+>            , ScalarType "macaddr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "xid"+>            , ScalarType "xid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "char"+>            , ScalarType "char"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "="+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<^"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<^"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<@"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<@"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<@"+>            [ ScalarType "lseg"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<@"+>            [ ScalarType "lseg"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<@"+>            [ ScalarType "point"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<@"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<@"+>            [ ScalarType "point"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<@"+>            [ ScalarType "point"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<@"+>            [ ScalarType "point"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<@"+>            [ ScalarType "point"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<@"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<@"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<@"+>            [ ScalarType "point"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<?>"+>            [ ScalarType "abstime"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "reltime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "oidvector"+>            , ScalarType "oidvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "char"+>            , ScalarType "char"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "date"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "date"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "timestamp"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "timestamptz"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "uuid"+>            , ScalarType "uuid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ Pseudo Record+>            , Pseudo Record+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<>"+>            [ ScalarType "macaddr"+>            , ScalarType "macaddr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "oidvector"+>            , ScalarType "oidvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "reltime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "uuid"+>            , ScalarType "uuid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "macaddr"+>            , ScalarType "macaddr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "timestamp"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "timestamptz"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "timestamp"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ Pseudo Record+>            , Pseudo Record+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "date"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "date"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "char"+>            , ScalarType "char"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<="+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<|"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<|"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<|"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<="+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<"+>            [ ScalarType "bit"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<<"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "circle"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "point"+>            , ScalarType "line"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "point"+>            , ScalarType "path"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "point"+>            , ScalarType "circle"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "lseg"+>            , ScalarType "box"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "point"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "lseg"+>            , ScalarType "line"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "point"+>            , ScalarType "box"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<->"+>            [ ScalarType "line"+>            , ScalarType "box"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<#>"+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "tinterval" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "oidvector"+>            , ScalarType "oidvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "timestamptz"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "timestamp"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "date"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "char"+>            , ScalarType "char"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ Pseudo Record+>            , Pseudo Record+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "macaddr"+>            , ScalarType "macaddr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "uuid"+>            , ScalarType "uuid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "date"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "reltime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "<"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "money"+>            , ScalarType "float4"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "circle"+>            , ScalarType "point"+>            ] (+>            ScalarType "circle" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "money"+>            , ScalarType "int4"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "path"+>            , ScalarType "point"+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "interval"+>            , ScalarType "float8"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "money"+>            , ScalarType "int2"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "money"+>            , ScalarType "float8"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "/"+>            [ ScalarType "box"+>            , ScalarType "point"+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "timestamptz"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "circle"+>            , ScalarType "point"+>            ] (+>            ScalarType "circle" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "date"+>            , ScalarType "int4"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "date"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ArrayType ( ScalarType "aclitem" )+>            , ScalarType "aclitem"+>            ] (+>            ArrayType ( ScalarType "aclitem" ) )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "inet"+>            , ScalarType "int8"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "box"+>            , ScalarType "point"+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "path"+>            , ScalarType "point"+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "time"+>            , ScalarType "interval"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "timetz"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "abstime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "timestamp"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "-"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "date"+>            , ScalarType "time"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "timetz"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "time"+>            , ScalarType "interval"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "timestamp"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "time"+>            , ScalarType "date"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "date"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "path"+>            , ScalarType "point"+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "box"+>            , ScalarType "point"+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "int8"+>            , ScalarType "inet"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ArrayType ( ScalarType "aclitem" )+>            , ScalarType "aclitem"+>            ] (+>            ArrayType ( ScalarType "aclitem" ) )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "inet"+>            , ScalarType "int8"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "interval"+>            , ScalarType "date"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "date"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "timetz"+>            , ScalarType "date"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "interval"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "interval"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "date"+>            , ScalarType "int4"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "interval"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "int4"+>            , ScalarType "date"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "circle"+>            , ScalarType "point"+>            ] (+>            ScalarType "circle" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "timestamptz"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "abstime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "+"+>            [ ScalarType "interval"+>            , ScalarType "time"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "path"+>            , ScalarType "point"+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "box"+>            , ScalarType "point"+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "money"+>            , ScalarType "float4"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "float4"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "money"+>            , ScalarType "float8"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "money"+>            , ScalarType "int4"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "money"+>            , ScalarType "int2"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "float8"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "int4"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "int2"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "circle"+>            , ScalarType "point"+>            ] (+>            ScalarType "circle" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "float8"+>            , ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "interval"+>            , ScalarType "float8"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "*"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&>"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&>"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&>"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&<|"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&<|"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&<|"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&<"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&<"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&<"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&&"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&&"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&&"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&&"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&&"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&&"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "&"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "%"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "%"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "%"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "%"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "#>="+>            [ ScalarType "tinterval"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "#>"+>            [ ScalarType "tinterval"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "#="+>            [ ScalarType "tinterval"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "#<>"+>            [ ScalarType "tinterval"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "#<="+>            [ ScalarType "tinterval"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "#<"+>            [ ScalarType "tinterval"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "##"+>            [ ScalarType "line"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "##"+>            [ ScalarType "lseg"+>            , ScalarType "line"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "##"+>            [ ScalarType "point"+>            , ScalarType "box"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "##"+>            [ ScalarType "lseg"+>            , ScalarType "box"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "##"+>            [ ScalarType "line"+>            , ScalarType "box"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "##"+>            [ ScalarType "point"+>            , ScalarType "line"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "##"+>            [ ScalarType "point"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "##"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "#"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "#"+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "#"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "#"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "#"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "#"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "#"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "!~~*"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "!~~*"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "!~~*"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "!~~"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "!~~"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "!~~"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "!~~"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "!~*"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "!~*"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "!~*"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "!~"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "!~"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunBinary+>            "!~"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "RI_FKey_cascade_del"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "RI_FKey_cascade_upd"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "RI_FKey_check_ins"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "RI_FKey_check_upd"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "RI_FKey_noaction_del"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "RI_FKey_noaction_upd"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "RI_FKey_restrict_del"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "RI_FKey_restrict_upd"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "RI_FKey_setdefault_del"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "RI_FKey_setdefault_upd"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "RI_FKey_setnull_del"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "RI_FKey_setnull_upd"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "abbrev"+>            [ ScalarType "cidr"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abbrev"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abs"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abs"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abs"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abs"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abs"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abs"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abstime"+>            [ ScalarType "timestamp"+>            ] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abstime"+>            [ ScalarType "timestamptz"+>            ] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abstimeeq"+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abstimege"+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abstimegt"+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abstimein"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abstimele"+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abstimelt"+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abstimene"+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abstimeout"+>            [ ScalarType "abstime"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "abstimerecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunName+>            "abstimesend"+>            [ ScalarType "abstime"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "aclcontains"+>            [ ArrayType ( ScalarType "aclitem" )+>            , ScalarType "aclitem"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "aclinsert"+>            [ ArrayType ( ScalarType "aclitem" )+>            , ScalarType "aclitem"+>            ] (+>            ArrayType ( ScalarType "aclitem" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "aclitemeq"+>            [ ScalarType "aclitem"+>            , ScalarType "aclitem"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "aclitemin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "aclitem" )+>            False+>        , EnvCreateFunction+>            FunName+>            "aclitemout"+>            [ ScalarType "aclitem"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "aclremove"+>            [ ArrayType ( ScalarType "aclitem" )+>            , ScalarType "aclitem"+>            ] (+>            ArrayType ( ScalarType "aclitem" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "acos"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "age"+>            [ ScalarType "xid"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "age"+>            [ ScalarType "timestamp"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "age"+>            [ ScalarType "timestamptz"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "age"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "age"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "any_in"+>            [ Pseudo Cstring+>            ] (+>            Pseudo Any )+>            False+>        , EnvCreateFunction+>            FunName+>            "any_out"+>            [ Pseudo Any+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "anyarray_in"+>            [ Pseudo Cstring+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "anyarray_out"+>            [ Pseudo AnyArray+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "anyarray_recv"+>            [ Pseudo Internal+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "anyarray_send"+>            [ Pseudo AnyArray+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "anyelement_in"+>            [ Pseudo Cstring+>            ] (+>            Pseudo AnyElement )+>            False+>        , EnvCreateFunction+>            FunName+>            "anyelement_out"+>            [ Pseudo AnyElement+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "anyenum_in"+>            [ Pseudo Cstring+>            ] (+>            Pseudo AnyEnum )+>            False+>        , EnvCreateFunction+>            FunName+>            "anyenum_out"+>            [ Pseudo AnyEnum+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "anynonarray_in"+>            [ Pseudo Cstring+>            ] (+>            Pseudo AnyNonArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "anynonarray_out"+>            [ Pseudo AnyNonArray+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "anytextcat"+>            [ Pseudo AnyNonArray+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "area"+>            [ ScalarType "path"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "area"+>            [ ScalarType "box"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "area"+>            [ ScalarType "circle"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "areajoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "areasel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_agg_finalfn"+>            [ Pseudo Internal+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_agg_transfn"+>            [ Pseudo Internal+>            , Pseudo AnyElement+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_append"+>            [ Pseudo AnyArray+>            , Pseudo AnyElement+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_cat"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_dims"+>            [ Pseudo AnyArray+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_eq"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_fill"+>            [ Pseudo AnyElement+>            , ArrayType ( ScalarType "int4" )+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_fill"+>            [ Pseudo AnyElement+>            , ArrayType ( ScalarType "int4" )+>            , ArrayType ( ScalarType "int4" )+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_ge"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_gt"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_in"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_larger"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_le"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_length"+>            [ Pseudo AnyArray+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_lower"+>            [ Pseudo AnyArray+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_lt"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_ndims"+>            [ Pseudo AnyArray+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_ne"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_out"+>            [ Pseudo AnyArray+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_prepend"+>            [ Pseudo AnyElement+>            , Pseudo AnyArray+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_recv"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_send"+>            [ Pseudo AnyArray+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_smaller"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_to_string"+>            [ Pseudo AnyArray+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "array_upper"+>            [ Pseudo AnyArray+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "arraycontained"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "arraycontains"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "arrayoverlap"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ascii"+>            [ ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ascii_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "ascii_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "asin"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "atan"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "atan2"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "big5_to_euc_tw"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "big5_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "big5_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "bit"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bit"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bit"+>            [ ScalarType "bit"+>            , ScalarType "int4"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bit_in"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bit_length"+>            [ ScalarType "bytea"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bit_length"+>            [ ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bit_length"+>            [ ScalarType "bit"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bit_out"+>            [ ScalarType "bit"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "bit_recv"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bit_send"+>            [ ScalarType "bit"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bitand"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bitcat"+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "varbit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bitcmp"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "biteq"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bitge"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bitgt"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bitle"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bitlt"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bitne"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bitnot"+>            [ ScalarType "bit"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bitor"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bitshiftleft"+>            [ ScalarType "bit"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bitshiftright"+>            [ ScalarType "bit"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bittypmodin"+>            [ ArrayType ( Pseudo Cstring )+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bittypmodout"+>            [ ScalarType "int4"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "bitxor"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bool"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "booland_statefunc"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "booleq"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "boolge"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "boolgt"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "boolin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "boolle"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "boollt"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "boolne"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "boolor_statefunc"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "boolout"+>            [ ScalarType "bool"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "boolrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "boolsend"+>            [ ScalarType "bool"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box"+>            [ ScalarType "polygon"+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box"+>            [ ScalarType "circle"+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_above"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_above_eq"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_add"+>            [ ScalarType "box"+>            , ScalarType "point"+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_below"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_below_eq"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_center"+>            [ ScalarType "box"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_contain"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_contained"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_distance"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_div"+>            [ ScalarType "box"+>            , ScalarType "point"+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_eq"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_ge"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_gt"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_intersect"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_le"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_left"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_lt"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_mul"+>            [ ScalarType "box"+>            , ScalarType "point"+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_out"+>            [ ScalarType "box"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_overabove"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_overbelow"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_overlap"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_overleft"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_overright"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_right"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_same"+>            [ ScalarType "box"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_send"+>            [ ScalarType "box"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "box_sub"+>            [ ScalarType "box"+>            , ScalarType "point"+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchar"+>            [ ScalarType "char"+>            ] (+>            ScalarType "bpchar" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchar"+>            [ ScalarType "name"+>            ] (+>            ScalarType "bpchar" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchar"+>            [ ScalarType "bpchar"+>            , ScalarType "int4"+>            , ScalarType "bool"+>            ] (+>            ScalarType "bpchar" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchar_larger"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bpchar" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchar_pattern_ge"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchar_pattern_gt"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchar_pattern_le"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchar_pattern_lt"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchar_smaller"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bpchar" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharcmp"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchareq"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharge"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchargt"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchariclike"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharicnlike"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharicregexeq"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharicregexne"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharin"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bpchar" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharle"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharlike"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharlt"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharne"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharnlike"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharout"+>            [ ScalarType "bpchar"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharrecv"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bpchar" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharregexeq"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharregexne"+>            [ ScalarType "bpchar"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpcharsend"+>            [ ScalarType "bpchar"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchartypmodin"+>            [ ArrayType ( Pseudo Cstring )+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bpchartypmodout"+>            [ ScalarType "int4"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "broadcast"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btabstimecmp"+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btarraycmp"+>            [ Pseudo AnyArray+>            , Pseudo AnyArray+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btbeginscan"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "btboolcmp"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btbpchar_pattern_cmp"+>            [ ScalarType "bpchar"+>            , ScalarType "bpchar"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btbuild"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "btbulkdelete"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "btcharcmp"+>            [ ScalarType "char"+>            , ScalarType "char"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btcostestimate"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "btendscan"+>            [ Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "btfloat48cmp"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btfloat4cmp"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btfloat84cmp"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btfloat8cmp"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btgetbitmap"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btgettuple"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btinsert"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btint24cmp"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btint28cmp"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btint2cmp"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btint42cmp"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btint48cmp"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btint4cmp"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btint82cmp"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btint84cmp"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btint8cmp"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btmarkpos"+>            [ Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "btnamecmp"+>            [ ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btoidcmp"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btoidvectorcmp"+>            [ ScalarType "oidvector"+>            , ScalarType "oidvector"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btoptions"+>            [ ArrayType ( ScalarType "text" )+>            , ScalarType "bool"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btrecordcmp"+>            [ Pseudo Record+>            , Pseudo Record+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btreltimecmp"+>            [ ScalarType "reltime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btrescan"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "btrestrpos"+>            [ Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "btrim"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btrim"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btrim"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bttext_pattern_cmp"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bttextcmp"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bttidcmp"+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bttintervalcmp"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "btvacuumcleanup"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "byteacat"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "byteacmp"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "byteaeq"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "byteage"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "byteagt"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "byteain"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "byteale"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bytealike"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "bytealt"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "byteane"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "byteanlike"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "byteaout"+>            [ ScalarType "bytea"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "bytearecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "byteasend"+>            [ ScalarType "bytea"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_cmp"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_div_flt4"+>            [ ScalarType "money"+>            , ScalarType "float4"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_div_flt8"+>            [ ScalarType "money"+>            , ScalarType "float8"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_div_int2"+>            [ ScalarType "money"+>            , ScalarType "int2"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_div_int4"+>            [ ScalarType "money"+>            , ScalarType "int4"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_eq"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_ge"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_gt"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_le"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_lt"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_mi"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_mul_flt4"+>            [ ScalarType "money"+>            , ScalarType "float4"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_mul_flt8"+>            [ ScalarType "money"+>            , ScalarType "float8"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_mul_int2"+>            [ ScalarType "money"+>            , ScalarType "int2"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_mul_int4"+>            [ ScalarType "money"+>            , ScalarType "int4"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_ne"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_out"+>            [ ScalarType "money"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_pl"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_send"+>            [ ScalarType "money"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cash_words"+>            [ ScalarType "money"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cashlarger"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cashsmaller"+>            [ ScalarType "money"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cbrt"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ceil"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ceil"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ceiling"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ceiling"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "center"+>            [ ScalarType "box"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "center"+>            [ ScalarType "circle"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "char"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "char" )+>            False+>        , EnvCreateFunction+>            FunName+>            "char"+>            [ ScalarType "text"+>            ] (+>            ScalarType "char" )+>            False+>        , EnvCreateFunction+>            FunName+>            "char_length"+>            [ ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "char_length"+>            [ ScalarType "bpchar"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "character_length"+>            [ ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "character_length"+>            [ ScalarType "bpchar"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "chareq"+>            [ ScalarType "char"+>            , ScalarType "char"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "charge"+>            [ ScalarType "char"+>            , ScalarType "char"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "chargt"+>            [ ScalarType "char"+>            , ScalarType "char"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "charin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "char" )+>            False+>        , EnvCreateFunction+>            FunName+>            "charle"+>            [ ScalarType "char"+>            , ScalarType "char"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "charlt"+>            [ ScalarType "char"+>            , ScalarType "char"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "charne"+>            [ ScalarType "char"+>            , ScalarType "char"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "charout"+>            [ ScalarType "char"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "charrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "char" )+>            False+>        , EnvCreateFunction+>            FunName+>            "charsend"+>            [ ScalarType "char"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "chr"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cideq"+>            [ ScalarType "cid"+>            , ScalarType "cid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cidin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "cid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cidout"+>            [ ScalarType "cid"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "cidr"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "cidr" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cidr_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "cidr" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cidr_out"+>            [ ScalarType "cidr"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "cidr_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "cidr" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cidr_send"+>            [ ScalarType "cidr"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cidrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "cid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cidsend"+>            [ ScalarType "cid"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle"+>            [ ScalarType "box"+>            ] (+>            ScalarType "circle" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle"+>            [ ScalarType "polygon"+>            ] (+>            ScalarType "circle" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle"+>            [ ScalarType "point"+>            , ScalarType "float8"+>            ] (+>            ScalarType "circle" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_above"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_add_pt"+>            [ ScalarType "circle"+>            , ScalarType "point"+>            ] (+>            ScalarType "circle" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_below"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_center"+>            [ ScalarType "circle"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_contain"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_contain_pt"+>            [ ScalarType "circle"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_contained"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_distance"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_div_pt"+>            [ ScalarType "circle"+>            , ScalarType "point"+>            ] (+>            ScalarType "circle" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_eq"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_ge"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_gt"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "circle" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_le"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_left"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_lt"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_mul_pt"+>            [ ScalarType "circle"+>            , ScalarType "point"+>            ] (+>            ScalarType "circle" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_ne"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_out"+>            [ ScalarType "circle"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_overabove"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_overbelow"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_overlap"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_overleft"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_overright"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "circle" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_right"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_same"+>            [ ScalarType "circle"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_send"+>            [ ScalarType "circle"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "circle_sub_pt"+>            [ ScalarType "circle"+>            , ScalarType "point"+>            ] (+>            ScalarType "circle" )+>            False+>        , EnvCreateFunction+>            FunName+>            "clock_timestamp"+>            [] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "close_lb"+>            [ ScalarType "line"+>            , ScalarType "box"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "close_ls"+>            [ ScalarType "line"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "close_lseg"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "close_pb"+>            [ ScalarType "point"+>            , ScalarType "box"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "close_pl"+>            [ ScalarType "point"+>            , ScalarType "line"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "close_ps"+>            [ ScalarType "point"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "close_sb"+>            [ ScalarType "lseg"+>            , ScalarType "box"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "close_sl"+>            [ ScalarType "lseg"+>            , ScalarType "line"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "col_description"+>            [ ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "contjoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "contsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "convert"+>            [ ScalarType "bytea"+>            , ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "convert_from"+>            [ ScalarType "bytea"+>            , ScalarType "name"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "convert_to"+>            [ ScalarType "text"+>            , ScalarType "name"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cos"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cot"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cstring_in"+>            [ Pseudo Cstring+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "cstring_out"+>            [ Pseudo Cstring+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "cstring_recv"+>            [ Pseudo Internal+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "cstring_send"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "current_database"+>            [] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "current_query"+>            [] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "current_schema"+>            [] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "current_schemas"+>            [ ScalarType "bool"+>            ] (+>            ArrayType ( ScalarType "name" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "current_setting"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "current_user"+>            [] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "currtid"+>            [ ScalarType "oid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "tid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "currtid2"+>            [ ScalarType "text"+>            , ScalarType "tid"+>            ] (+>            ScalarType "tid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "currval"+>            [ ScalarType "regclass"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cursor_to_xml"+>            [ ScalarType "refcursor"+>            , ScalarType "int4"+>            , ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "cursor_to_xmlschema"+>            [ ScalarType "refcursor"+>            , ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "database_to_xml"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "database_to_xml_and_xmlschema"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "database_to_xmlschema"+>            [ ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date"+>            [ ScalarType "abstime"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date"+>            [ ScalarType "timestamp"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date"+>            [ ScalarType "timestamptz"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_cmp"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_cmp_timestamp"+>            [ ScalarType "date"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_cmp_timestamptz"+>            [ ScalarType "date"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_eq"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_eq_timestamp"+>            [ ScalarType "date"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_eq_timestamptz"+>            [ ScalarType "date"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_ge"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_ge_timestamp"+>            [ ScalarType "date"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_ge_timestamptz"+>            [ ScalarType "date"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_gt"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_gt_timestamp"+>            [ ScalarType "date"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_gt_timestamptz"+>            [ ScalarType "date"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_larger"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_le"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_le_timestamp"+>            [ ScalarType "date"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_le_timestamptz"+>            [ ScalarType "date"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_lt"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_lt_timestamp"+>            [ ScalarType "date"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_lt_timestamptz"+>            [ ScalarType "date"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_mi"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_mi_interval"+>            [ ScalarType "date"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_mii"+>            [ ScalarType "date"+>            , ScalarType "int4"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_ne"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_ne_timestamp"+>            [ ScalarType "date"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_ne_timestamptz"+>            [ ScalarType "date"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_out"+>            [ ScalarType "date"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_part"+>            [ ScalarType "text"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_part"+>            [ ScalarType "text"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_part"+>            [ ScalarType "text"+>            , ScalarType "date"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_part"+>            [ ScalarType "text"+>            , ScalarType "time"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_part"+>            [ ScalarType "text"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_part"+>            [ ScalarType "text"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_part"+>            [ ScalarType "text"+>            , ScalarType "interval"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_part"+>            [ ScalarType "text"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_pl_interval"+>            [ ScalarType "date"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_pli"+>            [ ScalarType "date"+>            , ScalarType "int4"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_send"+>            [ ScalarType "date"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_smaller"+>            [ ScalarType "date"+>            , ScalarType "date"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_trunc"+>            [ ScalarType "text"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_trunc"+>            [ ScalarType "text"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "date_trunc"+>            [ ScalarType "text"+>            , ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "datetime_pl"+>            [ ScalarType "date"+>            , ScalarType "time"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "datetimetz_pl"+>            [ ScalarType "date"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dcbrt"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "decode"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "degrees"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dexp"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "diagonal"+>            [ ScalarType "box"+>            ] (+>            ScalarType "lseg" )+>            False+>        , EnvCreateFunction+>            FunName+>            "diameter"+>            [ ScalarType "circle"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dispell_init"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "dispell_lexize"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "dist_cpoly"+>            [ ScalarType "circle"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dist_lb"+>            [ ScalarType "line"+>            , ScalarType "box"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dist_pb"+>            [ ScalarType "point"+>            , ScalarType "box"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dist_pc"+>            [ ScalarType "point"+>            , ScalarType "circle"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dist_pl"+>            [ ScalarType "point"+>            , ScalarType "line"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dist_ppath"+>            [ ScalarType "point"+>            , ScalarType "path"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dist_ps"+>            [ ScalarType "point"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dist_sb"+>            [ ScalarType "lseg"+>            , ScalarType "box"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dist_sl"+>            [ ScalarType "lseg"+>            , ScalarType "line"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "div"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dlog1"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dlog10"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "domain_in"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            Pseudo Any )+>            False+>        , EnvCreateFunction+>            FunName+>            "domain_recv"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            Pseudo Any )+>            False+>        , EnvCreateFunction+>            FunName+>            "dpow"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dround"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dsimple_init"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "dsimple_lexize"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "dsnowball_init"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "dsnowball_lexize"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "dsqrt"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "dsynonym_init"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "dsynonym_lexize"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "dtrunc"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "encode"+>            [ ScalarType "bytea"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_cmp"+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_eq"+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_first"+>            [ Pseudo AnyEnum+>            ] (+>            Pseudo AnyEnum )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_ge"+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_gt"+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_in"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            ] (+>            Pseudo AnyEnum )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_larger"+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            Pseudo AnyEnum )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_last"+>            [ Pseudo AnyEnum+>            ] (+>            Pseudo AnyEnum )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_le"+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_lt"+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_ne"+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_out"+>            [ Pseudo AnyEnum+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_range"+>            [ Pseudo AnyEnum+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_range"+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_recv"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            ] (+>            Pseudo AnyEnum )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_send"+>            [ Pseudo AnyEnum+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "enum_smaller"+>            [ Pseudo AnyEnum+>            , Pseudo AnyEnum+>            ] (+>            Pseudo AnyEnum )+>            False+>        , EnvCreateFunction+>            FunName+>            "eqjoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "eqsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "euc_cn_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "euc_cn_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "euc_jis_2004_to_shift_jis_2004"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "euc_jis_2004_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "euc_jp_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "euc_jp_to_sjis"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "euc_jp_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "euc_kr_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "euc_kr_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "euc_tw_to_big5"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "euc_tw_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "euc_tw_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "exp"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "exp"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "factorial"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "family"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "flatfile_update_trigger"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float48div"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float48eq"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float48ge"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float48gt"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float48le"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float48lt"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float48mi"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float48mul"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float48ne"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float48pl"+>            [ ScalarType "float4"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4_accum"+>            [ ArrayType ( ScalarType "float8" )+>            , ScalarType "float4"+>            ] (+>            ArrayType ( ScalarType "float8" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4abs"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4div"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4eq"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4ge"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4gt"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4larger"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4le"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4lt"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4mi"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4mul"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4ne"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4out"+>            [ ScalarType "float4"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4pl"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4send"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4smaller"+>            [ ScalarType "float4"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4um"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float4up"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float84div"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float84eq"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float84ge"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float84gt"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float84le"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float84lt"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float84mi"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float84mul"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float84ne"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float84pl"+>            [ ScalarType "float8"+>            , ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_accum"+>            [ ArrayType ( ScalarType "float8" )+>            , ScalarType "float8"+>            ] (+>            ArrayType ( ScalarType "float8" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_avg"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_corr"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_covar_pop"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_covar_samp"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_regr_accum"+>            [ ArrayType ( ScalarType "float8" )+>            , ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ArrayType ( ScalarType "float8" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_regr_avgx"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_regr_avgy"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_regr_intercept"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_regr_r2"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_regr_slope"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_regr_sxx"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_regr_sxy"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_regr_syy"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_stddev_pop"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_stddev_samp"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_var_pop"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8_var_samp"+>            [ ArrayType ( ScalarType "float8" )+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8abs"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8div"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8eq"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8ge"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8gt"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8larger"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8le"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8lt"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8mi"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8mul"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8ne"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8out"+>            [ ScalarType "float8"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8pl"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8send"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8smaller"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8um"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "float8up"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "floor"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "floor"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "flt4_mul_cash"+>            [ ScalarType "float4"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "flt8_mul_cash"+>            [ ScalarType "float8"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "fmgr_c_validator"+>            [ ScalarType "oid"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "fmgr_internal_validator"+>            [ ScalarType "oid"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "fmgr_sql_validator"+>            [ ScalarType "oid"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "format_type"+>            [ ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gb18030_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "gbk_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "generate_series"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            SetOfType ( ScalarType "int8" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "generate_series"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            SetOfType ( ScalarType "int4" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "generate_series"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            SetOfType ( ScalarType "int8" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "generate_series"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            SetOfType ( ScalarType "int4" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "generate_series"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            , ScalarType "interval"+>            ] (+>            SetOfType ( ScalarType "timestamp" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "generate_series"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            , ScalarType "interval"+>            ] (+>            SetOfType ( ScalarType "timestamptz" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "generate_subscripts"+>            [ Pseudo AnyArray+>            , ScalarType "int4"+>            ] (+>            SetOfType ( ScalarType "int4" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "generate_subscripts"+>            [ Pseudo AnyArray+>            , ScalarType "int4"+>            , ScalarType "bool"+>            ] (+>            SetOfType ( ScalarType "int4" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "get_bit"+>            [ ScalarType "bytea"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "get_byte"+>            [ ScalarType "bytea"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "get_current_ts_config"+>            [] (+>            ScalarType "regconfig" )+>            False+>        , EnvCreateFunction+>            FunName+>            "getdatabaseencoding"+>            [] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "getpgusername"+>            [] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gin_cmp_prefix"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gin_cmp_tslexeme"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gin_extract_tsquery"+>            [ ScalarType "tsquery"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gin_extract_tsvector"+>            [ ScalarType "tsvector"+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gin_tsquery_consistent"+>            [ Pseudo Internal+>            , ScalarType "int2"+>            , ScalarType "tsquery"+>            , ScalarType "int4"+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ginarrayconsistent"+>            [ Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo AnyArray+>            , ScalarType "int4"+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ginarrayextract"+>            [ Pseudo AnyArray+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "ginbeginscan"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "ginbuild"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "ginbulkdelete"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gincostestimate"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "ginendscan"+>            [ Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "gingetbitmap"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gininsert"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ginmarkpos"+>            [ Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "ginoptions"+>            [ ArrayType ( ScalarType "text" )+>            , ScalarType "bool"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ginqueryarrayextract"+>            [ Pseudo AnyArray+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "ginrescan"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "ginrestrpos"+>            [ Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "ginvacuumcleanup"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gist_box_compress"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gist_box_consistent"+>            [ Pseudo Internal+>            , ScalarType "box"+>            , ScalarType "int4"+>            , ScalarType "oid"+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gist_box_decompress"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gist_box_penalty"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gist_box_picksplit"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gist_box_same"+>            [ ScalarType "box"+>            , ScalarType "box"+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gist_box_union"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "box" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gist_circle_compress"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gist_circle_consistent"+>            [ Pseudo Internal+>            , ScalarType "circle"+>            , ScalarType "int4"+>            , ScalarType "oid"+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gist_poly_compress"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gist_poly_consistent"+>            [ Pseudo Internal+>            , ScalarType "polygon"+>            , ScalarType "int4"+>            , ScalarType "oid"+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gistbeginscan"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gistbuild"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gistbulkdelete"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gistcostestimate"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "gistendscan"+>            [ Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "gistgetbitmap"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gistgettuple"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gistinsert"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gistmarkpos"+>            [ Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "gistoptions"+>            [ ArrayType ( ScalarType "text" )+>            , ScalarType "bool"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gistrescan"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "gistrestrpos"+>            [ Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "gistvacuumcleanup"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsquery_compress"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsquery_consistent"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , ScalarType "int4"+>            , ScalarType "oid"+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsquery_decompress"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsquery_penalty"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsquery_picksplit"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsquery_same"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsquery_union"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsvector_compress"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsvector_consistent"+>            [ Pseudo Internal+>            , ScalarType "gtsvector"+>            , ScalarType "int4"+>            , ScalarType "oid"+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsvector_decompress"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsvector_penalty"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsvector_picksplit"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsvector_same"+>            [ ScalarType "gtsvector"+>            , ScalarType "gtsvector"+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsvector_union"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsvectorin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "gtsvector" )+>            False+>        , EnvCreateFunction+>            FunName+>            "gtsvectorout"+>            [ ScalarType "gtsvector"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_any_column_privilege"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_any_column_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_any_column_privilege"+>            [ ScalarType "name"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_any_column_privilege"+>            [ ScalarType "name"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_any_column_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_any_column_privilege"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_column_privilege"+>            [ ScalarType "text"+>            , ScalarType "int2"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_column_privilege"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_column_privilege"+>            [ ScalarType "oid"+>            , ScalarType "int2"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_column_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_column_privilege"+>            [ ScalarType "name"+>            , ScalarType "text"+>            , ScalarType "int2"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_column_privilege"+>            [ ScalarType "name"+>            , ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_column_privilege"+>            [ ScalarType "name"+>            , ScalarType "oid"+>            , ScalarType "int2"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_column_privilege"+>            [ ScalarType "name"+>            , ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_column_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "int2"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_column_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_column_privilege"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            , ScalarType "int2"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_column_privilege"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_database_privilege"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_database_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_database_privilege"+>            [ ScalarType "name"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_database_privilege"+>            [ ScalarType "name"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_database_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_database_privilege"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_foreign_data_wrapper_privilege"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_foreign_data_wrapper_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_foreign_data_wrapper_privilege"+>            [ ScalarType "name"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_foreign_data_wrapper_privilege"+>            [ ScalarType "name"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_foreign_data_wrapper_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_foreign_data_wrapper_privilege"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_function_privilege"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_function_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_function_privilege"+>            [ ScalarType "name"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_function_privilege"+>            [ ScalarType "name"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_function_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_function_privilege"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_language_privilege"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_language_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_language_privilege"+>            [ ScalarType "name"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_language_privilege"+>            [ ScalarType "name"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_language_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_language_privilege"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_schema_privilege"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_schema_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_schema_privilege"+>            [ ScalarType "name"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_schema_privilege"+>            [ ScalarType "name"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_schema_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_schema_privilege"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_server_privilege"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_server_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_server_privilege"+>            [ ScalarType "name"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_server_privilege"+>            [ ScalarType "name"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_server_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_server_privilege"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_table_privilege"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_table_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_table_privilege"+>            [ ScalarType "name"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_table_privilege"+>            [ ScalarType "name"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_table_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_table_privilege"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_tablespace_privilege"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_tablespace_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_tablespace_privilege"+>            [ ScalarType "name"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_tablespace_privilege"+>            [ ScalarType "name"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_tablespace_privilege"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "has_tablespace_privilege"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hash_aclitem"+>            [ ScalarType "aclitem"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hash_numeric"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashbeginscan"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashbpchar"+>            [ ScalarType "bpchar"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashbuild"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashbulkdelete"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashchar"+>            [ ScalarType "char"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashcostestimate"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashendscan"+>            [ Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashenum"+>            [ Pseudo AnyEnum+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashfloat4"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashfloat8"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashgetbitmap"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashgettuple"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashinet"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashinsert"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashint2"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashint2vector"+>            [ ScalarType "int2vector"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashint4"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashint8"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashmacaddr"+>            [ ScalarType "macaddr"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashmarkpos"+>            [ Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashname"+>            [ ScalarType "name"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashoid"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashoidvector"+>            [ ScalarType "oidvector"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashoptions"+>            [ ArrayType ( ScalarType "text" )+>            , ScalarType "bool"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashrescan"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashrestrpos"+>            [ Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashtext"+>            [ ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashvacuumcleanup"+>            [ Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "hashvarlena"+>            [ Pseudo Internal+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "height"+>            [ ScalarType "box"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "host"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "hostmask"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "iclikejoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "iclikesel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "icnlikejoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "icnlikesel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "icregexeqjoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "icregexeqsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "icregexnejoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "icregexnesel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inet_client_addr"+>            [] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inet_client_port"+>            [] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inet_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inet_out"+>            [ ScalarType "inet"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "inet_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inet_send"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inet_server_addr"+>            [] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inet_server_port"+>            [] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inetand"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inetmi"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inetmi_int8"+>            [ ScalarType "inet"+>            , ScalarType "int8"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inetnot"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inetor"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inetpl"+>            [ ScalarType "inet"+>            , ScalarType "int8"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "initcap"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int24div"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int24eq"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int24ge"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int24gt"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int24le"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int24lt"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int24mi"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int24mul"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int24ne"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int24pl"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int28div"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int28eq"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int28ge"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int28gt"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int28le"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int28lt"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int28mi"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int28mul"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int28ne"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int28pl"+>            [ ScalarType "int2"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2_accum"+>            [ ArrayType ( ScalarType "numeric" )+>            , ScalarType "int2"+>            ] (+>            ArrayType ( ScalarType "numeric" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2_avg_accum"+>            [ ArrayType ( ScalarType "int8" )+>            , ScalarType "int2"+>            ] (+>            ArrayType ( ScalarType "int8" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2_mul_cash"+>            [ ScalarType "int2"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2_sum"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2abs"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2and"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2div"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2eq"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2ge"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2gt"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2larger"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2le"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2lt"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2mi"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2mod"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2mul"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2ne"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2not"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2or"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2out"+>            [ ScalarType "int2"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2pl"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2send"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2shl"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2shr"+>            [ ScalarType "int2"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2smaller"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2um"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2up"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2vectoreq"+>            [ ScalarType "int2vector"+>            , ScalarType "int2vector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2vectorin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "int2vector" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2vectorout"+>            [ ScalarType "int2vector"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2vectorrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "int2vector" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2vectorsend"+>            [ ScalarType "int2vector"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int2xor"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4"+>            [ ScalarType "bool"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4"+>            [ ScalarType "char"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4"+>            [ ScalarType "bit"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int42div"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int42eq"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int42ge"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int42gt"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int42le"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int42lt"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int42mi"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int42mul"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int42ne"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int42pl"+>            [ ScalarType "int4"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int48div"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int48eq"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int48ge"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int48gt"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int48le"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int48lt"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int48mi"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int48mul"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int48ne"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int48pl"+>            [ ScalarType "int4"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4_accum"+>            [ ArrayType ( ScalarType "numeric" )+>            , ScalarType "int4"+>            ] (+>            ArrayType ( ScalarType "numeric" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4_avg_accum"+>            [ ArrayType ( ScalarType "int8" )+>            , ScalarType "int4"+>            ] (+>            ArrayType ( ScalarType "int8" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4_mul_cash"+>            [ ScalarType "int4"+>            , ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4_sum"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4abs"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4and"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4div"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4eq"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4ge"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4gt"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4inc"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4larger"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4le"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4lt"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4mi"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4mod"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4mul"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4ne"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4not"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4or"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4out"+>            [ ScalarType "int4"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4pl"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4send"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4shl"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4shr"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4smaller"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4um"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4up"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int4xor"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8"+>            [ ScalarType "bit"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int82div"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int82eq"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int82ge"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int82gt"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int82le"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int82lt"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int82mi"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int82mul"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int82ne"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int82pl"+>            [ ScalarType "int8"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int84div"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int84eq"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int84ge"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int84gt"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int84le"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int84lt"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int84mi"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int84mul"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int84ne"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int84pl"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8_accum"+>            [ ArrayType ( ScalarType "numeric" )+>            , ScalarType "int8"+>            ] (+>            ArrayType ( ScalarType "numeric" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8_avg"+>            [ ArrayType ( ScalarType "int8" )+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8_avg_accum"+>            [ ArrayType ( ScalarType "numeric" )+>            , ScalarType "int8"+>            ] (+>            ArrayType ( ScalarType "numeric" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8_sum"+>            [ ScalarType "numeric"+>            , ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8abs"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8and"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8div"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8eq"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8ge"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8gt"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8inc"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8inc_any"+>            [ ScalarType "int8"+>            , Pseudo Any+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8inc_float8_float8"+>            [ ScalarType "int8"+>            , ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8larger"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8le"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8lt"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8mi"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8mod"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8mul"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8ne"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8not"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8or"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8out"+>            [ ScalarType "int8"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8pl"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8pl_inet"+>            [ ScalarType "int8"+>            , ScalarType "inet"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8send"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8shl"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8shr"+>            [ ScalarType "int8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8smaller"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8um"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8up"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "int8xor"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "integer_pl_date"+>            [ ScalarType "int4"+>            , ScalarType "date"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inter_lb"+>            [ ScalarType "line"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inter_sb"+>            [ ScalarType "lseg"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "inter_sl"+>            [ ScalarType "lseg"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "internal_in"+>            [ Pseudo Cstring+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "internal_out"+>            [ Pseudo Internal+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval"+>            [ ScalarType "reltime"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval"+>            [ ScalarType "time"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval"+>            [ ScalarType "interval"+>            , ScalarType "int4"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_accum"+>            [ ArrayType ( ScalarType "interval" )+>            , ScalarType "interval"+>            ] (+>            ArrayType ( ScalarType "interval" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_avg"+>            [ ArrayType ( ScalarType "interval" )+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_cmp"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_div"+>            [ ScalarType "interval"+>            , ScalarType "float8"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_eq"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_ge"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_gt"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_hash"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_in"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_larger"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_le"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_lt"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_mi"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_mul"+>            [ ScalarType "interval"+>            , ScalarType "float8"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_ne"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_out"+>            [ ScalarType "interval"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_pl"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_pl_date"+>            [ ScalarType "interval"+>            , ScalarType "date"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_pl_time"+>            [ ScalarType "interval"+>            , ScalarType "time"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_pl_timestamp"+>            [ ScalarType "interval"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_pl_timestamptz"+>            [ ScalarType "interval"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_pl_timetz"+>            [ ScalarType "interval"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_recv"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_send"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_smaller"+>            [ ScalarType "interval"+>            , ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "interval_um"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "intervaltypmodin"+>            [ ArrayType ( Pseudo Cstring )+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "intervaltypmodout"+>            [ ScalarType "int4"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "intinterval"+>            [ ScalarType "abstime"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "isclosed"+>            [ ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "isfinite"+>            [ ScalarType "abstime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "isfinite"+>            [ ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "isfinite"+>            [ ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "isfinite"+>            [ ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "isfinite"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ishorizontal"+>            [ ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ishorizontal"+>            [ ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ishorizontal"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "iso8859_1_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "iso8859_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "iso_to_koi8r"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "iso_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "iso_to_win1251"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "iso_to_win866"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "isopen"+>            [ ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "isparallel"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "isparallel"+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "isperp"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "isperp"+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "isvertical"+>            [ ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "isvertical"+>            [ ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "isvertical"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "johab_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "justify_days"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "justify_hours"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "justify_interval"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "koi8r_to_iso"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "koi8r_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "koi8r_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "koi8r_to_win1251"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "koi8r_to_win866"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "koi8u_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "language_handler_in"+>            [ Pseudo Cstring+>            ] (+>            Pseudo LanguageHandler )+>            False+>        , EnvCreateFunction+>            FunName+>            "language_handler_out"+>            [ Pseudo LanguageHandler+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "lastval"+>            [] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "latin1_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "latin2_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "latin2_to_win1250"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "latin3_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "latin4_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "length"+>            [ ScalarType "bytea"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "length"+>            [ ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "length"+>            [ ScalarType "lseg"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "length"+>            [ ScalarType "path"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "length"+>            [ ScalarType "bpchar"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "length"+>            [ ScalarType "bit"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "length"+>            [ ScalarType "tsvector"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "length"+>            [ ScalarType "bytea"+>            , ScalarType "name"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "like"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "like"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "like"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "like_escape"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "like_escape"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "likejoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "likesel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "line"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "line" )+>            False+>        , EnvCreateFunction+>            FunName+>            "line_distance"+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "line_eq"+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "line_horizontal"+>            [ ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "line_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "line" )+>            False+>        , EnvCreateFunction+>            FunName+>            "line_interpt"+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "line_intersect"+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "line_out"+>            [ ScalarType "line"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "line_parallel"+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "line_perp"+>            [ ScalarType "line"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "line_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "line" )+>            False+>        , EnvCreateFunction+>            FunName+>            "line_send"+>            [ ScalarType "line"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "line_vertical"+>            [ ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ln"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ln"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lo_close"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lo_creat"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lo_create"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lo_export"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lo_import"+>            [ ScalarType "text"+>            ] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lo_import"+>            [ ScalarType "text"+>            , ScalarType "oid"+>            ] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lo_lseek"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lo_open"+>            [ ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lo_tell"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lo_truncate"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lo_unlink"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "log"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "log"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "log"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "loread"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lower"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lowrite"+>            [ ScalarType "int4"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lpad"+>            [ ScalarType "text"+>            , ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lpad"+>            [ ScalarType "text"+>            , ScalarType "int4"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg"+>            [ ScalarType "box"+>            ] (+>            ScalarType "lseg" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "lseg" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_center"+>            [ ScalarType "lseg"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_distance"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_eq"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_ge"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_gt"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_horizontal"+>            [ ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "lseg" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_interpt"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_intersect"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_le"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_length"+>            [ ScalarType "lseg"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_lt"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_ne"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_out"+>            [ ScalarType "lseg"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_parallel"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_perp"+>            [ ScalarType "lseg"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "lseg" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_send"+>            [ ScalarType "lseg"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "lseg_vertical"+>            [ ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ltrim"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ltrim"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "macaddr_cmp"+>            [ ScalarType "macaddr"+>            , ScalarType "macaddr"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "macaddr_eq"+>            [ ScalarType "macaddr"+>            , ScalarType "macaddr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "macaddr_ge"+>            [ ScalarType "macaddr"+>            , ScalarType "macaddr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "macaddr_gt"+>            [ ScalarType "macaddr"+>            , ScalarType "macaddr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "macaddr_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "macaddr" )+>            False+>        , EnvCreateFunction+>            FunName+>            "macaddr_le"+>            [ ScalarType "macaddr"+>            , ScalarType "macaddr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "macaddr_lt"+>            [ ScalarType "macaddr"+>            , ScalarType "macaddr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "macaddr_ne"+>            [ ScalarType "macaddr"+>            , ScalarType "macaddr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "macaddr_out"+>            [ ScalarType "macaddr"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "macaddr_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "macaddr" )+>            False+>        , EnvCreateFunction+>            FunName+>            "macaddr_send"+>            [ ScalarType "macaddr"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "makeaclitem"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            , ScalarType "text"+>            , ScalarType "bool"+>            ] (+>            ScalarType "aclitem" )+>            False+>        , EnvCreateFunction+>            FunName+>            "masklen"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "md5"+>            [ ScalarType "bytea"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "md5"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_ascii"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_big5"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_euc_cn"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_euc_jp"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_euc_kr"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_euc_tw"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_iso"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_koi8r"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_latin1"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_latin2"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_latin3"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_latin4"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_sjis"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_win1250"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_win1251"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mic_to_win866"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "mktinterval"+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "tinterval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "mod"+>            [ ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "mod"+>            [ ScalarType "int2"+>            , ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunName+>            "mod"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "mod"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "mul_d_interval"+>            [ ScalarType "float8"+>            , ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "name"+>            [ ScalarType "text"+>            ] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "name"+>            [ ScalarType "bpchar"+>            ] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "name"+>            [ ScalarType "varchar"+>            ] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "nameeq"+>            [ ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "namege"+>            [ ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "namegt"+>            [ ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "nameiclike"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "nameicnlike"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "nameicregexeq"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "nameicregexne"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "namein"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "namele"+>            [ ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "namelike"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "namelt"+>            [ ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "namene"+>            [ ScalarType "name"+>            , ScalarType "name"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "namenlike"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "nameout"+>            [ ScalarType "name"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "namerecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "nameregexeq"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "nameregexne"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "namesend"+>            [ ScalarType "name"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "neqjoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "neqsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "netmask"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "network"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "cidr" )+>            False+>        , EnvCreateFunction+>            FunName+>            "network_cmp"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "network_eq"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "network_ge"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "network_gt"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "network_le"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "network_lt"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "network_ne"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "network_sub"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "network_subeq"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "network_sup"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "network_supeq"+>            [ ScalarType "inet"+>            , ScalarType "inet"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "nextval"+>            [ ScalarType "regclass"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "nlikejoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "nlikesel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "notlike"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "notlike"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "notlike"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "now"+>            [] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "npoints"+>            [ ScalarType "path"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "npoints"+>            [ ScalarType "polygon"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric"+>            [ ScalarType "numeric"+>            , ScalarType "int4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_abs"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_accum"+>            [ ArrayType ( ScalarType "numeric" )+>            , ScalarType "numeric"+>            ] (+>            ArrayType ( ScalarType "numeric" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_add"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_avg"+>            [ ArrayType ( ScalarType "numeric" )+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_avg_accum"+>            [ ArrayType ( ScalarType "numeric" )+>            , ScalarType "numeric"+>            ] (+>            ArrayType ( ScalarType "numeric" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_cmp"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_div"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_div_trunc"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_eq"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_exp"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_fac"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_ge"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_gt"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_in"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_inc"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_larger"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_le"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_ln"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_log"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_lt"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_mod"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_mul"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_ne"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_out"+>            [ ScalarType "numeric"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_power"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_recv"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_send"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_smaller"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_sqrt"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_stddev_pop"+>            [ ArrayType ( ScalarType "numeric" )+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_stddev_samp"+>            [ ArrayType ( ScalarType "numeric" )+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_sub"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_uminus"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_uplus"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_var_pop"+>            [ ArrayType ( ScalarType "numeric" )+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numeric_var_samp"+>            [ ArrayType ( ScalarType "numeric" )+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numerictypmodin"+>            [ ArrayType ( Pseudo Cstring )+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "numerictypmodout"+>            [ ScalarType "int4"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "numnode"+>            [ ScalarType "tsquery"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "obj_description"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "obj_description"+>            [ ScalarType "oid"+>            , ScalarType "name"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "octet_length"+>            [ ScalarType "bytea"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "octet_length"+>            [ ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "octet_length"+>            [ ScalarType "bpchar"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "octet_length"+>            [ ScalarType "bit"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oid"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oideq"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidge"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidgt"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidlarger"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidle"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidlt"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidne"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidout"+>            [ ScalarType "oid"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidsend"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidsmaller"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            ] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidvectoreq"+>            [ ScalarType "oidvector"+>            , ScalarType "oidvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidvectorge"+>            [ ScalarType "oidvector"+>            , ScalarType "oidvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidvectorgt"+>            [ ScalarType "oidvector"+>            , ScalarType "oidvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidvectorin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "oidvector" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidvectorle"+>            [ ScalarType "oidvector"+>            , ScalarType "oidvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidvectorlt"+>            [ ScalarType "oidvector"+>            , ScalarType "oidvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidvectorne"+>            [ ScalarType "oidvector"+>            , ScalarType "oidvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidvectorout"+>            [ ScalarType "oidvector"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidvectorrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "oidvector" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidvectorsend"+>            [ ScalarType "oidvector"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "oidvectortypes"+>            [ ScalarType "oidvector"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "on_pb"+>            [ ScalarType "point"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "on_pl"+>            [ ScalarType "point"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "on_ppath"+>            [ ScalarType "point"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "on_ps"+>            [ ScalarType "point"+>            , ScalarType "lseg"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "on_sb"+>            [ ScalarType "lseg"+>            , ScalarType "box"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "on_sl"+>            [ ScalarType "lseg"+>            , ScalarType "line"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "opaque_in"+>            [ Pseudo Cstring+>            ] (+>            Pseudo Opaque )+>            False+>        , EnvCreateFunction+>            FunName+>            "opaque_out"+>            [ Pseudo Opaque+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlaps"+>            [ ScalarType "time"+>            , ScalarType "time"+>            , ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlaps"+>            [ ScalarType "time"+>            , ScalarType "time"+>            , ScalarType "time"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlaps"+>            [ ScalarType "time"+>            , ScalarType "interval"+>            , ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlaps"+>            [ ScalarType "time"+>            , ScalarType "interval"+>            , ScalarType "time"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlaps"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            , ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlaps"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            , ScalarType "timestamp"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlaps"+>            [ ScalarType "timestamp"+>            , ScalarType "interval"+>            , ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlaps"+>            [ ScalarType "timestamp"+>            , ScalarType "interval"+>            , ScalarType "timestamp"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlaps"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlaps"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlaps"+>            [ ScalarType "timestamptz"+>            , ScalarType "interval"+>            , ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlaps"+>            [ ScalarType "timestamptz"+>            , ScalarType "interval"+>            , ScalarType "timestamptz"+>            , ScalarType "interval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlaps"+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            , ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlay"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "overlay"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path"+>            [ ScalarType "polygon"+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_add"+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_add_pt"+>            [ ScalarType "path"+>            , ScalarType "point"+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_center"+>            [ ScalarType "path"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_contain_pt"+>            [ ScalarType "path"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_distance"+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_div_pt"+>            [ ScalarType "path"+>            , ScalarType "point"+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_inter"+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_length"+>            [ ScalarType "path"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_mul_pt"+>            [ ScalarType "path"+>            , ScalarType "point"+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_n_eq"+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_n_ge"+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_n_gt"+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_n_le"+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_n_lt"+>            [ ScalarType "path"+>            , ScalarType "path"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_npoints"+>            [ ScalarType "path"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_out"+>            [ ScalarType "path"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_send"+>            [ ScalarType "path"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "path_sub_pt"+>            [ ScalarType "path"+>            , ScalarType "point"+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pclose"+>            [ ScalarType "path"+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_advisory_lock"+>            [ ScalarType "int8"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_advisory_lock"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_advisory_lock_shared"+>            [ ScalarType "int8"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_advisory_lock_shared"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_advisory_unlock"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_advisory_unlock"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_advisory_unlock_all"+>            [] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_advisory_unlock_shared"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_advisory_unlock_shared"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_backend_pid"+>            [] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_cancel_backend"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_char_to_encoding"+>            [ ScalarType "name"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_client_encoding"+>            [] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_column_size"+>            [ Pseudo Any+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_conf_load_time"+>            [] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_conversion_is_visible"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_current_xlog_insert_location"+>            [] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_current_xlog_location"+>            [] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_cursor"+>            [] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_database_size"+>            [ ScalarType "name"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_database_size"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_encoding_to_char"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_function_is_visible"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_constraintdef"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_constraintdef"+>            [ ScalarType "oid"+>            , ScalarType "bool"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_expr"+>            [ ScalarType "text"+>            , ScalarType "oid"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_expr"+>            [ ScalarType "text"+>            , ScalarType "oid"+>            , ScalarType "bool"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_function_arguments"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_function_identity_arguments"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_function_result"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_functiondef"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_indexdef"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_indexdef"+>            [ ScalarType "oid"+>            , ScalarType "int4"+>            , ScalarType "bool"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_keywords"+>            [] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_ruledef"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_ruledef"+>            [ ScalarType "oid"+>            , ScalarType "bool"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_serial_sequence"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_triggerdef"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_userbyid"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_viewdef"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_viewdef"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_viewdef"+>            [ ScalarType "text"+>            , ScalarType "bool"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_get_viewdef"+>            [ ScalarType "oid"+>            , ScalarType "bool"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_has_role"+>            [ ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_has_role"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_has_role"+>            [ ScalarType "name"+>            , ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_has_role"+>            [ ScalarType "name"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_has_role"+>            [ ScalarType "oid"+>            , ScalarType "name"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_has_role"+>            [ ScalarType "oid"+>            , ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_is_other_temp_schema"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_lock_status"+>            [] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_ls_dir"+>            [ ScalarType "text"+>            ] (+>            SetOfType ( ScalarType "text" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_my_temp_schema"+>            [] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_opclass_is_visible"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_operator_is_visible"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_options_to_table"+>            [ ArrayType ( ScalarType "text" )+>            ] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_postmaster_start_time"+>            [] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_prepared_statement"+>            [] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_prepared_xact"+>            [] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_read_file"+>            [ ScalarType "text"+>            , ScalarType "int8"+>            , ScalarType "int8"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_relation_size"+>            [ ScalarType "regclass"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_relation_size"+>            [ ScalarType "regclass"+>            , ScalarType "text"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_reload_conf"+>            [] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_rotate_logfile"+>            [] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_show_all_settings"+>            [] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_size_pretty"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_sleep"+>            [ ScalarType "float8"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_start_backup"+>            [ ScalarType "text"+>            , ScalarType "bool"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_clear_snapshot"+>            [] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_file"+>            [ ScalarType "text"+>            ] (+>            Pseudo Record )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_activity"+>            [ ScalarType "int4"+>            ] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_backend_activity"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_backend_activity_start"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_backend_client_addr"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_backend_client_port"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_backend_dbid"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_backend_idset"+>            [] (+>            SetOfType ( ScalarType "int4" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_backend_pid"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_backend_start"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_backend_userid"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_backend_waiting"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_backend_xact_start"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_bgwriter_buf_written_checkpoints"+>            [] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_bgwriter_buf_written_clean"+>            [] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_bgwriter_maxwritten_clean"+>            [] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_bgwriter_requested_checkpoints"+>            [] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_bgwriter_timed_checkpoints"+>            [] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_blocks_fetched"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_blocks_hit"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_buf_alloc"+>            [] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_buf_written_backend"+>            [] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_db_blocks_fetched"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_db_blocks_hit"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_db_numbackends"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_db_tuples_deleted"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_db_tuples_fetched"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_db_tuples_inserted"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_db_tuples_returned"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_db_tuples_updated"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_db_xact_commit"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_db_xact_rollback"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_dead_tuples"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_function_calls"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_function_self_time"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_function_time"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_last_analyze_time"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_last_autoanalyze_time"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_last_autovacuum_time"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_last_vacuum_time"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_live_tuples"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_numscans"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_tuples_deleted"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_tuples_fetched"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_tuples_hot_updated"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_tuples_inserted"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_tuples_returned"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_get_tuples_updated"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stat_reset"+>            [] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_stop_backup"+>            [] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_switch_xlog"+>            [] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_table_is_visible"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_tablespace_databases"+>            [ ScalarType "oid"+>            ] (+>            SetOfType ( ScalarType "oid" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_tablespace_size"+>            [ ScalarType "name"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_tablespace_size"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_terminate_backend"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_timezone_abbrevs"+>            [] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_timezone_names"+>            [] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_total_relation_size"+>            [ ScalarType "regclass"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_try_advisory_lock"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_try_advisory_lock"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_try_advisory_lock_shared"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_try_advisory_lock_shared"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_ts_config_is_visible"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_ts_dict_is_visible"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_ts_parser_is_visible"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_ts_template_is_visible"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_type_is_visible"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_typeof"+>            [ Pseudo Any+>            ] (+>            ScalarType "regtype" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_xlogfile_name"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pg_xlogfile_name_offset"+>            [ ScalarType "text"+>            ] (+>            Pseudo Record )+>            False+>        , EnvCreateFunction+>            FunName+>            "pi"+>            [] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "plainto_tsquery"+>            [ ScalarType "text"+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunName+>            "plainto_tsquery"+>            [ ScalarType "regconfig"+>            , ScalarType "text"+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point"+>            [ ScalarType "lseg"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point"+>            [ ScalarType "path"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point"+>            [ ScalarType "box"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point"+>            [ ScalarType "polygon"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point"+>            [ ScalarType "circle"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_above"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_add"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_below"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_distance"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_div"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_eq"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_horiz"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_left"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_mul"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_ne"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_out"+>            [ ScalarType "point"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_right"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_send"+>            [ ScalarType "point"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_sub"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "point_vert"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_above"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_below"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_center"+>            [ ScalarType "polygon"+>            ] (+>            ScalarType "point" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_contain"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_contain_pt"+>            [ ScalarType "polygon"+>            , ScalarType "point"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_contained"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_distance"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "polygon" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_left"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_npoints"+>            [ ScalarType "polygon"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_out"+>            [ ScalarType "polygon"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_overabove"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_overbelow"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_overlap"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_overleft"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_overright"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "polygon" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_right"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_same"+>            [ ScalarType "polygon"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "poly_send"+>            [ ScalarType "polygon"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "polygon"+>            [ ScalarType "path"+>            ] (+>            ScalarType "polygon" )+>            False+>        , EnvCreateFunction+>            FunName+>            "polygon"+>            [ ScalarType "box"+>            ] (+>            ScalarType "polygon" )+>            False+>        , EnvCreateFunction+>            FunName+>            "polygon"+>            [ ScalarType "circle"+>            ] (+>            ScalarType "polygon" )+>            False+>        , EnvCreateFunction+>            FunName+>            "polygon"+>            [ ScalarType "int4"+>            , ScalarType "circle"+>            ] (+>            ScalarType "polygon" )+>            False+>        , EnvCreateFunction+>            FunName+>            "popen"+>            [ ScalarType "path"+>            ] (+>            ScalarType "path" )+>            False+>        , EnvCreateFunction+>            FunName+>            "position"+>            [ ScalarType "bytea"+>            , ScalarType "bytea"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "position"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "position"+>            [ ScalarType "bit"+>            , ScalarType "bit"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "positionjoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "positionsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "postgresql_fdw_validator"+>            [ ArrayType ( ScalarType "text" )+>            , ScalarType "oid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pow"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pow"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "power"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "power"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "prsd_end"+>            [ Pseudo Internal+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "prsd_headline"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , ScalarType "tsquery"+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "prsd_lextype"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "prsd_nexttoken"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "prsd_start"+>            [ Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "pt_contained_circle"+>            [ ScalarType "point"+>            , ScalarType "circle"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "pt_contained_poly"+>            [ ScalarType "point"+>            , ScalarType "polygon"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "query_to_xml"+>            [ ScalarType "text"+>            , ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "query_to_xml_and_xmlschema"+>            [ ScalarType "text"+>            , ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "query_to_xmlschema"+>            [ ScalarType "text"+>            , ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "querytree"+>            [ ScalarType "tsquery"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "quote_ident"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "quote_literal"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "quote_literal"+>            [ Pseudo AnyElement+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "quote_nullable"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "quote_nullable"+>            [ Pseudo AnyElement+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "radians"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "radius"+>            [ ScalarType "circle"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "random"+>            [] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "record_eq"+>            [ Pseudo Record+>            , Pseudo Record+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "record_ge"+>            [ Pseudo Record+>            , Pseudo Record+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "record_gt"+>            [ Pseudo Record+>            , Pseudo Record+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "record_in"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            Pseudo Record )+>            False+>        , EnvCreateFunction+>            FunName+>            "record_le"+>            [ Pseudo Record+>            , Pseudo Record+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "record_lt"+>            [ Pseudo Record+>            , Pseudo Record+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "record_ne"+>            [ Pseudo Record+>            , Pseudo Record+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "record_out"+>            [ Pseudo Record+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "record_recv"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            Pseudo Record )+>            False+>        , EnvCreateFunction+>            FunName+>            "record_send"+>            [ Pseudo Record+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regclass"+>            [ ScalarType "text"+>            ] (+>            ScalarType "regclass" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regclassin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "regclass" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regclassout"+>            [ ScalarType "regclass"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "regclassrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "regclass" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regclasssend"+>            [ ScalarType "regclass"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regconfigin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "regconfig" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regconfigout"+>            [ ScalarType "regconfig"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "regconfigrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "regconfig" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regconfigsend"+>            [ ScalarType "regconfig"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regdictionaryin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "regdictionary" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regdictionaryout"+>            [ ScalarType "regdictionary"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "regdictionaryrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "regdictionary" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regdictionarysend"+>            [ ScalarType "regdictionary"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regexeqjoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regexeqsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regexnejoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regexnesel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regexp_matches"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            SetOfType ( ArrayType ( ScalarType "text" ) ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "regexp_matches"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            SetOfType ( ArrayType ( ScalarType "text" ) ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "regexp_replace"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regexp_replace"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regexp_split_to_array"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ArrayType ( ScalarType "text" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "regexp_split_to_array"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ArrayType ( ScalarType "text" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "regexp_split_to_table"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            SetOfType ( ScalarType "text" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "regexp_split_to_table"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            SetOfType ( ScalarType "text" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "regoperatorin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "regoperator" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regoperatorout"+>            [ ScalarType "regoperator"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "regoperatorrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "regoperator" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regoperatorsend"+>            [ ScalarType "regoperator"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regoperin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "regoper" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regoperout"+>            [ ScalarType "regoper"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "regoperrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "regoper" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regopersend"+>            [ ScalarType "regoper"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regprocedurein"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "regprocedure" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regprocedureout"+>            [ ScalarType "regprocedure"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "regprocedurerecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "regprocedure" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regproceduresend"+>            [ ScalarType "regprocedure"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regprocin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "regproc" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regprocout"+>            [ ScalarType "regproc"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "regprocrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "regproc" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regprocsend"+>            [ ScalarType "regproc"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regtypein"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "regtype" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regtypeout"+>            [ ScalarType "regtype"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "regtyperecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "regtype" )+>            False+>        , EnvCreateFunction+>            FunName+>            "regtypesend"+>            [ ScalarType "regtype"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "reltime"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "reltime" )+>            False+>        , EnvCreateFunction+>            FunName+>            "reltimeeq"+>            [ ScalarType "reltime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "reltimege"+>            [ ScalarType "reltime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "reltimegt"+>            [ ScalarType "reltime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "reltimein"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "reltime" )+>            False+>        , EnvCreateFunction+>            FunName+>            "reltimele"+>            [ ScalarType "reltime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "reltimelt"+>            [ ScalarType "reltime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "reltimene"+>            [ ScalarType "reltime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "reltimeout"+>            [ ScalarType "reltime"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "reltimerecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "reltime" )+>            False+>        , EnvCreateFunction+>            FunName+>            "reltimesend"+>            [ ScalarType "reltime"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "repeat"+>            [ ScalarType "text"+>            , ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "replace"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "round"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "round"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "round"+>            [ ScalarType "numeric"+>            , ScalarType "int4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "rpad"+>            [ ScalarType "text"+>            , ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "rpad"+>            [ ScalarType "text"+>            , ScalarType "int4"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "rtrim"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "rtrim"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "scalargtjoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "scalargtsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "scalarltjoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "scalarltsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "schema_to_xml"+>            [ ScalarType "name"+>            , ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "schema_to_xml_and_xmlschema"+>            [ ScalarType "name"+>            , ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "schema_to_xmlschema"+>            [ ScalarType "name"+>            , ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "session_user"+>            [] (+>            ScalarType "name" )+>            False+>        , EnvCreateFunction+>            FunName+>            "set_bit"+>            [ ScalarType "bytea"+>            , ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "set_byte"+>            [ ScalarType "bytea"+>            , ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "set_config"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "bool"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "set_masklen"+>            [ ScalarType "cidr"+>            , ScalarType "int4"+>            ] (+>            ScalarType "cidr" )+>            False+>        , EnvCreateFunction+>            FunName+>            "set_masklen"+>            [ ScalarType "inet"+>            , ScalarType "int4"+>            ] (+>            ScalarType "inet" )+>            False+>        , EnvCreateFunction+>            FunName+>            "setseed"+>            [ ScalarType "float8"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "setval"+>            [ ScalarType "regclass"+>            , ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "setval"+>            [ ScalarType "regclass"+>            , ScalarType "int8"+>            , ScalarType "bool"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "setweight"+>            [ ScalarType "tsvector"+>            , ScalarType "char"+>            ] (+>            ScalarType "tsvector" )+>            False+>        , EnvCreateFunction+>            FunName+>            "shell_in"+>            [ Pseudo Cstring+>            ] (+>            Pseudo Opaque )+>            False+>        , EnvCreateFunction+>            FunName+>            "shell_out"+>            [ Pseudo Opaque+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "shift_jis_2004_to_euc_jis_2004"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "shift_jis_2004_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "shobj_description"+>            [ ScalarType "oid"+>            , ScalarType "name"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "sign"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "sign"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "similar_escape"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "sin"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "sjis_to_euc_jp"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "sjis_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "sjis_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "slope"+>            [ ScalarType "point"+>            , ScalarType "point"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "smgreq"+>            [ ScalarType "smgr"+>            , ScalarType "smgr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "smgrin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "smgr" )+>            False+>        , EnvCreateFunction+>            FunName+>            "smgrne"+>            [ ScalarType "smgr"+>            , ScalarType "smgr"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "smgrout"+>            [ ScalarType "smgr"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "split_part"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "sqrt"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "sqrt"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "statement_timestamp"+>            [] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "string_to_array"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ArrayType ( ScalarType "text" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "strip"+>            [ ScalarType "tsvector"+>            ] (+>            ScalarType "tsvector" )+>            False+>        , EnvCreateFunction+>            FunName+>            "strpos"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "substr"+>            [ ScalarType "bytea"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "substr"+>            [ ScalarType "text"+>            , ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "substr"+>            [ ScalarType "bytea"+>            , ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "substr"+>            [ ScalarType "text"+>            , ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "substring"+>            [ ScalarType "bytea"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "substring"+>            [ ScalarType "text"+>            , ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "substring"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "substring"+>            [ ScalarType "bit"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "substring"+>            [ ScalarType "bytea"+>            , ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "substring"+>            [ ScalarType "text"+>            , ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "substring"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "substring"+>            [ ScalarType "bit"+>            , ScalarType "int4"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "suppress_redundant_updates_trigger"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "table_to_xml"+>            [ ScalarType "regclass"+>            , ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "table_to_xml_and_xmlschema"+>            [ ScalarType "regclass"+>            , ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "table_to_xmlschema"+>            [ ScalarType "regclass"+>            , ScalarType "bool"+>            , ScalarType "bool"+>            , ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tan"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text"+>            [ ScalarType "bool"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text"+>            [ ScalarType "char"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text"+>            [ ScalarType "name"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text"+>            [ ScalarType "xml"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text"+>            [ ScalarType "inet"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text"+>            [ ScalarType "bpchar"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text_ge"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text_gt"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text_larger"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text_le"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text_lt"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text_pattern_ge"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text_pattern_gt"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text_pattern_le"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text_pattern_lt"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "text_smaller"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "textanycat"+>            [ ScalarType "text"+>            , Pseudo AnyNonArray+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "textcat"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "texteq"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "texticlike"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "texticnlike"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "texticregexeq"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "texticregexne"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "textin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "textlen"+>            [ ScalarType "text"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "textlike"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "textne"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "textnlike"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "textout"+>            [ ScalarType "text"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "textrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "textregexeq"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "textregexne"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "textsend"+>            [ ScalarType "text"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "thesaurus_init"+>            [ Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "thesaurus_lexize"+>            [ Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            , Pseudo Internal+>            ] (+>            Pseudo Internal )+>            False+>        , EnvCreateFunction+>            FunName+>            "tideq"+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tidge"+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tidgt"+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tidin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "tid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tidlarger"+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "tid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tidle"+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tidlt"+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tidne"+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tidout"+>            [ ScalarType "tid"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "tidrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "tid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tidsend"+>            [ ScalarType "tid"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tidsmaller"+>            [ ScalarType "tid"+>            , ScalarType "tid"+>            ] (+>            ScalarType "tid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time"+>            [ ScalarType "abstime"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time"+>            [ ScalarType "timestamp"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time"+>            [ ScalarType "timestamptz"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time"+>            [ ScalarType "timetz"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time"+>            [ ScalarType "time"+>            , ScalarType "int4"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_cmp"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_eq"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_ge"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_gt"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_hash"+>            [ ScalarType "time"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_in"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_larger"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_le"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_lt"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_mi_interval"+>            [ ScalarType "time"+>            , ScalarType "interval"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_mi_time"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_ne"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_out"+>            [ ScalarType "time"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_pl_interval"+>            [ ScalarType "time"+>            , ScalarType "interval"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_recv"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_send"+>            [ ScalarType "time"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "time_smaller"+>            [ ScalarType "time"+>            , ScalarType "time"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timedate_pl"+>            [ ScalarType "time"+>            , ScalarType "date"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timemi"+>            [ ScalarType "abstime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timenow"+>            [] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timeofday"+>            [] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timepl"+>            [ ScalarType "abstime"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp"+>            [ ScalarType "abstime"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp"+>            [ ScalarType "date"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp"+>            [ ScalarType "timestamptz"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp"+>            [ ScalarType "date"+>            , ScalarType "time"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp"+>            [ ScalarType "timestamp"+>            , ScalarType "int4"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_cmp"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_cmp_date"+>            [ ScalarType "timestamp"+>            , ScalarType "date"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_cmp_timestamptz"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_eq"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_eq_date"+>            [ ScalarType "timestamp"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_eq_timestamptz"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_ge"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_ge_date"+>            [ ScalarType "timestamp"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_ge_timestamptz"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_gt"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_gt_date"+>            [ ScalarType "timestamp"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_gt_timestamptz"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_hash"+>            [ ScalarType "timestamp"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_in"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_larger"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_le"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_le_date"+>            [ ScalarType "timestamp"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_le_timestamptz"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_lt"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_lt_date"+>            [ ScalarType "timestamp"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_lt_timestamptz"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_mi"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_mi_interval"+>            [ ScalarType "timestamp"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_ne"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_ne_date"+>            [ ScalarType "timestamp"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_ne_timestamptz"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_out"+>            [ ScalarType "timestamp"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_pl_interval"+>            [ ScalarType "timestamp"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_recv"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_send"+>            [ ScalarType "timestamp"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamp_smaller"+>            [ ScalarType "timestamp"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptypmodin"+>            [ ArrayType ( Pseudo Cstring )+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptypmodout"+>            [ ScalarType "int4"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz"+>            [ ScalarType "abstime"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz"+>            [ ScalarType "date"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz"+>            [ ScalarType "timestamp"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz"+>            [ ScalarType "date"+>            , ScalarType "time"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz"+>            [ ScalarType "date"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz"+>            [ ScalarType "timestamptz"+>            , ScalarType "int4"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_cmp"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_cmp_date"+>            [ ScalarType "timestamptz"+>            , ScalarType "date"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_cmp_timestamp"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_eq"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_eq_date"+>            [ ScalarType "timestamptz"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_eq_timestamp"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_ge"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_ge_date"+>            [ ScalarType "timestamptz"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_ge_timestamp"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_gt"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_gt_date"+>            [ ScalarType "timestamptz"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_gt_timestamp"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_in"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_larger"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_le"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_le_date"+>            [ ScalarType "timestamptz"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_le_timestamp"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_lt"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_lt_date"+>            [ ScalarType "timestamptz"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_lt_timestamp"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_mi"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_mi_interval"+>            [ ScalarType "timestamptz"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_ne"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_ne_date"+>            [ ScalarType "timestamptz"+>            , ScalarType "date"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_ne_timestamp"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_out"+>            [ ScalarType "timestamptz"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_pl_interval"+>            [ ScalarType "timestamptz"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_recv"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_send"+>            [ ScalarType "timestamptz"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptz_smaller"+>            [ ScalarType "timestamptz"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptztypmodin"+>            [ ArrayType ( Pseudo Cstring )+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timestamptztypmodout"+>            [ ScalarType "int4"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetypmodin"+>            [ ArrayType ( Pseudo Cstring )+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetypmodout"+>            [ ScalarType "int4"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz"+>            [ ScalarType "time"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz"+>            [ ScalarType "timestamptz"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz"+>            [ ScalarType "timetz"+>            , ScalarType "int4"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_cmp"+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_eq"+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_ge"+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_gt"+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_hash"+>            [ ScalarType "timetz"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_in"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_larger"+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_le"+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_lt"+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_mi_interval"+>            [ ScalarType "timetz"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_ne"+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_out"+>            [ ScalarType "timetz"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_pl_interval"+>            [ ScalarType "timetz"+>            , ScalarType "interval"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_recv"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_send"+>            [ ScalarType "timetz"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetz_smaller"+>            [ ScalarType "timetz"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetzdate_pl"+>            [ ScalarType "timetz"+>            , ScalarType "date"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetztypmodin"+>            [ ArrayType ( Pseudo Cstring )+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timetztypmodout"+>            [ ScalarType "int4"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "timezone"+>            [ ScalarType "text"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timezone"+>            [ ScalarType "text"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timezone"+>            [ ScalarType "text"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timezone"+>            [ ScalarType "interval"+>            , ScalarType "timestamp"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timezone"+>            [ ScalarType "interval"+>            , ScalarType "timestamptz"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunName+>            "timezone"+>            [ ScalarType "interval"+>            , ScalarType "timetz"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tinterval"+>            [ ScalarType "abstime"+>            , ScalarType "abstime"+>            ] (+>            ScalarType "tinterval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalct"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalend"+>            [ ScalarType "tinterval"+>            ] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervaleq"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalge"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalgt"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "tinterval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalle"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalleneq"+>            [ ScalarType "tinterval"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervallenge"+>            [ ScalarType "tinterval"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervallengt"+>            [ ScalarType "tinterval"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervallenle"+>            [ ScalarType "tinterval"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervallenlt"+>            [ ScalarType "tinterval"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervallenne"+>            [ ScalarType "tinterval"+>            , ScalarType "reltime"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervallt"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalne"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalout"+>            [ ScalarType "tinterval"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalov"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "tinterval" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalrel"+>            [ ScalarType "tinterval"+>            ] (+>            ScalarType "reltime" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalsame"+>            [ ScalarType "tinterval"+>            , ScalarType "tinterval"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalsend"+>            [ ScalarType "tinterval"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tintervalstart"+>            [ ScalarType "tinterval"+>            ] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_ascii"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_ascii"+>            [ ScalarType "text"+>            , ScalarType "name"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_ascii"+>            [ ScalarType "text"+>            , ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_char"+>            [ ScalarType "int8"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_char"+>            [ ScalarType "int4"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_char"+>            [ ScalarType "float4"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_char"+>            [ ScalarType "float8"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_char"+>            [ ScalarType "timestamp"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_char"+>            [ ScalarType "timestamptz"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_char"+>            [ ScalarType "interval"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_char"+>            [ ScalarType "numeric"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_date"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_hex"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_hex"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_number"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_timestamp"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_timestamp"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_tsquery"+>            [ ScalarType "text"+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_tsquery"+>            [ ScalarType "regconfig"+>            , ScalarType "text"+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_tsvector"+>            [ ScalarType "text"+>            ] (+>            ScalarType "tsvector" )+>            False+>        , EnvCreateFunction+>            FunName+>            "to_tsvector"+>            [ ScalarType "regconfig"+>            , ScalarType "text"+>            ] (+>            ScalarType "tsvector" )+>            False+>        , EnvCreateFunction+>            FunName+>            "transaction_timestamp"+>            [] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunName+>            "translate"+>            [ ScalarType "text"+>            , ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "trigger_in"+>            [ Pseudo Cstring+>            ] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "trigger_out"+>            [ Pseudo Trigger+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "trunc"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "trunc"+>            [ ScalarType "macaddr"+>            ] (+>            ScalarType "macaddr" )+>            False+>        , EnvCreateFunction+>            FunName+>            "trunc"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "trunc"+>            [ ScalarType "numeric"+>            , ScalarType "int4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_debug"+>            [ ScalarType "text"+>            ] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_debug"+>            [ ScalarType "regconfig"+>            , ScalarType "text"+>            ] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_headline"+>            [ ScalarType "text"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_headline"+>            [ ScalarType "text"+>            , ScalarType "tsquery"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_headline"+>            [ ScalarType "regconfig"+>            , ScalarType "text"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_headline"+>            [ ScalarType "regconfig"+>            , ScalarType "text"+>            , ScalarType "tsquery"+>            , ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_lexize"+>            [ ScalarType "regdictionary"+>            , ScalarType "text"+>            ] (+>            ArrayType ( ScalarType "text" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_match_qv"+>            [ ScalarType "tsquery"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_match_tq"+>            [ ScalarType "text"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_match_tt"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_match_vq"+>            [ ScalarType "tsvector"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_parse"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_parse"+>            [ ScalarType "oid"+>            , ScalarType "text"+>            ] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_rank"+>            [ ScalarType "tsvector"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_rank"+>            [ ArrayType ( ScalarType "float4" )+>            , ScalarType "tsvector"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_rank"+>            [ ScalarType "tsvector"+>            , ScalarType "tsquery"+>            , ScalarType "int4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_rank"+>            [ ArrayType ( ScalarType "float4" )+>            , ScalarType "tsvector"+>            , ScalarType "tsquery"+>            , ScalarType "int4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_rank_cd"+>            [ ScalarType "tsvector"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_rank_cd"+>            [ ArrayType ( ScalarType "float4" )+>            , ScalarType "tsvector"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_rank_cd"+>            [ ScalarType "tsvector"+>            , ScalarType "tsquery"+>            , ScalarType "int4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_rank_cd"+>            [ ArrayType ( ScalarType "float4" )+>            , ScalarType "tsvector"+>            , ScalarType "tsquery"+>            , ScalarType "int4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_rewrite"+>            [ ScalarType "tsquery"+>            , ScalarType "text"+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_rewrite"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_stat"+>            [ ScalarType "text"+>            ] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_stat"+>            [ ScalarType "text"+>            , ScalarType "text"+>            ] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_token_type"+>            [ ScalarType "text"+>            ] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_token_type"+>            [ ScalarType "oid"+>            ] (+>            SetOfType ( Pseudo Record ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "ts_typanalyze"+>            [ Pseudo Internal+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsmatchjoinsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int2"+>            , Pseudo Internal+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsmatchsel"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsq_mcontained"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsq_mcontains"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsquery_and"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsquery_cmp"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsquery_eq"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsquery_ge"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsquery_gt"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsquery_le"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsquery_lt"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsquery_ne"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsquery_not"+>            [ ScalarType "tsquery"+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsquery_or"+>            [ ScalarType "tsquery"+>            , ScalarType "tsquery"+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsqueryin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsqueryout"+>            [ ScalarType "tsquery"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsqueryrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "tsquery" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsquerysend"+>            [ ScalarType "tsquery"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvector_cmp"+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvector_concat"+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "tsvector" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvector_eq"+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvector_ge"+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvector_gt"+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvector_le"+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvector_lt"+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvector_ne"+>            [ ScalarType "tsvector"+>            , ScalarType "tsvector"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvector_update_trigger"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvector_update_trigger_column"+>            [] (+>            Pseudo Trigger )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvectorin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "tsvector" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvectorout"+>            [ ScalarType "tsvector"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvectorrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "tsvector" )+>            False+>        , EnvCreateFunction+>            FunName+>            "tsvectorsend"+>            [ ScalarType "tsvector"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "txid_current"+>            [] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "txid_current_snapshot"+>            [] (+>            ScalarType "txid_snapshot" )+>            False+>        , EnvCreateFunction+>            FunName+>            "txid_snapshot_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "txid_snapshot" )+>            False+>        , EnvCreateFunction+>            FunName+>            "txid_snapshot_out"+>            [ ScalarType "txid_snapshot"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "txid_snapshot_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "txid_snapshot" )+>            False+>        , EnvCreateFunction+>            FunName+>            "txid_snapshot_send"+>            [ ScalarType "txid_snapshot"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "txid_snapshot_xip"+>            [ ScalarType "txid_snapshot"+>            ] (+>            SetOfType ( ScalarType "int8" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "txid_snapshot_xmax"+>            [ ScalarType "txid_snapshot"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "txid_snapshot_xmin"+>            [ ScalarType "txid_snapshot"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "txid_visible_in_snapshot"+>            [ ScalarType "int8"+>            , ScalarType "txid_snapshot"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "uhc_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "unknownin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "unknown" )+>            False+>        , EnvCreateFunction+>            FunName+>            "unknownout"+>            [ ScalarType "unknown"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "unknownrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "unknown" )+>            False+>        , EnvCreateFunction+>            FunName+>            "unknownsend"+>            [ ScalarType "unknown"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "unnest"+>            [ Pseudo AnyArray+>            ] (+>            SetOfType ( Pseudo AnyElement ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "upper"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_ascii"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_big5"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_euc_cn"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_euc_jis_2004"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_euc_jp"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_euc_kr"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_euc_tw"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_gb18030"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_gbk"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_iso8859"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_iso8859_1"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_johab"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_koi8r"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_koi8u"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_shift_jis_2004"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_sjis"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_uhc"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "utf8_to_win"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "uuid_cmp"+>            [ ScalarType "uuid"+>            , ScalarType "uuid"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "uuid_eq"+>            [ ScalarType "uuid"+>            , ScalarType "uuid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "uuid_ge"+>            [ ScalarType "uuid"+>            , ScalarType "uuid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "uuid_gt"+>            [ ScalarType "uuid"+>            , ScalarType "uuid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "uuid_hash"+>            [ ScalarType "uuid"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "uuid_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "uuid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "uuid_le"+>            [ ScalarType "uuid"+>            , ScalarType "uuid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "uuid_lt"+>            [ ScalarType "uuid"+>            , ScalarType "uuid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "uuid_ne"+>            [ ScalarType "uuid"+>            , ScalarType "uuid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "uuid_out"+>            [ ScalarType "uuid"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "uuid_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "uuid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "uuid_send"+>            [ ScalarType "uuid"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbit"+>            [ ScalarType "varbit"+>            , ScalarType "int4"+>            , ScalarType "bool"+>            ] (+>            ScalarType "varbit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbit_in"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "varbit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbit_out"+>            [ ScalarType "varbit"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbit_recv"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "varbit" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbit_send"+>            [ ScalarType "varbit"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbitcmp"+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbiteq"+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbitge"+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbitgt"+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbitle"+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbitlt"+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbitne"+>            [ ScalarType "varbit"+>            , ScalarType "varbit"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbittypmodin"+>            [ ArrayType ( Pseudo Cstring )+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varbittypmodout"+>            [ ScalarType "int4"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "varchar"+>            [ ScalarType "name"+>            ] (+>            ScalarType "varchar" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varchar"+>            [ ScalarType "varchar"+>            , ScalarType "int4"+>            , ScalarType "bool"+>            ] (+>            ScalarType "varchar" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varcharin"+>            [ Pseudo Cstring+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "varchar" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varcharout"+>            [ ScalarType "varchar"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "varcharrecv"+>            [ Pseudo Internal+>            , ScalarType "oid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "varchar" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varcharsend"+>            [ ScalarType "varchar"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varchartypmodin"+>            [ ArrayType ( Pseudo Cstring )+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "varchartypmodout"+>            [ ScalarType "int4"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "version"+>            [] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunName+>            "void_in"+>            [ Pseudo Cstring+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "void_out"+>            [ Pseudo Void+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "width"+>            [ ScalarType "box"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunName+>            "width_bucket"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            , ScalarType "float8"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "width_bucket"+>            [ ScalarType "numeric"+>            , ScalarType "numeric"+>            , ScalarType "numeric"+>            , ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunName+>            "win1250_to_latin2"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "win1250_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "win1251_to_iso"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "win1251_to_koi8r"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "win1251_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "win1251_to_win866"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "win866_to_iso"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "win866_to_koi8r"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "win866_to_mic"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "win866_to_win1251"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "win_to_utf8"+>            [ ScalarType "int4"+>            , ScalarType "int4"+>            , Pseudo Cstring+>            , Pseudo Internal+>            , ScalarType "int4"+>            ] (+>            Pseudo Void )+>            False+>        , EnvCreateFunction+>            FunName+>            "xideq"+>            [ ScalarType "xid"+>            , ScalarType "xid"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "xideqint4"+>            [ ScalarType "xid"+>            , ScalarType "int4"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "xidin"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "xid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "xidout"+>            [ ScalarType "xid"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "xidrecv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "xid" )+>            False+>        , EnvCreateFunction+>            FunName+>            "xidsend"+>            [ ScalarType "xid"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "xml"+>            [ ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "xml_in"+>            [ Pseudo Cstring+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "xml_out"+>            [ ScalarType "xml"+>            ] (+>            Pseudo Cstring )+>            False+>        , EnvCreateFunction+>            FunName+>            "xml_recv"+>            [ Pseudo Internal+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "xml_send"+>            [ ScalarType "xml"+>            ] (+>            ScalarType "bytea" )+>            False+>        , EnvCreateFunction+>            FunName+>            "xmlcomment"+>            [ ScalarType "text"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "xmlconcat2"+>            [ ScalarType "xml"+>            , ScalarType "xml"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunName+>            "xmlvalidate"+>            [ ScalarType "xml"+>            , ScalarType "text"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunName+>            "xpath"+>            [ ScalarType "text"+>            , ScalarType "xml"+>            ] (+>            ArrayType ( ScalarType "xml" ) )+>            False+>        , EnvCreateFunction+>            FunName+>            "xpath"+>            [ ScalarType "text"+>            , ScalarType "xml"+>            , ArrayType ( ScalarType "text" )+>            ] (+>            ArrayType ( ScalarType "xml" ) )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "array_agg"+>            [ Pseudo AnyElement+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "avg"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "avg"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "avg"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "avg"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "avg"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "avg"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "avg"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "bit_and"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "bit_and"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "bit_and"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "bit_and"+>            [ ScalarType "bit"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "bit_or"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "bit_or"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "bit_or"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "bit_or"+>            [ ScalarType "bit"+>            ] (+>            ScalarType "bit" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "bool_and"+>            [ ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "bool_or"+>            [ ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "corr"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "count"+>            [] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "count"+>            [ Pseudo Any+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "covar_pop"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "covar_samp"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "every"+>            [ ScalarType "bool"+>            ] (+>            ScalarType "bool" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "tid"+>            ] (+>            ScalarType "tid" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "abstime"+>            ] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "bpchar"+>            ] (+>            ScalarType "bpchar" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "date"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "time"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "timestamp"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "timestamptz"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "timetz"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ Pseudo AnyArray+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "max"+>            [ Pseudo AnyEnum+>            ] (+>            Pseudo AnyEnum )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int2" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "text"+>            ] (+>            ScalarType "text" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "oid"+>            ] (+>            ScalarType "oid" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "tid"+>            ] (+>            ScalarType "tid" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "abstime"+>            ] (+>            ScalarType "abstime" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "bpchar"+>            ] (+>            ScalarType "bpchar" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "date"+>            ] (+>            ScalarType "date" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "time"+>            ] (+>            ScalarType "time" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "timestamp"+>            ] (+>            ScalarType "timestamp" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "timestamptz"+>            ] (+>            ScalarType "timestamptz" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "timetz"+>            ] (+>            ScalarType "timetz" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ Pseudo AnyArray+>            ] (+>            Pseudo AnyArray )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "min"+>            [ Pseudo AnyEnum+>            ] (+>            Pseudo AnyEnum )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "regr_avgx"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "regr_avgy"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "regr_count"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "regr_intercept"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "regr_r2"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "regr_slope"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "regr_sxx"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "regr_sxy"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "regr_syy"+>            [ ScalarType "float8"+>            , ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev_pop"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev_pop"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev_pop"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev_pop"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev_pop"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev_pop"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev_samp"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev_samp"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev_samp"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev_samp"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev_samp"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "stddev_samp"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "sum"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "sum"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "sum"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "sum"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float4" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "sum"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "sum"+>            [ ScalarType "money"+>            ] (+>            ScalarType "money" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "sum"+>            [ ScalarType "interval"+>            ] (+>            ScalarType "interval" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "sum"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "var_pop"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "var_pop"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "var_pop"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "var_pop"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "var_pop"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "var_pop"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "var_samp"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "var_samp"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "var_samp"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "var_samp"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "var_samp"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "var_samp"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "variance"+>            [ ScalarType "int8"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "variance"+>            [ ScalarType "int2"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "variance"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "variance"+>            [ ScalarType "float4"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "variance"+>            [ ScalarType "float8"+>            ] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "variance"+>            [ ScalarType "numeric"+>            ] (+>            ScalarType "numeric" )+>            False+>        , EnvCreateFunction+>            FunAgg+>            "xmlagg"+>            [ ScalarType "xml"+>            ] (+>            ScalarType "xml" )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "cume_dist"+>            [] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "dense_rank"+>            [] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "first_value"+>            [ Pseudo AnyElement+>            ] (+>            Pseudo AnyElement )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "lag"+>            [ Pseudo AnyElement+>            ] (+>            Pseudo AnyElement )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "lag"+>            [ Pseudo AnyElement+>            , ScalarType "int4"+>            ] (+>            Pseudo AnyElement )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "lag"+>            [ Pseudo AnyElement+>            , ScalarType "int4"+>            , Pseudo AnyElement+>            ] (+>            Pseudo AnyElement )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "last_value"+>            [ Pseudo AnyElement+>            ] (+>            Pseudo AnyElement )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "lead"+>            [ Pseudo AnyElement+>            ] (+>            Pseudo AnyElement )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "lead"+>            [ Pseudo AnyElement+>            , ScalarType "int4"+>            ] (+>            Pseudo AnyElement )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "lead"+>            [ Pseudo AnyElement+>            , ScalarType "int4"+>            , Pseudo AnyElement+>            ] (+>            Pseudo AnyElement )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "nth_value"+>            [ Pseudo AnyElement+>            , ScalarType "int4"+>            ] (+>            Pseudo AnyElement )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "ntile"+>            [ ScalarType "int4"+>            ] (+>            ScalarType "int4" )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "percent_rank"+>            [] (+>            ScalarType "float8" )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "rank"+>            [] (+>            ScalarType "int8" )+>            False+>        , EnvCreateFunction+>            FunWindow+>            "row_number"+>            [] (+>            ScalarType "int8" )+>            False+>        , EnvCreateTable+>            "pg_aggregate"+>            [ ( "aggfnoid"+>              , ScalarType "regproc"+>              )+>            , ( "aggtransfn"+>              , ScalarType "regproc"+>              )+>            , ( "aggfinalfn"+>              , ScalarType "regproc"+>              )+>            , ( "aggsortop"+>              , ScalarType "oid"+>              )+>            , ( "aggtranstype"+>              , ScalarType "oid"+>              )+>            , ( "agginitval"+>              , ScalarType "text"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_am"+>            [ ( "amname"+>              , ScalarType "name"+>              )+>            , ( "amstrategies"+>              , ScalarType "int2"+>              )+>            , ( "amsupport"+>              , ScalarType "int2"+>              )+>            , ( "amcanorder"+>              , ScalarType "bool"+>              )+>            , ( "amcanbackward"+>              , ScalarType "bool"+>              )+>            , ( "amcanunique"+>              , ScalarType "bool"+>              )+>            , ( "amcanmulticol"+>              , ScalarType "bool"+>              )+>            , ( "amoptionalkey"+>              , ScalarType "bool"+>              )+>            , ( "amindexnulls"+>              , ScalarType "bool"+>              )+>            , ( "amsearchnulls"+>              , ScalarType "bool"+>              )+>            , ( "amstorage"+>              , ScalarType "bool"+>              )+>            , ( "amclusterable"+>              , ScalarType "bool"+>              )+>            , ( "amkeytype"+>              , ScalarType "oid"+>              )+>            , ( "aminsert"+>              , ScalarType "regproc"+>              )+>            , ( "ambeginscan"+>              , ScalarType "regproc"+>              )+>            , ( "amgettuple"+>              , ScalarType "regproc"+>              )+>            , ( "amgetbitmap"+>              , ScalarType "regproc"+>              )+>            , ( "amrescan"+>              , ScalarType "regproc"+>              )+>            , ( "amendscan"+>              , ScalarType "regproc"+>              )+>            , ( "ammarkpos"+>              , ScalarType "regproc"+>              )+>            , ( "amrestrpos"+>              , ScalarType "regproc"+>              )+>            , ( "ambuild"+>              , ScalarType "regproc"+>              )+>            , ( "ambulkdelete"+>              , ScalarType "regproc"+>              )+>            , ( "amvacuumcleanup"+>              , ScalarType "regproc"+>              )+>            , ( "amcostestimate"+>              , ScalarType "regproc"+>              )+>            , ( "amoptions"+>              , ScalarType "regproc"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_amop"+>            [ ( "amopfamily"+>              , ScalarType "oid"+>              )+>            , ( "amoplefttype"+>              , ScalarType "oid"+>              )+>            , ( "amoprighttype"+>              , ScalarType "oid"+>              )+>            , ( "amopstrategy"+>              , ScalarType "int2"+>              )+>            , ( "amopopr"+>              , ScalarType "oid"+>              )+>            , ( "amopmethod"+>              , ScalarType "oid"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_amproc"+>            [ ( "amprocfamily"+>              , ScalarType "oid"+>              )+>            , ( "amproclefttype"+>              , ScalarType "oid"+>              )+>            , ( "amprocrighttype"+>              , ScalarType "oid"+>              )+>            , ( "amprocnum"+>              , ScalarType "int2"+>              )+>            , ( "amproc"+>              , ScalarType "regproc"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_attrdef"+>            [ ( "adrelid"+>              , ScalarType "oid"+>              )+>            , ( "adnum"+>              , ScalarType "int2"+>              )+>            , ( "adbin"+>              , ScalarType "text"+>              )+>            , ( "adsrc"+>              , ScalarType "text"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_attribute"+>            [ ( "attrelid"+>              , ScalarType "oid"+>              )+>            , ( "attname"+>              , ScalarType "name"+>              )+>            , ( "atttypid"+>              , ScalarType "oid"+>              )+>            , ( "attstattarget"+>              , ScalarType "int4"+>              )+>            , ( "attlen"+>              , ScalarType "int2"+>              )+>            , ( "attnum"+>              , ScalarType "int2"+>              )+>            , ( "attndims"+>              , ScalarType "int4"+>              )+>            , ( "attcacheoff"+>              , ScalarType "int4"+>              )+>            , ( "atttypmod"+>              , ScalarType "int4"+>              )+>            , ( "attbyval"+>              , ScalarType "bool"+>              )+>            , ( "attstorage"+>              , ScalarType "char"+>              )+>            , ( "attalign"+>              , ScalarType "char"+>              )+>            , ( "attnotnull"+>              , ScalarType "bool"+>              )+>            , ( "atthasdef"+>              , ScalarType "bool"+>              )+>            , ( "attisdropped"+>              , ScalarType "bool"+>              )+>            , ( "attislocal"+>              , ScalarType "bool"+>              )+>            , ( "attinhcount"+>              , ScalarType "int4"+>              )+>            , ( "attacl"+>              , ArrayType ( ScalarType "aclitem" )+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_auth_members"+>            [ ( "roleid"+>              , ScalarType "oid"+>              )+>            , ( "member"+>              , ScalarType "oid"+>              )+>            , ( "grantor"+>              , ScalarType "oid"+>              )+>            , ( "admin_option"+>              , ScalarType "bool"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_authid"+>            [ ( "rolname"+>              , ScalarType "name"+>              )+>            , ( "rolsuper"+>              , ScalarType "bool"+>              )+>            , ( "rolinherit"+>              , ScalarType "bool"+>              )+>            , ( "rolcreaterole"+>              , ScalarType "bool"+>              )+>            , ( "rolcreatedb"+>              , ScalarType "bool"+>              )+>            , ( "rolcatupdate"+>              , ScalarType "bool"+>              )+>            , ( "rolcanlogin"+>              , ScalarType "bool"+>              )+>            , ( "rolconnlimit"+>              , ScalarType "int4"+>              )+>            , ( "rolpassword"+>              , ScalarType "text"+>              )+>            , ( "rolvaliduntil"+>              , ScalarType "timestamptz"+>              )+>            , ( "rolconfig"+>              , ArrayType ( ScalarType "text" )+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_cast"+>            [ ( "castsource"+>              , ScalarType "oid"+>              )+>            , ( "casttarget"+>              , ScalarType "oid"+>              )+>            , ( "castfunc"+>              , ScalarType "oid"+>              )+>            , ( "castcontext"+>              , ScalarType "char"+>              )+>            , ( "castmethod"+>              , ScalarType "char"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_class"+>            [ ( "relname"+>              , ScalarType "name"+>              )+>            , ( "relnamespace"+>              , ScalarType "oid"+>              )+>            , ( "reltype"+>              , ScalarType "oid"+>              )+>            , ( "relowner"+>              , ScalarType "oid"+>              )+>            , ( "relam"+>              , ScalarType "oid"+>              )+>            , ( "relfilenode"+>              , ScalarType "oid"+>              )+>            , ( "reltablespace"+>              , ScalarType "oid"+>              )+>            , ( "relpages"+>              , ScalarType "int4"+>              )+>            , ( "reltuples"+>              , ScalarType "float4"+>              )+>            , ( "reltoastrelid"+>              , ScalarType "oid"+>              )+>            , ( "reltoastidxid"+>              , ScalarType "oid"+>              )+>            , ( "relhasindex"+>              , ScalarType "bool"+>              )+>            , ( "relisshared"+>              , ScalarType "bool"+>              )+>            , ( "relistemp"+>              , ScalarType "bool"+>              )+>            , ( "relkind"+>              , ScalarType "char"+>              )+>            , ( "relnatts"+>              , ScalarType "int2"+>              )+>            , ( "relchecks"+>              , ScalarType "int2"+>              )+>            , ( "relhasoids"+>              , ScalarType "bool"+>              )+>            , ( "relhaspkey"+>              , ScalarType "bool"+>              )+>            , ( "relhasrules"+>              , ScalarType "bool"+>              )+>            , ( "relhastriggers"+>              , ScalarType "bool"+>              )+>            , ( "relhassubclass"+>              , ScalarType "bool"+>              )+>            , ( "relfrozenxid"+>              , ScalarType "xid"+>              )+>            , ( "relacl"+>              , ArrayType ( ScalarType "aclitem" )+>              )+>            , ( "reloptions"+>              , ArrayType ( ScalarType "text" )+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_constraint"+>            [ ( "conname"+>              , ScalarType "name"+>              )+>            , ( "connamespace"+>              , ScalarType "oid"+>              )+>            , ( "contype"+>              , ScalarType "char"+>              )+>            , ( "condeferrable"+>              , ScalarType "bool"+>              )+>            , ( "condeferred"+>              , ScalarType "bool"+>              )+>            , ( "conrelid"+>              , ScalarType "oid"+>              )+>            , ( "contypid"+>              , ScalarType "oid"+>              )+>            , ( "confrelid"+>              , ScalarType "oid"+>              )+>            , ( "confupdtype"+>              , ScalarType "char"+>              )+>            , ( "confdeltype"+>              , ScalarType "char"+>              )+>            , ( "confmatchtype"+>              , ScalarType "char"+>              )+>            , ( "conislocal"+>              , ScalarType "bool"+>              )+>            , ( "coninhcount"+>              , ScalarType "int4"+>              )+>            , ( "conkey"+>              , ArrayType ( ScalarType "int2" )+>              )+>            , ( "confkey"+>              , ArrayType ( ScalarType "int2" )+>              )+>            , ( "conpfeqop"+>              , ArrayType ( ScalarType "oid" )+>              )+>            , ( "conppeqop"+>              , ArrayType ( ScalarType "oid" )+>              )+>            , ( "conffeqop"+>              , ArrayType ( ScalarType "oid" )+>              )+>            , ( "conbin"+>              , ScalarType "text"+>              )+>            , ( "consrc"+>              , ScalarType "text"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_conversion"+>            [ ( "conname"+>              , ScalarType "name"+>              )+>            , ( "connamespace"+>              , ScalarType "oid"+>              )+>            , ( "conowner"+>              , ScalarType "oid"+>              )+>            , ( "conforencoding"+>              , ScalarType "int4"+>              )+>            , ( "contoencoding"+>              , ScalarType "int4"+>              )+>            , ( "conproc"+>              , ScalarType "regproc"+>              )+>            , ( "condefault"+>              , ScalarType "bool"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_database"+>            [ ( "datname"+>              , ScalarType "name"+>              )+>            , ( "datdba"+>              , ScalarType "oid"+>              )+>            , ( "encoding"+>              , ScalarType "int4"+>              )+>            , ( "datcollate"+>              , ScalarType "name"+>              )+>            , ( "datctype"+>              , ScalarType "name"+>              )+>            , ( "datistemplate"+>              , ScalarType "bool"+>              )+>            , ( "datallowconn"+>              , ScalarType "bool"+>              )+>            , ( "datconnlimit"+>              , ScalarType "int4"+>              )+>            , ( "datlastsysoid"+>              , ScalarType "oid"+>              )+>            , ( "datfrozenxid"+>              , ScalarType "xid"+>              )+>            , ( "dattablespace"+>              , ScalarType "oid"+>              )+>            , ( "datconfig"+>              , ArrayType ( ScalarType "text" )+>              )+>            , ( "datacl"+>              , ArrayType ( ScalarType "aclitem" )+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_depend"+>            [ ( "classid"+>              , ScalarType "oid"+>              )+>            , ( "objid"+>              , ScalarType "oid"+>              )+>            , ( "objsubid"+>              , ScalarType "int4"+>              )+>            , ( "refclassid"+>              , ScalarType "oid"+>              )+>            , ( "refobjid"+>              , ScalarType "oid"+>              )+>            , ( "refobjsubid"+>              , ScalarType "int4"+>              )+>            , ( "deptype"+>              , ScalarType "char"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_description"+>            [ ( "objoid"+>              , ScalarType "oid"+>              )+>            , ( "classoid"+>              , ScalarType "oid"+>              )+>            , ( "objsubid"+>              , ScalarType "int4"+>              )+>            , ( "description"+>              , ScalarType "text"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_enum"+>            [ ( "enumtypid"+>              , ScalarType "oid"+>              )+>            , ( "enumlabel"+>              , ScalarType "name"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_foreign_data_wrapper"+>            [ ( "fdwname"+>              , ScalarType "name"+>              )+>            , ( "fdwowner"+>              , ScalarType "oid"+>              )+>            , ( "fdwvalidator"+>              , ScalarType "oid"+>              )+>            , ( "fdwacl"+>              , ArrayType ( ScalarType "aclitem" )+>              )+>            , ( "fdwoptions"+>              , ArrayType ( ScalarType "text" )+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_foreign_server"+>            [ ( "srvname"+>              , ScalarType "name"+>              )+>            , ( "srvowner"+>              , ScalarType "oid"+>              )+>            , ( "srvfdw"+>              , ScalarType "oid"+>              )+>            , ( "srvtype"+>              , ScalarType "text"+>              )+>            , ( "srvversion"+>              , ScalarType "text"+>              )+>            , ( "srvacl"+>              , ArrayType ( ScalarType "aclitem" )+>              )+>            , ( "srvoptions"+>              , ArrayType ( ScalarType "text" )+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_index"+>            [ ( "indexrelid"+>              , ScalarType "oid"+>              )+>            , ( "indrelid"+>              , ScalarType "oid"+>              )+>            , ( "indnatts"+>              , ScalarType "int2"+>              )+>            , ( "indisunique"+>              , ScalarType "bool"+>              )+>            , ( "indisprimary"+>              , ScalarType "bool"+>              )+>            , ( "indisclustered"+>              , ScalarType "bool"+>              )+>            , ( "indisvalid"+>              , ScalarType "bool"+>              )+>            , ( "indcheckxmin"+>              , ScalarType "bool"+>              )+>            , ( "indisready"+>              , ScalarType "bool"+>              )+>            , ( "indkey"+>              , ScalarType "int2vector"+>              )+>            , ( "indclass"+>              , ScalarType "oidvector"+>              )+>            , ( "indoption"+>              , ScalarType "int2vector"+>              )+>            , ( "indexprs"+>              , ScalarType "text"+>              )+>            , ( "indpred"+>              , ScalarType "text"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_inherits"+>            [ ( "inhrelid"+>              , ScalarType "oid"+>              )+>            , ( "inhparent"+>              , ScalarType "oid"+>              )+>            , ( "inhseqno"+>              , ScalarType "int4"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_language"+>            [ ( "lanname"+>              , ScalarType "name"+>              )+>            , ( "lanowner"+>              , ScalarType "oid"+>              )+>            , ( "lanispl"+>              , ScalarType "bool"+>              )+>            , ( "lanpltrusted"+>              , ScalarType "bool"+>              )+>            , ( "lanplcallfoid"+>              , ScalarType "oid"+>              )+>            , ( "lanvalidator"+>              , ScalarType "oid"+>              )+>            , ( "lanacl"+>              , ArrayType ( ScalarType "aclitem" )+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_largeobject"+>            [ ( "loid"+>              , ScalarType "oid"+>              )+>            , ( "pageno"+>              , ScalarType "int4"+>              )+>            , ( "data"+>              , ScalarType "bytea"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_listener"+>            [ ( "relname"+>              , ScalarType "name"+>              )+>            , ( "listenerpid"+>              , ScalarType "int4"+>              )+>            , ( "notification"+>              , ScalarType "int4"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_namespace"+>            [ ( "nspname"+>              , ScalarType "name"+>              )+>            , ( "nspowner"+>              , ScalarType "oid"+>              )+>            , ( "nspacl"+>              , ArrayType ( ScalarType "aclitem" )+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_opclass"+>            [ ( "opcmethod"+>              , ScalarType "oid"+>              )+>            , ( "opcname"+>              , ScalarType "name"+>              )+>            , ( "opcnamespace"+>              , ScalarType "oid"+>              )+>            , ( "opcowner"+>              , ScalarType "oid"+>              )+>            , ( "opcfamily"+>              , ScalarType "oid"+>              )+>            , ( "opcintype"+>              , ScalarType "oid"+>              )+>            , ( "opcdefault"+>              , ScalarType "bool"+>              )+>            , ( "opckeytype"+>              , ScalarType "oid"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_operator"+>            [ ( "oprname"+>              , ScalarType "name"+>              )+>            , ( "oprnamespace"+>              , ScalarType "oid"+>              )+>            , ( "oprowner"+>              , ScalarType "oid"+>              )+>            , ( "oprkind"+>              , ScalarType "char"+>              )+>            , ( "oprcanmerge"+>              , ScalarType "bool"+>              )+>            , ( "oprcanhash"+>              , ScalarType "bool"+>              )+>            , ( "oprleft"+>              , ScalarType "oid"+>              )+>            , ( "oprright"+>              , ScalarType "oid"+>              )+>            , ( "oprresult"+>              , ScalarType "oid"+>              )+>            , ( "oprcom"+>              , ScalarType "oid"+>              )+>            , ( "oprnegate"+>              , ScalarType "oid"+>              )+>            , ( "oprcode"+>              , ScalarType "regproc"+>              )+>            , ( "oprrest"+>              , ScalarType "regproc"+>              )+>            , ( "oprjoin"+>              , ScalarType "regproc"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_opfamily"+>            [ ( "opfmethod"+>              , ScalarType "oid"+>              )+>            , ( "opfname"+>              , ScalarType "name"+>              )+>            , ( "opfnamespace"+>              , ScalarType "oid"+>              )+>            , ( "opfowner"+>              , ScalarType "oid"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_pltemplate"+>            [ ( "tmplname"+>              , ScalarType "name"+>              )+>            , ( "tmpltrusted"+>              , ScalarType "bool"+>              )+>            , ( "tmpldbacreate"+>              , ScalarType "bool"+>              )+>            , ( "tmplhandler"+>              , ScalarType "text"+>              )+>            , ( "tmplvalidator"+>              , ScalarType "text"+>              )+>            , ( "tmpllibrary"+>              , ScalarType "text"+>              )+>            , ( "tmplacl"+>              , ArrayType ( ScalarType "aclitem" )+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_proc"+>            [ ( "proname"+>              , ScalarType "name"+>              )+>            , ( "pronamespace"+>              , ScalarType "oid"+>              )+>            , ( "proowner"+>              , ScalarType "oid"+>              )+>            , ( "prolang"+>              , ScalarType "oid"+>              )+>            , ( "procost"+>              , ScalarType "float4"+>              )+>            , ( "prorows"+>              , ScalarType "float4"+>              )+>            , ( "provariadic"+>              , ScalarType "oid"+>              )+>            , ( "proisagg"+>              , ScalarType "bool"+>              )+>            , ( "proiswindow"+>              , ScalarType "bool"+>              )+>            , ( "prosecdef"+>              , ScalarType "bool"+>              )+>            , ( "proisstrict"+>              , ScalarType "bool"+>              )+>            , ( "proretset"+>              , ScalarType "bool"+>              )+>            , ( "provolatile"+>              , ScalarType "char"+>              )+>            , ( "pronargs"+>              , ScalarType "int2"+>              )+>            , ( "pronargdefaults"+>              , ScalarType "int2"+>              )+>            , ( "prorettype"+>              , ScalarType "oid"+>              )+>            , ( "proargtypes"+>              , ScalarType "oidvector"+>              )+>            , ( "proallargtypes"+>              , ArrayType ( ScalarType "oid" )+>              )+>            , ( "proargmodes"+>              , ArrayType ( ScalarType "char" )+>              )+>            , ( "proargnames"+>              , ArrayType ( ScalarType "text" )+>              )+>            , ( "proargdefaults"+>              , ScalarType "text"+>              )+>            , ( "prosrc"+>              , ScalarType "text"+>              )+>            , ( "probin"+>              , ScalarType "bytea"+>              )+>            , ( "proconfig"+>              , ArrayType ( ScalarType "text" )+>              )+>            , ( "proacl"+>              , ArrayType ( ScalarType "aclitem" )+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_rewrite"+>            [ ( "rulename"+>              , ScalarType "name"+>              )+>            , ( "ev_class"+>              , ScalarType "oid"+>              )+>            , ( "ev_attr"+>              , ScalarType "int2"+>              )+>            , ( "ev_type"+>              , ScalarType "char"+>              )+>            , ( "ev_enabled"+>              , ScalarType "char"+>              )+>            , ( "is_instead"+>              , ScalarType "bool"+>              )+>            , ( "ev_qual"+>              , ScalarType "text"+>              )+>            , ( "ev_action"+>              , ScalarType "text"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_shdepend"+>            [ ( "dbid"+>              , ScalarType "oid"+>              )+>            , ( "classid"+>              , ScalarType "oid"+>              )+>            , ( "objid"+>              , ScalarType "oid"+>              )+>            , ( "objsubid"+>              , ScalarType "int4"+>              )+>            , ( "refclassid"+>              , ScalarType "oid"+>              )+>            , ( "refobjid"+>              , ScalarType "oid"+>              )+>            , ( "deptype"+>              , ScalarType "char"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_shdescription"+>            [ ( "objoid"+>              , ScalarType "oid"+>              )+>            , ( "classoid"+>              , ScalarType "oid"+>              )+>            , ( "description"+>              , ScalarType "text"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_statistic"+>            [ ( "starelid"+>              , ScalarType "oid"+>              )+>            , ( "staattnum"+>              , ScalarType "int2"+>              )+>            , ( "stanullfrac"+>              , ScalarType "float4"+>              )+>            , ( "stawidth"+>              , ScalarType "int4"+>              )+>            , ( "stadistinct"+>              , ScalarType "float4"+>              )+>            , ( "stakind1"+>              , ScalarType "int2"+>              )+>            , ( "stakind2"+>              , ScalarType "int2"+>              )+>            , ( "stakind3"+>              , ScalarType "int2"+>              )+>            , ( "stakind4"+>              , ScalarType "int2"+>              )+>            , ( "staop1"+>              , ScalarType "oid"+>              )+>            , ( "staop2"+>              , ScalarType "oid"+>              )+>            , ( "staop3"+>              , ScalarType "oid"+>              )+>            , ( "staop4"+>              , ScalarType "oid"+>              )+>            , ( "stanumbers1"+>              , ArrayType ( ScalarType "float4" )+>              )+>            , ( "stanumbers2"+>              , ArrayType ( ScalarType "float4" )+>              )+>            , ( "stanumbers3"+>              , ArrayType ( ScalarType "float4" )+>              )+>            , ( "stanumbers4"+>              , ArrayType ( ScalarType "float4" )+>              )+>            , ( "stavalues1"+>              , Pseudo AnyArray+>              )+>            , ( "stavalues2"+>              , Pseudo AnyArray+>              )+>            , ( "stavalues3"+>              , Pseudo AnyArray+>              )+>            , ( "stavalues4"+>              , Pseudo AnyArray+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_tablespace"+>            [ ( "spcname"+>              , ScalarType "name"+>              )+>            , ( "spcowner"+>              , ScalarType "oid"+>              )+>            , ( "spclocation"+>              , ScalarType "text"+>              )+>            , ( "spcacl"+>              , ArrayType ( ScalarType "aclitem" )+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_trigger"+>            [ ( "tgrelid"+>              , ScalarType "oid"+>              )+>            , ( "tgname"+>              , ScalarType "name"+>              )+>            , ( "tgfoid"+>              , ScalarType "oid"+>              )+>            , ( "tgtype"+>              , ScalarType "int2"+>              )+>            , ( "tgenabled"+>              , ScalarType "char"+>              )+>            , ( "tgisconstraint"+>              , ScalarType "bool"+>              )+>            , ( "tgconstrname"+>              , ScalarType "name"+>              )+>            , ( "tgconstrrelid"+>              , ScalarType "oid"+>              )+>            , ( "tgconstraint"+>              , ScalarType "oid"+>              )+>            , ( "tgdeferrable"+>              , ScalarType "bool"+>              )+>            , ( "tginitdeferred"+>              , ScalarType "bool"+>              )+>            , ( "tgnargs"+>              , ScalarType "int2"+>              )+>            , ( "tgattr"+>              , ScalarType "int2vector"+>              )+>            , ( "tgargs"+>              , ScalarType "bytea"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_ts_config"+>            [ ( "cfgname"+>              , ScalarType "name"+>              )+>            , ( "cfgnamespace"+>              , ScalarType "oid"+>              )+>            , ( "cfgowner"+>              , ScalarType "oid"+>              )+>            , ( "cfgparser"+>              , ScalarType "oid"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_ts_config_map"+>            [ ( "mapcfg"+>              , ScalarType "oid"+>              )+>            , ( "maptokentype"+>              , ScalarType "int4"+>              )+>            , ( "mapseqno"+>              , ScalarType "int4"+>              )+>            , ( "mapdict"+>              , ScalarType "oid"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_ts_dict"+>            [ ( "dictname"+>              , ScalarType "name"+>              )+>            , ( "dictnamespace"+>              , ScalarType "oid"+>              )+>            , ( "dictowner"+>              , ScalarType "oid"+>              )+>            , ( "dicttemplate"+>              , ScalarType "oid"+>              )+>            , ( "dictinitoption"+>              , ScalarType "text"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_ts_parser"+>            [ ( "prsname"+>              , ScalarType "name"+>              )+>            , ( "prsnamespace"+>              , ScalarType "oid"+>              )+>            , ( "prsstart"+>              , ScalarType "regproc"+>              )+>            , ( "prstoken"+>              , ScalarType "regproc"+>              )+>            , ( "prsend"+>              , ScalarType "regproc"+>              )+>            , ( "prsheadline"+>              , ScalarType "regproc"+>              )+>            , ( "prslextype"+>              , ScalarType "regproc"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_ts_template"+>            [ ( "tmplname"+>              , ScalarType "name"+>              )+>            , ( "tmplnamespace"+>              , ScalarType "oid"+>              )+>            , ( "tmplinit"+>              , ScalarType "regproc"+>              )+>            , ( "tmpllexize"+>              , ScalarType "regproc"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_type"+>            [ ( "typname"+>              , ScalarType "name"+>              )+>            , ( "typnamespace"+>              , ScalarType "oid"+>              )+>            , ( "typowner"+>              , ScalarType "oid"+>              )+>            , ( "typlen"+>              , ScalarType "int2"+>              )+>            , ( "typbyval"+>              , ScalarType "bool"+>              )+>            , ( "typtype"+>              , ScalarType "char"+>              )+>            , ( "typcategory"+>              , ScalarType "char"+>              )+>            , ( "typispreferred"+>              , ScalarType "bool"+>              )+>            , ( "typisdefined"+>              , ScalarType "bool"+>              )+>            , ( "typdelim"+>              , ScalarType "char"+>              )+>            , ( "typrelid"+>              , ScalarType "oid"+>              )+>            , ( "typelem"+>              , ScalarType "oid"+>              )+>            , ( "typarray"+>              , ScalarType "oid"+>              )+>            , ( "typinput"+>              , ScalarType "regproc"+>              )+>            , ( "typoutput"+>              , ScalarType "regproc"+>              )+>            , ( "typreceive"+>              , ScalarType "regproc"+>              )+>            , ( "typsend"+>              , ScalarType "regproc"+>              )+>            , ( "typmodin"+>              , ScalarType "regproc"+>              )+>            , ( "typmodout"+>              , ScalarType "regproc"+>              )+>            , ( "typanalyze"+>              , ScalarType "regproc"+>              )+>            , ( "typalign"+>              , ScalarType "char"+>              )+>            , ( "typstorage"+>              , ScalarType "char"+>              )+>            , ( "typnotnull"+>              , ScalarType "bool"+>              )+>            , ( "typbasetype"+>              , ScalarType "oid"+>              )+>            , ( "typtypmod"+>              , ScalarType "int4"+>              )+>            , ( "typndims"+>              , ScalarType "int4"+>              )+>            , ( "typdefaultbin"+>              , ScalarType "text"+>              )+>            , ( "typdefault"+>              , ScalarType "text"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "pg_user_mapping"+>            [ ( "umuser"+>              , ScalarType "oid"+>              )+>            , ( "umserver"+>              , ScalarType "oid"+>              )+>            , ( "umoptions"+>              , ArrayType ( ScalarType "text" )+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "information_schema.sql_features"+>            [ ( "feature_id"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "feature_name"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "sub_feature_id"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "sub_feature_name"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_supported"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_verified_by"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "comments"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "information_schema.sql_implementation_info"+>            [ ( "implementation_info_id"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "implementation_info_name"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "integer_value"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "character_value"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "comments"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "information_schema.sql_languages"+>            [ ( "sql_language_source"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "sql_language_year"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "sql_language_conformance"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "sql_language_integrity"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "sql_language_implementation"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "sql_language_binding_style"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "sql_language_programming_language"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "information_schema.sql_packages"+>            [ ( "feature_id"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "feature_name"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_supported"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_verified_by"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "comments"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "information_schema.sql_parts"+>            [ ( "feature_id"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "feature_name"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_supported"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_verified_by"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "comments"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "information_schema.sql_sizing"+>            [ ( "sizing_id"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "sizing_name"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "supported_value"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "comments"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateTable+>            "information_schema.sql_sizing_profiles"+>            [ ( "sizing_id"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "sizing_name"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "profile_id"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "required_value"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "comments"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>            [ ( "tableoid"+>              , ScalarType "oid"+>              )+>            , ( "cmax"+>              , ScalarType "cid"+>              )+>            , ( "xmax"+>              , ScalarType "xid"+>              )+>            , ( "cmin"+>              , ScalarType "cid"+>              )+>            , ( "xmin"+>              , ScalarType "xid"+>              )+>            , ( "ctid"+>              , ScalarType "tid"+>              )+>            ]+>        , EnvCreateView+>            "information_schema._pg_foreign_data_wrappers"+>            [ ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "fdwowner"+>              , ScalarType "oid"+>              )+>            , ( "fdwoptions"+>              , ArrayType ( ScalarType "text" )+>              )+>            , ( "foreign_data_wrapper_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_data_wrapper_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "authorization_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_data_wrapper_language"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema._pg_foreign_servers"+>            [ ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "srvoptions"+>              , ArrayType ( ScalarType "text" )+>              )+>            , ( "foreign_server_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_server_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_data_wrapper_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_data_wrapper_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_server_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "foreign_server_version"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "authorization_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema._pg_user_mappings"+>            [ ( "oid"+>              , ScalarType "oid"+>              )+>            , ( "umoptions"+>              , ArrayType ( ScalarType "text" )+>              )+>            , ( "umuser"+>              , ScalarType "oid"+>              )+>            , ( "authorization_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_server_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_server_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "srvowner"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.administrable_role_authorizations"+>            [ ( "grantee"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "role_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "is_grantable"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.applicable_roles"+>            [ ( "grantee"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "role_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "is_grantable"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.attributes"+>            [ ( "udt_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "attribute_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "ordinal_position"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "attribute_default"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_nullable"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "data_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "character_maximum_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "character_octet_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "character_set_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "character_set_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "character_set_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "numeric_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_precision_radix"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_scale"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "datetime_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "interval_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "interval_precision"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "attribute_udt_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "attribute_udt_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "attribute_udt_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "maximum_cardinality"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "dtd_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "is_derived_reference_attribute"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.check_constraint_routine_usage"+>            [ ( "constraint_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.check_constraints"+>            [ ( "constraint_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "check_clause"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.column_domain_usage"+>            [ ( "domain_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "domain_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "domain_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "column_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.column_privileges"+>            [ ( "grantor"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "grantee"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "column_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "privilege_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_grantable"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.column_udt_usage"+>            [ ( "udt_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "column_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.columns"+>            [ ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "column_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "ordinal_position"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "column_default"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_nullable"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "data_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "character_maximum_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "character_octet_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_precision_radix"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_scale"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "datetime_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "interval_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "interval_precision"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "character_set_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "character_set_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "character_set_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "domain_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "domain_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "domain_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "maximum_cardinality"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "dtd_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "is_self_referencing"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_identity"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "identity_generation"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "identity_start"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "identity_increment"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "identity_maximum"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "identity_minimum"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "identity_cycle"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_generated"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "generation_expression"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_updatable"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.constraint_column_usage"+>            [ ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "column_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.constraint_table_usage"+>            [ ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.data_type_privileges"+>            [ ( "object_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "dtd_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.domain_constraints"+>            [ ( "constraint_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "domain_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "domain_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "domain_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "is_deferrable"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "initially_deferred"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.domain_udt_usage"+>            [ ( "udt_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "domain_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "domain_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "domain_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.domains"+>            [ ( "domain_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "domain_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "domain_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "data_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "character_maximum_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "character_octet_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "character_set_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "character_set_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "character_set_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "numeric_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_precision_radix"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_scale"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "datetime_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "interval_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "interval_precision"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "domain_default"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "udt_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "maximum_cardinality"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "dtd_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.element_types"+>            [ ( "object_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "collection_type_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "data_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "character_maximum_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "character_octet_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "character_set_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "character_set_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "character_set_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "numeric_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_precision_radix"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_scale"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "datetime_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "interval_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "interval_precision"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "domain_default"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "udt_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "maximum_cardinality"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "dtd_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.enabled_roles"+>            [ ( "role_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.foreign_data_wrapper_options"+>            [ ( "foreign_data_wrapper_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_data_wrapper_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "option_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "option_value"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.foreign_data_wrappers"+>            [ ( "foreign_data_wrapper_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_data_wrapper_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "authorization_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "library_name"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "foreign_data_wrapper_language"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.foreign_server_options"+>            [ ( "foreign_server_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_server_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "option_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "option_value"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.foreign_servers"+>            [ ( "foreign_server_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_server_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_data_wrapper_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_data_wrapper_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_server_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "foreign_server_version"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "authorization_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.information_schema_catalog_name"+>            [ ( "catalog_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.key_column_usage"+>            [ ( "constraint_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "column_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "ordinal_position"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "position_in_unique_constraint"+>              , DomainType "information_schema.cardinal_number"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.parameters"+>            [ ( "specific_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "ordinal_position"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "parameter_mode"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_result"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "as_locator"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "parameter_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "data_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "character_maximum_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "character_octet_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "character_set_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "character_set_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "character_set_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "numeric_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_precision_radix"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_scale"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "datetime_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "interval_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "interval_precision"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "udt_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "maximum_cardinality"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "dtd_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "pg_cursors"+>            [ ( "name"+>              , ScalarType "text"+>              )+>            , ( "statement"+>              , ScalarType "text"+>              )+>            , ( "is_holdable"+>              , ScalarType "bool"+>              )+>            , ( "is_binary"+>              , ScalarType "bool"+>              )+>            , ( "is_scrollable"+>              , ScalarType "bool"+>              )+>            , ( "creation_time"+>              , ScalarType "timestamptz"+>              )+>            ]+>        , EnvCreateView+>            "pg_group"+>            [ ( "groname"+>              , ScalarType "name"+>              )+>            , ( "grosysid"+>              , ScalarType "oid"+>              )+>            , ( "grolist"+>              , ArrayType ( ScalarType "oid" )+>              )+>            ]+>        , EnvCreateView+>            "pg_indexes"+>            [ ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "tablename"+>              , ScalarType "name"+>              )+>            , ( "indexname"+>              , ScalarType "name"+>              )+>            , ( "tablespace"+>              , ScalarType "name"+>              )+>            , ( "indexdef"+>              , ScalarType "text"+>              )+>            ]+>        , EnvCreateView+>            "pg_locks"+>            [ ( "locktype"+>              , ScalarType "text"+>              )+>            , ( "database"+>              , ScalarType "oid"+>              )+>            , ( "relation"+>              , ScalarType "oid"+>              )+>            , ( "page"+>              , ScalarType "int4"+>              )+>            , ( "tuple"+>              , ScalarType "int2"+>              )+>            , ( "virtualxid"+>              , ScalarType "text"+>              )+>            , ( "transactionid"+>              , ScalarType "xid"+>              )+>            , ( "classid"+>              , ScalarType "oid"+>              )+>            , ( "objid"+>              , ScalarType "oid"+>              )+>            , ( "objsubid"+>              , ScalarType "int2"+>              )+>            , ( "virtualtransaction"+>              , ScalarType "text"+>              )+>            , ( "pid"+>              , ScalarType "int4"+>              )+>            , ( "mode"+>              , ScalarType "text"+>              )+>            , ( "granted"+>              , ScalarType "bool"+>              )+>            ]+>        , EnvCreateView+>            "pg_prepared_statements"+>            [ ( "name"+>              , ScalarType "text"+>              )+>            , ( "statement"+>              , ScalarType "text"+>              )+>            , ( "prepare_time"+>              , ScalarType "timestamptz"+>              )+>            , ( "parameter_types"+>              , ArrayType ( ScalarType "regtype" )+>              )+>            , ( "from_sql"+>              , ScalarType "bool"+>              )+>            ]+>        , EnvCreateView+>            "pg_prepared_xacts"+>            [ ( "transaction"+>              , ScalarType "xid"+>              )+>            , ( "gid"+>              , ScalarType "text"+>              )+>            , ( "prepared"+>              , ScalarType "timestamptz"+>              )+>            , ( "owner"+>              , ScalarType "name"+>              )+>            , ( "database"+>              , ScalarType "name"+>              )+>            ]+>        , EnvCreateView+>            "pg_roles"+>            [ ( "rolname"+>              , ScalarType "name"+>              )+>            , ( "rolsuper"+>              , ScalarType "bool"+>              )+>            , ( "rolinherit"+>              , ScalarType "bool"+>              )+>            , ( "rolcreaterole"+>              , ScalarType "bool"+>              )+>            , ( "rolcreatedb"+>              , ScalarType "bool"+>              )+>            , ( "rolcatupdate"+>              , ScalarType "bool"+>              )+>            , ( "rolcanlogin"+>              , ScalarType "bool"+>              )+>            , ( "rolconnlimit"+>              , ScalarType "int4"+>              )+>            , ( "rolpassword"+>              , ScalarType "text"+>              )+>            , ( "rolvaliduntil"+>              , ScalarType "timestamptz"+>              )+>            , ( "rolconfig"+>              , ArrayType ( ScalarType "text" )+>              )+>            , ( "oid"+>              , ScalarType "oid"+>              )+>            ]+>        , EnvCreateView+>            "pg_rules"+>            [ ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "tablename"+>              , ScalarType "name"+>              )+>            , ( "rulename"+>              , ScalarType "name"+>              )+>            , ( "definition"+>              , ScalarType "text"+>              )+>            ]+>        , EnvCreateView+>            "pg_settings"+>            [ ( "name"+>              , ScalarType "text"+>              )+>            , ( "setting"+>              , ScalarType "text"+>              )+>            , ( "unit"+>              , ScalarType "text"+>              )+>            , ( "category"+>              , ScalarType "text"+>              )+>            , ( "short_desc"+>              , ScalarType "text"+>              )+>            , ( "extra_desc"+>              , ScalarType "text"+>              )+>            , ( "context"+>              , ScalarType "text"+>              )+>            , ( "vartype"+>              , ScalarType "text"+>              )+>            , ( "source"+>              , ScalarType "text"+>              )+>            , ( "min_val"+>              , ScalarType "text"+>              )+>            , ( "max_val"+>              , ScalarType "text"+>              )+>            , ( "enumvals"+>              , ArrayType ( ScalarType "text" )+>              )+>            , ( "boot_val"+>              , ScalarType "text"+>              )+>            , ( "reset_val"+>              , ScalarType "text"+>              )+>            , ( "sourcefile"+>              , ScalarType "text"+>              )+>            , ( "sourceline"+>              , ScalarType "int4"+>              )+>            ]+>        , EnvCreateView+>            "pg_shadow"+>            [ ( "usename"+>              , ScalarType "name"+>              )+>            , ( "usesysid"+>              , ScalarType "oid"+>              )+>            , ( "usecreatedb"+>              , ScalarType "bool"+>              )+>            , ( "usesuper"+>              , ScalarType "bool"+>              )+>            , ( "usecatupd"+>              , ScalarType "bool"+>              )+>            , ( "passwd"+>              , ScalarType "text"+>              )+>            , ( "valuntil"+>              , ScalarType "abstime"+>              )+>            , ( "useconfig"+>              , ArrayType ( ScalarType "text" )+>              )+>            ]+>        , EnvCreateView+>            "pg_stat_activity"+>            [ ( "datid"+>              , ScalarType "oid"+>              )+>            , ( "datname"+>              , ScalarType "name"+>              )+>            , ( "procpid"+>              , ScalarType "int4"+>              )+>            , ( "usesysid"+>              , ScalarType "oid"+>              )+>            , ( "usename"+>              , ScalarType "name"+>              )+>            , ( "current_query"+>              , ScalarType "text"+>              )+>            , ( "waiting"+>              , ScalarType "bool"+>              )+>            , ( "xact_start"+>              , ScalarType "timestamptz"+>              )+>            , ( "query_start"+>              , ScalarType "timestamptz"+>              )+>            , ( "backend_start"+>              , ScalarType "timestamptz"+>              )+>            , ( "client_addr"+>              , ScalarType "inet"+>              )+>            , ( "client_port"+>              , ScalarType "int4"+>              )+>            ]+>        , EnvCreateView+>            "pg_stat_all_indexes"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "indexrelid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "indexrelname"+>              , ScalarType "name"+>              )+>            , ( "idx_scan"+>              , ScalarType "int8"+>              )+>            , ( "idx_tup_read"+>              , ScalarType "int8"+>              )+>            , ( "idx_tup_fetch"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_stat_all_tables"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "seq_scan"+>              , ScalarType "int8"+>              )+>            , ( "seq_tup_read"+>              , ScalarType "int8"+>              )+>            , ( "idx_scan"+>              , ScalarType "int8"+>              )+>            , ( "idx_tup_fetch"+>              , ScalarType "int8"+>              )+>            , ( "n_tup_ins"+>              , ScalarType "int8"+>              )+>            , ( "n_tup_upd"+>              , ScalarType "int8"+>              )+>            , ( "n_tup_del"+>              , ScalarType "int8"+>              )+>            , ( "n_tup_hot_upd"+>              , ScalarType "int8"+>              )+>            , ( "n_live_tup"+>              , ScalarType "int8"+>              )+>            , ( "n_dead_tup"+>              , ScalarType "int8"+>              )+>            , ( "last_vacuum"+>              , ScalarType "timestamptz"+>              )+>            , ( "last_autovacuum"+>              , ScalarType "timestamptz"+>              )+>            , ( "last_analyze"+>              , ScalarType "timestamptz"+>              )+>            , ( "last_autoanalyze"+>              , ScalarType "timestamptz"+>              )+>            ]+>        , EnvCreateView+>            "pg_stat_bgwriter"+>            [ ( "checkpoints_timed"+>              , ScalarType "int8"+>              )+>            , ( "checkpoints_req"+>              , ScalarType "int8"+>              )+>            , ( "buffers_checkpoint"+>              , ScalarType "int8"+>              )+>            , ( "buffers_clean"+>              , ScalarType "int8"+>              )+>            , ( "maxwritten_clean"+>              , ScalarType "int8"+>              )+>            , ( "buffers_backend"+>              , ScalarType "int8"+>              )+>            , ( "buffers_alloc"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_stat_database"+>            [ ( "datid"+>              , ScalarType "oid"+>              )+>            , ( "datname"+>              , ScalarType "name"+>              )+>            , ( "numbackends"+>              , ScalarType "int4"+>              )+>            , ( "xact_commit"+>              , ScalarType "int8"+>              )+>            , ( "xact_rollback"+>              , ScalarType "int8"+>              )+>            , ( "blks_read"+>              , ScalarType "int8"+>              )+>            , ( "blks_hit"+>              , ScalarType "int8"+>              )+>            , ( "tup_returned"+>              , ScalarType "int8"+>              )+>            , ( "tup_fetched"+>              , ScalarType "int8"+>              )+>            , ( "tup_inserted"+>              , ScalarType "int8"+>              )+>            , ( "tup_updated"+>              , ScalarType "int8"+>              )+>            , ( "tup_deleted"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_stat_sys_indexes"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "indexrelid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "indexrelname"+>              , ScalarType "name"+>              )+>            , ( "idx_scan"+>              , ScalarType "int8"+>              )+>            , ( "idx_tup_read"+>              , ScalarType "int8"+>              )+>            , ( "idx_tup_fetch"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_stat_sys_tables"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "seq_scan"+>              , ScalarType "int8"+>              )+>            , ( "seq_tup_read"+>              , ScalarType "int8"+>              )+>            , ( "idx_scan"+>              , ScalarType "int8"+>              )+>            , ( "idx_tup_fetch"+>              , ScalarType "int8"+>              )+>            , ( "n_tup_ins"+>              , ScalarType "int8"+>              )+>            , ( "n_tup_upd"+>              , ScalarType "int8"+>              )+>            , ( "n_tup_del"+>              , ScalarType "int8"+>              )+>            , ( "n_tup_hot_upd"+>              , ScalarType "int8"+>              )+>            , ( "n_live_tup"+>              , ScalarType "int8"+>              )+>            , ( "n_dead_tup"+>              , ScalarType "int8"+>              )+>            , ( "last_vacuum"+>              , ScalarType "timestamptz"+>              )+>            , ( "last_autovacuum"+>              , ScalarType "timestamptz"+>              )+>            , ( "last_analyze"+>              , ScalarType "timestamptz"+>              )+>            , ( "last_autoanalyze"+>              , ScalarType "timestamptz"+>              )+>            ]+>        , EnvCreateView+>            "pg_stat_user_functions"+>            [ ( "funcid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "funcname"+>              , ScalarType "name"+>              )+>            , ( "calls"+>              , ScalarType "int8"+>              )+>            , ( "total_time"+>              , ScalarType "int8"+>              )+>            , ( "self_time"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_stat_user_indexes"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "indexrelid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "indexrelname"+>              , ScalarType "name"+>              )+>            , ( "idx_scan"+>              , ScalarType "int8"+>              )+>            , ( "idx_tup_read"+>              , ScalarType "int8"+>              )+>            , ( "idx_tup_fetch"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_stat_user_tables"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "seq_scan"+>              , ScalarType "int8"+>              )+>            , ( "seq_tup_read"+>              , ScalarType "int8"+>              )+>            , ( "idx_scan"+>              , ScalarType "int8"+>              )+>            , ( "idx_tup_fetch"+>              , ScalarType "int8"+>              )+>            , ( "n_tup_ins"+>              , ScalarType "int8"+>              )+>            , ( "n_tup_upd"+>              , ScalarType "int8"+>              )+>            , ( "n_tup_del"+>              , ScalarType "int8"+>              )+>            , ( "n_tup_hot_upd"+>              , ScalarType "int8"+>              )+>            , ( "n_live_tup"+>              , ScalarType "int8"+>              )+>            , ( "n_dead_tup"+>              , ScalarType "int8"+>              )+>            , ( "last_vacuum"+>              , ScalarType "timestamptz"+>              )+>            , ( "last_autovacuum"+>              , ScalarType "timestamptz"+>              )+>            , ( "last_analyze"+>              , ScalarType "timestamptz"+>              )+>            , ( "last_autoanalyze"+>              , ScalarType "timestamptz"+>              )+>            ]+>        , EnvCreateView+>            "pg_statio_all_indexes"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "indexrelid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "indexrelname"+>              , ScalarType "name"+>              )+>            , ( "idx_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "idx_blks_hit"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_statio_all_sequences"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "blks_read"+>              , ScalarType "int8"+>              )+>            , ( "blks_hit"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_statio_all_tables"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "heap_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "heap_blks_hit"+>              , ScalarType "int8"+>              )+>            , ( "idx_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "idx_blks_hit"+>              , ScalarType "int8"+>              )+>            , ( "toast_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "toast_blks_hit"+>              , ScalarType "int8"+>              )+>            , ( "tidx_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "tidx_blks_hit"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_statio_sys_indexes"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "indexrelid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "indexrelname"+>              , ScalarType "name"+>              )+>            , ( "idx_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "idx_blks_hit"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_statio_sys_sequences"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "blks_read"+>              , ScalarType "int8"+>              )+>            , ( "blks_hit"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_statio_sys_tables"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "heap_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "heap_blks_hit"+>              , ScalarType "int8"+>              )+>            , ( "idx_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "idx_blks_hit"+>              , ScalarType "int8"+>              )+>            , ( "toast_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "toast_blks_hit"+>              , ScalarType "int8"+>              )+>            , ( "tidx_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "tidx_blks_hit"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_statio_user_indexes"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "indexrelid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "indexrelname"+>              , ScalarType "name"+>              )+>            , ( "idx_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "idx_blks_hit"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_statio_user_sequences"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "blks_read"+>              , ScalarType "int8"+>              )+>            , ( "blks_hit"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_statio_user_tables"+>            [ ( "relid"+>              , ScalarType "oid"+>              )+>            , ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "relname"+>              , ScalarType "name"+>              )+>            , ( "heap_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "heap_blks_hit"+>              , ScalarType "int8"+>              )+>            , ( "idx_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "idx_blks_hit"+>              , ScalarType "int8"+>              )+>            , ( "toast_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "toast_blks_hit"+>              , ScalarType "int8"+>              )+>            , ( "tidx_blks_read"+>              , ScalarType "int8"+>              )+>            , ( "tidx_blks_hit"+>              , ScalarType "int8"+>              )+>            ]+>        , EnvCreateView+>            "pg_stats"+>            [ ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "tablename"+>              , ScalarType "name"+>              )+>            , ( "attname"+>              , ScalarType "name"+>              )+>            , ( "null_frac"+>              , ScalarType "float4"+>              )+>            , ( "avg_width"+>              , ScalarType "int4"+>              )+>            , ( "n_distinct"+>              , ScalarType "float4"+>              )+>            , ( "most_common_vals"+>              , Pseudo AnyArray+>              )+>            , ( "most_common_freqs"+>              , ArrayType ( ScalarType "float4" )+>              )+>            , ( "histogram_bounds"+>              , Pseudo AnyArray+>              )+>            , ( "correlation"+>              , ScalarType "float4"+>              )+>            ]+>        , EnvCreateView+>            "pg_tables"+>            [ ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "tablename"+>              , ScalarType "name"+>              )+>            , ( "tableowner"+>              , ScalarType "name"+>              )+>            , ( "tablespace"+>              , ScalarType "name"+>              )+>            , ( "hasindexes"+>              , ScalarType "bool"+>              )+>            , ( "hasrules"+>              , ScalarType "bool"+>              )+>            , ( "hastriggers"+>              , ScalarType "bool"+>              )+>            ]+>        , EnvCreateView+>            "pg_timezone_abbrevs"+>            [ ( "abbrev"+>              , ScalarType "text"+>              )+>            , ( "utc_offset"+>              , ScalarType "interval"+>              )+>            , ( "is_dst"+>              , ScalarType "bool"+>              )+>            ]+>        , EnvCreateView+>            "pg_timezone_names"+>            [ ( "name"+>              , ScalarType "text"+>              )+>            , ( "abbrev"+>              , ScalarType "text"+>              )+>            , ( "utc_offset"+>              , ScalarType "interval"+>              )+>            , ( "is_dst"+>              , ScalarType "bool"+>              )+>            ]+>        , EnvCreateView+>            "pg_user"+>            [ ( "usename"+>              , ScalarType "name"+>              )+>            , ( "usesysid"+>              , ScalarType "oid"+>              )+>            , ( "usecreatedb"+>              , ScalarType "bool"+>              )+>            , ( "usesuper"+>              , ScalarType "bool"+>              )+>            , ( "usecatupd"+>              , ScalarType "bool"+>              )+>            , ( "passwd"+>              , ScalarType "text"+>              )+>            , ( "valuntil"+>              , ScalarType "abstime"+>              )+>            , ( "useconfig"+>              , ArrayType ( ScalarType "text" )+>              )+>            ]+>        , EnvCreateView+>            "pg_user_mappings"+>            [ ( "umid"+>              , ScalarType "oid"+>              )+>            , ( "srvid"+>              , ScalarType "oid"+>              )+>            , ( "srvname"+>              , ScalarType "name"+>              )+>            , ( "umuser"+>              , ScalarType "oid"+>              )+>            , ( "usename"+>              , ScalarType "name"+>              )+>            , ( "umoptions"+>              , ArrayType ( ScalarType "text" )+>              )+>            ]+>        , EnvCreateView+>            "pg_views"+>            [ ( "schemaname"+>              , ScalarType "name"+>              )+>            , ( "viewname"+>              , ScalarType "name"+>              )+>            , ( "viewowner"+>              , ScalarType "name"+>              )+>            , ( "definition"+>              , ScalarType "text"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.referential_constraints"+>            [ ( "constraint_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "unique_constraint_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "unique_constraint_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "unique_constraint_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "match_option"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "update_rule"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "delete_rule"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.role_column_grants"+>            [ ( "grantor"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "grantee"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "column_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "privilege_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_grantable"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.role_routine_grants"+>            [ ( "grantor"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "grantee"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "routine_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "routine_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "routine_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "privilege_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_grantable"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.role_table_grants"+>            [ ( "grantor"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "grantee"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "privilege_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_grantable"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "with_hierarchy"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.role_usage_grants"+>            [ ( "grantor"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "grantee"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "privilege_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_grantable"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.routine_privileges"+>            [ ( "grantor"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "grantee"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "routine_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "routine_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "routine_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "privilege_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_grantable"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.routines"+>            [ ( "specific_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "routine_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "routine_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "routine_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "routine_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "module_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "module_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "module_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "udt_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "data_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "character_maximum_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "character_octet_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "character_set_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "character_set_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "character_set_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "collation_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "numeric_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_precision_radix"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_scale"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "datetime_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "interval_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "interval_precision"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "type_udt_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "type_udt_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "type_udt_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "scope_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "maximum_cardinality"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "dtd_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "routine_body"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "routine_definition"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "external_name"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "external_language"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "parameter_style"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_deterministic"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "sql_data_access"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_null_call"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "sql_path"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "schema_level_routine"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "max_dynamic_result_sets"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "is_user_defined_cast"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_implicitly_invocable"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "security_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "to_sql_specific_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "to_sql_specific_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "to_sql_specific_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "as_locator"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "created"+>              , DomainType "information_schema.time_stamp"+>              )+>            , ( "last_altered"+>              , DomainType "information_schema.time_stamp"+>              )+>            , ( "new_savepoint_level"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_udt_dependent"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "result_cast_from_data_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "result_cast_as_locator"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "result_cast_char_max_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "result_cast_char_octet_length"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "result_cast_char_set_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "result_cast_char_set_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "result_cast_character_set_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "result_cast_collation_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "result_cast_collation_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "result_cast_collation_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "result_cast_numeric_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "result_cast_numeric_precision_radix"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "result_cast_numeric_scale"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "result_cast_datetime_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "result_cast_interval_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "result_cast_interval_precision"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "result_cast_type_udt_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "result_cast_type_udt_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "result_cast_type_udt_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "result_cast_scope_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "result_cast_scope_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "result_cast_scope_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "result_cast_maximum_cardinality"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "result_cast_dtd_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.schemata"+>            [ ( "catalog_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "schema_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "schema_owner"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "default_character_set_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "default_character_set_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "default_character_set_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "sql_path"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.sequences"+>            [ ( "sequence_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "sequence_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "sequence_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "data_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "numeric_precision"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_precision_radix"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "numeric_scale"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "maximum_value"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "minimum_value"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "increment"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "cycle_option"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.table_constraints"+>            [ ( "constraint_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "constraint_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_deferrable"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "initially_deferred"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.table_privileges"+>            [ ( "grantor"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "grantee"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "privilege_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_grantable"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "with_hierarchy"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.tables"+>            [ ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "self_referencing_column_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "reference_generation"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "user_defined_type_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "user_defined_type_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "user_defined_type_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "is_insertable_into"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_typed"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "commit_action"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.triggered_update_columns"+>            [ ( "trigger_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "trigger_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "trigger_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "event_object_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "event_object_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "event_object_table"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "event_object_column"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.triggers"+>            [ ( "trigger_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "trigger_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "trigger_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "event_manipulation"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "event_object_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "event_object_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "event_object_table"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "action_order"+>              , DomainType "information_schema.cardinal_number"+>              )+>            , ( "action_condition"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "action_statement"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "action_orientation"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "condition_timing"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "condition_reference_old_table"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "condition_reference_new_table"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "condition_reference_old_row"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "condition_reference_new_row"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "created"+>              , DomainType "information_schema.time_stamp"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.usage_privileges"+>            [ ( "grantor"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "grantee"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "object_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "privilege_type"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_grantable"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.user_mapping_options"+>            [ ( "authorization_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_server_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_server_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "option_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "option_value"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.user_mappings"+>            [ ( "authorization_identifier"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_server_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "foreign_server_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.view_column_usage"+>            [ ( "view_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "view_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "view_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "column_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.view_routine_usage"+>            [ ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "specific_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.view_table_usage"+>            [ ( "view_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "view_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "view_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            ]+>        , EnvCreateView+>            "information_schema.views"+>            [ ( "table_catalog"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_schema"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "table_name"+>              , DomainType "information_schema.sql_identifier"+>              )+>            , ( "view_definition"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "check_option"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_updatable"+>              , DomainType "information_schema.character_data"+>              )+>            , ( "is_insertable_into"+>              , DomainType "information_schema.character_data"+>              )+>            ]+>        ]+
+ Database/HsSqlPpp/AstInternals/Environment/EnvironmentInternal.lhs view
@@ -0,0 +1,465 @@+Copyright 2009 Jake Wheat++This module contains the implementation of the Environment data types+and functions, and provides the api for the other type checking+modules.++> {-# LANGUAGE DeriveDataTypeable #-}+> {-# OPTIONS_HADDOCK hide  #-}++> module Database.HsSqlPpp.AstInternals.Environment.EnvironmentInternal+>     (+>      Environment+>     ,CastContext(..)+>     ,CompositeFlavour(..)+>     ,relationComposites+>     ,CompositeDef+>     ,FunctionPrototype+>     ,DomainDefinition+>     ,FunFlav(..)+>     ,emptyEnvironment+>     ,defaultEnvironment+>     ,EnvironmentUpdate(..)+>     ,ppEnvUpdate+>     ,updateEnvironment+>     ,deconstructEnvironment+>     -- type checker stuff+>     ,envCompositeDef+>     ,envCompositeAttrsPair+>     ,envCompositeAttrs+>     ,envCompositePublicAttrs+>     ,envTypeCategory+>     ,envPreferredType+>     ,envCast+>     ,envDomainBaseType+>     ,envLookupFns+>     ,envTypeExists+>     ,envLookupType+>     ,OperatorType(..)+>     ,getOperatorType+>     ,isOperatorName+>     ) where++> import Control.Monad+> import Data.List+> import Data.Generics+> -- import Debug.Trace+> import Data.Char++> import Database.HsSqlPpp.AstInternals.TypeType+> import Database.HsSqlPpp.Utils++> -- | The main datatype, this holds the catalog and context+> -- information to type check against.+> data Environment = Environment+>                    {envTypeNames :: [(String, Type)]+>                    ,envDomainDefs :: [DomainDefinition]+>                    ,envCasts :: [(Type,Type,CastContext)]+>                    ,envTypeCategories :: [(Type,String,Bool)]+>                    ,envPrefixOperators :: [FunctionPrototype]+>                    ,envPostfixOperators :: [FunctionPrototype]+>                    ,envBinaryOperators :: [FunctionPrototype]+>                    ,envFunctions :: [FunctionPrototype]+>                    ,envAggregates :: [FunctionPrototype]+>                    ,envWindowFunctions :: [FunctionPrototype]+>                    ,envAttrDefs :: [CompositeDef]+>                    ,envUpdates :: [EnvironmentUpdate]}+>                    deriving Show++> -- | Represents an empty environment. This doesn't contain things+> -- like the \'and\' operator, and so if you try to use it it will+> -- almost certainly not work.+> emptyEnvironment :: Environment+> emptyEnvironment = Environment [] [] [] [] [] [] [] [] [] [] [] []++> -- | Represents what you probably want to use as a starting point if+> -- you are building an environment from scratch. It contains+> -- information on built in function like things that aren't in the+> -- PostgreSQL catalog, such as greatest, coalesce, keyword operators+> -- like \'and\', etc..+> defaultEnvironment :: Environment+> defaultEnvironment = emptyEnvironment {+>                       envTypeNames = pseudoTypes+>                      ,envBinaryOperators = ("=",[Pseudo AnyElement+>                                                 ,Pseudo AnyElement],+>                                             typeBool, False):keywordOperatorTypes+>                      ,envFunctions = specialFunctionTypes}+++> -- | Use to note what the flavour of a cast is, i.e. if/when it can+> -- be used implicitly.+> data CastContext = ImplicitCastContext+>                  | AssignmentCastContext+>                  | ExplicitCastContext+>                    deriving (Eq,Show,Ord,Typeable,Data)++> -- | Used to distinguish between standalone composite types, and+> -- automatically generated ones, generated from a table or view+> -- respectively.+> data CompositeFlavour = Composite | TableComposite | ViewComposite+>                         deriving (Eq,Ord,Show)++> relationComposites :: [CompositeFlavour]+> relationComposites = [TableComposite,ViewComposite]+++> -- | Provides the definition of a composite type. The components are+> -- composite (or table or view) name, the flavour of the composite,+> -- the types of the composite attributes, and the types of the+> -- system columns iff the composite represents a table type (the+> -- third and fourth components are always 'CompositeType's).+> type CompositeDef = (String, CompositeFlavour, Type, Type)++> -- | The components are: function (or operator) name, argument+> -- types, return type and is variadic.+> type FunctionPrototype = (String, [Type], Type, Bool)++> -- | The components are domain type, base type (todo: add check+> -- constraint).+> type DomainDefinition = (Type,Type)++> data EnvironmentUpdate =+>     -- | add a new scalar type with the name given, also creates+>     -- an array type automatically+>     EnvCreateScalar Type String Bool+>   | EnvCreateDomain Type Type+>   | EnvCreateComposite String [(String,Type)]+>   | EnvCreateCast Type Type CastContext+>   | EnvCreateTable String [(String,Type)] [(String,Type)]+>   | EnvCreateView String [(String,Type)]+>   | EnvCreateFunction FunFlav String [Type] Type Bool+>   | EnvDropFunction Bool String [Type]+>     deriving (Eq,Ord,Typeable,Data,Show)++> ppEnvUpdate :: EnvironmentUpdate -> String+> ppEnvUpdate (EnvCreateScalar t c p) = "EnvCreateScalar " ++ show t ++ "(" ++ c ++ "," ++ show p ++ ")"+> ppEnvUpdate (EnvCreateDomain t b) = "EnvCreateDomain " ++ show t ++ " as " ++ show b+> ppEnvUpdate (EnvCreateComposite nm flds) = "EnvCreateComposite " ++ nm ++ showFlds flds+> ppEnvUpdate (EnvCreateCast s t ctx) = "EnvCreateCast " ++ show s ++ "->" ++ show t ++ " " ++ show ctx+> ppEnvUpdate (EnvCreateTable nm flds1 flds2) = "EnvCreateTable " ++ nm ++ showFlds flds1 ++ showFlds flds2+> ppEnvUpdate (EnvCreateView nm flds) = "EnvCreateView " ++ nm ++ showFlds flds+> ppEnvUpdate (EnvCreateFunction flav nm args ret vdc) =+>     "EnvCreateFunction " ++ show flav ++ " " ++ nm ++ " returns " ++ show ret +++>     "(" ++ intercalate "," (map show args) ++ ")" ++ if vdc then " variadic" else ""+> ppEnvUpdate (EnvDropFunction _ nm args) = "EnvDropFunction " ++ nm ++ "(" ++ show args ++ ")"++> showFlds :: [(String,Type)] -> String+> showFlds flds = "(\n" ++ sfs flds ++ ")"+>                 where+>                   sfs ((nm,t):fs) = "    " ++ show nm ++ " " ++ show t ++ "\n" ++ sfs fs+>                   sfs [] = ""++> data FunFlav = FunPrefix | FunPostfix | FunBinary+>              | FunName | FunAgg | FunWindow+>                deriving (Eq,Show,Ord,Typeable,Data)++> -- | Applies a list of 'EnvironmentUpdate's to an 'Environment' value+> -- to produce a new Environment value.+> updateEnvironment :: Environment+>                   -> [EnvironmentUpdate]+>                   -> Either [TypeError] Environment+> updateEnvironment env' eus =+>   foldM updateEnv' (env' {envUpdates = envUpdates env' ++ eus}) eus+>   where+>     updateEnv' env eu =+>       case eu of+>         EnvCreateScalar ty cat pref -> do+>                 errorWhen (not allowed)+>                   [BadEnvironmentUpdate $ "can only add scalar types\+>                                           \this way, got " ++ show ty]+>                 let ScalarType nm = ty+>                 return $ addTypeWithArray env nm ty cat pref+>                 where+>                   allowed = case ty of+>                                     ScalarType _ -> True+>                                     _ -> False+>         EnvCreateDomain ty baseTy -> do+>                 errorWhen (not allowed)+>                   [BadEnvironmentUpdate $ "can only add domain types\+>                                           \this way, got " ++ show ty]+>                 errorWhen (not baseAllowed)+>                   [BadEnvironmentUpdate $ "can only add domain types\+>                                           \based on scalars, got "+>                                           ++ show baseTy]+>                 let DomainType nm = ty+>                 let cat = envTypeCategory env baseTy+>                 return (addTypeWithArray env nm ty cat False) {+>                                        envDomainDefs =+>                                          (ty,baseTy):envDomainDefs env+>                                        ,envCasts =+>                                          (ty,baseTy,ImplicitCastContext):envCasts env}+>                 where+>                   allowed = case ty of+>                                             DomainType _ -> True+>                                             _ -> False+>                   baseAllowed = case baseTy of+>                                                     ScalarType _ -> True+>                                                     _ -> False++>         EnvCreateComposite nm flds ->+>                 return $ (addTypeWithArray env nm (NamedCompositeType nm) "C" False) {+>                             envAttrDefs =+>                               (nm,Composite,CompositeType flds, CompositeType [])+>                               : envAttrDefs env}+>         EnvCreateCast src tgt ctx -> return $ env {envCasts = (src,tgt,ctx):envCasts env}+>         EnvCreateTable nm attrs sysAttrs -> do+>                 checkTypeDoesntExist env nm (NamedCompositeType nm)+>                 return $ (addTypeWithArray env nm+>                             (NamedCompositeType nm) "C" False) {+>                             envAttrDefs =+>                               (nm,TableComposite,CompositeType attrs, CompositeType sysAttrs)+>                               : envAttrDefs env}+>         EnvCreateView nm attrs -> {-trace ("create view:" ++ show nm) $-} do+>                 checkTypeDoesntExist env nm (NamedCompositeType nm)+>                 return $ (addTypeWithArray env nm+>                             (NamedCompositeType nm) "C" False) {+>                             envAttrDefs =+>                               (nm,ViewComposite,CompositeType attrs, CompositeType [])+>                               : envAttrDefs env}+>         EnvCreateFunction f nm args ret vdc ->+>             return $ case f of+>               FunPrefix -> env {envPrefixOperators=(nm,args,ret,vdc):envPrefixOperators env}+>               FunPostfix -> env {envPostfixOperators=(nm,args,ret,vdc):envPostfixOperators env}+>               FunBinary -> env {envBinaryOperators=(nm,args,ret,vdc):envBinaryOperators env}+>               FunAgg -> env {envAggregates=(nm,args,ret,vdc):envAggregates env}+>               FunWindow -> env {envWindowFunctions=(nm,args,ret,vdc):envWindowFunctions env}+>               FunName -> env {envFunctions=(nm,args,ret,vdc):envFunctions env}+>         EnvDropFunction ifexists nm args -> do+>             let matches =  filter matchingFn (envFunctions env)+>             errorWhen (null matches) [BadEnvironmentUpdate $+>                                         "couldn't find function to drop " +++>                                         show nm ++ "(" ++ show args++")"]+>             errorWhen (length matches > 1) [BadEnvironmentUpdate $+>                                               "multiple matching functions to drop " +++>                                               show nm ++ "(" ++ show args++")"]+>             return env {envFunctions = filter (not . matchingFn) (envFunctions env)+>                        ,envUpdates = filter (not.matchingUpdate) (envUpdates env)}+>             where+>               matchingFn (nm1,a1,_,_) = map toLower nm == map toLower nm1 && args == a1+>               matchingUpdate (EnvDropFunction _ nm2 a2) | map toLower nm2 == map toLower nm+>                                                           && a2 == args = True+>               matchingUpdate (EnvCreateFunction _ nm2 a2 _ _) | map toLower nm2 == map toLower nm+>                                                           && a2 == args = True+>               matchingUpdate _ = False++todo:+look for matching function in list, if not found then error+remove from list, and remove from update list+++>     addTypeWithArray env nm ty cat pref =+>       env {envTypeNames =+>                ('_':nm,ArrayType ty)+>                : (nm,ty)+>                : envTypeNames env+>           ,envTypeCategories =+>                (ArrayType ty,"A",False)+>                : (ty,cat,pref)+>                : envTypeCategories env}+>     checkTypeDoesntExist env nm ty = do+>         errorWhen (any (==nm) $ map fst $ envTypeNames env)+>             [TypeAlreadyExists ty]+>         errorWhen (any (==ty) $ map snd $ envTypeNames env)+>             [TypeAlreadyExists ty]+>         return ()+++> {-+>  | Takes part an 'Environment' value to produce a list of 'EnvironmentUpdate's.+>  You can use this to look inside the Environment data type e.g. if you want to+>  examine a catalog. It should be the case that:+>  @+>   updateEnvironment emptyEnvironment (deconstructEnvironment env) = env+>  @ -}+> deconstructEnvironment :: Environment -> [EnvironmentUpdate]+> deconstructEnvironment = envUpdates+++================================================================================++= type checking stuff++> envCompositeDef :: Environment -> [CompositeFlavour] -> String -> Either [TypeError] (CompositeDef)+> envCompositeDef env flvs nm = do+>   let c = filter (\(n,t,_,_) -> n == nm && (null flvs || t `elem` flvs)) $ envAttrDefs env+>   errorWhen (null c)+>             [UnrecognisedRelation nm]+>   case c of+>     (_,fl1,r,s):[] -> return (nm,fl1,r,s)+>     _ -> error $ "problem getting attributes for: " ++ show nm ++ ", " ++ show c++> envCompositeAttrsPair :: Environment -> [CompositeFlavour] -> String+>                       -> Either [TypeError] ([(String,Type)],[(String,Type)])+> envCompositeAttrsPair env flvs ty = do+>    (_,_,CompositeType a,CompositeType b) <- envCompositeDef env flvs ty+>    return (a,b)++> envCompositeAttrs :: Environment -> [CompositeFlavour] -> String+>                   -> Either [TypeError] [(String,Type)]+> envCompositeAttrs env flvs ty = do+>   (a,b) <- envCompositeAttrsPair env flvs ty+>   return $ a ++ b++> envCompositePublicAttrs :: Environment -> [CompositeFlavour] -> String+>                   -> Either [TypeError] [(String,Type)]+> envCompositePublicAttrs env flvs ty = do+>   (a,_) <- envCompositeAttrsPair env flvs ty+>   return a+++> envTypeCategory :: Environment -> Type -> String+> envTypeCategory env ty =+>   let (c,_) = envGetCategoryInfo env ty+>   in c++> envPreferredType :: Environment -> Type -> Bool+> envPreferredType env ty =+>   let (_,p) = envGetCategoryInfo env ty+>   in p++> envCast :: Environment -> CastContext -> Type -> Type -> Bool+> envCast env ctx from to = {-trace ("check cast " ++ show from ++ show to) $-}+>     case from of+>       t@(DomainType _) -> let baseType = envDomainBaseType env t+>                           in (baseType == to) ||+>                                (envCast env ctx baseType to ||+>                                   any (== (from, to, ctx)) (envCasts env))+>       _ -> any (==(from,to,ctx)) (envCasts env)+++> envDomainBaseType :: Environment -> Type -> Type+> envDomainBaseType env ty =+>   --check type is domain, check it exists in main list+>   case lookup ty (envDomainDefs env) of+>       Nothing -> error "domain not found" -- Left [DomainDefNotFound ty]+>       Just t -> t+++> envLookupFns :: Environment -> String -> [FunctionPrototype]+> envLookupFns env name =+>     filter (\(nm,_,_,_) -> map toLower nm == map toLower name) envGetAllFns+>     where+>     envGetAllFns =+>         concat [envPrefixOperators env+>                ,envPostfixOperators env+>                ,envBinaryOperators env+>                ,envFunctions env+>                ,envAggregates env+>                ,envWindowFunctions env]++== internal support for type checker fns above++> envGetCategoryInfo :: Environment -> Type -> (String, Bool)+> envGetCategoryInfo env ty =+>   case ty of+>     SetOfType _ -> ("", False)+>     AnonymousRecordType _ -> ("", False)+>     ArrayType (Pseudo _) -> ("A",False)+>     Pseudo _ -> ("P",False)+>     _ -> let l = filter (\(t,_,_) -> ty == t) $ envTypeCategories env+>          in if null l+>               then error $ "no type category for " ++ show ty+>               else let (_,c,p):_ =l+>                    in (c,p)++> envTypeExists :: Environment -> Type -> Either [TypeError] Type+> envTypeExists env t =+>     errorWhen (t `notElem` map snd (envTypeNames env))+>               [UnknownTypeError t] >>+>     Right t++> envLookupType :: Environment -> String -> Either [TypeError] Type+> envLookupType env name =+>     liftME [UnknownTypeName name] $+>       lookup name (envTypeNames env)+++================================================================================++= built in stuff++keyword operators, all of these are built in and don't appear in any+postgresql catalog++This is wrong, these need to be separated into prefix, postfix, binary++> keywordOperatorTypes :: [FunctionPrototype]+> keywordOperatorTypes = [+>   ("!and", [typeBool, typeBool], typeBool, False)+>  ,("!or", [typeBool, typeBool], typeBool, False)+>  ,("!like", [ScalarType "text", ScalarType "text"], typeBool, False)+>  ,("!not", [typeBool], typeBool, False)+>  ,("!isnull", [Pseudo AnyElement], typeBool, False)+>  ,("!isnotnull", [Pseudo AnyElement], typeBool, False)+>  ,("!arrayctor", [ArrayType $ Pseudo AnyElement], Pseudo AnyArray, True)+>  ,("!between", [Pseudo AnyElement+>                ,Pseudo AnyElement+>                ,Pseudo AnyElement], Pseudo AnyElement, False)+>  ,("!substring", [ScalarType "text",typeInt,typeInt], ScalarType "text", False)+>  ,("!arraysub", [Pseudo AnyArray,typeInt], Pseudo AnyElement, False)+>  ]++these look like functions, but don't appear in the postgresql catalog.++> specialFunctionTypes :: [FunctionPrototype]+> specialFunctionTypes = [+>   ("coalesce", [ArrayType $ Pseudo AnyElement], Pseudo AnyElement, True)+>  ,("nullif", [Pseudo AnyElement, Pseudo AnyElement], Pseudo AnyElement,False)+>  ,("greatest", [ArrayType $ Pseudo AnyElement], Pseudo AnyElement,True)+>  ,("least", [ArrayType $ Pseudo AnyElement], Pseudo AnyElement,True)+>  ]++> pseudoTypes :: [(String, Type)]+> pseudoTypes =+>     [("any",Pseudo Any)+>     ,("anyarray",Pseudo AnyArray)+>     ,("anyelement",Pseudo AnyElement)+>     ,("anyenum",Pseudo AnyEnum)+>     ,("anynonarray",Pseudo AnyNonArray)+>     ,("cstring",Pseudo Cstring)+>     ,("record",Pseudo Record)+>     ,("trigger",Pseudo Trigger)+>     ,("void",Pseudo Void)+>     ,("_cstring",ArrayType $ Pseudo Cstring)+>     ,("_record",ArrayType $ Pseudo Record)+>     --,Pseudo Internal+>     --,Pseudo LanguageHandler+>     --,Pseudo Opaque+>     ]++================================================================================++= getOperatorType++used by the pretty printer, not sure this is a very good design++for now, assume that all the overloaded operators that have the+same name are all either binary, prefix or postfix, otherwise the+getoperatortype would need the types of the arguments to determine+the operator type, and the parser would have to be a lot cleverer+although, parsec handles - being unary and binary without breaking+a sweat, so maybe this isn't too difficult?++this is why binary @ operator isn't currently supported++> data OperatorType = BinaryOp | PrefixOp | PostfixOp+>                   deriving (Eq,Show)++> getOperatorType :: Environment -> String -> OperatorType+> getOperatorType env s = case () of+>                       _ | s `elem` ["!and", "!or","!like"] -> BinaryOp+>                         | s `elem` ["!not"] -> PrefixOp+>                         | s `elem` ["!isnull", "!isnotnull"] -> PostfixOp+>                         | any (\(x,_,_,_) -> x == s) (envBinaryOperators env) ->+>                             BinaryOp+>                         | any (\(x,_,_,_) -> x == s ||+>                                            (x=="-" && s=="u-"))+>                               (envPrefixOperators env) ->+>                             PrefixOp+>                         | any (\(x,_,_,_) -> x == s) (envPostfixOperators env) ->+>                             PostfixOp+>                         | otherwise ->+>                             error $ "don't know flavour of operator " ++ s++> isOperatorName :: String -> Bool+> isOperatorName = any (`elem` "+-*/<>=~!@#%^&|`?")
+ Database/HsSqlPpp/AstInternals/Environment/EnvironmentReader.lhs view
@@ -0,0 +1,258 @@+Copyright 2009 Jake Wheat++This module contains the code to read a set of environment updates+from a database.++The code here hasn't been tidied up since the Environment data type+was heavily changed so it's a bit messy.++> {-# OPTIONS_HADDOCK hide  #-}++> module Database.HsSqlPpp.AstInternals.Environment.EnvironmentReader+>     (readEnvironmentFromDatabase) where++> import qualified Data.Map as M+> import Data.Maybe+> import Control.Applicative+> --import Debug.Trace++> import Database.HsSqlPpp.Dbms.DBAccess+> import Database.HsSqlPpp.AstInternals.TypeType+> import Database.HsSqlPpp.Utils+> import Database.HsSqlPpp.AstInternals.Environment.EnvironmentInternal++> -- | Creates an 'EnvironmentUpdate' list by reading the database given.+> -- To create an Environment value from this, use+> --+> -- @+> -- env <- readEnvironmentFromDatabase 'something'+> -- let newEnv = updateEnvironment defaultEnvironment env+> -- @+> readEnvironmentFromDatabase :: String -- ^ name of the database to read+>                             -> IO [EnvironmentUpdate]+> readEnvironmentFromDatabase dbName = withConn ("dbname=" ++ dbName) $ \conn -> do+>    typeInfo <- selectRelation conn+>                  "select t.oid as oid,\n\+>                  \       t.typtype,\n\+>                  \       case nspname\n\+>                  \         when 'public' then t.typname\n\+>                  \         when 'pg_catalog' then t.typname\n\+>                  \         else nspname || '.' || t.typname\n\+>                  \       end as typname,\n\+>                  \       t.typarray,\n\+>                  \       coalesce(e.typtype,'0') as atyptype,\n\+>                  \       e.oid as aoid,\n\+>                  \       e.typname as atypname\n\+>                  \  from pg_catalog.pg_type t\n\+>                  \  left outer join pg_type e\n\+>                  \    on t.typarray = e.oid\n\+>                  \   inner join pg_namespace ns\n\+>                  \      on t.typnamespace = ns.oid\n\+>                   \         and ns.nspname in ('pg_catalog', 'public', 'information_schema')\n\+>                  \  where /*pg_catalog.pg_type_is_visible(t.oid)\n\+>                  \   and */not exists(select 1 from pg_catalog.pg_type el\n\+>                  \                       where el.typarray = t.oid)\n\+>                  \  order by t.typname;" []+>    let typeStuff = concatMap convTypeInfoRow typeInfo+>        typeAssoc = map (\(a,b,_) -> (a,b)) typeStuff+>        typeMap = M.fromList typeAssoc+>    cts <- map (\(nm:cat:pref:[]) ->+>                EnvCreateScalar (ScalarType nm) cat ( read pref :: Bool)) <$>+>           selectRelation conn+>                        "select t.typname,typcategory,typispreferred\n\+>                        \from pg_type t\n\+>                        \   inner join pg_namespace ns\n\+>                        \      on t.typnamespace = ns.oid\n\+>                        \         and ns.nspname in ('pg_catalog', 'public', 'information_schema')\n\+>                        \where t.typarray<>0 and\n\+>                        \    typtype='b' /*and\n\+>                        \    pg_catalog.pg_type_is_visible(t.oid)*/;" []+>    domainDefInfo <- selectRelation conn+>                       "select pg_type.oid, typbasetype\n\+>                       \  from pg_type\n\+>                       \  inner join pg_namespace ns\n\+>                       \      on pg_type.typnamespace = ns.oid\n\+>                       \         and ns.nspname in ('pg_catalog', 'public', 'information_schema')\n\+>                       \ where typtype = 'd'\n\+>                       \     /*and  pg_catalog.pg_type_is_visible(oid)*/;" []+>    let jlt k = fromJust $ M.lookup k typeMap+>    let domainDefs = map (\l -> (jlt (l!!0),  jlt (l!!1))) domainDefInfo+>    --let domainCasts = map (\(t,b) ->(t,b,ImplicitCastContext)) domainDefs+>    castInfo <- selectRelation conn+>                  "select castsource,casttarget,castcontext from pg_cast;" []+>    let casts = {- domainCasts ++ -}  flip map castInfo+>                  (\l -> (jlt (l!!0), jlt (l!!1),+>                          case (l!!2) of+>                                      "a" -> AssignmentCastContext+>                                      "i" -> ImplicitCastContext+>                                      "e" -> ExplicitCastContext+>                                      _ -> error $ "internal error: unknown cast context " ++ (l!!2)))+>    operatorInfo <- selectRelation conn+>                        "select oprname,\n\+>                        \       oprleft,\n\+>                        \       oprright,\n\+>                        \       oprresult\n\+>                        \from pg_operator\n\+>                        \      where not (oprleft <> 0 and oprright <> 0\n\+>                        \         and oprname = '@') --hack for now\n\+>                        \      order by oprname;" []+>    let getOps a b c [] = (a,b,c)+>        getOps pref post bin (l:ls) =+>          let bit = (\a -> (l!!0, a, jlt(l!!3)))+>          in case () of+>                   _ | l!!1 == "0" -> getOps (bit [jlt (l!!2)]:pref) post bin ls+>                     | l!!2 == "0" -> getOps pref (bit [jlt (l!!1)]:post) bin ls+>                     | otherwise -> getOps pref post (bit [jlt (l!!1), jlt (l!!2)]:bin) ls+>    let (prefixOps, postfixOps, binaryOps) = getOps [] [] [] operatorInfo+>    functionInfo <- selectRelation conn+>                       "select proname,\n\+>                       \       array_to_string(proargtypes,','),\n\+>                       \       proretset,\n\+>                       \       prorettype\n\+>                       \from pg_proc\n\+>                       \where pg_catalog.pg_function_is_visible(pg_proc.oid)\n\+>                       \      and provariadic = 0\n\+>                       \      and not proisagg\n\+>                       \      and not proiswindow\n\+>                       \order by proname,proargtypes;" []+>    let fnProts = map (convFnRow jlt) functionInfo++>    aggregateInfo <- selectRelation conn+>                       "select proname,\n\+>                       \       array_to_string(proargtypes,','),\n\+>                       \       proretset,\n\+>                       \       prorettype\n\+>                       \from pg_proc\n\+>                       \where pg_catalog.pg_function_is_visible(pg_proc.oid)\n\+>                       \      and provariadic = 0\n\+>                       \      and proisagg\n\+>                       \order by proname,proargtypes;" []+>    let aggProts = map (convFnRow jlt) aggregateInfo++>    windowInfo <- selectRelation conn+>                       "select proname,\n\+>                       \       array_to_string(proargtypes,','),\n\+>                       \       proretset,\n\+>                       \       prorettype\n\+>                       \from pg_proc\n\+>                       \where pg_catalog.pg_function_is_visible(pg_proc.oid)\n\+>                       \      and provariadic = 0\n\+>                       \      and proiswindow\n\+>                       \order by proname,proargtypes;" []+>    let winProts = map (convFnRow jlt) windowInfo+++>    comps <- map (\(kind:nm:atts:sysatts:nsp:[]) ->+>              let nm1 = case nsp of+>                                 "pg_catalog" -> nm+>                                 "public" -> nm+>                                 n -> n ++ "." ++ nm+>              in case kind of+>                     "c" -> EnvCreateComposite nm1 (convertAttString jlt atts)+>                     "r" -> EnvCreateTable nm1 (convertAttString jlt atts) (convertAttString jlt sysatts)+>                     "v" -> EnvCreateView nm1 (convertAttString jlt atts)+>                     _ -> error $ "unrecognised relkind: " ++ kind) <$>+>                 selectRelation conn+>                   "with att1 as (\n\+>                   \ select\n\+>                   \     attrelid,\n\+>                   \     attname,\n\+>                   \     attnum,\n\+>                   \     atttypid\n\+>                   \   from pg_attribute\n\+>                   \   inner join pg_class cls\n\+>                   \      on cls.oid = attrelid\n\+>                   \   inner join pg_namespace ns\n\+>                   \      on cls.relnamespace = ns.oid\n\+>                   \         and ns.nspname in ('pg_catalog', 'public', 'information_schema')\n\+>                   \   where /*pg_catalog.pg_table_is_visible(cls.oid)\n\+>                   \      and*/ cls.relkind in ('r','v','c')\n\+>                   \      and not attisdropped),\n\+>                   \ sysAtt as (\n\+>                   \ select attrelid,\n\+>                   \     array_to_string(\n\+>                   \       array_agg(attname || ';' || atttypid)\n\+>                   \         over (partition by attrelid order by attnum\n\+>                   \               range between unbounded preceding\n\+>                   \               and unbounded following)\n\+>                   \       ,',') as sysAtts\n\+>                   \   from att1\n\+>                   \   where attnum < 0),\n\+>                   \ att as (\n\+>                   \ select attrelid,\n\+>                   \     array_to_string(\n\+>                   \       array_agg(attname || ';' || atttypid)\n\+>                   \          over (partition by attrelid order by attnum\n\+>                   \                range between unbounded preceding\n\+>                   \                and unbounded following)\n\+>                   \       ,',') as atts\n\+>                   \   from att1\n\+>                   \   where attnum > 0)\n\+>                   \ select distinct\n\+>                   \     cls.relkind,\n\+>                   \     cls.relname,\n\+>                   \     atts,\n\+>                   \     coalesce(sysAtts,''),\n\+>                   \     nspname\n\+>                   \   from att left outer join sysAtt using (attrelid)\n\+>                   \   inner join pg_class cls\n\+>                   \     on cls.oid = attrelid\n\+>                   \   inner join pg_namespace ns\n\+>                   \      on cls.relnamespace = ns.oid\n\+>                   \   order by relkind,relname;" []+++>    return $ concat [+>                cts+>               ,map (uncurry EnvCreateDomain) domainDefs+>               ,map (\(a,b,c) -> EnvCreateCast a b c) casts+>               ,map (\(a,b,c) -> EnvCreateFunction FunPrefix a b c False) prefixOps+>               ,map (\(a,b,c) -> EnvCreateFunction FunPostfix a b c False) postfixOps+>               ,map (\(a,b,c) -> EnvCreateFunction FunBinary a b c False) binaryOps+>               ,map (\(a,b,c) -> EnvCreateFunction FunName a b c False) fnProts+>               ,map (\(a,b,c) -> EnvCreateFunction FunAgg a b c False) aggProts+>               ,map (\(a,b,c) -> EnvCreateFunction FunWindow a b c False) winProts+>               ,comps]+>    where+>      convertAttString jlt s =+>          let ps = split ',' s+>              ps1 = map (split ';') ps+>          in map (\pl -> (head pl, jlt (pl!!1))) ps1+>      convFnRow jlt l =+>         (head l,fnArgs,fnRet)+>         where+>           fnRet = let rt1 = jlt (l!!3)+>                   in if read (l!!2)::Bool+>                        then SetOfType rt1+>                        else rt1+>           fnArgs = if (l!!1) == ""+>                      then []+>                      else let a = split ',' (l!!1)+>                           in map jlt a+>      convTypeInfoRow l =+>        let name = (l!!2)+>            ctor = case (l!!1) of+>                     "b" -> ScalarType+>                     "c" -> NamedCompositeType+>                     "d" -> DomainType+>                     "e" -> EnumType+>                     "p" -> (\t -> Pseudo (case t of+>                                                  "any" -> Any+>                                                  "anyarray" -> AnyArray+>                                                  "anyelement" -> AnyElement+>                                                  "anyenum" -> AnyEnum+>                                                  "anynonarray" -> AnyNonArray+>                                                  "cstring" -> Cstring+>                                                  "internal" -> Internal+>                                                  "language_handler" -> LanguageHandler+>                                                  "opaque" -> Opaque+>                                                  "record" -> Record+>                                                  "trigger" -> Trigger+>                                                  "void" -> Void+>                                                  _ -> error $ "internal error: unknown pseudo " ++ t))+>                     _ -> error $ "internal error: unknown type type: " ++ (l !! 1)+>            scType = (head l, ctor name, name)+>        in if (l!!4) /= "0"+>           then [(l!!5,ArrayType $ ctor name, '_':name), scType]+>           else [scType]+
+ Database/HsSqlPpp/AstInternals/Environment/LocalIdentifierBindings.lhs view
@@ -0,0 +1,240 @@+Copyright 2009 Jake Wheat++This module contains the code to manage local identifier bindings+during the type checking process.++Main areas to support are parameters and variables++> {-# OPTIONS_HADDOCK hide  #-}++> module Database.HsSqlPpp.AstInternals.Environment.LocalIdentifierBindings+>     (+>      QualifiedIDs+>     ,LocalIdentifierBindings+>     ,emptyBindings+>     ,updateBindings+>     ,LocalIdentifierBindingsUpdate(..)+>     ,libExpandStar+>     ,libLookupID+>     ) where++> import Control.Monad+> import Data.List+> import Debug.Trace+> import Data.Char++> import Database.HsSqlPpp.AstInternals.TypeType+> import Database.HsSqlPpp.Utils+> import Database.HsSqlPpp.AstInternals.Environment.EnvironmentInternal++> -- | The main datatype, this holds the catalog and context+> -- information to type check against.+> data LocalIdentifierBindings = LocalIdentifierBindings+>                    {identifierTypes :: [[QualifiedIDs]]+>                    ,starTypes :: [QualifiedIDs]}++++> -- | Represents an empty environment. This doesn't contain things+> -- like the \'and\' operator, and so if you try to use it it will+> -- almost certainly not work.+> emptyBindings :: LocalIdentifierBindings+> emptyBindings = LocalIdentifierBindings [] []++> -- | Represents the types of the ids available, currently used for+> -- resolving identifiers inside select expressions. Will probably+> -- change as this is fixed to support more general contexts.  The+> -- components represent the qualifying name (empty string for no+> -- qualifying name), the list of identifier names with their types,+> -- and the list of system column identifier names with their types.+> type QualifiedIDs = (String, [(String,Type)])++> instance Show LocalIdentifierBindings where+>   show (LocalIdentifierBindings idTypes starEx) =+>       "ID Types:\n" ++ concatMap (flip showQList 0) idTypes +++>         "Star Exp:\n" ++ concatMap showQuals starEx+>       where+>         showQList :: [QualifiedIDs] -> Int -> String+>         showQList (x:xs) n = show n ++ ":\n" +++>                               showQuals x ++ "\n" ++ showQList xs (n + 1)+>         showQList [] _ = ""+>         showQuals :: QualifiedIDs -> String+>         showQuals (co, idList) = "qual: " ++ co ++ ":\n" ++ concatMap (\(n,t) -> n ++ "::" ++ show t ++ "\n") idList++++= Attribute identifier scoping++The way this scoping works is we have a list of prefixes/namespaces,+which is generally the table/view name, or the alias given to it, and+then a list of identifiers (with no dots) and their types. When we+look up the type of an identifier, if it has an correlation name we+try to match that against a table name or alias in that list, if it is+not present or not unique then throw an error. Similarly with no+correlation name, we look at all the lists, if the id is not present+or not unique then throw an error.++envIdentifierTypes is for expanding *. If we want to access the+common attributes from one of the tables in a using or natural join,+this attribute can be qualified with either of the table names/+aliases. But when we expand the *, we only output these common fields+once, so keep a separate list of these fields used just for expanding+the star. The other twist is that these common fields appear first in+the resultant field list.++System columns: pg also has these - they have names and types like+other attributes, but are not included when expanding stars, so you+only get them when you explicitly ask for them. The main use is using+the oid system column which is heavily used as a target for foreign+key references in the pg catalog.++This system still isn't working right. Subqueries are a+problem. Aspects which don't work right now are:++consider this query:+select relname as relvar_name+    from pg_class+    where ((relnamespace =+           (select oid+              from pg_namespace+              where (nspname = 'public'))) and (relkind = 'r'));++we need to be able to access attributes from pg_class inside the subquery,+but 1) they aren't inserted if you use * in the inner query+2) they can't make an identifier ambiguous, so the oid here in the subquery+is ok even though both the oid from pg_namespace and the oid from pg_class+are in scope.++So there are two problems with the current code:+it's too aggressive at throwing ambiguous identifier errors+it pulls in too many identifiers when expanding star++Solution ideas:+for the ambiguous errors, create a stack of identifiers, then split+the EnvUpdateIDs into two, one to replace the current set, and one to+push a new set on the stack. Then fix the lookup to walk the stack level by level.++for the *, we already have special cases for system columns, and for+join ids. I think the best solution is to provide a separate list of *+columns and types, with a separate env update ctor, and get the type+checker to resolve the list for * expansion rather than doing it here.++This should also handle parameters and variable declarations in plpgsql+functions too, these stack in the same way, with one complication to+do with parameters:++there is an additional complication with plpgsql, which isn't going to+be handled for now: instead of stacking like everything else, for+variable references inside select, insert, update and delete+statements only, which aren't qualified and match a parameter name,+then the parameter is used in lieu of variable declarations or+attributes inside a select expression. This will be handled at some+point.++this is something the lint checker should flag when it's written, it+will also flag any ambiguous identifiers which resolve ok only because+of stacking, this is a standard warning in many flavours of lint+checkers.++One last thing is that we need to make sure identifiers availability doesn't+get inherited too far: e.g. a create function inside a create function+can't access ids from the outer create function. This is pretty easy:+the following things generate identifier bindings:+select expressions, inside the expression+parameter defs+variable defs++since select expressions can't contain statements, we don't need to+worry about e.g. if statements, they want to inherit ids from params+and variable defs, so the default is good.++For environments being updated sequentially: since the environment is+updated in a statement list (i.e. environment updates stack from one+statement to the next within a single statement list), any var defs+can't break out of the containing list, so we are covered e.g. for a+variable def leaking from an inner block to an outer block.++With ids going into select expressions: we want the default which is+parameters, vardefs and ids from containing select expressions to be+inherited. So, in the end the only case to deal with is a create+function inside another create function. This isn't dealt with at the+moment.++++> libExpandStar :: LocalIdentifierBindings -> String -> Either [TypeError] [(String,Type)]+> libExpandStar env correlationName =+>     case lookup correlationName $ starTypes env of+>       Nothing -> errorWhen (correlationName == "")+>                            [InternalError "no star expansion found?"] >>+>                  Left [UnrecognisedCorrelationName correlationName]+>       Just l -> Right l++> splitIdentifier :: String -> (String,String)+> splitIdentifier s = let (a,b) = span (/= '.') s+>                     in if b == ""+>                          then ("", a)+>                          else (a,tail b)++> libLookupID :: LocalIdentifierBindings -> String -> Either [TypeError] Type+> libLookupID env iden1 =+>   envLookupID' $ identifierTypes env+>   where+>     (correlationName,iden) = splitIdentifier $ map toLower iden1+>     envLookupID' (its:itss) =+>       case lookup correlationName its of+>         Nothing -> envLookupID' itss+>         Just s -> case filter (\(n,_) -> map toLower n==iden) s of+>                     [] -> if correlationName == ""+>                             then envLookupID' itss+>                             else Left [UnrecognisedIdentifier $ correlationName ++ "." ++ iden]+>                     (_,t):[] -> Right t+>                     _ -> Left [AmbiguousIdentifier iden]+>     envLookupID' [] =+>       Left [if correlationName == ""+>               then UnrecognisedIdentifier iden+>               else UnrecognisedCorrelationName correlationName]++> -- | Applies a list of 'EnvironmentUpdate's to an 'Environment' value+> -- to produce a new Environment value.+> updateBindings :: LocalIdentifierBindings+>                -> Environment+>                -> [LocalIdentifierBindingsUpdate]+>                -> Either [TypeError] LocalIdentifierBindings+> updateBindings lbs' env eus =+>   let r = foldM updateEnv' lbs' eus+>   in {-trace ("*********************************************\nupdatebindings from " ++ show lbs' ++ "\nto\n" ++ show r) -} r+>   where+>     updateEnv' lbs eu =+>       case eu of+>         LibStackIDs qids -> return $ lbs {identifierTypes = expandComposites qids : identifierTypes lbs}+>         LibSetStarExpansion sids -> return $ lbs {starTypes = sids}+>     --take all the composite typed ids, and expand them out+>     expandComposites :: [(String, [(String,Type)])] -> [(String, [(String,Type)])]+>     expandComposites ((q,attrs):qis) =+>         ec attrs ++ (q, map (\(n,t) -> (n,wrapIfRecord n t)) attrs) : expandComposites qis+>         where+>           ec :: [(String,Type)] -> [(String, [(String,Type)])]+>           ec [] = []+>           ec ((nm,NamedCompositeType t):xs) = (nm,compFields t):ec xs+>           ec ((nm,SetOfType(NamedCompositeType t)):xs) = (nm,compFields t):ec xs+>           ec ((nm,CompositeType t):xs) = (nm, t):ec xs+>           ec ((nm,SetOfType(CompositeType t)):xs) = (nm, t):ec xs+>           ec (_:xs) = ec xs+>           wrapIfRecord n t =+>             case libLookupID lbs' n of+>               Right (PgRecord _) -> PgRecord (Just t)+>               _ -> t+>     expandComposites [] = []+>     compFields = fromRight [] . envCompositePublicAttrs env []++> data LocalIdentifierBindingsUpdate =+>     -- | to allow an unqualified identifier reference to work you need to+>     -- supply an extra entry with \"\" as the alias, and all the fields,+>     -- in the case of joins, these unaliased fields need to have the+>     -- duplicates removed and the types resolved+>       LibStackIDs [QualifiedIDs]+>     -- | to allow an unqualified star to work you need to+>     -- supply an extra entry with \"\" as the alias, and all the fields+>     | LibSetStarExpansion [QualifiedIDs]+
− Database/HsSqlPpp/AstInternals/EnvironmentInternal.lhs
@@ -1,537 +0,0 @@-Copyright 2009 Jake Wheat--This module contains the implementation of the Environment data types-and functions, and provides the api for the other type checking-modules.--> {-# LANGUAGE DeriveDataTypeable #-}-> {-# OPTIONS_HADDOCK hide  #-}--> module Database.HsSqlPpp.AstInternals.EnvironmentInternal->     (->      Environment->     ,QualifiedIDs->     ,CastContext(..)->     ,CompositeFlavour(..)->     ,CompositeDef->     ,FunctionPrototype->     ,DomainDefinition->     ,FunFlav(..)->     ,emptyEnvironment->     ,defaultEnvironment->     ,EnvironmentUpdate(..)->     ,updateEnvironment->     --,destructEnvironment->     -- type checker stuff->     ,envExpandStar->     ,envLookupID->     ,envCompositeAttrs->     ,envTypeCategory->     ,envPreferredType->     ,envCast->     ,envDomainBaseType->     ,envLookupFns->     ,envTypeExists->     ,envLookupType->     ,OperatorType(..)->     ,getOperatorType->     ,isOperatorName->     ) where--> import Control.Monad-> import Data.List-> import Data.Generics--> import Database.HsSqlPpp.AstInternals.TypeType-> import Database.HsSqlPpp.Utils--> -- | The main datatype, this holds the catalog and context-> -- information to type check against.-> data Environment = Environment->                    {envTypeNames :: [(String, Type)]->                    ,envDomainDefs :: [DomainDefinition]->                    ,envCasts :: [(Type,Type,CastContext)]->                    ,envTypeCategories :: [(Type,String,Bool)]->                    ,envPrefixOperators :: [FunctionPrototype]->                    ,envPostfixOperators :: [FunctionPrototype]->                    ,envBinaryOperators :: [FunctionPrototype]->                    ,envFunctions :: [FunctionPrototype]->                    ,envAggregates :: [FunctionPrototype]->                    ,envAttrDefs :: [CompositeDef]->                    --,envAttrSystemColumns :: [CompositeDef]->                    ,envIdentifierTypes :: [[QualifiedIDs]]->                    ,envStarTypes :: [QualifiedIDs]}---> -- | Represents an empty environment. This doesn't contain things-> -- like the \'and\' operator, and so if you try to use it it will-> -- almost certainly not work.-> emptyEnvironment :: Environment-> emptyEnvironment = Environment [] [] [] [] [] [] [] [] [] [] [] []--> -- | Represents what you probably want to use as a starting point if-> -- you are building an environment from scratch. It contains-> -- information on built in function like things that aren't in the-> -- PostGreSQL catalog, such as greatest, coalesce, keyword operators-> -- like \'and\', etc..-> defaultEnvironment :: Environment-> defaultEnvironment = emptyEnvironment {->                       envTypeNames = pseudoTypes->                      ,envBinaryOperators = keywordOperatorTypes->                      ,envFunctions = specialFunctionTypes}--> -- | Represents the types of the ids available, currently used for-> -- resolving identifiers inside select expressions. Will probably-> -- change as this is fixed to support more general contexts.  The-> -- components represent the qualifying name (empty string for no-> -- qualifying name), the list of identifier names with their types,-> -- and the list of system column identifier names with their types.-> type QualifiedIDs = (String, [(String,Type)])--> -- | Use to note what the flavour of a cast is, i.e. if/when it can-> -- be used implicitly.-> data CastContext = ImplicitCastContext->                  | AssignmentCastContext->                  | ExplicitCastContext->                    deriving (Eq,Show,Typeable,Data)--> -- | Used to distinguish between standalone composite types, and-> -- automatically generated ones, generated from a table or view-> -- respectively.-> data CompositeFlavour = Composite | TableComposite | ViewComposite->                         deriving (Eq,Show)--> -- | Provides the definition of a composite type. The components are-> -- composite (or table or view) name, the flavour of the composite,-> -- the types of the composite attributes, and the types of the-> -- system columns iff the composite represents a table type (the-> -- third and fourth components are always 'UnnamedCompositeType's).-> type CompositeDef = (String, CompositeFlavour, Type, Type)--> -- | The components are: function (or operator) name, argument-> -- types, and return type.-> type FunctionPrototype = (String, [Type], Type)--> -- | The components are domain type, base type (todo: add check-> -- constraint).-> type DomainDefinition = (Type,Type)--> data EnvironmentUpdate =->     -- | add a new scalar type with the name given, also creates->     -- an array type automatically->     EnvCreateScalar Type String Bool->   | EnvCreateDomain Type Type->   | EnvCreateComposite String [(String,Type)]->   | EnvCreateCast Type Type CastContext->   | EnvCreateTable String [(String,Type)] [(String,Type)]->   | EnvCreateView String [(String,Type)]->   | EnvCreateFunction FunFlav String [Type] Type->     -- | to allow an unqualified identifier reference to work you need to->     -- supply an extra entry with \"\" as the alias, and all the fields,->     -- in the case of joins, these unaliased fields need to have the->     -- duplicates removed and the types resolved->   | EnvStackIDs [QualifiedIDs]->     -- | to allow an unqualified star to work you need to->     -- supply an extra entry with \"\" as the alias, and all the fields->   | EnvSetStarExpansion [QualifiedIDs]->     deriving (Eq,Show,Typeable,Data)--> data FunFlav = FunPrefix | FunPostfix | FunBinary->              | FunName | FunAgg->                deriving (Eq,Show,Typeable,Data)--> -- | Applies a list of 'EnvironmentUpdate's to an 'Environment' value-> -- to produce a new Environment value.-> updateEnvironment :: Environment->                   -> [EnvironmentUpdate]->                   -> Either [TypeError] Environment-> updateEnvironment env' eus =->   foldM updateEnv' env' eus->   where->     updateEnv' env eu =->       case eu of->         EnvCreateScalar ty cat pref -> do->                 errorWhen (not allowed)->                   [BadEnvironmentUpdate $ "can only add scalar types\->                                           \this way, got " ++ show ty]->                 let ScalarType nm = ty->                 return $ addTypeWithArray env nm ty cat pref->                 where->                   allowed = case ty of->                                     ScalarType _ -> True->                                     _ -> False->         EnvCreateDomain ty baseTy -> do->                 errorWhen (not allowed)->                   [BadEnvironmentUpdate $ "can only add domain types\->                                           \this way, got " ++ show ty]->                 errorWhen (not baseAllowed)->                   [BadEnvironmentUpdate $ "can only add domain types\->                                           \based on scalars, got "->                                           ++ show baseTy]->                 let DomainType nm = ty->                 let cat = envTypeCategory env baseTy->                 return $ (addTypeWithArray env nm ty cat False) {->                                        envDomainDefs =->                                          (ty,baseTy):envDomainDefs env->                                        ,envCasts =->                                          (ty,baseTy,ImplicitCastContext):envCasts env}->                 where->                   allowed = case ty of->                                     DomainType _ -> True->                                     _ -> False->                   baseAllowed = case baseTy of->                                   ScalarType _ -> True->                                   _ -> False->         EnvCreateComposite nm flds ->->                 return $ (addTypeWithArray env nm (CompositeType nm) "C" False) {->                             envAttrDefs =->                               (nm,Composite,UnnamedCompositeType flds, UnnamedCompositeType [])->                               : envAttrDefs env}->         EnvCreateCast src tgt ctx -> return $ env {envCasts = (src,tgt,ctx):envCasts env}->         EnvCreateTable nm attrs sysAttrs -> do->                 checkTypeDoesntExist env nm (CompositeType nm)->                 return $ (addTypeWithArray env nm->                             (CompositeType nm) "C" False) {->                             envAttrDefs =->                               (nm,TableComposite,UnnamedCompositeType attrs, UnnamedCompositeType sysAttrs)->                               : envAttrDefs env}->         EnvCreateView nm attrs -> {-trace ("create view:" ++ show nm) $-} do->                 checkTypeDoesntExist env nm (CompositeType nm)->                 return $ (addTypeWithArray env nm->                             (CompositeType nm) "C" False) {->                             envAttrDefs =->                               (nm,ViewComposite,UnnamedCompositeType attrs, UnnamedCompositeType [])->                               : envAttrDefs env}->         EnvCreateFunction f nm args ret ->->             return $ case f of->               FunPrefix -> env {envPrefixOperators=(nm,args,ret):envPrefixOperators env}->               FunPostfix -> env {envPostfixOperators=(nm,args,ret):envPostfixOperators env}->               FunBinary -> env {envBinaryOperators=(nm,args,ret):envBinaryOperators env}->               FunAgg -> env {envAggregates=(nm,args,ret):envAggregates env}->               FunName -> env {envFunctions=(nm,args,ret):envFunctions env}->         EnvStackIDs qids -> return $ env {envIdentifierTypes = qids:envIdentifierTypes env}->         EnvSetStarExpansion sids -> return $ env {envStarTypes = sids}->     addTypeWithArray env nm ty cat pref =->       env {envTypeNames =->                ('_':nm,ArrayType ty)->                : (nm,ty)->                : envTypeNames env->           ,envTypeCategories =->                (ArrayType ty,"A",False)->                : (ty,cat,pref)->                : envTypeCategories env}->     checkTypeDoesntExist env nm ty = do->         errorWhen (any (==nm) $ map fst $ envTypeNames env)->             [TypeAlreadyExists ty]->         errorWhen (any (==ty) $ map snd $ envTypeNames env)->             [TypeAlreadyExists ty]->         return ()---> {--> -- | Takes part an 'Environment' value to produce a list of 'EnvironmentUpdate's.-> -- You can use this to look inside the Environment data type e.g. if you want to-> -- examine a catalog. It should be the case that:-> ---> -- @-> -- updateEnvironment emptyEnvironment (destructEnvironment env) = env-> -- @-> destructEnvironment :: Environment -> [EnvironmentUpdate]-> destructEnvironment = undefined-> -}--TODO -this shouldn't be too difficult, just bluff it and use quick-check to see if it works---================================================================================--= type checking stuff--> envCompositeAttrs :: Environment -> [CompositeFlavour] -> Type -> Either [TypeError] (CompositeDef)-> envCompositeAttrs env flvs ty = do->   let CompositeType nm = ty->   let c = filter (\(n,t,_,_) -> n == nm && (null flvs || t `elem` flvs)) $ envAttrDefs env->   errorWhen (null c)->             [UnrecognisedRelation nm]->   case c of->     (_,fl1,r,s):[] -> return (nm,fl1,r,s)->     _ -> error $ "problem getting attributes for: " ++ show ty ++ ", " ++ show c--> envTypeCategory :: Environment -> Type -> String-> envTypeCategory env ty =->   let (c,_) = envGetCategoryInfo env ty->   in c--> envPreferredType :: Environment -> Type -> Bool-> envPreferredType env ty =->   let (_,p) = envGetCategoryInfo env ty->   in p--> envCast :: Environment -> CastContext -> Type -> Type -> Bool-> envCast env ctx from to = any (==(from,to,ctx)) (envCasts env)---> envDomainBaseType :: Environment -> Type -> Type-> envDomainBaseType env ty =->   --check type is domain, check it exists in main list->   case lookup ty (envDomainDefs env) of->       Nothing -> error "domain not found" -- Left [DomainDefNotFound ty]->       Just t -> t---> envLookupFns :: Environment -> String -> [FunctionPrototype]-> envLookupFns env name =->     filter (\(nm,_,_) -> nm == name) envGetAllFns->     where->     envGetAllFns =->         concat [envPrefixOperators env->                ,envPostfixOperators env->                ,envBinaryOperators env->                ,envFunctions env->                ,envAggregates env]--== internal support for type checker fns above--> envGetCategoryInfo :: Environment -> Type -> (String, Bool)-> envGetCategoryInfo env ty =->   case ty of->     ArrayType (Pseudo _) -> ("A",False)->     Pseudo _ -> ("P",False)->     _ -> let l = filter (\(t,_,_) -> ty == t) $ envTypeCategories env->          in if null l->               then error $ "no type category for " ++ show ty->               else let (_,c,p):_ =l->                    in (c,p)----= Attribute identifier scoping--The way this scoping works is we have a list of prefixes/namespaces,-which is generally the table/view name, or the alias given to it, and-then a list of identifiers (with no dots) and their types. When we-look up the type of an identifier, if it has an correlation name we-try to match that against a table name or alias in that list, if it is-not present or not unique then throw an error. Similarly with no-correlation name, we look at all the lists, if the id is not present-or not unique then throw an error.--envIdentifierTypes is for expanding *. If we want to access the-common attributes from one of the tables in a using or natural join,-this attribute can be qualified with either of the table names/-aliases. But when we expand the *, we only output these common fields-once, so keep a separate list of these fields used just for expanding-the star. The other twist is that these common fields appear first in-the resultant field list.--System columns: pg also has these - they have names and types like-other attributes, but are not included when expanding stars, so you-only get them when you explicitly ask for them. The main use is using-the oid system column which is heavily used as a target for foreign-key references in the pg catalog.--This system still isn't working right. Subqueries are a-problem. Aspects which don't work right now are:--consider this query:-select relname as relvar_name-    from pg_class-    where ((relnamespace =-           (select oid-              from pg_namespace-              where (nspname = 'public'))) and (relkind = 'r'));--we need to be able to access attributes from pg_class inside the subquery,-but 1) they aren't inserted if you use * in the inner query-2) they can't make an identifier ambiguous, so the oid here in the subquery-is ok even though both the oid from pg_namespace and the oid from pg_class-are in scope.--So there are two problems with the current code:-it's too aggressive at throwing ambiguous identifier errors-it pulls in too many identifiers when expanding star--Solution ideas:-for the ambiguous errors, create a stack of identifiers, then split-the EnvUpdateIDs into two, one to replace the current set, and one to-push a new set on the stack. Then fix the lookup to walk the stack level by level.--for the *, we already have special cases for system columns, and for-join ids. I think the best solution is to provide a separate list of *-columns and types, with a separate env update ctor, and get the type-checker to resolve the list for * expansion rather than doing it here.--This should also handle parameters and variable declarations in plpgsql-functions too, these stack in the same way, with one complication to-do with parameters:--there is an additional complication with plpgsql, which isn't going to-be handled for now: instead of stacking like everything else, for-variable references inside select, insert, update and delete-statements only, which aren't qualified and match a parameter name,-then the parameter is used in lieu of variable declarations or-attributes inside a select expression. This will be handled at some-point.--this is something the lint checker should flag when it's written, it-will also flag any ambiguous identifiers which resolve ok only because-of stacking, this is a standard warning in many flavours of lint-checkers.--One last thing is that we need to make sure identifiers availability doesn't-get inherited too far: e.g. a create function inside a create function-can't access ids from the outer create function. This is pretty easy:-the following things generate identifier bindings:-select expressions, inside the expression-parameter defs-variable defs--since select expressions can't contain statements, we don't need to-worry about e.g. if statements, they want to inherit ids from params-and variable defs, so the default is good.--For environments being updated sequentially: since the environment is-updated in a statement list (i.e. environment updates stack from one-statement to the next within a single statement list), any var defs-can't break out of the containing list, so we are covered e.g. for a-variable def leaking from an inner block to an outer block.--With ids going into select expressions: we want the default which is-parameters, vardefs and ids from containing select expressions to be-inherited. So, in the end the only case to deal with is a create-function inside another create function. This isn't dealt with at the-moment.----> envExpandStar :: Environment -> String -> Either [TypeError] [(String,Type)]-> envExpandStar env correlationName =->     case lookup correlationName $ envStarTypes env of->       Nothing -> errorWhen (correlationName == "")->                            [InternalError "no star expansion found?"] >>->                  Left [UnrecognisedCorrelationName correlationName]->       Just l -> Right l--> envLookupID :: Environment -> String -> String -> Either [TypeError] Type-> envLookupID env correlationName iden = {-trace ("lookup " ++ show iden ++ " in " ++ show (envIdentifierTypes env)) $ -}->   envLookupID' $ envIdentifierTypes env->   where->     envLookupID' (its:itss) =->       case lookup correlationName its of->         Nothing -> errorWhen (correlationName == "")->                              [UnrecognisedIdentifier iden] >>->                    Left [UnrecognisedCorrelationName correlationName]->         Just s -> case filter (\(n,_) -> n==iden) s of->                     [] -> envLookupID' itss->                     (_,t):[] -> Right t->                     _ -> Left [AmbiguousIdentifier iden]->     envLookupID' [] = Left [UnrecognisedIdentifier $ if correlationName == "" then iden else correlationName ++ "." ++ iden]--> envTypeExists :: Environment -> Type -> Either [TypeError] Type-> envTypeExists env t =->     errorWhen (t `notElem` map snd (envTypeNames env))->               [UnknownTypeError t] >>->     Right t--> envLookupType :: Environment -> String -> Either [TypeError] Type-> envLookupType env name =->     liftME [UnknownTypeName name] $->       lookup name (envTypeNames env)---================================================================================--= built in stuff--keyword operators, all of these are built in and don't appear in any-postgresql catalog--This is wrong, these need to be separated into prefix, postfix, binary--> keywordOperatorTypes :: [(String,[Type],Type)]-> keywordOperatorTypes = [->   ("!and", [typeBool, typeBool], typeBool)->  ,("!or", [typeBool, typeBool], typeBool)->  ,("!like", [ScalarType "text", ScalarType "text"], typeBool)->  ,("!not", [typeBool], typeBool)->  ,("!isNull", [Pseudo AnyElement], typeBool)->  ,("!isNotNull", [Pseudo AnyElement], typeBool)->  ,("!arrayCtor", [Pseudo AnyElement], Pseudo AnyArray) -- not quite right,->                                         -- needs variadic support->                                         -- currently works via a special case->                                         -- in the type checking code->  ,("!between", [Pseudo AnyElement->               ,Pseudo AnyElement->               ,Pseudo AnyElement], Pseudo AnyElement)->  ,("!substring", [ScalarType "text",typeInt,typeInt], ScalarType "text")->  ,("!arraySub", [Pseudo AnyArray,typeInt], Pseudo AnyElement)->  ]--these look like functions, but don't appear in the postgresql catalog.--> specialFunctionTypes :: [(String,[Type],Type)]-> specialFunctionTypes = [->   ("coalesce", [Pseudo AnyElement],->     Pseudo AnyElement) -- needs variadic support to be correct,->                        -- uses special case in type checking->                        -- currently->  ,("nullif", [Pseudo AnyElement, Pseudo AnyElement], Pseudo AnyElement)->  ,("greatest", [Pseudo AnyElement], Pseudo AnyElement) --variadic, blah->  ,("least", [Pseudo AnyElement], Pseudo AnyElement) --also->  ]--> pseudoTypes :: [(String, Type)]-> pseudoTypes =->     [("any",Pseudo Any)->     ,("anyarray",Pseudo AnyArray)->     ,("anyelement",Pseudo AnyElement)->     ,("anyenum",Pseudo AnyEnum)->     ,("anynonarray",Pseudo AnyNonArray)->     ,("cstring",Pseudo Cstring)->     ,("record",Pseudo Record)->     ,("trigger",Pseudo Trigger)->     ,("void",Pseudo Void)->     ,("_cstring",ArrayType $ Pseudo Cstring)->     ,("_record",ArrayType $ Pseudo Record)->     --,Pseudo Internal->     --,Pseudo LanguageHandler->     --,Pseudo Opaque->     ]--================================================================================--= getOperatorType--used by the pretty printer, not sure this is a very good design--for now, assume that all the overloaded operators that have the-same name are all either binary, prefix or postfix, otherwise the-getoperatortype would need the types of the arguments to determine-the operator type, and the parser would have to be a lot cleverer-although, parsec handles - being unary and binary without breaking-a sweat, so maybe this isn't too difficult?--this is why binary @ operator isn't currently supported--> data OperatorType = BinaryOp | PrefixOp | PostfixOp->                   deriving (Eq,Show)--> getOperatorType :: Environment -> String -> OperatorType-> getOperatorType env s = case () of->                       _ | s `elem` ["!and", "!or","!like"] -> BinaryOp->                         | s `elem` ["!not"] -> PrefixOp->                         | s `elem` ["!isNull", "!isNotNull"] -> PostfixOp->                         | any (\(x,_,_) -> x == s) (envBinaryOperators env) ->->                             BinaryOp->                         | any (\(x,_,_) -> x == s ||->                                            (x=="-" && s=="u-"))->                               (envPrefixOperators env) ->->                             PrefixOp->                         | any (\(x,_,_) -> x == s) (envPostfixOperators env) ->->                             PostfixOp->                         | otherwise ->->                             error $ "don't know flavour of operator " ++ s--> isOperatorName :: String -> Bool-> isOperatorName = any (`elem` "+-*/<>=~!@#%^&|`?")
− Database/HsSqlPpp/AstInternals/EnvironmentReader.lhs
@@ -1,219 +0,0 @@-Copyright 2009 Jake Wheat--This module contains the code to read a set of environment updates-from a database.--The code here hasn't been tidied up since the Environment data type-was heavily changed so it's a bit messy.--> {-# OPTIONS_HADDOCK hide  #-}--> module Database.HsSqlPpp.AstInternals.EnvironmentReader->     (readEnvironmentFromDatabase) where--> import qualified Data.Map as M-> import Data.Maybe-> import Control.Applicative--> import Database.HsSqlPpp.Dbms.DBAccess-> import Database.HsSqlPpp.AstInternals.TypeType-> import Database.HsSqlPpp.Utils-> import Database.HsSqlPpp.AstInternals.EnvironmentInternal--> -- | Creates an 'EnvironmentUpdate' list by reading the database given.-> -- To create an Environment value from this, use-> ---> -- @-> -- env <- readEnvironmentFromDatabase 'something'-> -- let newEnv = updateEnvironment defaultEnvironment env-> -- @-> readEnvironmentFromDatabase :: String -- ^ name of the database to read->                             -> IO [EnvironmentUpdate]-> readEnvironmentFromDatabase dbName = withConn ("dbname=" ++ dbName) $ \conn -> do->    typeInfo <- selectRelation conn->                  "select t.oid as oid,\n\->                  \       t.typtype,\n\->                  \       t.typname,\n\->                  \       t.typarray,\n\->                  \       coalesce(e.typtype,'0') as atyptype,\n\->                  \       e.oid as aoid,\n\->                  \       e.typname as atypname\n\->                  \  from pg_catalog.pg_type t\n\->                  \  left outer join pg_type e\n\->                  \    on t.typarray = e.oid\n\->                  \  where pg_catalog.pg_type_is_visible(t.oid)\n\->                  \   and not exists(select 1 from pg_catalog.pg_type el\n\->                  \                       where el.typarray = t.oid)\n\->                  \  order by t.typname;" []->    let typeStuff = concatMap convTypeInfoRow typeInfo->        typeAssoc = map (\(a,b,_) -> (a,b)) typeStuff->        typeMap = M.fromList typeAssoc->    cts <- map (\(nm:cat:pref:[]) ->->                EnvCreateScalar (ScalarType nm) cat ( read pref :: Bool)) <$>->           selectRelation conn->                        "select t.typname,typcategory,typispreferred\n\->                        \from pg_type t\n\->                        \where t.typarray<>0 and\n\->                        \    typtype='b' and\n\->                        \    pg_catalog.pg_type_is_visible(t.oid);" []->    domainDefInfo <- selectRelation conn->                       "select oid, typbasetype\n\->                       \from pg_type where typtype = 'd'\n\->                       \     and  pg_catalog.pg_type_is_visible(oid);" []->    let jlt k = fromJust $ M.lookup k typeMap->    let domainDefs = map (\l -> (jlt (l!!0),  jlt (l!!1))) domainDefInfo->    --let domainCasts = map (\(t,b) ->(t,b,ImplicitCastContext)) domainDefs->    castInfo <- selectRelation conn->                  "select castsource,casttarget,castcontext from pg_cast;" []->    let casts = {- domainCasts ++ -}  flip map castInfo->                  (\l -> (jlt (l!!0), jlt (l!!1),->                          case (l!!2) of->                                      "a" -> AssignmentCastContext->                                      "i" -> ImplicitCastContext->                                      "e" -> ExplicitCastContext->                                      _ -> error $ "internal error: unknown cast context " ++ (l!!2)))->    operatorInfo <- selectRelation conn->                        "select oprname,\n\->                        \       oprleft,\n\->                        \       oprright,\n\->                        \       oprresult\n\->                        \from pg_operator\n\->                        \      where not (oprleft <> 0 and oprright <> 0\n\->                        \         and oprname = '@') --hack for now\n\->                        \      order by oprname;" []->    let getOps a b c [] = (a,b,c)->        getOps pref post bin (l:ls) =->          let bit = (\a -> (l!!0, a, jlt(l!!3)))->          in case () of->                   _ | l!!1 == "0" -> getOps (bit [jlt (l!!2)]:pref) post bin ls->                     | l!!2 == "0" -> getOps pref (bit [jlt (l!!1)]:post) bin ls->                     | otherwise -> getOps pref post (bit [jlt (l!!1), jlt (l!!2)]:bin) ls->    let (prefixOps, postfixOps, binaryOps) = getOps [] [] [] operatorInfo->    functionInfo <- selectRelation conn->                       "select proname,\n\->                       \       array_to_string(proargtypes,','),\n\->                       \       proretset,\n\->                       \       prorettype\n\->                       \from pg_proc\n\->                       \where pg_catalog.pg_function_is_visible(pg_proc.oid)\n\->                       \      and provariadic = 0\n\->                       \      and not proisagg\n\->                       \      and not proiswindow\n\->                       \order by proname,proargtypes;" []->    let fnProts = map (convFnRow jlt) functionInfo-->    aggregateInfo <- selectRelation conn->                       "select proname,\n\->                       \       array_to_string(proargtypes,','),\n\->                       \       proretset,\n\->                       \       prorettype\n\->                       \from pg_proc\n\->                       \where pg_catalog.pg_function_is_visible(pg_proc.oid)\n\->                       \      and provariadic = 0\n\->                       \      and proisagg\n\->                       \order by proname,proargtypes;" []->    let aggProts = map (convFnRow jlt) aggregateInfo-->    comps <- map (\(kind:nm:atts:sysatts:[]) ->->              case kind of->                "c" -> EnvCreateComposite nm (convertAttString jlt atts)->                "r" -> EnvCreateTable nm (convertAttString jlt atts) (convertAttString jlt sysatts)->                "v" -> EnvCreateView nm (convertAttString jlt atts)->                _ -> error $ "unrecognised relkind: " ++ kind) <$>->                 selectRelation conn->                   "with att1 as (\n\->                   \ select\n\->                   \     attrelid,\n\->                   \     attname,\n\->                   \     attnum,\n\->                   \     atttypid\n\->                   \   from pg_attribute\n\->                   \   inner join pg_class cls\n\->                   \      on cls.oid = attrelid\n\->                   \   where pg_catalog.pg_table_is_visible(cls.oid)\n\->                   \      and cls.relkind in ('r','v','c')\n\->                   \      and not attisdropped),\n\->                   \ sysAtt as (\n\->                   \ select attrelid,\n\->                   \     array_to_string(\n\->                   \       array_agg(attname || ';' || atttypid)\n\->                   \         over (partition by attrelid order by attnum\n\->                   \               range between unbounded preceding\n\->                   \               and unbounded following)\n\->                   \       ,',') as sysAtts\n\->                   \   from att1\n\->                   \   where attnum < 0),\n\->                   \ att as (\n\->                   \ select attrelid,\n\->                   \     array_to_string(\n\->                   \       array_agg(attname || ';' || atttypid)\n\->                   \          over (partition by attrelid order by attnum\n\->                   \                range between unbounded preceding\n\->                   \                and unbounded following)\n\->                   \       ,',') as atts\n\->                   \   from att1\n\->                   \   where attnum > 0)\n\->                   \ select distinct\n\->                   \     cls.relkind,\n\->                   \     cls.relname,\n\->                   \     atts,\n\->                   \     coalesce(sysAtts,'')\n\->                   \   from att left outer join sysAtt using (attrelid)\n\->                   \   inner join pg_class cls\n\->                   \     on cls.oid = attrelid\n\->                   \   order by relkind,relname;" []--->    return $ concat [->                cts->               ,map (uncurry EnvCreateDomain) domainDefs->               ,map (\(a,b,c) -> EnvCreateCast a b c) casts->               ,map (\(a,b,c) -> EnvCreateFunction FunPrefix a b c) prefixOps->               ,map (\(a,b,c) -> EnvCreateFunction FunPostfix a b c) postfixOps->               ,map (\(a,b,c) -> EnvCreateFunction FunBinary a b c) binaryOps->               ,map (\(a,b,c) -> EnvCreateFunction FunName a b c) fnProts->               ,map (\(a,b,c) -> EnvCreateFunction FunAgg a b c) aggProts->               ,comps]->    where->      convertAttString jlt s =->          let ps = split ',' s->              ps1 = map (split ';') ps->          in map (\pl -> (head pl, jlt (pl!!1))) ps1->      convFnRow jlt l =->         (head l,fnArgs,fnRet)->         where->           fnRet = let rt1 = jlt (l!!3)->                   in if read (l!!2)::Bool->                        then SetOfType rt1->                        else rt1->           fnArgs = if (l!!1) == ""->                      then []->                      else let a = split ',' (l!!1)->                           in map jlt a->      convTypeInfoRow l =->        let name = (l!!2)->            ctor = case (l!!1) of->                     "b" -> ScalarType->                     "c" -> CompositeType->                     "d" -> DomainType->                     "e" -> EnumType->                     "p" -> (\t -> Pseudo (case t of->                                                  "any" -> Any->                                                  "anyarray" -> AnyArray->                                                  "anyelement" -> AnyElement->                                                  "anyenum" -> AnyEnum->                                                  "anynonarray" -> AnyNonArray->                                                  "cstring" -> Cstring->                                                  "internal" -> Internal->                                                  "language_handler" -> LanguageHandler->                                                  "opaque" -> Opaque->                                                  "record" -> Record->                                                  "trigger" -> Trigger->                                                  "void" -> Void->                                                  _ -> error $ "internal error: unknown pseudo " ++ t))->                     _ -> error $ "internal error: unknown type type: " ++ (l !! 1)->            scType = (head l, ctor name, name)->        in if (l!!4) /= "0"->           then [(l!!5,ArrayType $ ctor name, '_':name), scType]->           else [scType]-
− Database/HsSqlPpp/AstInternals/TypeChecking.ag
@@ -1,1139 +0,0 @@-{--Copyright 2009 Jake Wheat--This file contains the attr and sem definitions, which do the type-checking, etc..--A lot of the haskell code has been moved into other files:-TypeCheckingH, AstUtils.lhs, it is intended that only small amounts of-code appear (i.e. one-liners) inline in this file, and larger bits go-in AstUtils.lhs. These are only divided because the attribute grammar-system uses a custom syntax with a custom preprocessor. These-guidelines aren't followed very well.--The current type checking approach doesn't quite match how SQL-works. The main problem is that you can e.g. exec create table-statements inside a function. This is something that the type checker-will probably not be able to deal for a while if ever. (Will need-hooks into postgresql to do this properly, which might not be-impossible...).--Once most of the type checking is working, all the code and-documentation will be overhauled quite a lot. Alternatively put, this-code is in need of better documentation and organisation, and serious-refactoring.--An unholy mixture of Maybe, Either, Either/Error Monad and TypeCheckFailed-is used to do error handling.--One of the common patterns is when type checking a node:--first check any types of subnodes which it depends on, if any are-typecheckfailed, then this node's type is typecheckfailed and we stop-there.--otherwise, calculate the type of this node, or get an error if there-is a problem, this is put into loc.tpe which is Either TypeError-Type. Then some common code takes this value and sets the node type to-the type or typecheckfailed if tpe is left, and if it is left add a-type error annotation also.--================================================================================--= main attributes used--Here are the main attributes used in the type checking:--env is used to chain the environments up and down the tree, to allow-access to the catalog information, and to store the in environment-identifier names and types e.g. inside a select expression.--annotatedTree is used to create a copy of the ast with the type,-etc. annotations.---}-ATTR AllNodes Root ExpressionRoot-  [ env : Environment || annotatedTree : SELF]--ATTR StatementList Root-  [|| producedEnv : Environment]--{--================================================================================--= expressions---}--{-annTypesAndErrors :: Data a => a -> Type -> [TypeError]-                  -> Maybe [AnnotationElement] -> a-annTypesAndErrors item nt errs add =-    updateAnnotation modifier item-    where-      modifier = (([TypeAnnotation nt] ++ fromMaybe [] add ++-       map TypeErrorA errs) ++)--}--SEM Expression-    | IntegerLit StringLit FloatLit BooleanLit NullLit FunCall Identifier-      Exists Case CaseSimple Cast InPredicate ScalarSubQuery-      --PositionalArg WindowFn-        lhs.annotatedTree = annTypesAndErrors @loc.backTree-                              (errorToTypeFail @loc.tpe)-                              (getErrors @loc.tpe)-                              Nothing--{--== literals--}--SEM Expression-    | IntegerLit-        loc.backTree = IntegerLit @ann @i-    | StringLit-        loc.backTree = StringLit @ann @quote @value-    | FloatLit-        loc.backTree = FloatLit @ann @d-    | BooleanLit-        loc.backTree = BooleanLit @ann @b-    | NullLit-        loc.backTree = NullLit @ann--SEM Expression-     | IntegerLit loc.tpe = Right typeInt-     | StringLit loc.tpe = Right UnknownStringLit-     | FloatLit loc.tpe = Right typeNumeric-     | BooleanLit loc.tpe = Right typeBool-     -- I think a null has the same type resolution as an unknown string lit-     | NullLit loc.tpe = Right UnknownStringLit---{---== cast expression---}--SEM Expression-    | Cast loc.tpe = Right $ @tn.namedType-           loc.backTree = Cast @ann @expr.annotatedTree @tn.annotatedTree--{---== type names--Types with type modifiers (called PrecTypeName here, to be changed),-are not supported at the moment.---}--ATTR TypeName [||namedType : Type]--SEM TypeName-     | SimpleTypeName ArrayTypeName SetOfTypeName PrecTypeName-         lhs.namedType = errorToTypeFail @loc.tpe-         lhs.annotatedTree = updateAnnotation-                               ((map TypeErrorA $ getErrors @loc.tpe) ++)-                               @loc.backTree---SEM TypeName-     | SimpleTypeName-        loc.tpe = envLookupType @lhs.env $ canonicalizeTypeName @tn-        loc.backTree = SimpleTypeName @ann @tn-     | ArrayTypeName-        loc.tpe = chainTypeCheckFailed [@typ.namedType] $ Right $ ArrayType @typ.namedType-        loc.backTree = ArrayTypeName @ann @typ.annotatedTree-     | SetOfTypeName-        loc.tpe = chainTypeCheckFailed [@typ.namedType] $ Right $ SetOfType @typ.namedType-        loc.backTree = SetOfTypeName @ann @typ.annotatedTree-     | PrecTypeName-        loc.tpe = Right TypeCheckFailed-        loc.backTree = PrecTypeName @ann @tn @prec--{--== operators and functions--}-SEM Expression-    | FunCall-        loc.tpe = chainTypeCheckFailed @args.typeList $-                    typeCheckFunCall-                      @lhs.env-                      @funName-                      @args.typeList-        loc.backTree = FunCall @ann @funName @args.annotatedTree--{--== case expression--for non simple cases, we need all the when expressions to be bool, and-then to collect the types of the then parts to see if we can resolve a-common type--for simple cases, we need to check all the when parts have the same type-as the value to check against, then we collect the then parts as above.---}--SEM Expression-    | Case CaseSimple-        loc.whenTypes = map getTypeAnnotation $ concatMap fst $-                        @cases.annotatedTree-        loc.thenTypes = map getTypeAnnotation $-                            (map snd $ @cases.annotatedTree) ++-                              maybeToList @els.annotatedTree--SEM Expression-    | Case-        loc.tpe =-            chainTypeCheckFailed @loc.whenTypes $ do-               when (any (/= typeBool) @loc.whenTypes) $-                 Left [WrongTypes typeBool @loc.whenTypes]-               chainTypeCheckFailed @loc.thenTypes $-                        resolveResultSetType-                          @lhs.env-                          @loc.thenTypes-        loc.backTree = Case @ann @cases.annotatedTree @els.annotatedTree---SEM Expression-    | CaseSimple-        loc.tpe =-          chainTypeCheckFailed @loc.whenTypes $ do-          checkWhenTypes <- resolveResultSetType-                                 @lhs.env-                                 (getTypeAnnotation @value.annotatedTree: @loc.whenTypes)-          chainTypeCheckFailed @loc.thenTypes $-                     resolveResultSetType-                              @lhs.env-                              @loc.thenTypes-        loc.backTree = CaseSimple @ann @value.annotatedTree @cases.annotatedTree @els.annotatedTree--{--== identifiers-pull id types out of env for identifiers---}--SEM Expression-    | Identifier-        loc.tpe = let (correlationName,iden) = splitIdentifier @i-                  in envLookupID @lhs.env correlationName iden-        loc.backTree = Identifier @ann @i--SEM Expression-    | Exists-        loc.tpe = Right typeBool-        loc.backTree = Exists @ann @sel.annotatedTree---{--== scalar subquery-1 col -> type of that col-2 + cols -> row type--}--SEM Expression-    | ScalarSubQuery-        loc.tpe = let selType = getTypeAnnotation @sel.annotatedTree-                  in chainTypeCheckFailed [selType]-                       $ do-                         f <- map snd <$> unwrapSetOfComposite selType-                         case length f of-                              0 -> Left [InternalError "no columns in scalar subquery?"]-                              1 -> Right $ head f-                              _ -> Right $ RowCtor f--        loc.backTree = ScalarSubQuery @ann @sel.annotatedTree-{--== inlist--}--SEM Expression-    | InPredicate-        loc.tpe = do-                    lt <- @list.listType-                    ty <- resolveResultSetType-                            @lhs.env-                            [getTypeAnnotation @expr.annotatedTree, lt]-                    return typeBool-        loc.backTree = InPredicate @ann @expr.annotatedTree @i @list.annotatedTree---ATTR InList [||listType : {Either [TypeError] Type}]--SEM InList-    | InList-        lhs.listType = resolveResultSetType-                         @lhs.env-                         @exprs.typeList-    | InSelect-        lhs.listType =-            do-              attrs <-  map snd <$> (unwrapSetOfComposite $-                          let a = getTypeAnnotation @sel.annotatedTree-                          in {-trace ("attrs is: " ++ show a) $-} a)-              typ <- case length attrs of-                           0 -> Left [InternalError "got subquery with no columns? in inselect"]-                           1 -> Right $ head attrs-                           _ -> Right $ RowCtor attrs-              chainTypeCheckFailed attrs $ Right typ----ATTR ExpressionList [||typeList : {[Type]}]--SEM ExpressionList-    | Cons lhs.typeList = getTypeAnnotation @hd.annotatedTree : @tl.typeList-    | Nil lhs.typeList = []---ATTR ExpressionListList  [||typeListList : {[[Type]]}]--SEM ExpressionListList-    | Cons lhs.typeListList = @hd.typeList : @tl.typeListList-    | Nil lhs.typeListList = []---{--================================================================================--= statements---}--SEM Statement-    | SelectStatement Insert Update Delete CreateView CreateDomain-      CreateFunction CreateType CreateTable Return-        lhs.annotatedTree = annTypesAndErrors @loc.backTree-                              (errorToTypeFail @loc.tpe)-                              (getErrors @loc.tpe)-                              $ Just (map StatementInfoA @loc.statementInfo ++-                                      [EnvUpdates @loc.envUpdates])-        lhs.envUpdates = @loc.envUpdates--ATTR Statement [||envUpdates : {[EnvironmentUpdate]}]--SEM Statement-    | Assignment CaseStatement ContinueStatement Copy CopyData DropFunction-      DropSomething Execute ExecuteInto ForIntegerStatement ForSelectStatement-      If NullStatement Perform Raise ReturnNext ReturnQuery Truncate-      WhileStatement-        lhs.envUpdates = []---ATTR StatementList [ envUpdates : {[EnvironmentUpdate]}||]--SEM Root-    | Root statements.envUpdates = []--SEM StatementList-    | Cons-        loc.newEnv = fromRight @lhs.env $ updateEnvironment @lhs.env @lhs.envUpdates-        hd.env = @loc.newEnv-        tl.env = @loc.newEnv-        lhs.producedEnv = case @tl.annotatedTree of-                           [] -> @loc.newEnv-                           _ -> @tl.producedEnv-        tl.envUpdates = @hd.envUpdates-    | Nil-        lhs.producedEnv = emptyEnvironment---SEM ExpressionListStatementListPair-    | Tuple x2.envUpdates = []-SEM ExpressionStatementListPair-    | Tuple x2.envUpdates = []-SEM FnBody-    | PlpgsqlFnBody SqlFnBody sts.envUpdates = []-SEM Statement-    | CaseStatement If els.envUpdates = []-SEM Statement-    | ForIntegerStatement ForSelectStatement WhileStatement-         sts.envUpdates = []--{---================================================================================--= basic select statements--This is a bit of a mess, will be rewritten with a proper literate-flavour once all the different bits are type checking ok, which should-make it much more readable.---}--SEM Statement-    | SelectStatement-        loc.tpe = chainTypeCheckFailed [getTypeAnnotation @ex.annotatedTree] $ Right $ Pseudo Void-        loc.statementInfo = [SelectInfo $ getTypeAnnotation @ex.annotatedTree]-        loc.backTree = SelectStatement @ann @ex.annotatedTree-        loc.envUpdates = []---SEM SelectExpression-    | Values Select CombineSelect-        lhs.annotatedTree = annTypesAndErrors @loc.backTree-                              (errorToTypeFail @loc.tpe)-                              (getErrors @loc.tpe)-                              Nothing--SEM SelectExpression-    | Values-        loc.tpe = typeCheckValuesExpr-                              @lhs.env-                              @vll.typeListList-        loc.backTree = Values @ann @vll.annotatedTree-    | Select-        loc.tpe =-           do-           let trefType = let ts = @selTref.annotatedTree-                          in case null ts of-                               True -> typeBool-                               _ -> getTypeAnnotation $ head ts-                          {-fromMaybe typeBool $ fmap getTypeAnnotation-                                                    @selTref.annotatedTree-}-               slType = @selSelectList.listType-           chainTypeCheckFailed [trefType, slType] $-             Right $ case slType of-                       UnnamedCompositeType [(_,Pseudo Void)] -> Pseudo Void-                       _ -> SetOfType slType-        loc.backTree = Select @ann-                              @selDistinct.annotatedTree-                              @selSelectList.annotatedTree-                              @selTref.annotatedTree-                              @selWhere.annotatedTree-                              @selGroupBy.annotatedTree-                              @selHaving.annotatedTree-                              @selOrderBy.annotatedTree-                              @selLimit.annotatedTree-                              @selOffset.annotatedTree-    | CombineSelect-        loc.tpe =-          let sel1t = getTypeAnnotation @sel1.annotatedTree-              sel2t = getTypeAnnotation @sel2.annotatedTree-          in chainTypeCheckFailed [sel1t, sel2t] $-                typeCheckCombineSelect @lhs.env sel1t sel2t-        loc.backTree = CombineSelect @ann @ctype.annotatedTree-                                     @sel1.annotatedTree-                                     @sel2.annotatedTree--{-getTbCols c = unwrapSetOfComposite (getTypeAnnotation c)-}--ATTR TableRef TableRefList [||idens : {[(String,([(String,Type)],[(String,Type)]))]}-                               joinIdens : {[String]} ]--SEM TableRef-    | SubTref TrefAlias Tref TrefFun TrefFunAlias JoinedTref-        lhs.annotatedTree = annTypesAndErrors @loc.backTree-                              (errorToTypeFail @loc.tpe)-                              (getErrors @loc.tpe)-                              Nothing---- one of the main hairy bits of code which needs a serious refactor:-SEM TableRef-    | SubTref loc.tpe = chainTypeCheckFailed [getTypeAnnotation @sel.annotatedTree] <$>-                        unwrapSetOfWhenComposite $ getTypeAnnotation @sel.annotatedTree-              loc.backTree = SubTref @ann @sel.annotatedTree @alias-              lhs.idens = [(@alias, (fromRight [] $ getTbCols @sel.annotatedTree, []))]-              lhs.joinIdens = []-    | TrefAlias Tref-        loc.tpe = either Left (Right . fst) @loc.relType-        lhs.joinIdens = []-        loc.relType = getRelationType @lhs.env @tbl-        loc.unwrappedRelType =-            fromRight ([],[]) $-            do-              lrt <- @loc.relType-              let (UnnamedCompositeType a,UnnamedCompositeType b) = lrt-              return (a,b)-    | Tref-        lhs.idens = [(@tbl, @loc.unwrappedRelType)]-        loc.backTree = Tref @ann @tbl-    | TrefAlias-        lhs.idens = [(@alias, @loc.unwrappedRelType)]-        loc.backTree = TrefAlias @ann @tbl @alias-    | TrefFun TrefFunAlias-        loc.tpe = getFnType @lhs.env @loc.alias1 @fn.annotatedTree-        lhs.joinIdens = []-        lhs.idens = case getFunIdens-                              @lhs.env @loc.alias1-                              @fn.annotatedTree of-                      Right (s, UnnamedCompositeType c) -> [(s,(c,[]))]-                      _ -> []-    | TrefFun-        loc.alias1 = ""-        loc.backTree = TrefFun @ann @fn.annotatedTree-    | TrefFunAlias-        loc.alias1 = @alias-        loc.backTree = TrefFunAlias @ann @fn.annotatedTree @alias-    | JoinedTref-        loc.tpe =-            chainTypeCheckFailed [tblt-                      ,tbl1t] $-               case (@nat.annotatedTree, @onExpr.annotatedTree) of-                      (Natural, _) -> unionJoinList $-                                      commonFieldNames tblt tbl1t-                      (_,Just (JoinUsing _ s)) -> unionJoinList s-                      _ -> unionJoinList []-            where-              tblt = getTypeAnnotation @tbl.annotatedTree-              tbl1t = getTypeAnnotation @tbl1.annotatedTree-              unionJoinList s =-                  combineTableTypesWithUsingList @lhs.env s tblt tbl1t-        lhs.idens = @tbl.idens ++ @tbl1.idens-        lhs.joinIdens = commonFieldNames (getTypeAnnotation @tbl.annotatedTree)-                                         (getTypeAnnotation @tbl1.annotatedTree)-        loc.backTree = JoinedTref @ann-                                  @tbl.annotatedTree-                                  @nat.annotatedTree-                                  @joinType.annotatedTree-                                  @tbl1.annotatedTree-                                  @onExpr.annotatedTree--{--getFnType :: Environment -> String -> Expression -> Either [TypeError] Type-getFnType env alias =-    either Left (Right . snd) . getFunIdens env alias--getFunIdens :: Environment -> String -> Expression -> Either [TypeError] (String,Type)-getFunIdens env alias fnVal =-   case fnVal of-       FunCall _ f _ ->-           let correlationName = if alias /= ""-                                   then alias-                                   else f-           in Right (correlationName, case getTypeAnnotation fnVal of-                SetOfType (CompositeType t) -> getCompositeType t-                SetOfType x -> UnnamedCompositeType [(correlationName,x)]-                y -> UnnamedCompositeType [(correlationName,y)])-       x -> Left [ContextError "FunCall"]-   where-     getCompositeType t =-                    case getAttrs env [Composite-                                      ,TableComposite-                                      ,ViewComposite] t of-                      Just (_,_,a@(UnnamedCompositeType _), _) -> a-                      _ -> UnnamedCompositeType []-}--SEM TableRefList-    | Cons lhs.idens = @hd.idens-           lhs.joinIdens = @hd.joinIdens-    | Nil-        lhs.idens = []-        lhs.joinIdens = []--ATTR SelectItemList SelectList [||listType : Type]--SEM SelectItemList-    | Cons lhs.listType = doSelectItemListTpe @lhs.env @hd.columnName @hd.itemType @tl.listType-    | Nil lhs.listType = UnnamedCompositeType []--ATTR SelectItem [||itemType : Type]--SEM SelectItem-    | SelExp SelectItem-        lhs.itemType = getTypeAnnotation @ex.annotatedTree---- hack to fix up for errors for ok *-SEM SelectItem-    | SelExp-        loc.annotatedTree = SelExp @ann $ fixStar @ex.annotatedTree-    | SelectItem-        loc.backTree = SelectItem @ann (fixStar @ex.annotatedTree) @name--{--fixStar :: Expression -> Expression-fixStar =-    everywhere (mkT fixStar')-    where-      fixStar' :: Annotation -> Annotation-      fixStar' a =-          if TypeAnnotation TypeCheckFailed `elem` a-              && any (\an ->-                       case an of-                         TypeErrorA (UnrecognisedIdentifier x) |-                           let (_,iden) = splitIdentifier x-                           in iden == "*" -> True-                         _ -> False) a-             then filter (\an -> case an of-                                   TypeAnnotation TypeCheckFailed -> False-                                   TypeErrorA (UnrecognisedIdentifier _) -> False-                                   _ -> True) a-             else a-}--SEM SelectList-    | SelectList-        lhs.listType = @items.listType---{---== env passing--env flow:-current simple version:-from tref -> select list-          -> where--(so we take the identifiers and types from the tref part, and send-them into the selectlist and where parts)--full order of identifier passing:-   1. from-   2. where-   3. group by-   4. having-   5. select---}--SEM SelectExpression-    | Select-         loc.newEnv = case updateEnvironment @lhs.env-                            (convertToNewStyleUpdates @selTref.idens @selTref.joinIdens) of-                        Left x -> error $ show x -- @lhs.env-                        Right e -> e-         selSelectList.env = @loc.newEnv-         selWhere.env = @loc.newEnv--{---== attributes--columnName is used to collect the column names that the select list-produces, it is combined into an unnamedcompositetype in-selectitemlist, which is also where star expansion happens.---}--ATTR SelectItem [||columnName : String]--{--if the select item is just an identifier, then that column is named-after the identifier-e.g. select a, b as c, b + c from d, gives three columns one named-a, one named c, and one unnamed, even though only one has an alias-if the select item is a function or aggregate call at the top level,-then it is named after that function or aggregate--if it is a cast, the column is named after the target data type name-iff it is a simple type name---}----default value for non identifier nodes--ATTR Expression [||liftedColumnName USE {`(fixedValue "")`} {""}: String]--{-fixedValue :: a -> a -> a -> a-fixedValue a _ _ = a-}--{--override for identifier nodes, this only makes it out to the selectitem-node if the identifier is not wrapped in parens, function calls, etc.--}--SEM Expression-  | Identifier lhs.liftedColumnName = @i-  | FunCall lhs.liftedColumnName =-      if isOperatorName @funName-         then ""-         else @funName-  | Cast lhs.liftedColumnName = case @tn.annotatedTree of-                                  SimpleTypeName _ tn -> tn-                                  _ -> ""---- collect the aliases and column names for use by the selectitemlist nodes-SEM SelectItem-    | SelExp lhs.columnName = case @ex.liftedColumnName of-                                "" -> "?column?"-                                s -> s-    | SelectItem lhs.columnName = @name---{--================================================================================--= insert---}-{-getCAtts t =-    case t of-      SetOfType (UnnamedCompositeType t) -> t-      _ -> []-}--SEM Statement-    | Insert-        loc.columnStuff =-            checkColumnConsistency @lhs.env-                                   @table-                                   @targetCols.strings-                                   (getCAtts $ getTypeAnnotation @insData.annotatedTree)-        loc.tpe =-            chainTypeCheckFailed [getTypeAnnotation @insData.annotatedTree] $ do-              @loc.columnStuff-              Right $ Pseudo Void-        loc.statementInfo =-            [InsertInfo @table $ errorToTypeFailF UnnamedCompositeType @loc.columnStuff]-        loc.backTree = Insert @ann @table @targetCols.annotatedTree-                              @insData.annotatedTree @returning-        loc.envUpdates = []--ATTR StringList [||strings : {[String]}]--SEM StringList-  | Cons lhs.strings = @hd : @tl.strings-  | Nil lhs.strings = []--{--================================================================================--= update---}--SEM Statement-    | Update-        loc.tpe =-            do-            let re = checkRelationExists @lhs.env @table-            when (isJust re) $-                 Left [fromJust $ re]-            chainTypeCheckFailed (map snd @assigns.pairs) $ do-              @loc.columnsConsistent-              checkErrorList @assigns.rowSetErrors $ Pseudo Void-        loc.columnsConsistent =-            checkColumnConsistency @lhs.env @table (map fst @assigns.pairs) @assigns.pairs-        loc.statementInfo =-            [UpdateInfo @table $ errorToTypeFailF UnnamedCompositeType @loc.columnsConsistent]-        loc.backTree = Update @ann @table @assigns.annotatedTree @whr.annotatedTree @returning-        loc.envUpdates = []--ATTR SetClauseList [||pairs : {[(String,Type)]}-                      rowSetErrors : {[TypeError]}]--SEM SetClauseList-  | Cons lhs.pairs = @hd.pairs ++ @tl.pairs-         lhs.rowSetErrors = maybeToList @hd.rowSetError ++ @tl.rowSetErrors-  | Nil lhs.pairs = []-        lhs.rowSetErrors = []--ATTR SetClause [||pairs : {[(String,Type)]}-                  rowSetError : {Maybe TypeError}]--SEM SetClause-    | SetClause-        lhs.pairs = [(@att, getTypeAnnotation @val.annotatedTree)]-        lhs.rowSetError = Nothing-    | RowSetClause-        loc.rowSetError =-          let atts = @atts.strings-              types = getRowTypes @vals.typeList-          in if length atts /= length types-               then Just WrongNumberOfColumns-               else Nothing-        lhs.pairs = zip @atts.strings $ getRowTypes @vals.typeList--{-getRowTypes :: [Type] -> [Type]-getRowTypes [RowCtor ts] = ts-getRowTypes ts = ts-}--{--================================================================================--= delete--}--SEM Statement-    | Delete-        loc.tpe =-            case checkRelationExists @lhs.env @table of-              Just e -> Left [e]-              Nothing -> Right $ Pseudo Void-        loc.statementInfo = [DeleteInfo @table]-        loc.backTree = Delete @ann @table @whr.annotatedTree @returning-        loc.envUpdates = []--{--================================================================================--= create table--env needs to be modified:-types, typenames, typecats, attrdefs, systemcolumns--produces a compositedef: (name, tablecomposite, unnamedcomp [(attrname, type)])---}-ATTR AttributeDef [||attrName : String-                     namedType : Type]--SEM AttributeDef-    | AttributeDef-      lhs.attrName = @name-      lhs.namedType = @typ.namedType--ATTR AttributeDefList [||attrs : {[(String, Type)]}]--SEM AttributeDefList-    | Cons lhs.attrs = (@hd.attrName, @hd.namedType) : @tl.attrs-    | Nil lhs.attrs = []--SEM Statement-    | CreateTable-        loc.attrTypes = map snd @atts.attrs-        loc.tpe = Right $ Pseudo Void-        loc.backTree = CreateTable @ann @name @atts.annotatedTree @cons.annotatedTree-        loc.statementInfo = []-        loc.envUpdates = [EnvCreateTable @name @atts.attrs []]--SEM Statement-    | CreateTableAs-        loc.selType = getTypeAnnotation @expr.annotatedTree-        loc.tpe = Right @loc.selType-        loc.backTree = CreateTableAs @ann @name @expr.annotatedTree-        loc.statementInfo = []-        loc.attrs = case @loc.selType of-                      UnnamedCompositeType c -> c-                      _-> []-        loc.envUpdates = [EnvCreateTable @name @loc.attrs []]-{--================================================================================--= create view---}--SEM Statement-    | CreateView-        loc.tpe = chainTypeCheckFailed [getTypeAnnotation @expr.annotatedTree] $ Right $ Pseudo Void-        loc.backTree = CreateView @ann @name @expr.annotatedTree-        loc.statementInfo = []-        loc.attrs = case getTypeAnnotation @expr.annotatedTree of-                      SetOfType (UnnamedCompositeType c) -> c-                      _ -> []-        loc.envUpdates = [EnvCreateView @name @loc.attrs]----{--================================================================================--= create type---}-ATTR TypeAttributeDef [||attrName : String-                            namedType : Type]--SEM TypeAttributeDef-    | TypeAttDef-        lhs.attrName = @name-        lhs.namedType = @typ.namedType--ATTR TypeAttributeDefList [||attrs : {[(String, Type)]}]--SEM TypeAttributeDefList-    | Cons lhs.attrs = (@hd.attrName, @hd.namedType) : @tl.attrs-    | Nil lhs.attrs = []--SEM Statement-    | CreateType-        loc.tpe = Right $ Pseudo Void-        loc.backTree = CreateType @ann @name @atts.annotatedTree-        loc.statementInfo = []-        loc.envUpdates = [EnvCreateComposite @name @atts.attrs]--{---================================================================================--= create domain---}--SEM Statement-    | CreateDomain-        loc.tpe = Right $ Pseudo Void-        loc.backTree = CreateDomain @ann @name @typ.annotatedTree @check.annotatedTree-        loc.statementInfo = []-        loc.envUpdates = [EnvCreateDomain (ScalarType @name) @typ.namedType]-{--================================================================================--= create function--get the signature, does some checking of the body, still a bit limited--ISSUE:--when writing an sql file, you can put a create function which refers-to a table definition that is given later. As long as the function-isn't called before the table definition is given, this is ok. To-handle this, need to gather the function prototype, but delay checking-the contents until either a) all the other type checking has been-done, or b) the function is needed (list ways this can happen: used in-a view (even then, not needed until view is used), function can be-called directly, or indirectly in another function call, ...)--No thoughts on how to do this - but at some point want to support-'declarative' sql source code, where the order doesn't matter, and-this code figures out an order to load it into the database which will-get past pgs checks, so hopefully the solution will move towards this-goal also. One additional consideration is that the error message in a-situation like this would be really helpful if it could tell that a-problem like this could be fixed with a reordering, and suggest that-reordering.---}--ATTR ParamDef [||paramName : String]--ATTR ParamDefList [||params : {[(String, Type)]}]--ATTR ParamDef [||namedType : Type]--SEM ParamDef-    | ParamDef ParamDefTp-        lhs.namedType = @typ.namedType-    | ParamDef-        lhs.paramName = @name-    | ParamDefTp-        lhs.paramName = ""--SEM ParamDefList-     | Nil lhs.params = []-     | Cons lhs.params = ((@hd.paramName, @hd.namedType) : @tl.params)--SEM Statement-    | CreateFunction-        loc.tpe = Right $ Pseudo Void-        loc.backTree = CreateFunction @ann-                                      @lang.annotatedTree-                                      @name-                                      @params.annotatedTree-                                      @rettype.annotatedTree-                                      @bodyQuote-                                      @body.annotatedTree-                                      @vol.annotatedTree-        loc.statementInfo = []-        loc.envUpdates = [EnvCreateFunction FunName @name (map snd @params.params) @rettype.namedType]-        --add the parameters to the environment for the contained statements-        body.env = fromRight @lhs.env $-                   updateEnvironment @lhs.env [EnvStackIDs [("", @params.params)-                                                           ,(@name, @params.params)]]--SEM FnBody-    | PlpgsqlFnBody-        sts.env = fromRight @lhs.env $ updateEnvironment @lhs.env [EnvStackIDs [("", @vars.defs)]]--ATTR VarDef [||def : {(String,Type)}]--ATTR VarDefList [||defs : {[(String,Type)]}]--SEM VarDef-    | VarDef lhs.def = (@name, @typ.namedType)--SEM VarDefList-    | Cons lhs.defs = @hd.def : @tl.defs-    | Nil lhs.defs = []--{--================================================================================--= statement common components---}--SEM MaybeBoolExpression-    | Just-        lhs.annotatedTree =-          if getTypeAnnotation @just.annotatedTree `notElem` [typeBool, TypeCheckFailed]-            then Just $ updateAnnotation ((TypeErrorA ExpressionMustBeBool) :)-                          @just.annotatedTree-            else Just $ @just.annotatedTree--ATTR MaybeExpression [||exprType : {Maybe Type}]--SEM MaybeExpression-    | Just lhs.exprType = Just $ getTypeAnnotation @just.annotatedTree-    | Nothing lhs.exprType = Nothing----{---================================================================================--= plpgsql statements---}--SEM Statement-    | Return-        loc.tpe = chainTypeCheckFailed [fromMaybe typeBool @value.exprType] $ Right $ Pseudo Void-        loc.backTree = Return @ann @value.annotatedTree-        loc.envUpdates = []-        loc.statementInfo = []--{---================================================================================--= static tests--Try to use a list of message data types to hold all sorts of-information which works its way out to the top level where the client-code gets it. Want to have the lists concatenated together-automatically from subnodes to parent node, and then to be able to add-extra messages to this list at each node also.--Problem 1: can't have two sem statements for the same node type which-both add messages, and then the messages get combined to provide the-final message list attribute value for that node. You want this so-that e.g. that different sorts of checks appear in different-sections. Workaround is instead of having each check in it's own-section, to combine them all into one SEM.--Problem 2: no shorthand to combine what the default rule for messages-would be and then add a bit extra - so if you want all the children-messages, plus possibly an extra message or two, have to write out the-default rule in full explicitly. Can get round this by writing out-loads of code.--Both the workarounds to these seem a bit tedious and error prone, and-will make the code much less readable. Maybe need a preprocessor to-produce the ag file? Alternatively, just attach the messages to each-node (so this appears in the data types and isn't an attribute, then-have a tree walker collect them all). Since an annotation field in-each node is going to be added anyway, so each node can be labelled-with a type, will probably do this at some point.--================================================================================--= inloop testing--inloop - use to check continue, exit, and other commands that can only-appear inside loops (for, while, loop)--the only nodes that really need this attribute are the ones which can-contain statements--The inloop test is the only thing which uses the messages atm. It-shouldn't, at some point inloop testing will become part of the type-checking.--This is just some example code, will probably do something a lot more-heavy weight like symbolic interpretation - want to do all sorts of-loop, return, nullability, etc. analysis.---}-{--ATTR AllNodes Root ExpressionRoot [||messages USE {++} {[]} : {[Message]}]--ATTR AllNodes-  [ inLoop: Bool||]--SEM Root-  | Root statements.inLoop = False--SEM ExpressionRoot-  | ExpressionRoot expr.inLoop = False---- set the inloop stuff which nests, it's reset inside a create--- function statement, in case you have a create function inside a--- loop, seems unlikely you'd do this though--SEM Statement-     | ForSelectStatement ForIntegerStatement WhileStatement sts.inLoop = True-     | CreateFunction body.inLoop = False---- now we can check when we hit a continue statement if it is in the--- right context-SEM Statement-    | ContinueStatement  lhs.messages = if not @lhs.inLoop-                                          then [Error ContinueNotInLoop]-                                          else []--}-{--================================================================================--= notes and todo---containment guide for select expressions:-combineselect 2 selects-insert ?select-createtableas 1 select-createview 1 select-return query 1 select-forselect 1 select-select->subselect select-expression->exists select-            scalarsubquery select-            inselect select--containment guide for statements:-forselect [statement]-forinteger [statement]-while [statement]-casestatement [[statement]]-if [[statement]]-createfunction->fnbody [Statement]--TODO--some non type-check checks:-check plpgsql only in plpgsql function-orderby in top level select only-copy followed immediately by copydata iff stdin, copydata only follows-  copy from stdin-count args to raise, etc., check same number as placeholders in string-no natural with onexpr in joins-typename -> setof (& fix parsing), what else like this?-expressions: positionalarg in function, window function only in select- list top level--review all ast checks, and see if we can also catch them during-parsing (e.g. typeName parses setof, but this should only be allowed-for a function return, and we can make this a parse error when parsing-from source code rather than checking a generated ast. This needs-judgement to say whether a parse error is better than a check error, I-think for setof it is, but e.g. for a continue not in a loop (which-could be caught during parsing) works better as a check error, looking-at the error message the user will get. This might be wrong, haven't-thought too carefully about it yet).---TODO: canonicalize ast process, as part of type checking produces a-canonicalized ast which:-all implicit casts appear explicitly in the ast (maybe distinguished-from explicit casts?)-all names fully qualified-all types use canonical names-literal values and selectors in one form (use row style?)-nodes are tagged with types-what else?--Canonical form only defined for type consistent asts.--This canonical form should pretty print and parse back to the same-form, and type check correctly.----}
+ Database/HsSqlPpp/AstInternals/TypeChecking/CreateFunction.ag view
@@ -0,0 +1,135 @@+{-+Copyright 2009 Jake Wheat++This file contains the ag code for create function statements. This+includes producing the function prototype, and passing the parameter+and variable declaration bindings into the statement body.++== function prototype++all we do here is type check enough to produce the prototype+information which is added to the catalog, this means the function+name, parameter types, and the return type.++type checking failure is contained so that the function prototype is+produced iff the parameter and return types check ok. Any type errors+in the function body (including the top level variable declarations+don't affect the prototype, and hence callers of the function).++-}++SEM Statement+    | CreateFunction+        loc.tpe = dependsOnRTpe+                    (@rettype.namedType : @loc.parameterTypes) $+                    Right $ Pseudo Void+        loc.envUpdates = dependsOn [tpeToT @loc.tpe] []+                                   [EnvCreateFunction FunName+                                                      (map toLower @name)+                                                      @loc.parameterTypes+                                                      @rettype.namedType+                                                      False]+        loc.parameterTypes = (map snd @params.params)++        loc.backTree = CreateFunction @ann+                                      @name+                                      @params.annotatedTree+                                      @rettype.annotatedTree+                                      @lang.annotatedTree+                                      @bodyQuote+                                      @body.annotatedTree+                                      @vol.annotatedTree+        loc.statementType = []+        body.env = @lhs.inProducedEnv++{-+== parameters+-}++ATTR ParamDef [||paramName : String+                 namedType : Type]++ATTR ParamDefList [||params : {[(String, Type)]}]++SEM ParamDef+    | ParamDef ParamDefTp+        lhs.namedType = @typ.namedType+    | ParamDef+        lhs.paramName = @name+    | ParamDefTp+        lhs.paramName = ""++SEM ParamDefList+     | Nil lhs.params = []+     | Cons lhs.params = ((@hd.paramName, @hd.namedType) : @tl.params)+++{-+ISSUE:++when writing an sql file, you can put a create function which refers+to a table definition that is given later. As long as the function+isn't called before the table definition is given, this is ok. To+handle this, need to gather the function prototype, but delay checking+the contents until either a) all the other type checking has been+done, or b) the function is needed (list ways this can happen: used in+a view (even then, not needed until view is used), function can be+called directly, or indirectly in another function call, ...)++No thoughts on how to do this - but at some point want to support+'declarative' sql source code, where the order doesn't matter, and+this code figures out an order to load it into the database which will+get past pgs checks, so hopefully the solution will move towards this+goal also. One additional consideration is that the error message in a+situation like this would be really helpful if it could tell that a+problem like this could be fixed with a reordering, and suggest that+reordering.++New plan: do two passes, type check everything but the bodies of+functions in first pass, then type check bodies of functions in second+pass. Not perfect, but better than current situation. This will be+achieved by using a separate env attribute which is the same as the env+value which gets returned from the annotation functions in AstInternal.ag++-}++SEM Statement+    | CreateFunction+        --add the parameters to the environment for the contained statements+        body.lib = let p = @params.params+                           ++ (zip posNames $ map snd @params.params)+                   in fromRight @lhs.lib $+                      updateBindings @lhs.lib @lhs.env+                                     [LibStackIDs [("", p)+                                                  ,(@name, @params.params)]]+                   where+                     posNames :: [String]+                     posNames = map (\l -> '$':show l) [1..]+{-+TODO: using fromRight on it's own for identifier bindings or env+updates is wrong, if an error is produced then this needs to be added+to an annotation somewhere. Some of the code uses error instead of fromRight+which is even worse.+-}++SEM FnBody+    | PlpgsqlFnBody+        --make the variable names available in the body of the+        --function this needs to be generalised to begin/end blocks+        --which can nest inside plpgsql functions (they aren't even+        --supported by the parser at the moment)+        sts.lib = fromRight @lhs.lib $+                  updateBindings @lhs.lib @lhs.env+                                 [LibStackIDs [("", @vars.defs)]]++ATTR VarDef [||def : {(String,Type)}]++ATTR VarDefList [||defs : {[(String,Type)]}]++--slightly hacky, should fix this better+SEM VarDef+    | VarDef lhs.def = (@name, if @typ.namedType == Pseudo Record then PgRecord Nothing else @typ.namedType)++SEM VarDefList+    | Cons lhs.defs = @hd.def : @tl.defs+    | Nil lhs.defs = []
+ Database/HsSqlPpp/AstInternals/TypeChecking/CreateTable.ag view
@@ -0,0 +1,101 @@+{-+Copyright 2009 Jake Wheat++This file contains the code for typechecking create table statements+(and also create table as statements). It's pretty limited at the+moment, the bits that work are:++gathers enough information to add the table attributes types to the+catalog++typechecks row check constraints properly, but table check constraints+and all other constraints are not checked at all.++doesn't check for duplicate attribute names. doesn't check if the+types are valid for a table (e.g. disallow setof types)++We produce a valid environment update if the types of the attributes+check ok, any errors in the constraints aren't leaked.++-}+++SEM Statement+    | CreateTable+        loc.tpe = dependsOnRTpe @loc.attrTypes $ Right $ Pseudo Void+        loc.envUpdates = dependsOn @loc.attrTypes []+                           [EnvCreateTable @name @atts.attrs defaultSystemColumns]+        loc.attrTypes : {[Type]}+        loc.attrTypes = map snd @atts.attrs++        loc.statementType = []+        loc.backTree = CreateTable @ann+                                   @name+                                   @atts.annotatedTree+                                   @cons.annotatedTree+        cons.lib = case updateBindings @lhs.lib @lhs.env+                     [LibStackIDs [("", @atts.attrs)]] of+                      Left x -> error $ show x+                      Right e -> e+{+defaultSystemColumns :: [(String,Type)]+defaultSystemColumns = [("tableoid", ScalarType "oid")+                       ,("cmax", ScalarType "cid")+                       ,("xmax", ScalarType "xid")+                       ,("cmin", ScalarType "cid")+                       ,("xmin", ScalarType "xid")+                       ,("ctid", ScalarType "tid")]+}+++SEM Statement+    | CreateTableAs+        loc.tpe =+            dependsOnRTpe [@loc.selType] $ do+              @loc.attrs+              Right @loc.selType+        loc.envUpdates =+           leftToEmpty (\as -> [EnvCreateTable @name as defaultSystemColumns]) $ do+              ats <- @loc.attrs+              return $ dependsOn (tpeToT @loc.tpe :+                                  (map snd ats)) [] ats++        loc.selType = getTypeAnnotation @expr.annotatedTree+        -- type of the columns in the select expression+        loc.attrs = unwrapSetOfComposite @loc.selType++        loc.backTree = CreateTableAs @ann @name @expr.annotatedTree+        loc.statementType = []++{-+attribute name and type gathering+-}++ATTR AttributeDef [||attrName : String+                     namedType : Type]++SEM AttributeDef+    | AttributeDef+        lhs.attrName = map toLower @name+        lhs.namedType = @typ.namedType++ATTR AttributeDefList [||attrs : {[(String, Type)]}]++SEM AttributeDefList+    | Cons lhs.attrs = (@hd.attrName, @hd.namedType) : @tl.attrs+    | Nil lhs.attrs = []++{-+row check constraint:+inject the column name and type into the column constraints+-}++SEM AttributeDef+    | AttributeDef+        cons.lib =+            case updateBindings @lhs.lib @lhs.env+                     [LibStackIDs [("", [(@name, @typ.namedType)])]] of+              Left x -> error $ show x+              Right e -> e++
+ Database/HsSqlPpp/AstInternals/TypeChecking/Dml.ag view
@@ -0,0 +1,208 @@+{-+Copyright 2009 Jake Wheat++This file contains the type checking code for dml, currently insert,+update and delete.++================================================================================++= insert++check the insert data is the correct type. Doesn't cope with columns+with default values at the moment.++-}++SEM Statement+    | Insert+        loc.tpe =+            dependsOnRTpe [getTypeAnnotation @insData.annotatedTree] $ do+              @loc.columnTypes+              Right $ Pseudo Void+        loc.statementType =+            leftToEmpty (\ct -> [StatementType [] (fromMaybe [] @returning.listType)]) @loc.columnTypes++        loc.columnTypes =+            do+            tys <- unwrapSetOfComposite $+                   getTypeAnnotation @insData.annotatedTree+            checkColumnConsistency @lhs.env+                                   @table+                                   @targetCols.strings+                                   tys++        loc.backTree = Insert @ann @table @targetCols.annotatedTree+                              @insData.annotatedTree @returning.annotatedTree+        loc.envUpdates = []++-- inject the ids into the returning part++SEM Statement+    | Insert+        returning.lib =+            fromRight @lhs.lib $ do+              atts <- envCompositeAttrs @lhs.env relationComposites @table+              updateBindings @lhs.lib @lhs.env [LibStackIDs [("", atts)]]++{-+================================================================================++= update++check the set clause assignments are ok, and inject ids into the where part++-}++SEM Statement+    | Update+        loc.tpe =+            do+            checkRelationExists @lhs.env @table+            dependsOnRTpe (map snd @assigns.pairs) $ do+              @loc.columnTypes+              liftErrors @assigns.rowSetErrors+              return $ Pseudo Void+        loc.statementType =+            leftToEmpty (\ct -> [StatementType [] (fromMaybe [] @returning.listType)]) @loc.columnTypes++        loc.columnTypes =+            checkColumnConsistency @lhs.env+                                   @table+                                   (map fst @assigns.pairs)+                                   @assigns.pairs++        loc.backTree = Update @ann+                              @table+                              @assigns.annotatedTree+                              @whr.annotatedTree+                              @returning.annotatedTree+        loc.envUpdates = []+++-- local identifier bindings: pass the table attribute names and types+-- into the where expression, and the set clause expressions++SEM Statement+    | Update+        loc.lib =+             fromRight @lhs.lib $ do+             ct <- envCompositeAttrs @lhs.env+                                     relationComposites+                                     @table+             updateBindings @lhs.lib @lhs.env [LibStackIDs [("", ct)]]+        whr.lib = @loc.lib+        assigns.lib = @loc.lib+        returning.lib = @loc.lib++{-+== set clauses++small complication is slightly hacky code to deal with row set+assignments, where we assign from a multiple attribute subselect into+multiple columns - todo: check if we need so much special casing for+this: should be able to reuse the funcall typing of row set equality+(trade one hack for another, squinting so that assignment looks like+an equality check - since it type checks the same we might be ok). If+we do this, we only need to expand the row sets out to produce a+single string,type list at the end.++-}++ATTR SetClauseList [||pairs : {[(String,Type)]}+                      rowSetErrors : {[TypeError]}]++SEM SetClauseList+  | Cons lhs.pairs = @hd.pairs ++ @tl.pairs+         lhs.rowSetErrors = maybeToList @hd.rowSetError ++ @tl.rowSetErrors+  | Nil lhs.pairs = []+        lhs.rowSetErrors = []++ATTR SetClause [||pairs : {[(String,Type)]}+                  rowSetError : {Maybe TypeError}]++SEM SetClause+    | SetClause+        lhs.pairs = [(@att, getTypeAnnotation @val.annotatedTree)]+        lhs.rowSetError = Nothing+    | RowSetClause+        loc.rowSetError =+          let atts = @atts.strings+              types = getRowTypes @vals.typeList+          in if length atts /= length types+               then Just WrongNumberOfColumns+               else Nothing+        lhs.pairs = zip @atts.strings $ getRowTypes @vals.typeList++{+getRowTypes :: [Type] -> [Type]+getRowTypes [AnonymousRecordType ts] = ts+getRowTypes ts = ts+}++{-+================================================================================++= delete++pretty simple, mainly just need to inject ids into the where part++-}++SEM Statement+    | Delete+        loc.tpe =+            checkRelationExists @lhs.env @table >>+            Right (Pseudo Void)+        loc.statementType = [StatementType [] (fromMaybe [] @returning.listType)]++        loc.backTree = Delete @ann @table @whr.annotatedTree @returning.annotatedTree+        loc.envUpdates = []+++SEM Statement+    | Delete+        loc.lib =+            fromRight @lhs.lib $ do+            columnTypes <- envCompositeAttrs @lhs.env relationComposites @table+            updateBindings @lhs.lib @lhs.env [LibStackIDs [("", columnTypes)]]+        whr.lib = @loc.lib+        returning.lib = @loc.lib++{-+================================================================================+-}+{++--small shortcut to help produce better errors?+checkRelationExists :: Environment -> String -> Either [TypeError] ()+checkRelationExists env tbl =+    envCompositeDef env relationComposites tbl >>+    return ()++--used by both insert and update+checkColumnConsistency :: Environment ->  String -> [String] -> [(String,Type)]+                       -> Either [TypeError] [(String,Type)]+checkColumnConsistency env tbl cols' insNameTypePairs = do+  ttcols <- lowerize <$> envCompositePublicAttrs env [] tbl+  let cols = if null cols'+               then map fst ttcols+               else map (map toLower) cols'+  errorWhen (length insNameTypePairs /= length cols) [WrongNumberOfColumns]+  let nonMatchingColumns = cols \\ map fst ttcols+  errorWhen (not $ null nonMatchingColumns) $+       map UnrecognisedIdentifier nonMatchingColumns+  let targetNameTypePairs = map (\l -> (l,fromJust $ lookup l ttcols)) cols+        --check the types of the insdata match the column targets+        --name datatype columntype+      typeTriples = map (\((a,b),c) -> (a,b,c)) $+                    zip targetNameTypePairs $+                    map snd insNameTypePairs+      errs :: [TypeError]+      errs = concat $ lefts $+             map (\(_,b,c) -> checkAssignmentValid env c b) typeTriples+  liftErrors errs+  return targetNameTypePairs+  where+    lowerize = map (\(a,b) -> (map toLower a,b))++}
+ Database/HsSqlPpp/AstInternals/TypeChecking/Drops.ag view
@@ -0,0 +1,31 @@+{-+Copyright 2009 Jake Wheat++This file contains the code for drop statements, only does drop function at the moment++-}++SEM Statement+    | DropFunction+        loc.tpe = Right $ Pseudo Void+        loc.backTree = DropFunction @ann @ifE.annotatedTree @sigs.annotatedTree @cascade.annotatedTree+        loc.envUpdates = flip map @sigs.fnSigs $ \(nm,args) ->+                               EnvDropFunction ifE nm args+                         where+                           ifE = @ifE.annotatedTree == IfExists+        loc.statementType = []++ATTR StringTypeNameListPairList [||fnSigs:{[(String,[Type])]}]+SEM StringTypeNameListPairList+    | Cons lhs.fnSigs = @hd.fnSig : @tl.fnSigs+    | Nil lhs.fnSigs = []++ATTR StringTypeNameListPair [||fnSig:{(String,[Type])}]+SEM StringTypeNameListPair+    | Tuple lhs.fnSig = (@x1, @x2.namedTypes)++ATTR TypeNameList [||namedTypes:{[Type]}]++SEM TypeNameList+    | Cons lhs.namedTypes = @hd.namedType : @tl.namedTypes+    | Nil lhs.namedTypes = []
+ Database/HsSqlPpp/AstInternals/TypeChecking/ErrorUtils.lhs view
@@ -0,0 +1,59 @@+Copyright 2009 Jake Wheat++This file contains a bunch of small low level utilities to help with+type checking.++> {-# OPTIONS_HADDOCK hide #-}++> module Database.HsSqlPpp.AstInternals.TypeChecking.ErrorUtils+>     (+>      dependsOn+>     ,dependsOnRTpe+>     ,dependsOnT+>     ,tpeToT+>     ,liftErrors+>     ,getErrors+>     ) where++> import Data.List++> import Database.HsSqlPpp.AstInternals.TypeType++================================================================================++= type checking utils++== checkErrors++if we find a typecheckfailed in the list, then propagate that, else+use the final argument.++> dependsOn :: [Type] -> t -> t -> t+> dependsOn ts bad ok =+>   if any (==TypeCheckFailed) ts+>     then bad+>     else ok++> dependsOnRTpe :: [Type] -> Either a Type -> Either a Type+> dependsOnRTpe ts = dependsOn ts (Right TypeCheckFailed)++> dependsOnT :: [Type] -> Type -> Type+> dependsOnT ts = dependsOn ts TypeCheckFailed++convert an 'either [typeerror] type' to a type++> tpeToT :: Either [TypeError] Type -> Type+> tpeToT tpe = case tpe of+>                   Left _ -> TypeCheckFailed+>                   Right t -> t++> liftErrors :: [TypeError] -> Either [TypeError] ()+> liftErrors es = if null es+>                   then Right ()+>                   else Left es++extract errors from an either, gives empty list if right++> getErrors :: Either [TypeError] Type -> [TypeError]+> getErrors = either id (const [])+
+ Database/HsSqlPpp/AstInternals/TypeChecking/Expressions.ag view
@@ -0,0 +1,310 @@+{-+Copyright 2009 Jake Wheat++This file contains the type checking code for the expression ast data+type.++-}++--gather the backtree, type errors and types together and add annotations+SEM Expression+    | IntegerLit StringLit FloatLit BooleanLit NullLit FunCall Identifier+      Exists Case CaseSimple Cast InPredicate ScalarSubQuery LiftOperator+      PositionalArg Placeholder WindowFn+        lhs.annotatedTree = annTypesAndErrors @loc.backTree+                              (tpeToT @loc.tpe)+                              (getErrors @loc.tpe)+                              Nothing++{-+== literals++pretty straightforward+-}++SEM Expression+     | IntegerLit loc.tpe = Right typeInt+     | StringLit loc.tpe = Right UnknownType+     | FloatLit loc.tpe = Right typeNumeric+     | BooleanLit loc.tpe = Right typeBool+     -- I think a null has the same type resolution as an unknown string lit+     | NullLit loc.tpe = Right UnknownType++SEM Expression+    | IntegerLit+        loc.backTree = IntegerLit @ann @i+    | StringLit+        loc.backTree = StringLit @ann @quote @value+    | FloatLit+        loc.backTree = FloatLit @ann @d+    | BooleanLit+        loc.backTree = BooleanLit @ann @b+    | NullLit+        loc.backTree = NullLit @ann+++{-++== cast expression++all the work is done in the typename node+-}++SEM Expression+    | Cast loc.tpe = Right $ @tn.namedType+           loc.backTree = Cast @ann @expr.annotatedTree @tn.annotatedTree++{-+== operators and functions+-}+SEM Expression+    | FunCall+        loc.tpe = dependsOnRTpe @args.typeList $+                    typeCheckFunCall+                      @lhs.env+                      @funName+                      @args.typeList+        loc.backTree = FunCall @ann @funName @args.annotatedTree+++   | WindowFn+        loc.tpe = Right (getTypeAnnotation @fn.annotatedTree)+        loc.backTree = WindowFn @ann+                                @fn.annotatedTree+                                @partitionBy.annotatedTree+                                @orderBy.annotatedTree+                                @dir.annotatedTree+                                @frm.annotatedTree+{+{-++small shim in front of findCallMatch in the type conversion code, to+handle some special cases.++Some of the special cases will no longer be needed when variadic+support is added.++between, greatest and least are treated as syntactic sugar so we+delegate the function lookups to the <=/>= operators.++the row comparison should be more general than this, since it supports+any operator satisfying some properties+++TODO: move all of this into find call match. Don't know why it's separate+-}+typeCheckFunCall :: Environment -> String -> [Type] -> Either [TypeError] Type+typeCheckFunCall env fnName' argsType =+    {-trace ("typecheckfncall " ++ fnName' ++ show argsType) $-}+    dependsOnRTpe argsType $+      case fnName of+              "count" -> -- not quite sure how this is suppose to work,+                         -- the counts in the pg catalog accept either+                         -- no args, or one arg of type any, but you can call+                         -- count with multiple arguments?+                         return typeBigInt+              "!between" -> do+                    f1 <- lookupFn ">=" [argsType !! 0, argsType !! 1]+                    f2 <- lookupFn "<=" [argsType !! 0, argsType !! 2]+                    lookupFn "!and" [f1,f2]+              --"coalesce" -> resolveResultSetType env argsType+              "greatest" -> do+                    t <- lookupFn fnName argsType -- t <- resolveResultSetType env argsType+                    lookupFn ">=" [t,t]+                    return t+              "least" -> do+                    t <- lookupFn fnName argsType -- resolveResultSetType env argsType+                    lookupFn "<=" [t,t]+                    return t+              "!rowctor" -> return $ AnonymousRecordType argsType+                    -- special case the row comparison ops+                    -- this needs to be fixed: we want to match+                    -- any implicit casts to functions on composite types+                    -- first, then we can use the anonymous record type on+                    -- any composite+              _ | fnName `elem` ["=", "<>", "<=", ">=", "<", ">"]+                         && length argsType == 2+                         && all isCompositeOrSetOfCompositeType argsType+                         && compositesCompatible env (head argsType) (head $ tail argsType) -> Right typeBool+              --checked for all special cases, so run general case now+              s -> lookupFn s argsType+    where+      lookupFn :: String -> [Type] -> Either [TypeError] Type+      lookupFn s1 args = do+        (_,_,r,_) <- findCallMatch env+                             (if s1 == "u-" then "-" else s1) args+        return r+      checkRowTypesMatch (AnonymousRecordType t1s) (AnonymousRecordType t2s) = do+        when (length t1s /= length t2s) $ Left [ValuesListsMustBeSameLength]+        let errs = map (resolveResultSetType env . (\(a,b) -> [a,b])) $+                     zip t1s t2s+        liftErrors $ concat $ lefts errs+        return typeBool+      checkRowTypesMatch x y  =+        error $ "internal error: checkRowTypesMatch called with " +++                show x ++ "," ++ show y+      fnName = map toLower fnName'+}++{-+lifted operator:+pretty much the same as haskell 'any (lhs [op]) rhss' (or all instead of any)+where lhs is the first argument and rhss is the second argument+which must be an array++pg allows the rhss to also be a subselect, this is a todo++-}++SEM Expression+    | LiftOperator+        loc.tpe = dependsOnRTpe @args.typeList $ do+                  let args = @args.annotatedTree+                  errorWhen (length args /= 2)+                            [AnyAllError $ "must have two args, got " ++ show args]+                  let [a,b] = args+                      aType = getTypeAnnotation a+                      bType = getTypeAnnotation b+                  dependsOnRTpe [aType,bType] $ do+                  errorWhen (not $ isArrayType bType)+                            [AnyAllError $ "second arg must be array, got " ++ show args]+                  elemType <- unwrapArray $ bType+                  resType <- typeCheckFunCall+                                     @lhs.env+                                     @oper+                                     [aType,elemType]+                  errorWhen (resType /= typeBool)+                            [AnyAllError $ "operator must have bool return, got " ++ show resType]+                  return resType+        loc.backTree = LiftOperator @ann @oper @flav.annotatedTree @args.annotatedTree+++{-+== case expression++for non simple cases, we need all the when expressions to be bool, and+then to collect the types of the then parts to see if we can resolve a+common type++for simple cases, we need to check all the when parts have the same type+as the value to check against, then we collect the then parts as above.++-}++SEM Expression+    | Case CaseSimple+        loc.whenTypes = map getTypeAnnotation $ concatMap fst $+                        @cases.annotatedTree+        loc.thenTypes = map getTypeAnnotation $+                            (map snd $ @cases.annotatedTree) +++                              maybeToList @els.annotatedTree++SEM Expression+    | Case+        loc.tpe =+            dependsOnRTpe @loc.whenTypes $ do+            errorWhen (any (/= typeBool) @loc.whenTypes) $+                      [WrongTypes typeBool @loc.whenTypes]+            dependsOnRTpe @loc.thenTypes $+              resolveResultSetType @lhs.env @loc.thenTypes+        loc.backTree = Case @ann @cases.annotatedTree @els.annotatedTree+++SEM Expression+    | CaseSimple+        loc.tpe =+          dependsOnRTpe @loc.whenTypes $ do+          let valueType = getTypeAnnotation @value.annotatedTree+          checkWhenTypes <-+              resolveResultSetType @lhs.env (valueType : @loc.whenTypes)+          dependsOnRTpe @loc.thenTypes $+            resolveResultSetType @lhs.env @loc.thenTypes+        loc.backTree = CaseSimple @ann+                                  @value.annotatedTree+                                  @cases.annotatedTree+                                  @els.annotatedTree++{-+== identifiers+pull id types out of env for identifiers++-}++SEM Expression+    | Identifier+        loc.tpe = libLookupID @lhs.lib @i+        loc.backTree = Identifier @ann @i+++SEM Expression+    | PositionalArg+        loc.tpe = libLookupID @lhs.lib ('$':show @p)+        loc.backTree = PositionalArg @ann @p+++SEM Expression+    | Placeholder+        loc.tpe = Right UnknownType+        loc.backTree = Placeholder @ann++-- exists: will work on any subselect so we don't need to do any checking+SEM Expression+    | Exists+        loc.tpe = Right typeBool+        loc.backTree = Exists @ann @sel.annotatedTree+++{-+== scalar subquery+1 col -> type of that col+2 + cols -> row type+-}++SEM Expression+    | ScalarSubQuery+        loc.tpe =+            do+            let selType = getTypeAnnotation @sel.annotatedTree+            dependsOnRTpe [selType] $ do+            f <- map snd <$> unwrapSetOfComposite selType+            case length f of+              0 -> Left [InternalError "no columns in scalar subquery?"]+              1 -> Right $ head f+              _ -> Right $ AnonymousRecordType f++        loc.backTree = ScalarSubQuery @ann @sel.annotatedTree+{-+== inlist+todo: make the ast and typechecking a special case of lifted operator+-}++SEM Expression+    | InPredicate+        loc.tpe = do+                  lt <- @list.listType+                  ty <- resolveResultSetType+                            @lhs.env+                            [getTypeAnnotation @expr.annotatedTree, lt]+                  return typeBool+        loc.backTree = InPredicate @ann+                                   @expr.annotatedTree+                                   @i+                                   @list.annotatedTree+++ATTR InList [||listType : {Either [TypeError] Type}]++SEM InList+    | InList+        lhs.listType = resolveResultSetType @lhs.env @exprs.typeList+    | InSelect+        lhs.listType =+            do+            attrs <- map snd <$> (unwrapSetOfComposite $+                                  getTypeAnnotation @sel.annotatedTree)+            typ <- case length attrs of+                      0 -> Left [InternalError+                                 "got subquery with no columns? in inselect"]+                      1 -> Right $ head attrs+                      _ -> Right $ AnonymousRecordType attrs+            dependsOnRTpe attrs $ Right typ
+ Database/HsSqlPpp/AstInternals/TypeChecking/Misc.ag view
@@ -0,0 +1,109 @@+{-+Copyright 2009 Jake Wheat++Contains bit and pieces of type checking which don't fit anywhere else++================================================================================++= type names++Types with type modifiers (called PrecTypeName here, to be changed),+are not supported at the moment.++-}++ATTR TypeName [||namedType : Type]++SEM TypeName+     | SimpleTypeName ArrayTypeName SetOfTypeName PrecTypeName+         lhs.namedType = tpeToT @loc.tpe+         lhs.annotatedTree = updateAnnotation+                               ((map TypeErrorA $ getErrors @loc.tpe) ++)+                               @loc.backTree+++SEM TypeName+     | SimpleTypeName+        loc.tpe = envLookupType @lhs.env $ canonicalizeTypeName @tn+        loc.backTree = SimpleTypeName @ann @tn+     | ArrayTypeName+        loc.tpe = dependsOnRTpe [@typ.namedType] $ Right $ ArrayType @typ.namedType+        loc.backTree = ArrayTypeName @ann @typ.annotatedTree+     | SetOfTypeName+        loc.tpe = dependsOnRTpe [@typ.namedType] $ Right $ SetOfType @typ.namedType+        loc.backTree = SetOfTypeName @ann @typ.annotatedTree+     | PrecTypeName+        loc.tpe = envLookupType @lhs.env $ canonicalizeTypeName @tn+        loc.backTree = PrecTypeName @ann @tn @prec+++{-+================================================================================++= generic node types++-}++--expression list and list list - just collect up the types++ATTR ExpressionList [||typeList : {[Type]}]++SEM ExpressionList+    | Cons lhs.typeList = getTypeAnnotation @hd.annotatedTree : @tl.typeList+    | Nil lhs.typeList = []+++ATTR ExpressionListList  [||typeListList : {[[Type]]}]++SEM ExpressionListList+    | Cons lhs.typeListList = @hd.typeList : @tl.typeListList+    | Nil lhs.typeListList = []+++-- stringlist: collect the strings+ATTR StringList [||strings : {[String]}]++SEM StringList+  | Cons lhs.strings = @hd : @tl.strings+  | Nil lhs.strings = []++-- maybe bool expression: if present, then check its type is bool++SEM MaybeBoolExpression+    | Just+        lhs.annotatedTree =+          if getTypeAnnotation @just.annotatedTree `notElem` [typeBool, TypeCheckFailed]+            then Just $ updateAnnotation ((TypeErrorA ExpressionMustBeBool) :)+                          @just.annotatedTree+            else Just $ @just.annotatedTree+++{+{-+================================================================================++= couple of small utils++I think this should be alright, an identifier referenced in an+expression can only have zero or one dot in it.+-}++splitIdentifier :: String -> (String,String)+splitIdentifier s = let (a,b) = span (/= '.') s+                    in if b == ""+                         then ("", a)+                         else (a,tail b)++{-+helper to make adding annotations a bit easier+-}++annTypesAndErrors :: Data a => a -> Type -> [TypeError]+                  -> Maybe [AnnotationElement] -> a+annTypesAndErrors item nt errs add =+    updateAnnotation modifier item+    where+      modifier = (([TypeAnnotation nt] ++ fromMaybe [] add +++       map TypeErrorA errs) ++)++}
+ Database/HsSqlPpp/AstInternals/TypeChecking/MiscCreates.ag view
@@ -0,0 +1,71 @@+{-+Copyright 2009 Jake Wheat++This file contains the ddl checking, apart from create function and+create table which have their own files.++= create view++pretty simple, just forwards the select expression type++-}++SEM Statement+    | CreateView+        loc.tpe = dependsOnRTpe [getTypeAnnotation @expr.annotatedTree] $+                    Right $ Pseudo Void+        loc.backTree = CreateView @ann @name @expr.annotatedTree+        loc.attrs = case getTypeAnnotation @expr.annotatedTree of+                      SetOfType (CompositeType c) -> c+                      _ -> [] --TODO: error ignored+        loc.envUpdates = [EnvCreateView @name @loc.attrs]+        loc.statementType = []++{-+================================================================================++= create type++might move this to create table since they have a fair bit in common++main shortcomings are the names and types aren't checked++-}++ATTR TypeAttributeDef [||attrName : String+                         namedType : Type]++SEM TypeAttributeDef+    | TypeAttDef+        lhs.attrName = @name+        lhs.namedType = @typ.namedType++ATTR TypeAttributeDefList [||attrs : {[(String, Type)]}]++SEM TypeAttributeDefList+    | Cons lhs.attrs = (@hd.attrName, @hd.namedType) : @tl.attrs+    | Nil lhs.attrs = []++SEM Statement+    | CreateType+        loc.tpe = Right $ Pseudo Void+        loc.backTree = CreateType @ann @name @atts.annotatedTree+        loc.statementType = []+        loc.envUpdates = [EnvCreateComposite @name @atts.attrs]++{-++= create domain++-}++SEM Statement+    | CreateDomain+        loc.tpe = Right $ Pseudo Void+        loc.backTree = CreateDomain @ann @name @typ.annotatedTree @checkName @check.annotatedTree+        loc.statementType = []+        loc.envUpdates = [EnvCreateDomain (DomainType @name) @typ.namedType]+        --allow refering to value as 'value' in check expression+        check.lib = fromRight @lhs.lib $+                    updateBindings @lhs.lib @lhs.env+                      [LibStackIDs [("", [("value", @typ.namedType)])]]
+ Database/HsSqlPpp/AstInternals/TypeChecking/Plpgsql.ag view
@@ -0,0 +1,87 @@+{-+Copyright 2009 Jake Wheat++This file contains the checking code for a few plpgsql statements.+++-}++--todo: check return type consistent with function return type+SEM Statement+    | Return+        loc.tpe =+            dependsOnRTpe [maybe typeBool+                                getTypeAnnotation+                                @value.annotatedTree] $ Right $ Pseudo Void+        loc.backTree = Return @ann @value.annotatedTree+        loc.envUpdates = []+        loc.statementType = []+++SEM Statement+    | Assignment+        loc.tpe =+            do+            let fromType = getTypeAnnotation @value.annotatedTree+            toType <- libLookupID @lhs.lib @target+            dependsOnRTpe [getTypeAnnotation @value.annotatedTree, toType] $ do+            checkAssignmentValid @lhs.env fromType toType+            return $ Pseudo Void+        loc.backTree = Assignment @ann @target @value.annotatedTree+        loc.envUpdates = []+        loc.statementType = []++SEM Statement+    | ForIntegerStatement+        loc.varTypeE = libLookupID @lhs.lib @var+        loc.tpe =+          do+          let fromType = getTypeAnnotation @from.annotatedTree+              toType = getTypeAnnotation @to.annotatedTree+          dependsOnRTpe [fromType,toType] $ do+          --probably a bit too strict:+          errorWhen (fromType /= toType) [FromToTypesNotSame fromType toType]+          case @loc.varTypeE of+            Right t -> checkAssignmentValid @lhs.env fromType t+            Left _ -> return ()+          return $ Pseudo Void+        sts.lib =+            case @loc.varTypeE of+              Left [UnrecognisedIdentifier @var] ->+                  fromRight @lhs.lib $+                  updateBindings @lhs.lib @lhs.env+                                 [LibStackIDs [("", [(@var,getTypeAnnotation @from.annotatedTree)])]]+              _ -> @lhs.lib++        loc.backTree = ForIntegerStatement @ann @var @from.annotatedTree @to.annotatedTree @sts.annotatedTree+        loc.envUpdates = []+        loc.statementType = []+++SEM Statement+    | ForSelectStatement+        loc.selType = getTypeAnnotation @sel.annotatedTree+        loc.tpe =+          do+          dependsOnRTpe [@loc.selType] $ do+          toType <- libLookupID @lhs.lib @var+          dependsOnRTpe [toType] $ do+          checkAssignmentValid @lhs.env @loc.selType toType+          return $ Pseudo Void+        --just handles assigning to a record type for now+        --one thing that isn't quite right is that the record variable+        --holds the last row in it after the for statement, which isn't+        --supported here+        sts.lib =+            if okToUpdate+              then fromRight @lhs.lib $+                   updateBindings @lhs.lib @lhs.env [LibStackIDs [("", [(@var,@loc.selType)])]]+                   -- todo:ignoring error+              else @lhs.lib+            where+              okToUpdate = isRight @loc.tpe && @loc.selType /= TypeCheckFailed++        loc.backTree = ForSelectStatement @ann @var @sel.annotatedTree @sts.annotatedTree+        loc.envUpdates = []+        loc.statementType = []+
+ Database/HsSqlPpp/AstInternals/TypeChecking/SelectLists.ag view
@@ -0,0 +1,184 @@+{-+Copyright 2009 Jake Wheat++This file contains the code that handles the select list part of a+select expression.++TODO: stop wrapping string,type lists in unnamedcompositetypes, pointless++-}++SEM SelectItem+    | SelExp+        loc.annotatedTree = SelExp @ann $ fixStar @ex.annotatedTree+    | SelectItem+        loc.annotatedTree = SelectItem @ann (fixStar @ex.annotatedTree) @name++ATTR MaybeSelectList [||listType : {Maybe [(String,Type)]}]++ATTR SelectItemList SelectList [||listType : {[(String,Type)]}]+ATTR SelectItem [||itemType : Type]++ATTR SelectList [||libUpdates : {[LocalIdentifierBindingsUpdate]}]++SEM MaybeSelectList+    | Just lhs.listType = Just @just.listType+    | Nothing lhs.listType = Nothing++SEM SelectItemList+    | Cons lhs.listType = expandStar @lhs.lib @hd.columnName @hd.itemType @tl.listType+    | Nil lhs.listType = []+++SEM SelectItem+    | SelExp SelectItem+        lhs.itemType = getTypeAnnotation @ex.annotatedTree++++SEM SelectList+    | SelectList+        lhs.listType = @items.listType+-- check the into types+        loc.errs = case @loc.stuff of+                     (er,_) -> er+        loc.stuff =+          case () of+            _ | null sl -> ([],Nothing)+              | not (null targetTypeErrs) -> (targetTypeErrs,Nothing)+              | (case targetTypes of+                   [PgRecord _] -> True+                   _ -> False) -> ([],Just (head sl, CompositeType @items.listType))+              | matchingComposite /= Left [] -> (fromLeft [] matchingComposite,Nothing)+              | length sl /= length @items.listType -> ([WrongNumberOfColumns],Nothing)+              | not (null assignErrs) -> (assignErrs,Nothing)+              | otherwise -> ([],Nothing)+          where+            targetTypeEithers = map (libLookupID @lhs.lib) sl+            targetTypeErrs = concat $ lefts $ targetTypeEithers+            targetTypes = rights $ targetTypeEithers+            typePairs = zip (map snd @items.listType) targetTypes+            assignErrs = concat $ lefts $ map (uncurry $ checkAssignmentValid @lhs.env) typePairs+            sl = @into.strings+            matchingComposite =+                case targetTypes of+                  [t] | isCompositeType t -> checkAssignmentValid @lhs.env (AnonymousRecordType (map snd @items.listType)) t+                  _ -> Left []++        lhs.annotatedTree = SelectList (@ann ++ map TypeErrorA @loc.errs)+                                       @items.annotatedTree+                                       @into.annotatedTree+        lhs.libUpdates =+            case @loc.stuff of+              (_,Just r) -> [LibStackIDs [("", [r])]]+              _ -> []+--[(@var,@loc.selType)]++SEM Statement+    | SelectStatement+        loc.libUpdates = @ex.libUpdates++ATTR SelectExpression [||libUpdates : {[LocalIdentifierBindingsUpdate]}]++SEM SelectExpression+    | Select+        lhs.libUpdates = @selSelectList.libUpdates+    | CombineSelect Values+          lhs.libUpdates = []++-- utils to handle a star, bit hacky, maybe should use a separate pass+-- or something?++{+expandStar :: LocalIdentifierBindings+           -> String+           -> Type+           -> [(String,Type)]+           -> [(String,Type)]+expandStar env colName colType types =+    fromRight types $ do+    let (correlationName,iden) = splitIdentifier colName+    newCols <- if iden == "*"+                 then libExpandStar env correlationName+                 else return [(iden, colType)]+    return $ newCols ++ types++fixStar :: Expression -> Expression+fixStar =+    everywhere (mkT fixStar')+    where+      fixStar' :: Annotation -> Annotation+      fixStar' a =+          if TypeAnnotation TypeCheckFailed `elem` a+              && any (\an ->+                       case an of+                         TypeErrorA (UnrecognisedIdentifier x) |+                           let (_,iden) = splitIdentifier x+                           in iden == "*" -> True+                         _ -> False) a+             then filter (\an -> case an of+                                   TypeAnnotation TypeCheckFailed -> False+                                   TypeErrorA (UnrecognisedIdentifier _) -> False+                                   _ -> True) a+             else a+}+++{-++================================================================================++= attribute names++columnName is used to collect the column names that the select list+produces, it is combined into an unnamedcompositetype in+selectitemlist, which is also where star expansion happens.++-}++ATTR SelectItem [||columnName : String]++{-+if the select item is just an identifier, then that column is named+after the identifier+e.g. select a, b as c, b + c from d, gives three columns one named+a, one named c, and one unnamed, even though only one has an alias+if the select item is a function or aggregate call at the top level,+then it is named after that function or aggregate++if it is a cast, the column is named after the target data type name+iff it is a simple type name++-}++--default value for non identifier nodes++{-+override for identifier nodes, this only makes it out to the selectitem+node if the identifier is not wrapped in parens, function calls, etc.+-}++ATTR Expression [||liftedColumnName : String]++SEM Expression+  | Identifier lhs.liftedColumnName = @i+  | FunCall lhs.liftedColumnName =+      if isOperatorName @funName+         then ""+         else @funName+  | Cast lhs.liftedColumnName = case @tn.annotatedTree of+                                  SimpleTypeName _ tn -> tn+                                  _ -> ""+++SEM Expression+  | BooleanLit Case Exists FloatLit IntegerLit LiftOperator+    NullLit PositionalArg Placeholder ScalarSubQuery StringLit+      lhs.liftedColumnName = ""++-- collect the aliases and column names for use by the selectitemlist nodes+SEM SelectItem+    | SelExp lhs.columnName = case @ex.liftedColumnName of+                                "" -> "?column?"+                                s -> s+    | SelectItem lhs.columnName = @name
+ Database/HsSqlPpp/AstInternals/TypeChecking/SelectStatement.ag view
@@ -0,0 +1,191 @@+{-+Copyright 2009 Jake Wheat++= basic select statements++This is a bit of a mess, will be rewritten with a proper literate+flavour once all the different bits are type checking ok, which should+make it much more readable.++-}++SEM Statement+    | SelectStatement+        loc.tpe = dependsOnRTpe [getTypeAnnotation @ex.annotatedTree] $ Right $ Pseudo Void+        loc.statementType = [StatementType ph $ leftToEmpty id  $+                                                unwrapSetOfComposite $+                                                getTypeAnnotation @ex.annotatedTree]+                            where+                              ph = flip map (getPlaceholders @ex.annotatedTree)+                                     $ const $ ScalarType "text"+        loc.backTree = SelectStatement @ann @ex.annotatedTree+        loc.envUpdates = []++SEM SelectExpression+    | Values Select CombineSelect+        lhs.annotatedTree = annTypesAndErrors @loc.backTree+                              (tpeToT @loc.tpe)+                              (getErrors @loc.tpe)+                              Nothing+{-++================================================================================++Type checking select expressions++The main issue is the complicated flow of identifier bindings through the+various parts. This is the rough order in which this happens:++with+from+where+groupby+having+select+combine+orderby+limit++if a type error occurs, we want to give up on any following stages,+rather than create loads of type errors (maybe this could be refined+more).++The select list produces the final type which the selectexpression has.++inside the from, if we have any join expressions we need to pass the types+from the joined trefs to the join expressions.++So, the basic plan is to propagate the iden bindings in the env attribute+as elsewhere, and also pass along a flag to say whether the previous stage+type checked or not, so we can bail if it has failed.++alternative idea: explore transforming the ast for a select expression into+something using relational algebra-like operations - can then follow the flow+of ids easily. The problem might be with updating the annotations in the original+tree though.++== env passing current bodge++env flow:+current simple version:+from tref -> select list+          -> where++(so we take the identifiers and types from the tref part, and send+them into the selectlist and where parts)++full order of identifier passing:+   1. from+   2. where+   3. group by+   4. having+   5. select+++group by notes, from the pg manual:+group by expressions can be an input column name, or the name or+ordinal number of an output column (SELECT list item), or an arbitrary+expression formed from input-column values. In case of ambiguity, a+GROUP BY name will be interpreted as an input-column name rather than+an output column name.++For now, just send the input columns in as identifiers+-}++SEM SelectExpression+    | Select+         loc.newLib = case updateBindings @lhs.lib @lhs.env @selTref.libUpdates of+                        Left x -> error $ show x -- @lhs.env+                        Right e -> e+         selSelectList.lib = @loc.newLib+         selWhere.lib = @loc.newLib+         selGroupBy.lib = @loc.newLib+         selOrderBy.lib = @loc.newLib++++SEM SelectExpression+    | Values+        loc.tpe = typeCheckValuesExpr+                              @lhs.env+                              @vll.typeListList+        loc.backTree = Values @ann @vll.annotatedTree+    | Select+        loc.tpe =+           do+           --let trefType = fromMaybe typeBool $ fmap getTypeAnnotation+           --                                         @selTref.annotatedTree+           Right $ case @selSelectList.listType of+                     [(_,Pseudo Void)] -> Pseudo Void+                     _ -> SetOfType $ CompositeType @selSelectList.listType+        loc.backTree = Select @ann+                              @selDistinct.annotatedTree+                              @selSelectList.annotatedTree+                              @selTref.annotatedTree+                              @selWhere.annotatedTree+                              @selGroupBy.annotatedTree+                              @selHaving.annotatedTree+                              @selOrderBy.annotatedTree+                              @selLimit.annotatedTree+                              @selOffset.annotatedTree+    | CombineSelect+        loc.tpe =+          let sel1t = getTypeAnnotation @sel1.annotatedTree+              sel2t = getTypeAnnotation @sel2.annotatedTree+          in dependsOnRTpe [sel1t, sel2t] $+                typeCheckCombineSelect @lhs.env sel1t sel2t+        loc.backTree = CombineSelect @ann @ctype.annotatedTree+                                     @sel1.annotatedTree+                                     @sel2.annotatedTree++{++typeCheckValuesExpr :: Environment -> [[Type]] -> Either [TypeError] Type+typeCheckValuesExpr env rowsTs =+        let colNames = zipWith (++)+                           (repeat "column")+                           (map show [1..length $ head rowsTs])+        in unionRelTypes env rowsTs colNames+++typeCheckCombineSelect :: Environment -> Type -> Type -> Either [TypeError] Type+typeCheckCombineSelect env v1 v2 = do+    u1 <- unwrapSetOfComposite v1+    let colNames = map fst u1+    u2 <- unwrapSetOfComposite v2+    let colTypes1 = map snd u1+    let colTypes2 = map snd u2+    unionRelTypes env [colTypes1,colTypes2] colNames++unionRelTypes :: Environment -> [[Type]] -> [String] -> Either [TypeError] Type+unionRelTypes env rowsTs colNames =+  let lengths = map length rowsTs+  in case () of+             _ | null rowsTs ->+                   Left [NoRowsGivenForValues]+               | not (all (==head lengths) lengths) ->+                   Left [ValuesListsMustBeSameLength]+               | otherwise ->+                   --i don't think this propagates all the errors, just the first set+                   mapM (resolveResultSetType env) (transpose rowsTs) >>=+                     (return . SetOfType . CompositeType . zip colNames)++}++INCLUDE "TypeChecking/TableRefs.ag"++INCLUDE "TypeChecking/SelectLists.ag"+++{+getPlaceholders :: Data a => a -> [Expression]+getPlaceholders st =+    filter isPlaceholder $ everything (++) (mkQ [] ga) st+    where+      ga :: Expression -> [Expression]+      ga s = [s]+      isPlaceholder e = case e of+                          PositionalArg _ _ -> True+                          Placeholder _ -> True+                          _ -> False+}
+ Database/HsSqlPpp/AstInternals/TypeChecking/Statements.ag view
@@ -0,0 +1,122 @@+{-+Copyright 2009 Jake Wheat++This file contains the general code for statements and statement+lists, and includes the ag files for various flavours of statement.++The attributes and sem statements in this file are for chaining the+env updates as we progress through a statement list, and for producing+the resultant env after we've checked a whole ast, this can be used+e.g. to type check multiple files in a row which depend on eachother.++-}++-- env updates syn attr is used by each statement to report+-- what changes it makes to the catalog, we use this to update+-- the env to feed into the next statement++ATTR Statement [||envUpdates : {[EnvironmentUpdate]}+                  libUpdates : {[LocalIdentifierBindingsUpdate]}]+++ATTR StatementList [envUpdates : {[EnvironmentUpdate]}+                    libUpdates : {[LocalIdentifierBindingsUpdate]}||]+++--producedenv is used to pass the final updated env out+ATTR StatementList Root [|| producedEnv : Environment+                            producedLib : LocalIdentifierBindings]++ATTR Statement [inProducedEnv: Environment||]++SEM StatementList+    | Cons Nil+        --newenv is the environment passed into the head statement+        --updated with any catalog changes that that statement has made+        loc.newEnv = fromRight @lhs.env $ updateEnvironment @lhs.env @lhs.envUpdates+        loc.newLib = fromRight @lhs.lib $ updateBindings @lhs.lib @lhs.env @lhs.libUpdates+    | Cons+        hd.env = @loc.newEnv+        tl.env = @loc.newEnv+        hd.lib = @loc.newLib+        tl.lib = @loc.newLib+        --produced env is used to chain the final updated environment from the last+        --element of the list and pass it back up the list so in can be pushed up+        -- to the root element and sent out from there+        lhs.producedEnv = @tl.producedEnv+        lhs.producedLib = @tl.producedLib+        --this is probably a bit inefficient: it creates a new environment from scratch+        --on each statement instead of chaining on the last updated env+        tl.envUpdates = @hd.envUpdates+        tl.libUpdates = @hd.libUpdates+    | Nil+        lhs.producedEnv = @loc.newEnv+        lhs.producedLib = @loc.newLib++SEM Statement+    | SelectStatement Insert Update Delete CreateView CreateDomain+      CreateFunction CreateType CreateTable CreateTableAs Return Assignment+      ForSelectStatement ForIntegerStatement DropFunction+        loc.tpe : {Either [TypeError] Type}+        lhs.annotatedTree = annTypesAndErrors @loc.backTree+                              (tpeToT @loc.tpe)+                              (getErrors @loc.tpe)+                              $ Just (map StatementTypeA @loc.statementType +++                                      [EnvUpdates @loc.envUpdates])+        loc.envUpdates : {[EnvironmentUpdate]}+        lhs.envUpdates = @loc.envUpdates+        lhs.libUpdates = @loc.libUpdates+    | Insert Update Delete CreateView CreateDomain+      CreateFunction CreateType CreateTable CreateTableAs Return+      Assignment ForSelectStatement ForIntegerStatement Set CreateLanguage+      Notify CreateSequence AlterSequence DropFunction+        loc.libUpdates = []++SEM StatementList+    | Cons hd.inProducedEnv = @tl.producedEnv+++SEM Root+    | Root statements.envUpdates = []+           statements.libUpdates = []++SEM Statement+    | CaseStatement ContinueStatement Copy CopyData+      DropSomething Execute ExecuteInto+      If NullStatement Perform Raise ReturnNext ReturnQuery Truncate+      WhileStatement Set CreateLanguage Notify CreateSequence+      AlterSequence AlterTable CreateTrigger+        lhs.envUpdates = []+        lhs.libUpdates = []++SEM ExpressionListStatementListPair+    | Tuple+        x2.envUpdates = []+        x2.libUpdates = []+SEM ExpressionStatementListPair+    | Tuple+        x2.envUpdates = []+        x2.libUpdates = []+SEM FnBody+    | PlpgsqlFnBody SqlFnBody+        sts.envUpdates = []+        sts.libUpdates = []+SEM Statement+    | CaseStatement If+        els.envUpdates = []+        els.libUpdates = []+SEM Statement+    | ForIntegerStatement ForSelectStatement WhileStatement+        sts.envUpdates = []+        sts.libUpdates = []++++INCLUDE "TypeChecking/SelectStatement.ag"+INCLUDE "TypeChecking/Dml.ag"+INCLUDE "TypeChecking/CreateTable.ag"+INCLUDE "TypeChecking/MiscCreates.ag"+INCLUDE "TypeChecking/CreateFunction.ag"+INCLUDE "TypeChecking/Drops.ag"+INCLUDE "TypeChecking/Plpgsql.ag"+
+ Database/HsSqlPpp/AstInternals/TypeChecking/TableRefs.ag view
@@ -0,0 +1,270 @@+{-+Copyright 2009 Jake Wheat++This file contains the checking for tablerefs (the from part of a+select expression).++-}++-- lib update contains the updated id and star expansions coming out+-- of the tableref part of a select expression. These updates aren't+-- used for chaining these things for nested table refs (in join+-- statements) - use attributes for them++ATTR TableRef TableRefList [|| libUpdates: {[LocalIdentifierBindingsUpdate]}]++-- use these attributes which contain a copy of the info in lib+-- updates in a form more digestible to the join attributes resolution+-- the main advantages is we don't have to pull the ids out of a list+-- of update wrappers, and we don't have to split the id bindings into+-- qualified and unqualified parts. We could do it just using the+-- libupdates in principle, but this way seems to be a bit more direct+-- and clear to write and read (i.e. when I tried to to it using+-- libupdates I failed and gave up several times).+ATTR TableRef [|| idLookups : {[(String,Type)]}+                  starExpansion : {[(String,Type)]}+                  qidLookups : {[(String,[(String,Type)])]}+                  qstarExpansion : {[(String,[(String,Type)])]}]++-- set the annotations, just need to pick up any type errors whilst+-- calculating the new bindings+SEM TableRef+    | SubTref Tref TrefFun JoinedTref+        lhs.annotatedTree =+            updateAnnotation (map TypeErrorA @loc.errs ++) @loc.backTree++SEM TableRefList+    | Nil+        lhs.libUpdates = []+    | Cons+        lhs.libUpdates = @hd.libUpdates++{-++in the individual sem parts, we set four values:+idlookups : [(string,type)] pairs for all the unqualified ids which will be in scope coming out of the tref+qidlookups: [(string, [(string,type)])] for all the qualified ids+starexpansion: to expand unqualified *+qstarexpansion: to expand qualified *+(we need idlookups and starexpansion because of pg system columns,+which are a serious pain to deal with).++These are set as local vars, because we need to feed the resultant lib+update into the on expressions in joins lower down, which we can't do+directly with a syn attribute, so we collect them in locals, the+combined the in a local for libupdates. We copy all the parts and the+lib updates to regular attributes so we can access them from other+sems (the components (idlookups, etc.) are needed in working out joins+attributes, and the libupdate is used in the join expression, so all+this extra copying is only needed to support joins).++in each part, we collect errors in the errs local which we can then+add to the annotation for the node. when this happens, further type+checking in the select statement should stop but this isn't properly+implemented yet (this is to avoid too many type errors all over the+tree resulting from one mistake - a user friendliness consideration)++-}++SEM TableRef+    | SubTref Tref TrefFun JoinedTref+        loc.idLookups : {[(String,Type)]}+        loc.qidLookups : {[(String,[(String,Type)])]}+        loc.starExpansion : {[(String,Type)]}+        loc.qstarExpansion : {[(String,[(String,Type)])]}+        loc.libUpdates = if null @errs+                           then [LibStackIDs $ ("", @loc.idLookups): @loc.qidLookups+                                ,LibSetStarExpansion $ ("", @loc.starExpansion): @loc.qstarExpansion]+                           else []++ATTR TableRef [jlibUpdates: {[LocalIdentifierBindingsUpdate]}||]++{-++similar sort of pattern for each sem:+forward the errs+get the information we need to fill in the lookups and expansions as an either+fill in the lookups and expansions++-}+SEM TableRef+    | SubTref+        loc.errs = case @loc.selectAttrs of+                           Left e -> e+                           Right _ -> []+        loc.selectAttrs : {Either [TypeError] [(String,Type)]}+        loc.selectAttrs = unwrapSetOfComposite (getTypeAnnotation @sel.annotatedTree)++        loc.idLookups = fromRight [] @loc.selectAttrs+        loc.qidLookups = [(getAlias "" @alias.annotatedTree, @loc.idLookups)]+        loc.starExpansion = @loc.idLookups+        loc.qstarExpansion = @loc.qidLookups++    | Tref+        loc.errs = case @loc.relType of+                     Left e -> e+                     Right _ -> []+        loc.relType : {Either [TypeError] ([(String, Type)], [(String, Type)])}+        loc.relType = envCompositeAttrsPair @lhs.env [] @tbl+        loc.relType1 = fromRight ([],[]) @loc.relType+        loc.pAttrs = fst @loc.relType1+        loc.sAttrs = snd @loc.relType1++        loc.idLookups = @loc.pAttrs ++ @loc.sAttrs+        loc.alias = getAlias @tbl @alias.annotatedTree+        loc.qidLookups = [(@loc.alias, @loc.idLookups)]+        loc.starExpansion = @loc.pAttrs+        loc.qstarExpansion = [(@loc.alias, @loc.pAttrs)]++    | TrefFun+        loc.errs = case @eqfunIdens of+                     Left e -> e+                     Right _ -> []+        loc.eqfunIdens : {Either [TypeError] (String,[(String,Type)])}+        loc.eqfunIdens = funIdens @lhs.env @loc.alias @fn.annotatedTree+        loc.qfunIdens = fromRight ("",[]) @loc.eqfunIdens+        loc.alias2 = fst @loc.qfunIdens+        loc.funIdens = snd @loc.qfunIdens+        loc.alias = getAlias "" @alias.annotatedTree++        loc.idLookups = @loc.funIdens+        loc.qidLookups = [(@alias2, @loc.idLookups)]+        loc.starExpansion = @loc.idLookups+        loc.qstarExpansion = @loc.qidLookups+    | JoinedTref+        loc.errs = fromLeft [] @loc.ejoinAttrs+        loc.removeJoinAttrs = filter (\(n,_) -> n `notElem` @loc.joinNames)+        --the main meat: find out the name and types of all the common+        -- join attributes that need to be combined in the result+        -- (this is all the attributes which appear in both tables in+        -- the case of a natural join, or all the attributes appearing+        -- in the join list in the case of a using join.  for other+        -- joins, this list is empty+        -- all the attributes which don't appear in this list just+        -- get added together so we don't need to worry about them+        loc.ejoinAttrs : {Either [TypeError] [(String,Type)]}+        loc.ejoinAttrs =+            do+            -- get the names of the join columns+            let jns = case (@nat.annotatedTree, @onExpr.originalTree) of+                          (Natural, _) -> commonFieldNames+                          (_,Just (JoinUsing _ s)) -> s+                          _ -> []+                --make sure these columns appear in both tables+                tjtsm = map (flip lookup @tbl.idLookups) jns+                t1jtsm = map (flip lookup @tbl1.idLookups) jns+            errorWhen (not $ null $ filter (==Nothing) $ tjtsm ++ t1jtsm)+                      [MissingJoinAttribute]+            let tjts = catMaybes tjtsm -- should be no nothings at this stage+                t1jts = catMaybes t1jtsm+                -- find the types of these columns - this uses the result set+                -- type resolution (see typeconversion.lhs for more details+                -- and the relevant link to the pg manual+                resolvedTypes :: [Either [TypeError] Type]+                resolvedTypes = map (\(a,b) -> resolveResultSetType @lhs.env [a,b]) $ zip tjts t1jts+            liftErrors $ concat $ lefts resolvedTypes+            return $ zip jns $ rights resolvedTypes+            where+              commonFieldNames = intersect (f @tbl.starExpansion) (f @tbl1.starExpansion)+                                 where f = map fst+        loc.joinNames = map fst @loc.joinAttrs+        loc.joinAttrs = fromRight [] @loc.ejoinAttrs++        --this is where we use the joinAttrs to filter the lookups and+        --expansions: stick the joinattrs at the start+        -- and add the other two lists minus the join attributes+        loc.idLookups = @loc.joinAttrs +++                          @loc.removeJoinAttrs @tbl.idLookups +++                          @loc.removeJoinAttrs @tbl1.idLookups+        loc.qidLookups = @tbl.qidLookups ++ @tbl1.qidLookups+        loc.starExpansion = @loc.joinAttrs +++                              @loc.removeJoinAttrs @tbl.starExpansion +++                              @loc.removeJoinAttrs @tbl1.starExpansion+        loc.qstarExpansion = @tbl.qstarExpansion ++ @tbl1.qstarExpansion++        -- we need the attributes from the joined tables to be available+        -- in the join expression.+        loc.newLib = case updateBindings @lhs.lib @lhs.env (@loc.libUpdates ++ @lhs.jlibUpdates) of+                       Left x -> error $ show x+                       Right e -> {-trace ("on expr lib:" ++ show e)-} e+        onExpr.lib = @loc.newLib+        --need to pass this into nested joins also+        tbl.jlibUpdates = @loc.libUpdates+        tbl1.jlibUpdates = @loc.libUpdates+++SEM TableRefList+    | Cons hd.jlibUpdates = []+++{+{-+convert a function call into a [String,[(string,type)]] list for use+in a tableref context+first consideration is the alias: if there is an alias in the select,+e.g. select * from generate_series(1,2) x;  (alias is x)+we use that, otherwise we use the name of the function+second consideration is the attributes coming out, roughly speaking+we have to convert an arbitrary type to a relation type+if we have a relation valued function, we don't need to do anything+if we have a setof non composite, we lift the single type to an+attribute, using the function name for the attribute name+if we have a non setof, we lift the single type to an attribute and+then relation, using the function name for the attribute name+need to check to see what should happen with arrayof++-}+funIdens :: Environment -> String -> Expression -> Either [TypeError] (String,[(String,Type)])+funIdens env alias fnVal = do+   errorWhen (case fnVal of+                FunCall _ _ _ -> False+                _ -> True)+             [ContextError "FunCall"]+   let (FunCall _ fnName _) = fnVal+       correlationName = if alias /= ""+                           then alias+                           else fnName+   attrs <- do+     case getTypeAnnotation fnVal of+       SetOfType (NamedCompositeType t) -> envCompositePublicAttrs env [] t+       SetOfType x -> return [(correlationName,x)]+       y -> return [(correlationName,y)]+   return (correlationName, attrs)++getAlias :: String -> TableAlias -> String+getAlias def alias =+  case alias of+    NoAlias -> def+    TableAlias t -> t+    FullAlias t _ -> t++}++-- boilerplate+-- copying the locals to syn attrs++SEM TableRef+    | SubTref Tref TrefFun JoinedTref+        lhs.libUpdates = @loc.libUpdates+        lhs.idLookups = @loc.idLookups+        lhs.qidLookups = @loc.qidLookups+        lhs.starExpansion = @loc.starExpansion+        lhs.qstarExpansion = @loc.qstarExpansion++-- backtrees++SEM TableRef+    | SubTref+        loc.backTree = SubTref @ann @sel.annotatedTree @alias.annotatedTree+    | Tref+        loc.backTree = Tref @ann @tbl @alias.annotatedTree+    | TrefFun+        loc.backTree = TrefFun @ann @fn.annotatedTree @alias.annotatedTree+    | JoinedTref+        loc.backTree = JoinedTref @ann+                                  @tbl.annotatedTree+                                  @nat.annotatedTree+                                  @joinType.annotatedTree+                                  @tbl1.annotatedTree+                                  @onExpr.annotatedTree+                                  @alias.annotatedTree
+ Database/HsSqlPpp/AstInternals/TypeChecking/TypeChecking.ag view
@@ -0,0 +1,213 @@+{-+Copyright 2009 Jake Wheat++This file contains the attr and sem definitions, which do the type+checking, etc..++A lot of the haskell code has been moved into other files:+TypeCheckingH, AstUtils.lhs, it is intended that only small amounts of+code appear (i.e. one-liners) inline in this file, and larger bits go+in AstUtils.lhs. These are only divided because the attribute grammar+system uses a custom syntax with a custom preprocessor. These+guidelines aren't followed very well.++The current type checking approach doesn't quite match how SQL+works. The main problem is that you can e.g. exec create table+statements inside a function. This is something that the type checker+will probably not be able to deal for a while if ever. (Will need+hooks into postgresql to do this properly, which might not be+impossible...).++Once most of the type checking is working, all the code and+documentation will be overhauled quite a lot. Alternatively put, this+code is in need of better documentation and organisation, and serious+refactoring.++An unholy mixture of Maybe, Either, Either/Error Monad and TypeCheckFailed+is used to do error handling.++One of the common patterns is when type checking a node:++first check any types of subnodes which it depends on, if any are+typecheckfailed, then this node's type is typecheckfailed and we stop+there.++otherwise, calculate the type of this node, or get an error if there+is a problem, this is put into loc.tpe which is Either TypeError+Type. Then some common code takes this value and sets the node type to+the type or typecheckfailed if tpe is left, and if it is left add a+type error annotation also.++================================================================================++= main attributes used++Here are the main attributes used in the type checking:++env is used to chain the environments up and down the tree, to allow+access to the catalog information, and to store the in environment+identifier names and types e.g. inside a select expression.++annotatedTree is used to create a copy of the ast with the type,+etc. annotations.++-}+ATTR AllNodes Root ExpressionRoot+  [ env : Environment+    lib : LocalIdentifierBindings || annotatedTree : SELF+                                     -- workaround: avoid bogus cycle+                                     -- detections search for this,+                                     -- replace with annotated tree+                                     -- and uuagc can't tell that+                                     -- there aren't any real cycles+                                     originalTree : SELF]++++INCLUDE "TypeChecking/Misc.ag"+INCLUDE "TypeChecking/Expressions.ag"+INCLUDE "TypeChecking/Statements.ag"+++{-++old stuff:++================================================================================++= static tests++Try to use a list of message data types to hold all sorts of+information which works its way out to the top level where the client+code gets it. Want to have the lists concatenated together+automatically from subnodes to parent node, and then to be able to add+extra messages to this list at each node also.++Problem 1: can't have two sem statements for the same node type which+both add messages, and then the messages get combined to provide the+final message list attribute value for that node. You want this so+that e.g. that different sorts of checks appear in different+sections. Workaround is instead of having each check in it's own+section, to combine them all into one SEM. Can work around this+without too much difficulty by using local attributes. Not sure if+something more clever would be an improvement.++Problem 2: no shorthand to combine what the default rule for messages+would be and then add a bit extra - so if you want all the children+messages, plus possibly an extra message or two, have to write out the+default rule in full explicitly. Can get round this by writing out+loads of code, which is error prone. Don't know if there is a better way++================================================================================++= inloop testing++inloop - use to check continue, exit, and other commands that can only+appear inside loops (for, while, loop)++the only nodes that really need this attribute are the ones which can+contain statements++The inloop test is the only thing which uses the messages atm. It+shouldn't, at some point inloop testing will become part of the type+checking.++This is just some example code, will probably do something a lot more+heavy weight like symbolic interpretation - want to do all sorts of+loop, return, nullability, etc. analysis.++-}+{-+ATTR AllNodes Root ExpressionRoot [||messages USE {++} {[]} : {[Message]}]++ATTR AllNodes+  [ inLoop: Bool||]++SEM Root+  | Root statements.inLoop = False++SEM ExpressionRoot+  | ExpressionRoot expr.inLoop = False++-- set the inloop stuff which nests, it's reset inside a create+-- function statement, in case you have a create function inside a+-- loop, seems unlikely you'd do this though++SEM Statement+     | ForSelectStatement ForIntegerStatement WhileStatement sts.inLoop = True+     | CreateFunction body.inLoop = False++-- now we can check when we hit a continue statement if it is in the+-- right context+SEM Statement+    | ContinueStatement  lhs.messages = if not @lhs.inLoop+                                          then [Error ContinueNotInLoop]+                                          else []+-}+{-+================================================================================++= notes and todo+++containment guide for select expressions:+combineselect 2 selects+insert ?select+createtableas 1 select+createview 1 select+return query 1 select+forselect 1 select+select->subselect select+expression->exists select+            scalarsubquery select+            inselect select++containment guide for statements:+forselect [statement]+forinteger [statement]+while [statement]+casestatement [[statement]]+if [[statement]]+createfunction->fnbody [Statement]++TODO++some non type-check checks:+check plpgsql only in plpgsql function+orderby in top level select only+copy followed immediately by copydata iff stdin, copydata only follows+  copy from stdin+count args to raise, etc., check same number as placeholders in string+no natural with onexpr in joins+typename -> setof (& fix parsing), what else like this?+expressions: positionalarg in function, window function only in select+ list top level++review all ast checks, and see if we can also catch them during+parsing (e.g. typeName parses setof, but this should only be allowed+for a function return, and we can make this a parse error when parsing+from source code rather than checking a generated ast. This needs+judgement to say whether a parse error is better than a check error, I+think for setof it is, but e.g. for a continue not in a loop (which+could be caught during parsing) works better as a check error, looking+at the error message the user will get. This might be wrong, haven't+thought too carefully about it yet).+++TODO: canonicalize ast process, as part of type checking produces a+canonicalized ast which:+all implicit casts appear explicitly in the ast (maybe distinguished+from explicit casts?)+all names fully qualified+all types use canonical names+literal values and selectors in one form (use row style?)+nodes are tagged with types+what else?++Canonical form only defined for type consistent asts.++This canonical form should pretty print and parse back to the same+form, and type check correctly.+++-}
+ Database/HsSqlPpp/AstInternals/TypeChecking/TypeConversion.lhs view
@@ -0,0 +1,571 @@+Copyright 2009 Jake Wheat++This file contains the functions for resolving types and+function/operator resolution. See the pg manual chapter 10:++http://www.postgresql.org/docs/8.4/interactive/typeconv.html++This code is really spaghettified.++findCallMatch - pass in a name and a list of arguments, and it returns+the matching function. (pg manual 10.2,10.3)++resolveResultSetType - pass in a set of types, and it tries to find+the common type they can all be cast to. (pg manual 10.5)++checkAssignmentValid - pass in source type and target type, returns+                typelist[] if ok, otherwise error, pg manual 10.4+                Value Storage++> {-# OPTIONS_HADDOCK hide #-}++> module Database.HsSqlPpp.AstInternals.TypeChecking.TypeConversion (+>                        findCallMatch+>                       ,resolveResultSetType+>                       ,checkAssignmentValid+>                       ,compositesCompatible+>                       ) where++> import Data.Maybe+> import Data.List+> import Debug.Trace++> import Database.HsSqlPpp.AstInternals.TypeType+> import Database.HsSqlPpp.AstInternals.TypeChecking.ErrorUtils+> import Database.HsSqlPpp.AstInternals.Environment.EnvironmentInternal+> import Database.HsSqlPpp.Utils++ > traceIt :: Show a => String -> a -> a+ > traceIt s t = trace (s ++ ": " ++ show t) t++= findCallMatch++findCallMatch - partially implements the type conversion rules for+finding an operator or function match given a name and list of+arguments with partial or fully specified types++TODO:, qualifiers+namespaces+function style casts not in catalog+variadic args+default args+domains -> base type+what about aggregates and window functions?++Algo:++cands = all fns with matching names+        and same number of args++if exact match on types in this list, use it+  (if binary operator being matched, and one arg is typed and one is+  unknown, also match an operator by assuming the unknown is the same+  as the typed arg)++best match part:++filter cands with args which don't exactly match input args, and input+args cannot be converted by an implicit cast. unknowns count as+matching anything+if one left: use it++filter for preferred types:++for each cand, count each arg at each position which needs conversion,+and the cand type is a preferred type at that position.+if there are cands with count>0, keep only cands with the max count,+if one return it+if there are no cands with count>0, keep them all++check unknowns:+if any input args are unknown, and any cand accepts string at that+position, fix that arg's category as string, otherwise if all cands+accept same category at that position, fix that input args as that+category.+if we still have unknowns, then fail++discard cands which don't match the new input arg/category list++for each categorised input arg, if any cand accepts preferred type at+that position, get rid of cands which don't accept preferred type at+that position++if one left: use+else fail++polymorphic matching:+want to create a set of matches to insert into the cast pairs list+so:++find all matches on name, num args and have polymorphic parameters++for each one, check the polymorphic categories - eliminate fns that+have params in wrong category - array, non array, enum.+work out the base types for the polymorphic args at each spot based on+the args passed - so each arg is unchanged except arrays which have+the array part stripped off++now we have a list of types to match against the polymorphic params,+use resolveResultSetType to see if we can produce a match, if so,+create a new prototype which is the same as the polymorphic function+but with this matching arg swapped in, work out the casts and add it+into cand cast pairs, after exact match has been run.+++findCallMatch is a bit of a mess++todos:++rewrite this to try to make it a bit clearer++find some way to draw a data flow diagram of the code easily++add a logging facility so the function can explain what has happened+at each state, so you can provide a detailed explanation e.g. if the+code can't find an operator match to see what it has tried to match+against.++> type ProtArgCast = (FunctionPrototype, [ArgCastFlavour])++> findCallMatch :: Environment -> String -> [Type] ->  Either [TypeError] FunctionPrototype+> findCallMatch env f inArgs =+>     returnIfOnne [+>        exactMatch+>       ,binOp1UnknownMatch+>       ,polymorpicExactMatches+>       ,reachable+>       ,mostExactMatches+>       ,filteredForPreferred+>       ,unknownMatchesByCat]+>       [NoMatchingOperator f inArgs]+>     where+>       -- basic lists which roughly mirror algo+>       -- get the possibly matching candidates+>       initialCandList :: [FunctionPrototype]+>       initialCandList = filter (\(_,candArgs,_,_) ->+>                                   length candArgs == length inArgs) $+>                                map expandVariadic $ envLookupFns env f+>+>       expandVariadic fp@(fn,a,r,v) =+>         if v+>           then case last a of+>                  ArrayType t -> (fn, na,r,v)+>                                 where na = init a ++ replicate (length inArgs - length a + 1) t+>                  _ -> fp --should be error+>           else fp+>+>       -- record what casts are needed for each candidate+>       castPairs :: [[ArgCastFlavour]]+>       castPairs = map (listCastPairs . getFnArgs) initialCandList+>+>       candCastPairs :: [ProtArgCast]+>       candCastPairs = {-traceIt "candCastPairs" $-} zip initialCandList castPairs+>+>       -- see if we have an exact match+>       exactMatch :: [ProtArgCast]+>       exactMatch = filterCandCastPairs (all (==ExactMatch)) candCastPairs+>+>       -- implement the one known, one unknown resolution for binary operators+>       binOp1UnknownMatch :: [ProtArgCast]+>       binOp1UnknownMatch = getBinOp1UnknownMatch candCastPairs+>+>       --collect possible polymorphic matches+>       polymorphicMatches :: [ProtArgCast]+>       polymorphicMatches = filterPolymorphics candCastPairs+>+>       polymorpicExactMatches :: [ProtArgCast]+>       polymorpicExactMatches = filterCandCastPairs (all (==ExactMatch)) polymorphicMatches+>+>       -- eliminate candidates for which the inargs cannot be casted to+>       reachable :: [ProtArgCast]+>       reachable = mergePolys (filterCandCastPairs (none (==CannotCast)) candCastPairs)+>                     polymorphicMatches+>+>       mostExactMatches :: [ProtArgCast]+>       mostExactMatches =+>         let inArgsBase = map (replaceWithBase env) inArgs+>             exactCounts :: [Int]+>             exactCounts =+>               map ((length+>                       . filter (\(a1,a2) -> a1==replaceWithBase env a2)+>                       . zip inArgsBase)+>                 . (\((_,a,_,_),_) -> a)) reachable+>             pairs = zip reachable exactCounts+>             maxm = maximum exactCounts+>         in case () of+>              _ | null reachable -> []+>                | maxm > 0 -> map fst $ filter (\(_,b) -> b == maxm) pairs+>                | otherwise -> []+>+>       -- keep the cands with the most casts to preferred types+>       preferredTypesCounts = countPreferredTypeCasts reachable+>       keepCounts = maximum preferredTypesCounts+>       itemCountPairs :: [(ProtArgCast,Int)]+>       itemCountPairs = zip reachable preferredTypesCounts+>       filteredForPreferred :: [ProtArgCast]+>       filteredForPreferred = map fst $ filter (\(_,i) -> i == keepCounts) itemCountPairs+>+>       -- collect the inArg type categories to do unknown inArg resolution+>       argCats :: [Either () String]+>       argCats = getCastCategoriesForUnknowns filteredForPreferred+>       unknownMatchesByCat :: [ProtArgCast]+>       unknownMatchesByCat = getCandCatMatches filteredForPreferred argCats+>+>       -------------+>+>       listCastPairs :: [Type] -> [ArgCastFlavour]+>       listCastPairs l = listCastPairs' inArgs l+>                         where+>                           listCastPairs' :: [Type] -> [Type] -> [ArgCastFlavour]+>                           listCastPairs' (ia:ias) (ca:cas) =+>                               (case () of+>                                  _ | ia == ca -> ExactMatch+>                                    | castableFromTo env ImplicitCastContext ia ca ->+>                                        if envPreferredType env ca+>                                          then ImplicitToPreferred+>                                          else ImplicitToNonPreferred+>                                    | otherwise -> CannotCast+>                               ) : listCastPairs' ias cas+>                           listCastPairs' [] [] = []+>                           listCastPairs' _ _ = error "internal error: mismatched num args in implicit cast algorithm"+>+>+>       getBinOp1UnknownMatch :: [ProtArgCast] -> [ProtArgCast]+>       getBinOp1UnknownMatch cands =+>           if not (isOperatorName f &&+>                   length inArgs == 2 &&+>                   count (==UnknownType) inArgs == 1)+>             then []+>             else let newInArgs =+>                          replicate 2 (if head inArgs == UnknownType+>                                         then inArgs !! 1+>                                         else head inArgs)+>                  in filter (\((_,a,_,_),_) -> a == newInArgs) cands+>+>       filterPolymorphics :: [ProtArgCast] -> [ProtArgCast]+>       filterPolymorphics cl =+>           let ms :: [ProtArgCast]+>               ms = filter canMatch polys+>               polyTypes :: [Maybe Type]+>               polyTypes = map resolvePolyType ms+>               polyTypePairs :: [(Maybe Type, ProtArgCast)]+>               polyTypePairs = zip polyTypes ms+>               keepPolyTypePairs :: [(Type, ProtArgCast)]+>               keepPolyTypePairs =+>                 mapMaybe (\(t,p) -> case t of+>                                            Nothing -> Nothing+>                                            Just t' -> Just (t',p))+>                               polyTypePairs+>               finalRows = map (\(t,p) -> instantiatePolyType p t)+>                               keepPolyTypePairs+>               --create the new cast lists+>               cps :: [[ArgCastFlavour]]+>               cps = map (listCastPairs . getFnArgs . fst) finalRows+>           in zip (map fst finalRows) cps+>           where+>             polys :: [ProtArgCast]+>             polys = filter (\((_,a,_,_),_) -> any (`elem`+>                                              [Pseudo Any+>                                              ,Pseudo AnyArray+>                                              ,Pseudo AnyElement+>                                              ,Pseudo AnyEnum+>                                              ,Pseudo AnyNonArray]) a) cl+>             canMatch :: ProtArgCast -> Bool+>             canMatch pac =+>                let ((_,fnArgs,_,_),_) = pac+>                in canMatch' inArgs fnArgs+>                where+>                  canMatch' [] [] = True+>                  canMatch' (ia:ias) (pa:pas) =+>                    case pa of+>                      Pseudo Any -> nextMatch+>                      Pseudo AnyArray -> isArrayType ia && nextMatch+>                      Pseudo AnyElement -> nextMatch+>                      Pseudo AnyEnum -> False+>                      Pseudo AnyNonArray -> if isArrayType ia+>                                              then False+>                                              else nextMatch+>                      _ -> True+>                    where+>                      nextMatch = canMatch' ias pas+>                  canMatch' _ _ = error "internal error: mismatched lists in canMatch'"+>             resolvePolyType :: ProtArgCast -> Maybe Type+>             resolvePolyType ((_,fnArgs,_,_),_) =+>                 {-trace ("\nresolving " ++ show fnArgs ++ " against " ++ show inArgs ++ "\n") $-}+>                 let argPairs = zip inArgs fnArgs+>                     typeList :: [Type]+>                     typeList = catMaybes $ flip map argPairs+>                                  (\(ia,fa) -> case fa of+>                                                   Pseudo Any -> if isArrayType ia+>                                                                          then eitherToMaybe $ unwrapArray ia+>                                                                          else Just ia+>                                                   Pseudo AnyArray -> eitherToMaybe $ unwrapArray ia+>                                                   Pseudo AnyElement -> if isArrayType ia+>                                                                          then eitherToMaybe $ unwrapArray ia+>                                                                          else Just ia+>                                                   Pseudo AnyEnum -> Nothing+>                                                   Pseudo AnyNonArray -> Just ia+>                                                   _ -> Nothing)+>                 in {-trace ("\nresolve types: " ++ show typeList ++ "\n") $-}+>                    case resolveResultSetType env typeList of+>                      Left _ -> Nothing+>                      Right t -> Just t+>             instantiatePolyType :: ProtArgCast -> Type -> ProtArgCast+>             instantiatePolyType pac t =+>               let ((fn,a,r,v),_) = pac+>                   instArgs = swapPolys t a+>                   p1 = (fn, instArgs, swapPoly t r,v)+>               in let x = (p1,listCastPairs instArgs)+>                  in {-trace ("\nfixed:" ++ show x ++ "\n")-} x+>               where+>                 swapPolys :: Type -> [Type] -> [Type]+>                 swapPolys = map . swapPoly+>                 swapPoly :: Type -> Type -> Type+>                 swapPoly pit at =+>                   case at of+>                     Pseudo Any -> if isArrayType at+>                                     then ArrayType pit+>                                     else pit+>                     Pseudo AnyArray -> ArrayType pit+>                     Pseudo AnyElement -> if isArrayType at+>                                            then ArrayType pit+>                                            else pit+>                     Pseudo AnyEnum -> pit+>                     Pseudo AnyNonArray -> pit+>                     _ -> at+>       --merge in the instantiated poly functions, with a twist:+>       -- if we already have the exact same set of args in the non poly list+>       -- as a poly, then don't include that poly+>       mergePolys :: [ProtArgCast] -> [ProtArgCast] -> [ProtArgCast]+>       mergePolys orig polys =+>           let origArgs = map (\((_,a,_,_),_) -> a) orig+>               filteredPolys = filter (\((_,a,_,_),_) -> a `notElem` origArgs) polys+>           in orig ++ filteredPolys+>+>       countPreferredTypeCasts :: [ProtArgCast] -> [Int]+>       countPreferredTypeCasts =+>           map (\(_,cp) -> count (==ImplicitToPreferred) cp)+>+>       -- Left () is used for inArgs which aren't unknown,+>       --                      and for unknowns which we don't have a+>       --                      unique category+>       -- Right s -> s is the single letter category at+>       --                           that position+>       getCastCategoriesForUnknowns :: [ProtArgCast] -> [Either () String]+>       getCastCategoriesForUnknowns cands =+>           filterArgN 0+>           where+>             candArgLists :: [[Type]]+>             candArgLists = map (\((_,a,_,_), _) -> a) cands+>             filterArgN :: Int -> [Either () String]+>             filterArgN n =+>                 if n == length inArgs+>                   then []+>                   else let targType = inArgs !! n+>                        in ((if targType /= UnknownType+>                               then Left ()+>                               else getCandsCatAt n) : filterArgN (n+1))+>                 where+>                   getCandsCatAt :: Int -> Either () String+>                   getCandsCatAt n' =+>                       let typesAtN = map (!!n') candArgLists+>                           catsAtN = map (envTypeCategory env) typesAtN+>                       in case () of+>                            --if any are string choose string+>                            _ | any (== "S") catsAtN -> Right "S"+>                              -- if all are same cat choose that+>                              | all (== head catsAtN) catsAtN -> Right $ head catsAtN+>                              -- otherwise no match, this will be+>                              -- picked up as complete failure to match+>                              -- later on+>                              | otherwise -> Left ()+>+>       getCandCatMatches :: [ProtArgCast] -> [Either () String] -> [ProtArgCast]+>       getCandCatMatches candsA cats = getMatches candsA 0+>          where+>            getMatches :: [ProtArgCast] -> Int -> [ProtArgCast]+>            getMatches cands n =+>                case () of+>                  _ | n == length inArgs -> cands+>                    | (inArgs !! n) /= UnknownType -> getMatches cands (n + 1)+>                    | otherwise ->+>                        let catMatches :: [ProtArgCast]+>                            catMatches = filter (\c -> Right (getCatForArgN n c) ==+>                                                      (cats !! n)) cands+>                            prefMatches :: [ProtArgCast]+>                            prefMatches = filter (envPreferredType env .+>                                                    getTypeForArgN n) catMatches+>                            keepMatches :: [ProtArgCast]+>                            keepMatches = if length prefMatches > 0+>                                            then prefMatches+>                                            else catMatches+>                        in getMatches keepMatches (n + 1)+>            getTypeForArgN :: Int -> ProtArgCast -> Type+>            getTypeForArgN n ((_,a,_,_),_) = a !! n+>            getCatForArgN :: Int -> ProtArgCast -> String+>            getCatForArgN n = envTypeCategory env . getTypeForArgN n+>+>       -- utils+>       -- filter a candidate/cast flavours pair by a predicate on each+>       -- individual cast flavour+>       filterCandCastPairs :: ([ArgCastFlavour] -> Bool)+>                           -> [ProtArgCast]+>                           -> [ProtArgCast]+>       filterCandCastPairs predi = filter (\(_,cp) -> predi cp)+>+>       getFnArgs :: FunctionPrototype -> [Type]+>       getFnArgs (_,a,_,_) = a+>       returnIfOnne [] e = Left e+>       returnIfOnne (l:ls) e = if length l == 1+>                               then Right $ getHeadFn l+>                               else returnIfOnne ls e+>+>       getHeadFn :: [ProtArgCast] -> FunctionPrototype+>       getHeadFn l =  let ((hdFn, _):_) = l+>                      in hdFn+>       none p = not . any p+>       count p = length . filter p+>+> data ArgCastFlavour = ExactMatch+>                     | CannotCast+>                     | ImplicitToPreferred+>                     | ImplicitToNonPreferred+>                       deriving (Eq,Show)+>++resolveResultSetType -+partially implement the typing of results sets where the types aren't+all the same and not unknown+used in union,except,intersect columns, case, array ctor, values, greatest and least++algo:+if all inputs are same and not unknown -> that type+replace domains with base types+if all inputs are unknown then text+if the non unknown types aren't all in same category then fail+choose first input type that is a preferred type if there is one+choose last non unknown type that has implicit casts from all preceding inputs+check all can convert to selected type else fail++code is not as much of a mess as findCallMatch++> resolveResultSetType :: Environment -> [Type] -> Either [TypeError] Type+> resolveResultSetType env inArgs =+>   dependsOnRTpe inArgs $ do+>   errorWhen (null inArgs) [TypelessEmptyArray]+>   returnWhen allSameType (head inArgs) $ do+>   returnWhen allSameBaseType (head inArgsBase) $ do+>   returnWhen allUnknown (ScalarType "text") $ do+>   errorWhen (not allSameCat) [IncompatibleTypeSet inArgs]+>   returnWhen (isJust targetType &&+>               allConvertibleToFrom (fromJust targetType) inArgs)+>               (fromJust targetType) $ do+>   Left [IncompatibleTypeSet inArgs]+>   where+>      allSameType = all (== head inArgs) inArgs &&+>                      head inArgs /= UnknownType+>      allSameBaseType = all (== head inArgsBase) inArgsBase &&+>                      head inArgsBase /= UnknownType+>      inArgsBase = map (replaceWithBase env) inArgs+>      allUnknown = all (==UnknownType) inArgsBase+>      allSameCat = let firstCat = envTypeCategory env (head knownTypes)+>                   in all (\t -> envTypeCategory env t == firstCat)+>                          knownTypes+>      targetType = case catMaybes [firstPreferred, lastAllConvertibleTo] of+>                     [] -> Nothing+>                     (x:_) -> Just x+>      firstPreferred = find (envPreferredType env) knownTypes+>      lastAllConvertibleTo = firstAllConvertibleTo (reverse knownTypes)+>      firstAllConvertibleTo (x:xs) = if allConvertibleToFrom x xs+>                                       then Just x+>                                       else firstAllConvertibleTo xs+>      firstAllConvertibleTo [] = Nothing+>      knownTypes = filter (/=UnknownType) inArgsBase+>      allConvertibleToFrom = all . flip (castableFromTo env ImplicitCastContext)++todo:+cast empty array, where else can an empty array work?++================================================================================++= checkAssignmentValue++> checkAssignmentValid :: Environment -> Type -> Type -> Either [TypeError] ()+> checkAssignmentValid env from to =+>     if castableFromTo env AssignmentCastContext from to+>        then Right ()+>        else Left [IncompatibleTypes to from]++> compositesCompatible :: Environment -> Type -> Type -> Bool+> compositesCompatible env =+>     castableFromTo env ImplicitCastContext++================================================================================++= castable function++wrapper around the catalog to add a bunch of extra valid casts++> castableFromTo :: Environment -> CastContext -> Type -> Type -> Bool+> castableFromTo env cc from to =+>   {-trace ("check cast " ++ show from ++ "->" ++ show to) $-}+>   -- put this here to avoid having to write it everywhere else+>   from == to+>   -- unknown can be implicitly cast to anything (is this completely true?)+>   || from == UnknownType+>   --hack?+>   || to == UnknownType+>   -- check base types of domains+>   || ((isDomainType from || isDomainType to)+>       && castableFromTo env cc (replaceWithBase env from)+>                                (replaceWithBase env to))+>   -- check the casts listed in the catalog+>   || envCast env cc from to+>   -- implicitcast => assignment cast+>   || (cc == AssignmentCastContext+>       && envCast env ImplicitCastContext from to)+>   -- can assign composite to record+>   || (cc == AssignmentCastContext+>       && isCompOrSetoOfComp from+>       && case to of+>            PgRecord _ -> True+>            _ -> False)+>   -- check unboxing: wrapped single attribute+>   || recurseTransFrom (unboxedSingleType from)+>   || recurseTransTo (unboxedSingleType to)+>   -- check unboxing: wrapped composite+>   || recurseTransFrom (unboxedSetOfType from)+>   || recurseTransTo (unboxedSetOfType to)+>   -- check composites compatible by comparing attribute types+>   || case (getCompositeTypes from+>           ,getCompositeTypes to) of+>        -- zip almost does the right thing here, needs a bit of tweaking+>        (Just ft, Just tt) | length ft == length tt -> all (uncurry $ castableFromTo env cc) $ zip ft tt+>        _ -> False+>   where++>     getCompositeTypes (NamedCompositeType n) =+>         Just $ map snd $ fromRight [] $ envCompositePublicAttrs env [] n+>     getCompositeTypes (CompositeType t) = Just $ map snd t+>     getCompositeTypes (AnonymousRecordType t) = Just t+>     getCompositeTypes (PgRecord Nothing) = Nothing+>     getCompositeTypes (PgRecord (Just t)) = getCompositeTypes t+>     getCompositeTypes _ = Nothing++>     isCompOrSetoOfComp (SetOfType c) = isCompositeType c+>     isCompOrSetoOfComp c = isCompositeType c++>     unboxedSingleType (SetOfType (CompositeType [(_,t)])) = Just t+>     unboxedSingleType (PgRecord (Just t)) = unboxedSingleType t+>     unboxedSingleType _ = Nothing++>     unboxedSetOfType (SetOfType a) = Just a+>     unboxedSetOfType (PgRecord (Just t)) = unboxedSetOfType t+>     unboxedSetOfType _ = Nothing++>     recurseTransFrom = maybe False (flip (castableFromTo env cc) to)+>     recurseTransTo = maybe False (castableFromTo env cc from)++> replaceWithBase :: Environment -> Type -> Type+> replaceWithBase env t@(DomainType _) = envDomainBaseType env t+> replaceWithBase _ t = t
− Database/HsSqlPpp/AstInternals/TypeCheckingH.lhs
@@ -1,260 +0,0 @@-Copyright 2009 Jake Wheat--This file contains some utility functions for working with types and-type checking, which have been moved out of TypeChecking.ag for ease-of development (no uuagc mode for emacs is the problem).--> {-# OPTIONS_HADDOCK hide #-}--> module Database.HsSqlPpp.AstInternals.TypeCheckingH->     (->      typeCheckFunCall->     ,typeCheckValuesExpr->     ,getAttrs->     ,combineTableTypesWithUsingList->     ,doSelectItemListTpe->     ,splitIdentifier->     ,getRelationType->     ,checkColumnConsistency->     ,checkRelationExists->     ,convertToNewStyleUpdates->     ,commonFieldNames->     ,typeCheckCombineSelect->     ,chainTypeCheckFailed->     ,errorToTypeFail->     ,errorToTypeFailF->     ,checkErrorList->     ,getErrors->     ) where--> import Data.Maybe-> import Data.List-> import Debug.Trace-> import Data.Either-> import Control.Applicative-> import Control.Monad.Error--> import Database.HsSqlPpp.AstInternals.TypeType-> import Database.HsSqlPpp.AstInternals.AstUtils-> import Database.HsSqlPpp.AstInternals.TypeConversion-> import Database.HsSqlPpp.AstInternals.EnvironmentInternal-> import Database.HsSqlPpp.Utils--================================================================================--= type check code--> typeCheckFunCall :: Environment -> String -> [Type] -> Either [TypeError] Type-> typeCheckFunCall env fnName argsType =->     chainTypeCheckFailed argsType $->       case fnName of->               -- do the special cases first, some of these will use->               -- the variadic support when it is done and no longer->               -- be special cases.->               "!arrayCtor" ->->                     ArrayType <$> resolveResultSetType env argsType->               "!between" -> do->                     f1 <- lookupFn ">=" [argsType !! 0, argsType !! 1]->                     f2 <- lookupFn "<=" [argsType !! 0, argsType !! 2]->                     lookupFn "!and" [f1,f2]->               "coalesce" -> resolveResultSetType env argsType->               "greatest" -> do->                     t <- resolveResultSetType env argsType->                     lookupFn ">=" [t,t]->                     return t->               "least" -> do->                     t <- resolveResultSetType env argsType->                     lookupFn "<=" [t,t]->                     return t->               "!rowCtor" -> return $ RowCtor argsType->                     -- special case the row comparison ops->               _ | let isRowCtor t = case t of->                                       RowCtor _ -> True->                                       _ -> False->                   in fnName `elem` ["=", "<>", "<=", ">=", "<", ">"]->                          && length argsType == 2->                          && all isRowCtor argsType ->->                     checkRowTypesMatch (head argsType) (head $ tail argsType)->               s -> lookupFn s argsType->     where->       lookupFn :: String -> [Type] -> Either [TypeError] Type->       lookupFn s1 args = do->         (_,_,r) <- findCallMatch env->                              (if s1 == "u-" then "-" else s1) args->         return r->       checkRowTypesMatch (RowCtor t1s) (RowCtor t2s) = do->         when (length t1s /= length t2s) $ Left [ValuesListsMustBeSameLength]->         --this is wrong - we want all the errors, not just the first set->         mapM_ (resolveResultSetType env . (\(a,b) -> [a,b])) $ zip t1s t2s->         return typeBool->       checkRowTypesMatch x y  =->         error $ "internal error: checkRowTypesMatch called with " ++ show x ++ "," ++ show y---> typeCheckValuesExpr :: Environment -> [[Type]] -> Either [TypeError] Type-> typeCheckValuesExpr env rowsTs =->         let colNames = zipWith (++)->                            (repeat "column")->                            (map show [1..length $ head rowsTs])->         in unionRelTypes env rowsTs colNames--> typeCheckCombineSelect :: Environment -> Type -> Type -> Either [TypeError] Type-> typeCheckCombineSelect env v1 v2 = do->     u1 <- unwrapSetOfComposite v1->     let colNames = map fst u1->     u2 <- unwrapSetOfComposite v2->     let colTypes1 = map snd u1->     let colTypes2 = map snd u2->     unionRelTypes env [colTypes1,colTypes2] colNames--> unionRelTypes :: Environment -> [[Type]] -> [String] -> Either [TypeError] Type-> unionRelTypes env rowsTs colNames =->   let lengths = map length rowsTs->   in case () of->              _ | null rowsTs ->->                    Left [NoRowsGivenForValues]->                | not (all (==head lengths) lengths) ->->                    Left [ValuesListsMustBeSameLength]->                | otherwise ->->                    --i don't think this propagates all the errors, just the first set->                    mapM (resolveResultSetType env) (transpose rowsTs) >>=->                      (return . SetOfType . UnnamedCompositeType . zip colNames)--================================================================================--= utils--lookup a composite type name, restricting it to only certain kinds of-composite type, returns the composite definition which you can get the-attributes out of which is a pair with the normal columns first, then-the system columns second--> getAttrs :: Environment -> [CompositeFlavour] -> String -> Maybe CompositeDef-> getAttrs env f n = case envCompositeAttrs env f (CompositeType n) of->                      Left _ -> Nothing->                      Right a -> Just a--combine two relvar types when being joined, pass in a using list and-it checks the types in the using list are compatible, and eliminates-duplicate columns of the attrs in the using list, returns the relvar-type of the joined tables.--> combineTableTypesWithUsingList :: Environment -> [String] -> Type -> Type -> Either [TypeError] Type-> combineTableTypesWithUsingList env l t1c t2c = do->     --check t1 and t2 have l->     t1 <-unwrapComposite t1c->     t2 <- unwrapComposite t2c->     let names1 = getNames t1->     let names2 = getNames t2->     when (not (contained l names1) ||->               not (contained l names2)) $->          Left [MissingJoinAttribute]->     --check the types->     joinColumnTypes <- mapM (getColumnType t1 t2) l->     let nonJoinColumns =->             let notJoin = (\(s,_) -> s `notElem` l)->             in filter notJoin t1 ++ filter notJoin t2->     return $ UnnamedCompositeType $ zip l joinColumnTypes ++ nonJoinColumns->     where->       getNames :: [(String,Type)] -> [String]->       getNames = map fst->       contained l1 l2 = all (`elem` l2) l1->       getColumnType :: [(String,Type)] -> [(String,Type)] -> String -> Either [TypeError] Type->       getColumnType t1 t2 f =->           let ct1 = getFieldType t1 f->               ct2 = getFieldType t2 f->           in resolveResultSetType env [ct1,ct2]->       getFieldType t f = snd $ fromJust $ find (\(s,_) -> s == f) t--> doSelectItemListTpe :: Environment->                     -> String->                     -> Type->                     -> Type->                     -> Type-> doSelectItemListTpe env colName colType types =->     if types == TypeCheckFailed->        then types->        else errorToTypeFail (do->          let (correlationName,iden) = splitIdentifier colName->          newCols <- if iden == "*"->                          then envExpandStar env correlationName->                          else return [(iden, colType)]->          foldM (flip consComposite) types $ reverse newCols)--I think this should be alright, an identifier referenced in an-expression can only have zero or one dot in it.--> splitIdentifier :: String -> (String,String)-> splitIdentifier s = let (a,b) = span (/= '.') s->                     in if b == ""->                          then ("", a)->                          else (a,tail b)---returns the type of the relation, and the system columns also--> getRelationType :: Environment -> String -> Either [TypeError] (Type,Type)-> getRelationType env tbl =->           case getAttrs env [TableComposite, ViewComposite] tbl of->             Just ((_,_,a@(UnnamedCompositeType _), s@(UnnamedCompositeType _)))->                  -> Right (a,s)->             _ -> Left [UnrecognisedRelation tbl]--> commonFieldNames :: Type -> Type -> [String]-> commonFieldNames t1 t2 =->     intersect (fn t1) (fn t2)->     where->       fn (UnnamedCompositeType s) = map fst s->       fn _ = []--> checkColumnConsistency :: Environment ->  String -> [String] -> [(String,Type)]->                        -> Either [TypeError] [(String,Type)]-> checkColumnConsistency env tbl cols' insNameTypePairs = do->   rt <- getRelationType env tbl->   ttcols <- unwrapComposite $ fst rt->   let cols :: [String]->       cols = if null cols'->                then map fst ttcols->                else cols'->   errorWhen (length insNameTypePairs /= length cols) [WrongNumberOfColumns]->   let nonMatchingColumns = cols \\ map fst ttcols->   errorWhen (not $ null nonMatchingColumns) $->        map UnrecognisedIdentifier nonMatchingColumns->   let targetNameTypePairs =->         map (\l -> (l,fromJust $ lookup l ttcols)) cols->         --check the types of the insdata match the column targets->         --name datatype columntype->       typeTriples = map (\((a,b),c) -> (a,b,c)) $ zip targetNameTypePairs $ map snd insNameTypePairs->       errs :: [TypeError]->       errs = concat $ lefts $ map (\(_,b,c) -> checkAssignmentValid env c b) typeTriples->   unless (null errs) $ Left errs->   return targetNameTypePairs--> checkRelationExists :: Environment -> String -> Maybe TypeError-> checkRelationExists env tbl =->           case getAttrs env [TableComposite, ViewComposite] tbl of->             Just _ -> Nothing->             _ -> Just $ UnrecognisedRelation tbl--this function a bit of a mess - artefact of not fully updated code-after the environment data type was changed.--> convertToNewStyleUpdates :: [(String, ([(String,Type)], [(String,Type)]))] -> [String] -> [EnvironmentUpdate]-> convertToNewStyleUpdates qualIdens joinIdens =->   -- we're given a list of qualified types, and a list of names of join columns->   -- want to produce a list of qualified types, with an additional one with "" qualification->   -- and produce a star expansion->     [EnvStackIDs newQualifiedList->     ,EnvSetStarExpansion newStarExpansion]->   where->     qualifiedFieldsCombined :: [(String,[(String,Type)])]->     qualifiedFieldsCombined = map (\(alias,(att,sysatt)) -> (alias, att++sysatt)) qualIdens->     isJoinField (n,_) = n `elem` joinIdens->     (joinFields,nonJoinFields) = partition isJoinField $ concatMap snd qualifiedFieldsCombined->     --need to resolve types instead of using nub->     newQualifiedList = ("", nub joinFields ++ nonJoinFields):qualifiedFieldsCombined->     qualifiedFieldsStarExp = map (\(alias,(att,_)) -> (alias, att)) qualIdens->     (joinFieldsStarExp,nonJoinFieldsStarExp) =->         partition isJoinField $ concatMap snd qualifiedFieldsStarExp->     --need to resolve types instead of using nub->     newStarExpansion = ("", nub joinFieldsStarExp ++ nonJoinFieldsStarExp):qualifiedFieldsStarExp
− Database/HsSqlPpp/AstInternals/TypeConversion.lhs
@@ -1,498 +0,0 @@-Copyright 2009 Jake Wheat--This file contains the functions for resolving types and-function/operator resolution. See the pg manual chapter 10:--http://www.postgresql.org/docs/8.4/interactive/typeconv.html--This code is really spaghettified.--findCallMatch - pass in a name and a list of arguments, and it returns-the matching function. (pg manual 10.2,10.3)--resolveResultSetType - pass in a set of types, and it tries to find-the common type they can all be cast to. (pg manual 10.5)--checkAssignmentValid - pass in source type and target type, returns-                typelist[] if ok, otherwise error, pg manual 10.4-                Value Storage--> {-# OPTIONS_HADDOCK hide #-}--> module Database.HsSqlPpp.AstInternals.TypeConversion (->                        findCallMatch->                       ,resolveResultSetType->                       ,checkAssignmentValid->                       ) where--> import Data.Maybe-> import Data.List--> import Database.HsSqlPpp.AstInternals.TypeType-> import Database.HsSqlPpp.AstInternals.AstUtils-> import Database.HsSqlPpp.AstInternals.EnvironmentInternal-> import Database.HsSqlPpp.Utils---= findCallMatch--findCallMatch - partially implements the type conversion rules for-finding an operator or function match given a name and list of-arguments with partial or fully specified types--TODO:, qualifiers-namespaces-function style casts not in catalog-variadic args-default args-domains -> base type-what about aggregates and window functions?--Algo:--cands = all fns with matching names-        and same number of args--if exact match on types in this list, use it-  (if binary operator being matched, and one arg is typed and one is-  unknown, also match an operator by assuming the unknown is the same-  as the typed arg)--best match part:--filter cands with args which don't exactly match input args, and input-args cannot be converted by an implicit cast. unknowns count as-matching anything-if one left: use it--filter for preferred types:--for each cand, count each arg at each position which needs conversion,-and the cand type is a preferred type at that position.-if there are cands with count>0, keep only cands with the max count,-if one return it-if there are no cands with count>0, keep them all--check unknowns:-if any input args are unknown, and any cand accepts string at that-position, fix that arg's category as string, otherwise if all cands-accept same category at that position, fix that input args as that-category.-if we still have unknowns, then fail--discard cands which don't match the new input arg/category list--for each categorised input arg, if any cand accepts preferred type at-that position, get rid of cands which don't accept preferred type at-that position--if one left: use-else fail--polymorphic matching:-want to create a set of matches to insert into the cast pairs list-so:--find all matches on name, num args and have polymorphic parameters--for each one, check the polymorphic categories - eliminate fns that-have params in wrong category - array, non array, enum.-work out the base types for the polymorphic args at each spot based on-the args passed - so each arg is unchanged except arrays which have-the array part stripped off--now we have a list of types to match against the polymorphic params,-use resolveResultSetType to see if we can produce a match, if so,-create a new prototype which is the same as the polymorphic function-but with this matching arg swapped in, work out the casts and add it-into cand cast pairs, after exact match has been run.---findCallMatch is a bit of a mess--> type ProtArgCast = (FunctionPrototype, [ArgCastFlavour])--> findCallMatch :: Environment -> String -> [Type] ->  Either [TypeError] FunctionPrototype-> findCallMatch env f inArgs =->     returnIfOnne [->        exactMatch->       ,binOp1UnknownMatch->       ,polymorpicExactMatches->       ,reachable->       ,mostExactMatches->       ,filteredForPreferred->       ,unknownMatchesByCat]->       [NoMatchingOperator f inArgs]->     where->       -- basic lists which roughly mirror algo->       -- get the possibly matching candidates->       initialCandList :: [FunctionPrototype]->       initialCandList = filter (\(_,candArgs,_) ->->                                   length candArgs == length inArgs) $->                                envLookupFns env f->->       -- record what casts are needed for each candidate->       castPairs :: [[ArgCastFlavour]]->       castPairs = map (listCastPairs . getFnArgs) initialCandList->->       candCastPairs :: [ProtArgCast]->       candCastPairs = zip initialCandList castPairs->->       -- see if we have an exact match->       exactMatch :: [ProtArgCast]->       exactMatch = filterCandCastPairs (all (==ExactMatch)) candCastPairs->->       -- implement the one known, one unknown resolution for binary operators->       binOp1UnknownMatch :: [ProtArgCast]->       binOp1UnknownMatch = getBinOp1UnknownMatch candCastPairs->->       --collect possible polymorphic matches->       polymorphicMatches :: [ProtArgCast]->       polymorphicMatches = filterPolymorphics candCastPairs->->       polymorpicExactMatches :: [ProtArgCast]->       polymorpicExactMatches = filterCandCastPairs (all (==ExactMatch)) polymorphicMatches->->       -- eliminate candidates for which the inargs cannot be casted to->       reachable :: [ProtArgCast]->       reachable = mergePolys (filterCandCastPairs (none (==CannotCast)) candCastPairs)->                     polymorphicMatches->->       mostExactMatches :: [ProtArgCast]->       mostExactMatches =->         let inArgsBase = map (replaceWithBase env) inArgs->             exactCounts :: [Int]->             exactCounts =->               map ((length->                       . filter (\(a1,a2) -> a1==replaceWithBase env a2)->                       . zip inArgsBase)->                 . (\((_,a,_),_) -> a)) reachable->             pairs = zip reachable exactCounts->             maxm = maximum exactCounts->         in case () of->              _ | null reachable -> []->                | maxm > 0 -> map fst $ filter (\(_,b) -> b == maxm) pairs->                | otherwise -> []->->       -- keep the cands with the most casts to preferred types->       preferredTypesCounts = countPreferredTypeCasts reachable->       keepCounts = maximum preferredTypesCounts->       itemCountPairs :: [(ProtArgCast,Int)]->       itemCountPairs = zip reachable preferredTypesCounts->       filteredForPreferred :: [ProtArgCast]->       filteredForPreferred = map fst $ filter (\(_,i) -> i == keepCounts) itemCountPairs->->       -- collect the inArg type categories to do unknown inArg resolution->       argCats :: [Either () String]->       argCats = getCastCategoriesForUnknowns filteredForPreferred->       unknownMatchesByCat :: [ProtArgCast]->       unknownMatchesByCat = getCandCatMatches filteredForPreferred argCats->->       -------------->->       listCastPairs :: [Type] -> [ArgCastFlavour]->       listCastPairs l = listCastPairs' inArgs l->                         where->                           listCastPairs' :: [Type] -> [Type] -> [ArgCastFlavour]->                           listCastPairs' (ia:ias) (ca:cas) =->                               (case () of->                                  _ | ia == ca -> ExactMatch->                                    | implicitlyCastableFromTo env ia ca ->->                                        if envPreferredType env ca->                                          then ImplicitToPreferred->                                          else ImplicitToNonPreferred->                                    | otherwise -> CannotCast->                               ) : listCastPairs' ias cas->                           listCastPairs' [] [] = []->                           listCastPairs' _ _ = error "internal error: mismatched num args in implicit cast algorithm"->->->       getBinOp1UnknownMatch :: [ProtArgCast] -> [ProtArgCast]->       getBinOp1UnknownMatch cands =->           if not (isOperatorName f &&->                   length inArgs == 2 &&->                   count (==UnknownStringLit) inArgs == 1)->             then []->             else let newInArgs =->                          replicate 2 (if head inArgs == UnknownStringLit->                                         then inArgs !! 1->                                         else head inArgs)->                  in filter (\((_,a,_),_) -> a == newInArgs) cands->->       filterPolymorphics :: [ProtArgCast] -> [ProtArgCast]->       filterPolymorphics cl =->           let ms :: [ProtArgCast]->               ms = filter canMatch polys->               polyTypes :: [Maybe Type]->               polyTypes = map resolvePolyType ms->               polyTypePairs :: [(Maybe Type, ProtArgCast)]->               polyTypePairs = zip polyTypes ms->               keepPolyTypePairs :: [(Type, ProtArgCast)]->               keepPolyTypePairs =->                 mapMaybe (\(t,p) -> case t of->                                            Nothing -> Nothing->                                            Just t' -> Just (t',p))->                               polyTypePairs->               finalRows = map (\(t,p) -> instantiatePolyType p t)->                               keepPolyTypePairs->               --create the new cast lists->               cps :: [[ArgCastFlavour]]->               cps = map (listCastPairs . getFnArgs . fst) finalRows->           in zip (map fst finalRows) cps->           where->             polys :: [ProtArgCast]->             polys = filter (\((_,a,_),_) -> any (`elem`->                                              [Pseudo Any->                                              ,Pseudo AnyArray->                                              ,Pseudo AnyElement->                                              ,Pseudo AnyEnum->                                              ,Pseudo AnyNonArray]) a) cl->             canMatch :: ProtArgCast -> Bool->             canMatch pac =->                let ((_,fnArgs,_),_) = pac->                in canMatch' inArgs fnArgs->                where->                  canMatch' [] [] = True->                  canMatch' (ia:ias) (pa:pas) =->                    case pa of->                      Pseudo Any -> nextMatch->                      Pseudo AnyArray -> isArrayType ia && nextMatch->                      Pseudo AnyElement -> nextMatch->                      Pseudo AnyEnum -> False->                      Pseudo AnyNonArray -> if isArrayType ia->                                              then False->                                              else nextMatch->                      _ -> True->                    where->                      nextMatch = canMatch' ias pas->                  canMatch' _ _ = error "internal error: mismatched lists in canMatch'"->             resolvePolyType :: ProtArgCast -> Maybe Type->             resolvePolyType ((_,fnArgs,_),_) =->                 {-trace ("\nresolving " ++ show fnArgs ++ " against " ++ show inArgs ++ "\n") $-}->                 let argPairs = zip inArgs fnArgs->                     typeList :: [Type]->                     typeList = catMaybes $ flip map argPairs->                                  (\(ia,fa) -> case fa of->                                                   Pseudo Any -> if isArrayType ia->                                                                          then eitherToMaybe $ unwrapArray ia->                                                                          else Just ia->                                                   Pseudo AnyArray -> eitherToMaybe $ unwrapArray ia->                                                   Pseudo AnyElement -> if isArrayType ia->                                                                          then eitherToMaybe $ unwrapArray ia->                                                                          else Just ia->                                                   Pseudo AnyEnum -> Nothing->                                                   Pseudo AnyNonArray -> Just ia->                                                   _ -> Nothing)->                 in {-trace ("\nresolve types: " ++ show typeList ++ "\n") $-}->                    case resolveResultSetType env typeList of->                      Left _ -> Nothing->                      Right t -> Just t->             instantiatePolyType :: ProtArgCast -> Type -> ProtArgCast->             instantiatePolyType pac t =->               let ((fn,a,r),_) = pac->                   instArgs = swapPolys t a->                   p1 = (fn, instArgs, swapPoly t r)->               in let x = (p1,listCastPairs instArgs)->                  in {-trace ("\nfixed:" ++ show x ++ "\n")-} x->               where->                 swapPolys :: Type -> [Type] -> [Type]->                 swapPolys = map . swapPoly->                 swapPoly :: Type -> Type -> Type->                 swapPoly pit at =->                   case at of->                     Pseudo Any -> if isArrayType at->                                     then ArrayType pit->                                     else pit->                     Pseudo AnyArray -> ArrayType pit->                     Pseudo AnyElement -> if isArrayType at->                                            then ArrayType pit->                                            else pit->                     Pseudo AnyEnum -> pit->                     Pseudo AnyNonArray -> pit->                     _ -> at->       --merge in the instantiated poly functions, with a twist:->       -- if we already have the exact same set of args in the non poly list->       -- as a poly, then don't include that poly->       mergePolys :: [ProtArgCast] -> [ProtArgCast] -> [ProtArgCast]->       mergePolys orig polys =->           let origArgs = map (\((_,a,_),_) -> a) orig->               filteredPolys = filter (\((_,a,_),_) -> a `notElem` origArgs) polys->           in orig ++ filteredPolys->->       countPreferredTypeCasts :: [ProtArgCast] -> [Int]->       countPreferredTypeCasts =->           map (\(_,cp) -> count (==ImplicitToPreferred) cp)->->       -- Left () is used for inArgs which aren't unknown,->       --                      and for unknowns which we don't have a->       --                      unique category->       -- Right s -> s is the single letter category at->       --                           that position->       getCastCategoriesForUnknowns :: [ProtArgCast] -> [Either () String]->       getCastCategoriesForUnknowns cands =->           filterArgN 0->           where->             candArgLists :: [[Type]]->             candArgLists = map (\((_,a,_), _) -> a) cands->             filterArgN :: Int -> [Either () String]->             filterArgN n =->                 if n == length inArgs->                   then []->                   else let targType = inArgs !! n->                        in ((if targType /= UnknownStringLit->                               then Left ()->                               else getCandsCatAt n) : filterArgN (n+1))->                 where->                   getCandsCatAt :: Int -> Either () String->                   getCandsCatAt n' =->                       let typesAtN = map (!!n') candArgLists->                           catsAtN = map (envTypeCategory env) typesAtN->                       in case () of->                            --if any are string choose string->                            _ | any (== "S") catsAtN -> Right "S"->                              -- if all are same cat choose that->                              | all (== head catsAtN) catsAtN -> Right $ head catsAtN->                              -- otherwise no match, this will be->                              -- picked up as complete failure to match->                              -- later on->                              | otherwise -> Left ()->->       getCandCatMatches :: [ProtArgCast] -> [Either () String] -> [ProtArgCast]->       getCandCatMatches candsA cats = getMatches candsA 0->          where->            getMatches :: [ProtArgCast] -> Int -> [ProtArgCast]->            getMatches cands n =->                case () of->                  _ | n == length inArgs -> cands->                    | (inArgs !! n) /= UnknownStringLit -> getMatches cands (n + 1)->                    | otherwise ->->                        let catMatches :: [ProtArgCast]->                            catMatches = filter (\c -> Right (getCatForArgN n c) ==->                                                      (cats !! n)) cands->                            prefMatches :: [ProtArgCast]->                            prefMatches = filter (envPreferredType env .->                                                    getTypeForArgN n) catMatches->                            keepMatches :: [ProtArgCast]->                            keepMatches = if length prefMatches > 0->                                            then prefMatches->                                            else catMatches->                        in getMatches keepMatches (n + 1)->            getTypeForArgN :: Int -> ProtArgCast -> Type->            getTypeForArgN n ((_,a,_),_) = a !! n->            getCatForArgN :: Int -> ProtArgCast -> String->            getCatForArgN n = envTypeCategory env . getTypeForArgN n->->       -- utils->       -- filter a candidate/cast flavours pair by a predicate on each->       -- individual cast flavour->       filterCandCastPairs :: ([ArgCastFlavour] -> Bool)->                           -> [ProtArgCast]->                           -> [ProtArgCast]->       filterCandCastPairs predi = filter (\(_,cp) -> predi cp)->->       getFnArgs :: FunctionPrototype -> [Type]->       getFnArgs (_,a,_) = a->       returnIfOnne [] e = Left e->       returnIfOnne (l:ls) e = if length l == 1->                               then Right $ getHeadFn l->                               else returnIfOnne ls e->->       getHeadFn :: [ProtArgCast] -> FunctionPrototype->       getHeadFn l =  let ((hdFn, _):_) = l->                      in hdFn->       none p = not . any p->       count p = length . filter p->-> data ArgCastFlavour = ExactMatch->                     | CannotCast->                     | ImplicitToPreferred->                     | ImplicitToNonPreferred->                       deriving (Eq,Show)->-> implicitlyCastableFromTo :: Environment -> Type -> Type -> Bool-> implicitlyCastableFromTo env from to = from == UnknownStringLit ||->                                          envCast env ImplicitCastContext from to->--resolveResultSetType --partially implement the typing of results sets where the types aren't-all the same and not unknown-used in union,except,intersect columns, case, array ctor, values, greatest and least--algo:-if all inputs are same and not unknown -> that type-replace domains with base types-if all inputs are unknown then text-if the non unknown types aren't all in same category then fail-choose first input type that is a preferred type if there is one-choose last non unknown type that has implicit casts from all preceding inputs-check all can convert to selected type else fail--code is not as much of a mess as findCallMatch--> resolveResultSetType :: Environment -> [Type] -> Either [TypeError] Type-> resolveResultSetType env inArgs =->   chainTypeCheckFailed inArgs $->       case () of->               _ | null inArgs -> Left [TypelessEmptyArray]->                 | allSameType -> Right $ head inArgs->                 | allSameBaseType -> Right $ head inArgsBase->                 --todo: do domains->                 | allUnknown -> Right $ ScalarType "text"->                 | not allSameCat ->->                     Left [IncompatibleTypeSet inArgs]->                 | isJust targetType &&->                   allConvertibleToFrom (fromJust targetType) inArgs ->->                       Right $ fromJust targetType->                 | otherwise -> Left [IncompatibleTypeSet inArgs]->   where->      allSameType = all (== head inArgs) inArgs &&->                      head inArgs /= UnknownStringLit->      allSameBaseType = all (== head inArgsBase) inArgsBase &&->                      head inArgsBase /= UnknownStringLit->      inArgsBase = map (replaceWithBase env) inArgs->      allUnknown = all (==UnknownStringLit) inArgsBase->      allSameCat = let firstCat = envTypeCategory env (head knownTypes)->                   in all (\t -> envTypeCategory env t == firstCat)->                          knownTypes->      targetType = case catMaybes [firstPreferred, lastAllConvertibleTo] of->                     [] -> Nothing->                     (x:_) -> Just x->      firstPreferred = find (envPreferredType env) knownTypes->      lastAllConvertibleTo = firstAllConvertibleTo (reverse knownTypes)->      firstAllConvertibleTo (x:xs) = if allConvertibleToFrom x xs->                                       then Just x->                                       else firstAllConvertibleTo xs->      firstAllConvertibleTo [] = Nothing->      matchOrImplicitToFrom t t1 = t == t1 ||->                                   implicitlyCastableFromTo env t1 t->      knownTypes = filter (/=UnknownStringLit) inArgsBase->      allConvertibleToFrom = all . matchOrImplicitToFrom--> replaceWithBase :: Environment -> Type -> Type-> replaceWithBase env t@(DomainType _) = envDomainBaseType env t-> replaceWithBase _ t = t--todo:-row ctor implicitly and explicitly cast to a composite type-cast empty array, where else can an empty array work?--================================================================================--= checkAssignmentValue--assignment is ok if:-types are equal-there is a cast from src to target--> checkAssignmentValid :: Environment -> Type -> Type -> Either [TypeError] ()-> checkAssignmentValid env src tgt =->     case () of->       _ | src == tgt -> Right()->         | assignCastableFromTo env src tgt -> Right ()->         | otherwise -> Left [IncompatibleTypes tgt src]--> assignCastableFromTo :: Environment -> Type -> Type -> Bool-> assignCastableFromTo env from to = from == UnknownStringLit ||->                                    envCast env ImplicitCastContext from to ||->                                    envCast env AssignmentCastContext from to
Database/HsSqlPpp/AstInternals/TypeType.lhs view
@@ -65,19 +65,26 @@ > data Type = ScalarType String >           | ArrayType Type >           | SetOfType Type->           | CompositeType String->           | UnnamedCompositeType [(String,Type)]+>             --three variations, choose better name for rowctor+>             --refer to composite type in catalog+>           | NamedCompositeType String+>             --refer to composite type either in catalog or one generated on fly+>           | CompositeType [(String,Type)]+>             --refer to anonymous composite type: the fields have no names+>             --these three types are equality and assign compatible if the fields+>             --are ignoring the names, so the fields have to be in the same order.+>           | AnonymousRecordType [Type] -- was rowctor+>           | PgRecord (Maybe Type) -- can only hold namedcomposite, composite or anonymousrecord >           | DomainType String >           | EnumType String->           | RowCtor [Type] >           | Pseudo PseudoType >           | TypeCheckFailed -- represents something which the type checker >                             -- doesn't know how to type check >                             -- or it cannot work the type out because of errors->           | UnknownStringLit -- represents a string literal+>           | UnknownType -- represents a string literal >                              -- token whose type isn't yet >                              -- determined->             deriving (Eq,Show,Typeable,Data)+>             deriving (Eq,Show,Ord,Typeable,Data)  > data PseudoType = Any >                 | AnyArray@@ -91,7 +98,7 @@ >                 | Internal >                 | LanguageHandler >                 | Opaque->                   deriving (Eq,Show,Typeable,Data)+>                   deriving (Eq,Show,Ord,Typeable,Data)  this list will need reviewing, probably refactor to a completely different set of infos, also will want to add more information to@@ -121,10 +128,12 @@ >                | DomainDefNotFound Type >                | BadEnvironmentUpdate String >                | TypeAlreadyExists Type+>                | AnyAllError String >                | InternalError String+>                | FromToTypesNotSame Type Type >                 --shoved in to humour the Either Monad >                | MiscError String->                  deriving (Eq,Show,Typeable,Data)+>                  deriving (Eq,Show,Ord,Typeable,Data)  > instance Error ([TypeError]) where >   noMsg = [MiscError "Unknown error"]@@ -164,7 +173,7 @@ >                     | otherwise -> s >   where >       smallIntNames = ["int2", "smallint"]->       intNames = ["int4", "integer", "int"]+>       intNames = ["int4", "integer", "int", "serial"] >       bigIntNames = ["int8", "bigint"] >       numericNames = ["numeric", "decimal"] >       float4Names = ["real", "float4"]@@ -251,16 +260,32 @@ > isArrayType (ArrayType _) = True > isArrayType _ = False +> isDomainType :: Type -> Bool+> isDomainType (DomainType _) = True+> isDomainType _ = False+++> isCompositeType :: Type -> Bool+> isCompositeType (CompositeType _) = True+> isCompositeType (NamedCompositeType _) = True+> isCompositeType (AnonymousRecordType _) = True+> isCompositeType (PgRecord _) = True+> isCompositeType _ = False++> isCompositeOrSetOfCompositeType :: Type -> Bool+> isCompositeOrSetOfCompositeType (SetOfType a) = isCompositeType a+> isCompositeOrSetOfCompositeType a = isCompositeType a+ > unwrapArray :: Type -> Either [TypeError] Type > unwrapArray (ArrayType t) = Right t > unwrapArray x = Left [InternalError $ "can't get types from non array " ++ show x]  > unwrapSetOfWhenComposite :: Type -> Either [TypeError] Type-> unwrapSetOfWhenComposite (SetOfType a@(UnnamedCompositeType _)) = Right a+> unwrapSetOfWhenComposite (SetOfType a@(CompositeType _)) = Right a > unwrapSetOfWhenComposite x = Left [InternalError $ "tried to unwrapSetOfWhenComposite on " ++ show x]  > unwrapSetOfComposite :: Type -> Either [TypeError]  [(String,Type)]-> unwrapSetOfComposite (SetOfType (UnnamedCompositeType a)) = Right a+> unwrapSetOfComposite (SetOfType (CompositeType a)) = Right a > unwrapSetOfComposite x = Left [InternalError $ "tried to unwrapSetOfComposite on " ++ show x]  @@ -269,99 +294,87 @@ > unwrapSetOf x = Left [InternalError $ "tried to unwrapSetOf on " ++ show x]  > unwrapComposite :: Type -> Either [TypeError] [(String,Type)]-> unwrapComposite (UnnamedCompositeType a) = Right a+> unwrapComposite (CompositeType a) = Right a > unwrapComposite x = Left [InternalError $ "cannot unwrapComposite on " ++ show x]  > consComposite :: (String,Type) -> Type -> Either [TypeError] Type-> consComposite l (UnnamedCompositeType a) = Right $ UnnamedCompositeType (l:a)+> consComposite l (CompositeType a) = Right $ CompositeType (l:a) > consComposite a b = Left [InternalError $ "called consComposite on " ++ show (a,b)]  > unwrapRowCtor :: Type -> Either [TypeError] [Type]-> unwrapRowCtor (RowCtor a) = Right a+> unwrapRowCtor (AnonymousRecordType a) = Right a > unwrapRowCtor x = Left [InternalError $ "cannot unwrapRowCtor on " ++ show x] +================================================================================ +new plan for types: -> {--> instance Binary Database.HsSqlPpp.TypeChecking.TypeType.CompositeFlavour where->   put Composite = putWord8 0->   put TableComposite = putWord8 1->   put ViewComposite = putWord8 2->   get = do->     tag_ <- getWord8->     case tag_ of->       0 -> return Composite->       1 -> return TableComposite->       2 -> return ViewComposite->       _ -> fail "no parse"+The type annotations attached to nodes will be either typecheckfailed 'type'+this will allow chaining type check failed more robustly. Type errors don't change. -> instance Binary Database.HsSqlPpp.TypeChecking.TypeType.CastContext where->   put ImplicitCastContext = putWord8 0->   put AssignmentCastContext = putWord8 1->   put ExplicitCastContext = putWord8 2->   get = do->     tag_ <- getWord8->     case tag_ of->       0 -> return ImplicitCastContext->       1 -> return AssignmentCastContext->       2 -> return ExplicitCastContext->       _ -> fail "no parse"+the sql type type will be changed so we can track the different+contexts where different sql types can be used, split to use different+sets of types so we can use the haskell type system to enforce these+contexts. -> instance Binary Database.HsSqlPpp.TypeChecking.TypeType.Type where->   put (ScalarType a) = putWord8 0 >> put a->   put (ArrayType a) = putWord8 1 >> put a->   put (SetOfType a) = putWord8 2 >> put a->   put (CompositeType a) = putWord8 3 >> put a->   put (UnnamedCompositeType a) = putWord8 4 >> put a->   put (DomainType a) = putWord8 5 >> put a->   put (EnumType a) = putWord8 6 >> put a->   put (RowCtor a) = putWord8 7 >> put a->   put (Pseudo a) = putWord8 8 >> put a->   put TypeCheckFailed = putWord8 9->   put UnknownStringLit = putWord8 10->   get = do->     tag_ <- getWord8->     case tag_ of->       0 -> get >>= \a -> return (ScalarType a)->       1 -> get >>= \a -> return (ArrayType a)->       2 -> get >>= \a -> return (SetOfType a)->       3 -> get >>= \a -> return (CompositeType a)->       4 -> get >>= \a -> return (UnnamedCompositeType a)->       5 -> get >>= \a -> return (DomainType a)->       6 -> get >>= \a -> return (EnumType a)->       7 -> get >>= \a -> return (RowCtor a)->       8 -> get >>= \a -> return (Pseudo a)->       9 -> return TypeCheckFailed->       10 -> return UnknownStringLit->       _ -> fail "no parse"+rename type to sqltype, too confusing otherwise+new set of sqltypes: (these aren't in one haskell type anymore)+scalar type - corresponds to sqltypes in pg which aren't one of the+  other types (no easy way to define this)+array type+setof type : can be applied to scalar, domain, ... but not all types+composite types are changed:+namedcomposite string+composite [(string,type)] -> what types can appear in the attribute list?+anonymousrecord [type] -> what types can appear here? -> this+represents a row expression type, which can be returned in select+expressions (but not as a column in a view), and is used in other places+domaintype : what types are allowable as the base type?+pseudo types: these are used for arguments and return values for function prototypes only+any*, record - just means pg infers the return type which will be a composite type (namedcomposite, composite or anonymousrecord), trigger: just a tag, void: just a tag, any*: polymorphic functions, ignore cstring, internal, language handler and opaque.+issue: a variable declaration can be a polymorphic type in a polymorphic function, but we can't use the other pseudo types so need to split these+a variable declared as type record IS NOT the same thing as the pseudo record type, I've finally worked out.+so our plpgsqlrecordtype is plpgsqlrecordtype (Nothing|one of the three composite types) -> instance Binary Database.HsSqlPpp.TypeChecking.TypeType.PseudoType where->   put Any = putWord8 0->   put AnyArray = putWord8 1->   put AnyElement = putWord8 2->   put AnyEnum = putWord8 3->   put AnyNonArray = putWord8 4->   put Cstring = putWord8 5->   put Record = putWord8 6->   put Trigger = putWord8 7->   put Void = putWord8 8->   put Internal = putWord8 9->   put LanguageHandler = putWord8 10->   put Opaque = putWord8 11->   get = do->     tag_ <- getWord8->     case tag_ of->       0 -> return Any->       1 -> return AnyArray->       2 -> return AnyElement->       3 -> return AnyEnum->       4 -> return AnyNonArray->       5 -> return Cstring->       6 -> return Record->       7 -> return Trigger->       8 -> return Void->       9 -> return Internal->       10 -> return LanguageHandler->       11 -> return Opaque->       _ -> fail "no parse"->-}+typechecking polymorphic functions: will have to relax the type+checking to some degree. want to check against each usage of the+polymorphic function in the source, so substitute in the actual types+and check the function.++contexts:+function prototypes: args and return type+function calls: args and return+variable declaration in plpgsql+attribute in a select expression+attribute in a view (less permissive than a select expression), also create table as?+attribute in a table, type (is this the same list as for composite and anonymous records? - can nest anonymous records)+base type for domain+cast expression+insert: targetatts are same set of types as attributes in a table+update: targets can be attr types or anonymous records of attr types for rowset style assign (x,y) = selectexp+assignment statement: type on left same set as type in a for, types in select into, etc?+return statement+return query statement+expressions in a raise statement+expressions in execute, anything else?+types used inside select expression checking:+  selectlist, trefs, groupby, orderby, limit, offset, where, having+expressions:+what can an identifiers type be?+what can the type of an Expression node be?+  scalar: integerlit,floatlit+  stringlit: what can an unknown resolve to (not quite everything)+  booleanlit: scalar+  nulllit: same as stringlit?+  positionalarg: any type that a function arg can have+  cast: any type you can cast to+  identifier: ?+  case, casesimple: any type in the rhs expressions, what are these?+  exists: scalar+  funcall: any type a function return type can have+  inpredicate: scalar+  windowfn: ?+  liftoperator: booleans only?++problem: can't get types using gettypeannotation function and support+different valid combinations of types
+ Database/HsSqlPpp/Commands/CommandComponents.lhs view
@@ -0,0 +1,420 @@+Copyright 2009 Jake Wheat++Wrappers used in the command line program++> {-# LANGUAGE FlexibleContexts #-}+++> {- | This module contains all the functions used in the hssqlsystem+>      exe. Mainly a set of wrappers to lift other functions into an+>      ErrorT monad. See HsSqlSystem.lhs for example use.+> -}+> module Database.HsSqlPpp.Commands.CommandComponents+>     (+>      -- * errort wrapper+>      wrapET+>      -- * parsing+>     ,lexSql+>     ,parseSql1+>     ,parseExpression1+>      -- * show and pretty print+>     ,printList+>     ,ppSh+>     ,ppSql+>     ,ppAnnOrig+>     ,ppTypeErrors+>      -- * annotations+>     ,stripAnn+>     ,typeCheckC+>     ,typeCheckExpressionC+>     ,getTEs+>     ,Database.HsSqlPpp.Commands.CommandComponents.getTopLevelTypes+>      -- * dbms access+>     ,readCatalog+>     ,clearDB+>     ,loadAst+>     ,loadSqlUsingPsqlFromFile+>     ,loadSqlUsingPsql+>     ,pgDump+>      -- catalog diffs+>     ,compareCatalogs+>     ,ppCatDiff+>     ,CatDiff(..)+>      -- extensions+>     ,runExtensions+>     -- docs+>     ,pandoc+>     ,hsTextize+>     -- testing+>     ,wrapperGen1+>      -- * utils+>     ,message+>     ,putStrLnList+>     ,readInput+>     ,Database.HsSqlPpp.Commands.CommandComponents.writeFile+>     ,lconcat+>     ,lfst+>     ,lsnd+>     ,AllErrors(..)+>     ) where++> import Control.Monad.Error+> import System+> import Data.List+> import System.IO+> import Data.Generics++> import Text.Show.Pretty+> import System.Process.Pipe+> --import Text.Pandoc++> import Database.HsSqlPpp.Parsing.Parser+> import Database.HsSqlPpp.Parsing.Lexer++> import Database.HsSqlPpp.Ast.TypeChecker as A+> import Database.HsSqlPpp.Ast.Annotation+> import Database.HsSqlPpp.Ast.Environment+> import Database.HsSqlPpp.Ast.Ast+> import Database.HsSqlPpp.Ast.SqlTypes++> import Database.HsSqlPpp.PrettyPrinter.PrettyPrinter+> import Database.HsSqlPpp.PrettyPrinter.AnnotateSource++> import Database.HsSqlPpp.Dbms.DBAccess+> import Database.HsSqlPpp.Dbms.DatabaseLoader++> import Database.HsSqlPpp.Extensions.ChaosExtensions++> import Database.HsSqlPpp.Utils+> import Database.HsSqlPpp.HsText.HsText++> import Database.HsSqlPpp.Dbms.WrapperGen++===============================================================================++parsing++> -- | Lex a string to a list of tokens.+> lexSql :: Monad m => String -> String -> ErrorT AllErrors m [Token]+> lexSql f = throwEEEither . lexSqlText f++> -- | Parse a string to an ast.+> parseSql1 :: Monad m => String -> String -> ErrorT AllErrors m StatementList+> parseSql1 f = throwEEEither . parseSql f++> -- | Parse an expression to an ast.+> parseExpression1 :: Monad m => String -> String -> ErrorT AllErrors m Expression+> parseExpression1 f = throwEEEither . parseExpression f++================================================================================++> -- | Transform an ast using the chaos syntax extensions.+> runExtensions :: (Monad m, Error e) => StatementList -> ErrorT e m StatementList+> runExtensions = return . extensionize++================================================================================++annotation ish++> -- | Take an ast and remove all the annotations. Can be used to view+> --   an ast without all the source position annotations cluttering+> --   it up.+> stripAnn :: (Monad m, Error e, Data a) => a -> ErrorT e m a+> stripAnn = return . stripAnnotations++> -- | Type check an ast against a catalog, return the annotated ast+> --   and the updated catalog.+> typeCheckC :: (Monad m, Error e) => Environment -> StatementList+>            -> ErrorT e m (Environment, StatementList)+> typeCheckC cat = return . typeCheck cat++> -- | Type check an expression ast against a catalog+> typeCheckExpressionC :: (Monad m, Error e) => Environment -> Expression+>                      -> ErrorT e m Expression+> typeCheckExpressionC cat = return . typeCheckExpression cat++could probably make this more general, so can run an arbitrary filter+on annotations and then get a list of them with source positions++> -- | Take an ast and return a list of type errors with source position+> --   if available.+> getTEs :: (Monad m, Error e, Data d) =>+>           d -> ErrorT e m [(Maybe AnnotationElement,[TypeError])]+> getTEs = return . getTypeErrors++> -- | Pretty print list of type errors with optional source position+> --   in emacs readable format.+> ppTypeErrors :: Monad m =>+>                 [(Maybe AnnotationElement, [TypeError])] -> m [String]+> ppTypeErrors tes =+>   return $ map showSpTe tes+>   where+>     showSpTe (Just (SourcePos fn l c), e) =+>         fn ++ ":" ++ show l ++ ":" ++ show c ++ ":\n" ++ show e+>     showSpTe (_,e) = "unknown:0:0:\n" ++ show e++> -- | Get the top level type annotation from the ast passed.+> getTopLevelTypes :: (Monad m, Error e, Data d) =>+>           d -> ErrorT e m [Type]+> getTopLevelTypes ast = return $ A.getTopLevelTypes [ast]+++================================================================================++pretty printing++todo: change the naming convention, so fns which produce haskell+syntax start with show, human readable stuff starts with pp, not sure+where printsql comes in system though++> -- | use ppshow to pretty print a value.+> ppSh :: (Monad m, Error e, Show a) => a -> ErrorT e m String+> ppSh = return . ppShow++> -- | pretty print an ast.+> ppSql :: (Monad m, Error e) => StatementList -> ErrorT e m String+> ppSql = return . printSql++> -- | take a source text and annotated ast and interpolate annotations into the source+> --   as comments+> ppAnnOrig :: (Monad m, Error e) => Bool -> String -> StatementList -> ErrorT e m String+> ppAnnOrig doErrs src = return . annotateSource doErrs src++================================================================================++dbms utilities++> -- | get the catalog from the database+> readCatalog :: MonadIO m => String -> ErrorT AllErrors m Environment+> readCatalog dbName =+>   liftIO (readEnvironmentFromDatabase dbName) >>=+>   throwTESEither . updateEnvironment defaultEnvironment++> -- | run psql to load the sql text into a database.+> loadSqlUsingPsql :: MonadIO m  => String -> String -> ErrorT AllErrors m String+> loadSqlUsingPsql dbName =+>   liftIO . pipeString [("psql", [dbName+>                                 ,"-q"+>                                 ,"--set"+>                                 ,"ON_ERROR_STOP=on"+>                                 ,"--file=-"])]++> -- | run psql to load sql from the filename given into a database.+> loadSqlUsingPsqlFromFile :: MonadIO m  => String -> FilePath -> ErrorT AllErrors m String+> loadSqlUsingPsqlFromFile dbName fn = do+>   ex <- liftIO $ system ("psql " ++ dbName +++>                 " -q --set ON_ERROR_STOP=on" +++>                 " --file=" ++ fn)+>   case ex of+>     ExitFailure e -> throwError $ AEMisc $ "psql failed with " ++ show e+>     ExitSuccess -> return ""++> -- | use the hssqlppp code to load the sql into a database directly+> --   (this parses and pretty prints the sql to load it)+> loadAst :: (MonadIO m, Error e) => String -> String -> StatementList -> ErrorT e m ()+> loadAst db fn = liftIO . loadIntoDatabase db fn++> -- | use a dodgy hack to clear the database given+> clearDB :: MonadIO m => String -> ErrorT AllErrors m ()+> clearDB db =+>   liftIO $ withConn ("dbname=" ++ db) $ \conn ->+>     runSqlCommand conn "drop owned by jake cascade;"++> -- | dump the given database to sql source using pg_dump+> pgDump :: MonadIO m => String -> ErrorT AllErrors m String+> pgDump db = liftIO $ pipeString [("pg_dump", [db+>                                              ,"--schema-only"+>                                              ,"--no-owner"+>                                              ,"--no-privileges"])] ""++================================================================================++catalog stuff - just a diff to compare two catalogs++> -- | items in first catalog and not second, items in second and not first.+> data CatDiff = CatDiff [EnvironmentUpdate] [EnvironmentUpdate]+>                deriving Show++> -- | find differences between two catalogs+> compareCatalogs :: (Monad m, Error e) => Environment -> Environment -> Environment -> ErrorT e m CatDiff+> compareCatalogs base start end =+>         let baseEnvBits = deconstructEnvironment base+>             startEnvBits = deconstructEnvironment start \\ baseEnvBits+>             endEnvBits = deconstructEnvironment end \\ baseEnvBits+>             missing = sort $ endEnvBits \\ startEnvBits+>             extras = sort $ startEnvBits \\ endEnvBits+>         in return $ CatDiff missing extras++> -- | print a catdiff in a more human readable way than show.+> ppCatDiff :: (Monad m, Error e) => CatDiff -> ErrorT e m String+> ppCatDiff (CatDiff missing extra) =+>           return $ "\nmissing:\n"+>                    ++ intercalate "\n" (map ppEnvUpdate missing)+>                    ++ "\nextra:\n"+>                    ++ intercalate "\n" (map ppEnvUpdate extra)++================================================================================++> -- | Documentation command to produce some hssqlppp docs, takes a+> --   pandoc source file and converts to html, can run and insert+> --   commands embedded in the source+> pandoc :: MonadIO m => String -> ErrorT AllErrors m String+> pandoc txt = return txt {-+>   liftM (writeHtmlString wopt . readMarkdown defaultParserState)+>     (hsTextize txt)+>   where+>     wopt = defaultWriterOptions {+>                writerStandalone = True+>               ,writerTitlePrefix = "HsSqlPpp documentation"+>               ,writerTableOfContents = True+>               ,writerHeader = "<style>\n\+>                               \pre {\n\+>                               \    border: 1px dotted gray;\n\+>                               \    background-color: #ececec;\n\+>                               \    color: #1111111;\n\+>                               \    padding: 0.5em;\n\+>                               \}\n\+>                               \</style>"+>              }-}+++writerStandalone :: Bool	Include header and footer+writerHeader :: String	Header for the document+writerTitlePrefix :: String	Prefix for HTML titles+writerTabStop :: Int	Tabstop for conversion btw spaces and tabs+writerTableOfContents :: Bool	Include table of contents+writerS5 :: Bool	We're writing S5+writerHTMLMathMethod :: HTMLMathMethod	How to print math in HTML+writerIgnoreNotes :: Bool	Ignore footnotes (used in making toc)+writerIncremental :: Bool	Incremental S5 lists+writerNumberSections :: Bool	Number sections in LaTeX+writerIncludeBefore :: String	String to include before the body+writerIncludeAfter :: String	String to include after the body+writerStrictMarkdown :: Bool	Use strict markdown syntax+writerReferenceLinks :: Bool	Use reference links in writing markdown, rst+writerWrapText :: Bool	Wrap text to line length+writerLiterateHaskell :: Bool	Write as literate haskell+writerEmailObfuscation :: ObfuscationMethod	How to obfu++>   {-ex <- liftIO $ system ("pandoc -s -f markdown -t html "+>                          ++ src ++ " -o " ++ tgt)+>   case ex of+>     ExitFailure e -> throwError $ AEMisc $ "psql failed with " ++ show e+>     ExitSuccess -> return ()-}++================================================================================++process doc commands++> -- | read a text file, and pull out the commands, run them and insert+> --   the results into the text+> hsTextize :: MonadIO m => String -> ErrorT AllErrors m String+> hsTextize s =+>     liftIO (hsTextify+>              (("hssqlsystem", hsSqlSystemCommand):defaultCommands)+>              "docs/build"+>              s) >>= throwEither . mapLeft AEMisc++> -- | run hssqlsystem using shell+> hsSqlSystemCommand :: String -> IO String+> hsSqlSystemCommand s =  shell ("HsSqlSystem " ++ s) >>= \m ->+>                         return $ "$ HsSqlSystem " ++ s+>                                  ++ "\n\n~~~~~~~~~~\n"+>                                  ++ m+>                                  ++ "\n~~~~~~~~~~\n\n"++================================================================================++> wrapperGen1 :: (MonadIO m, Error e) => String -> String -> ErrorT e m String+> wrapperGen1 db fn = liftIO $ wrapperGen db fn+++================================================================================++errort stuff++wrap all our errors in an algebraic data type, not sure if there is a+more elegant way of doing this but it does the job for now++> data AllErrors = AEExtendedError ParseErrorExtra+>                | AETypeErrors [TypeError]+>                | AEMisc String+>                  deriving (Show)++> instance Error AllErrors where+>   noMsg = AEMisc "Unknown error"+>   strMsg = AEMisc++> throwEEEither :: (MonadError AllErrors m) => Either ParseErrorExtra a -> m a+> throwEEEither = throwEither . mapLeft AEExtendedError++> throwTESEither :: (MonadError AllErrors m) => Either [TypeError] a -> m a+> throwTESEither = throwEither . mapLeft AETypeErrors++> throwEither :: (MonadError t m) => Either t a -> m a+> throwEither (Left err) = throwError err+> throwEither (Right val) = return val++================================================================================++read file as string - issues are:++want to support reading from stdin, and reading from a string passed+as an argument to the exe++> -- | read a file as text, will read from stdin if filename is '-'.+> readInput :: (Error e, MonadIO m) => FilePath -> ErrorT e m String+> readInput f =+>   liftIO $ case f of+>              "-" -> getContents+>              _ | length f >= 2 &&+>                  head f == '"' && last f == '"'+>                    -> return $ drop 1 $ take (length f - 1) f+>                | otherwise -> readFile f++================================================================================++> -- | write text to a file+> writeFile :: (Error e, MonadIO m) => FilePath -> String -> ErrorT e m ()+> writeFile fn =+>     liftIO . System.IO.writeFile fn++================================================================================++Utilities++> -- | wrapper for putstrln+> message :: MonadIO m => String -> m ()+> message = liftIO . putStrLn++run in errort monad+should think of something better to do here than just rethrow as io error1++> -- wrapper to run in errorT monad and return right or error on left+> wrapET :: (Show e, Monad m) => ErrorT e m a -> m a+> wrapET c = runErrorT c >>= \x ->+>          case x of+>            Left er -> error $ show er+>            Right l -> return l++> -- | print a list, using newlines instead of commas, no outer []+> printList :: (MonadIO m, Show a) => [a] -> m ()+> printList = mapM_ (liftIO . print)++> -- | run putstrln over each element of a list+> putStrLnList :: MonadIO m => [String]-> m ()+> putStrLnList = mapM_ (liftIO . putStrLn)++> -- | lifted fst+> lfst :: (Monad m, Error e) => (a,b) -> ErrorT e m a+> lfst = return . fst++> -- | lifted snd+> lsnd :: (Monad m, Error e) => (a,b) -> ErrorT e m b+> lsnd = return . snd++> -- | lifted concat+> lconcat :: (Monad m, Error e) => [[a]] -> ErrorT e m [a]+> lconcat = return . concat++
Database/HsSqlPpp/Dbms/DatabaseLoader.lhs view
@@ -27,7 +27,7 @@ This code is currently on the backburner, and is a mess.  > {- | Routine load SQL into a database. Should work alright, but if->  you get any errors from PostGreSQL it won't be easy to track them+>  you get any errors from PostgreSQL it won't be easy to track them >   down in the original source.-} > module Database.HsSqlPpp.Dbms.DatabaseLoader >     (@@ -45,6 +45,7 @@ > import Database.HsSqlPpp.PrettyPrinter.PrettyPrinter > import Database.HsSqlPpp.Ast.Ast as Ast > import Database.HsSqlPpp.Dbms.DBAccess+> import Database.HsSqlPpp.Ast.Annotation  > loadIntoDatabase :: String -- ^ database name >                  -> FilePath -- ^ filename to include in error messages@@ -53,7 +54,7 @@ >                  -> IO () > loadIntoDatabase dbName fn ast = >   withConn ("dbname=" ++ dbName) $ \conn -> do->          loadPlpgsqlIntoDatabase conn+>          --loadPlpgsqlIntoDatabase conn >          mapM_ (\st -> >                 loadStatement conn st >                 >> putStr ".") (filterStatements ast)@@ -61,9 +62,17 @@ >     loadStatement conn st = case st of >                                          Skipit -> return () >                                          VanillaStatement vs ->->                                              handleError fn ("",0::Int,0::Int) vs (runSqlCommand conn+>                                              putStrLn (printSql [vs]) >>+>                                              handleError fn (getSourcePos vs) vs (runSqlCommand conn >                                                       (printSql [vs]))->                                          CopyStdin a b -> runCopy conn a b ("",0::Int,0::Int)+>                                          CopyStdin a b -> runCopy conn a b (getSourcePos a)+>     getSourcePos st = let a = getAnnotation st+>                       in sp a+>                       where+>                         sp (x:xs) = case x of+>                                       SourcePos s l c -> (s,l,c)+>                                       _ -> sp xs+>                         sp [] = ("",0,0) >     --hack cos we don't have support in hdbc for copy from stdin >     --(which libpq does support - adding this properly should be a todo) >     --we need the copy from stdin and the copydata to be processed in one go,@@ -89,17 +98,18 @@ >                                  (VanillaStatement (Copy [] tb cl >                                                     (CopyFilename tfn1)))) >                          _ -> error "internal error: pattern match fail in runCopy in loadIntoDatabase"->     loadPlpgsqlIntoDatabase conn = do+>     {-loadPlpgsqlIntoDatabase conn = do >          -- first, check plpgsql is in the database >          x <- selectValue conn >                 "select count(1) from pg_language where lanname='plpgsql';" >          when (readInt x == 0) $ >               runSqlCommand conn "create procedural language plpgsql;"->     readInt x = read x :: Int+>     readInt x = read x :: Int-}  > data Wrapper = CopyStdin Ast.Statement Ast.Statement >              | Skipit >              | VanillaStatement Ast.Statement+>                deriving Show  ================================================================================ 
+ Database/HsSqlPpp/Dbms/WrapLib.lhs view
@@ -0,0 +1,16 @@+Copyright 2010 Jake Wheat++> {-# OPTIONS_HADDOCK hide #-}++> module Database.HsSqlPpp.Dbms.WrapLib where++> import Database.HDBC++> selectRelation :: (IConnection conn) =>+>                   conn -> String -> [SqlValue] -> IO [[SqlValue]]+> selectRelation conn query args = do+>   sth <- prepare conn query+>   execute sth args+>   v <- fetchAllRows' sth+>   return v+
+ Database/HsSqlPpp/Dbms/WrapperGen.lhs view
@@ -0,0 +1,173 @@+Copyright 2010 Jake Wheat++demo code for using the hssqlppp typechecker to generate typesafe+database access code++could probably use some quasi quotation++> {-# LANGUAGE FlexibleContexts #-}++> {-# OPTIONS_HADDOCK hide #-}++> module Database.HsSqlPpp.Dbms.WrapperGen+>     (wrapperGen) where++> import Text.Show.Pretty (ppShow)+> import Language.Haskell.Exts hiding (String)+> import qualified Language.Haskell.Exts as Exts+> import Data.Generics.PlateData+> import Data.Generics hiding (Prefix,Infix)+> import Control.Monad.Error+> import Data.Maybe++> import Database.HsSqlPpp.Ast.SqlTypes as Sql+> import Database.HsSqlPpp.Ast.Environment+> import Database.HsSqlPpp.Ast.TypeChecker+> import Database.HsSqlPpp.Parsing.Parser+> import Database.HsSqlPpp.Ast.Annotation++> wrapperGen :: String -> String -> IO String+> wrapperGen db fn = do+>   p <- parseFile fn+>   case p of+>     ParseOk ast -> do+>                    envU <- readEnvironmentFromDatabase db+>                    case updateEnvironment defaultEnvironment envU of+>                      Left er -> return $ show er+>                      Right env ->+>                          return $ {-ppShow ast ++  "\n\n" ++ -} prettyPrint (processTree env (addImports ast))+>     x -> return $ ppShow x++> processTree :: Data a => Environment -> a -> a+> processTree env =+>     transformBi $ \x ->+>       case x of+>         (PatBind _+>              (PVar (Ident fnName))+>              Nothing+>              (UnGuardedRhs(Lit (Exts.String sqlSrc)))+>              (BDecls [])) : tl+>           -> createWrapper env fnName sqlSrc ++ tl+>         x1 -> x1++> addImports :: Data a => a -> a+> addImports =+>     transformBi $ \x ->+>       case x of+>         Module sl mn o wt es im d -> Module sl mn o wt es (imports ++ im) d+++> noSrcLoc :: SrcLoc+> noSrcLoc = (SrcLoc "" 0 0)++> imports :: [ImportDecl]+> imports = [ImportDecl {importLoc = noSrcLoc+>                       ,importModule = ModuleName "Database.HDBC"+>                       ,importQualified = False+>                       ,importSrc = False+>                       ,importPkg = Nothing+>                       ,importAs = Nothing+>                       ,importSpecs = Nothing+>                       }+>           ,ImportDecl {importLoc = noSrcLoc+>                       ,importModule = ModuleName "Database.HsSqlPpp.Dbms.WrapLib"+>                       ,importQualified = False+>                       ,importSrc = False+>                       ,importPkg = Nothing+>                       ,importAs = Nothing+>                       ,importSpecs = Nothing+>                       }]+++> createWrapper :: Environment+>               -> String+>               -> String+>               -> [Decl]+> createWrapper env fnName sql =+>     let rt = getStatementType env sql+>     in case rt of+>       Left e -> error e+>       Right (StatementType pt ts) ->+>           let pts = map sqlTypeToHaskellTypeName pt+>               tns = map (sqlTypeToHaskellTypeName . snd) ts+>           in [makeTypeSig fnName pts tns+>              ,makeFn fnName sql pts tns]++> makeFn :: String -> String -> [String] -> [String] -> Decl+> makeFn fnName sql pts typeNames = FunBind+>       [ Match noSrcLoc(+>           Ident fnName )+>           (PVar (Ident "conn") : map (PVar . Ident) pNames)+>           Nothing (+>           UnGuardedRhs (+>             Do+>               [ Generator noSrcLoc (+>                   PVar ( Ident "r" ) ) (+>                   App (+>                     App (+>                       App (+>                         Var ( UnQual ( Ident "selectRelation" ) ) ) (+>                         Var ( UnQual ( Ident "conn" ) ) ) ) (+>                       Lit ( Exts.String sql ) ) ) (+>                     List $ map (\l -> App (+>                         Var ( UnQual ( Ident "toSql" ) ) ) (+>                         Var ( UnQual ( Ident l ) ) )) pNames+>                     ))+>               , Qualifier (+>                   InfixApp (+>                     Var ( UnQual ( Ident "return" ) ) ) (+>                     QVarOp ( UnQual ( Symbol "$" ) ) ) (+>                     InfixApp (+>                       App (+>                         App (+>                           Var ( UnQual ( Ident "flip" ) ) ) (+>                           Var ( UnQual ( Ident "map" ) ) ) ) (+>                         Var ( UnQual ( Ident "r" ) ) ) ) (+>                       QVarOp ( UnQual ( Symbol "$" ) ) ) (+>                       Lambda noSrcLoc+>                         [ PList (map (PVar . Ident) vns)+>                         ] (+>                         Tuple (map (\n -> App (vui "fromSql") (vui n)) vns)+>                         ) ) ) )+>               ] ) ) (+>           BDecls [] )+>       ]+>       where+>         varName n = "a" ++ show n+>         vns = map varName [0..length typeNames - 1]+>         vui = Var . UnQual . Ident+>         pName n = "b" ++ show n+>         pNames = map pName [0..length pts - 1]++++> makeTypeSig :: String -> [String] -> [String] -> Decl+> makeTypeSig fnName argTypes typeNames =+>   TypeSig noSrcLoc [Ident fnName] $+>     TyForall Nothing [ClassA (UnQual (Ident "IConnection")) [TyVar(Ident "conn")]] $+>       foldr TyFun lastArg args+>   where+>     tc = TyCon . UnQual . Ident+>     tntt = (TyApp (tc "Maybe")) . tc+>     args = ((TyVar (Ident "conn")) : map tntt argTypes)+>     lastArg = (TyApp (tc "IO") (TyList (TyTuple Boxed $ map tntt typeNames)))++> sqlTypeToHaskellTypeName :: Sql.Type -> String+> sqlTypeToHaskellTypeName t =+>     case t of+>        ScalarType "text" -> "String"+>        ScalarType "int4" -> "Int"+>        _ -> "a"+++> getStatementType :: Environment -> String -> Either String StatementType+> getStatementType env sql = do+>     ast <- tsl $ parseSql "" sql+>     let (_,aast) = typeCheck env ast+>     let a = getTopLevelInfos aast+>     return $ fromJust $ head a++> tsl :: (MonadError String m, Show t) => Either t a -> m a+> tsl x = case x of+>                Left s -> throwError $ show s+>                Right b -> return b
+ Database/HsSqlPpp/Extensions/ChaosExtensions.lhs view
@@ -0,0 +1,489 @@+Copyright 2009 Jake Wheat++Experimental code to use uniplate to implement extensions++> {-# LANGUAGE ViewPatterns #-}++> {- | Experimental code to half implement some simple syntax+>      extensions for plpgsql. Eventually, want to use this to write+>      macro type things for plpgsql, have implementation of all these+>      in pure plpgsql code but it's a mess, and the plpgsql+>      implementation is opaque to the hssqlppp type checker.+>  -}++> module Database.HsSqlPpp.Extensions.ChaosExtensions+>     (+>      extensionize+>     ,addReadonlyTriggers+>     ,rewriteCreateVars+>     ,createClientActionWrapper+>     ,addNotifyTriggers+>     ,addConstraint+>     ,addKey+>     ,addForeignKey+>     ,zeroOneTuple+>     ,noDelIns+>     ,transitionConstraints+>     ,replaceGenerateSpellChoiceActions+>     ) where++> import Data.Generics+> import Data.Generics.PlateData+> import Debug.Trace++> import Text.Parsec hiding(many, optional, (<|>))+> import qualified Text.Parsec.Token as P+> import Text.Parsec.Language++> import Control.Applicative+> import Control.Monad.Identity+> import Data.List++> import Database.HsSqlPpp.Ast.Ast+> import Database.HsSqlPpp.Ast.Annotation+> import Database.HsSqlPpp.Parsing.Lexer+> import Database.HsSqlPpp.Parsing.Parser++++> data FunCallView = FUnit+>                  | FunCallView Annotation String [Expression]++> funCallView :: Statement -> FunCallView+> funCallView (SelectStatement an (Select _ _ (SelectList _ [SelExp _ (FunCall _ fnName+>               args)] []) [] Nothing [] Nothing [] Nothing Nothing)) = FunCallView an fnName args+> funCallView _ = FUnit++> -- | run all the extensions in this module on the given ast+> extensionize :: Data a => a -> a+> extensionize = addReadonlyTriggers .+>                rewriteCreateVars .+>                createClientActionWrapper .+>                addNotifyTriggers .+>                addConstraint .+>                addKey .+>                addForeignKey .+>                zeroOneTuple .+>                noDelIns .+>                transitionConstraints .+>                replaceGenerateSpellChoiceActions+++================================================================================++My dodgy SQL code uses a function called create_var to create a table+with a single attribute, which can hold 0 or 1 tuples (it adds the+constraints to handle all this), a bit like a global maybe+variable. It also creates a wrapper function to return the value from+the table which is sometimes more convenient to use in expressions+instead of e.g. a join.+e.g.+select create_var('name', 'type');+->+create table name_table (+    name type+);++create function get_name() returns type as $a$+  select * from name_table;+$a$ language sql stable;+[missing constraint stuff...]++When trying to type check these files, my code can't work out that the+create_var invocation changes the catalog in this way, as a hack to+get round this tried to write a little generic function which+transforms the create var invocation to the create table and create+function by transforming the ast tree before it is type checked. With+this in place, the code can type check these tables.++The future plan is to get rid of the create var function definition in+the sql entirely, and just use this macro feature instead. (so we+still call create_var in the same way). The main motivation is to make+type checking the code easier (the other obvious alternative is to+write a partial interpreter for pl/pgsql which sounds like an immense+amount of work in comparison).++> -- | short cut for creating a table with exactly one attribute whose+> -- cardinality is restricted to 0 or 1. Also provides a get_var function shortcut.+> rewriteCreateVars :: Data a => a -> a+> rewriteCreateVars =+>     transformBi $ \x ->+>       case x of+>         (funCallView -> FunCallView an "create_var" [StringLit _ _ tableName,StringLit _ _ typeName]):tl+>             -> [(CreateTable an+>                            (tableName ++ "_table")+>                            [AttributeDef an+>                                          tableName+>                                          (SimpleTypeName an typeName)+>                                          Nothing+>                                          []]+>                            [])+>                 ,(CreateFunction an ("get_" ++ tableName) []+>                     (SimpleTypeName an typeName) Sql "$a$"+>                     (SqlFnBody an+>                      [SelectStatement an+>                       (Select an Dupes+>                        (SelectList an+>                         [SelExp an+>                          (Identifier an "*")] [])+>                        [Tref an (tableName ++ "_table") NoAlias]+>                        Nothing [] Nothing [] Nothing Nothing)]) Stable)]+>                ++ createKey an (tableName ++ "_table") [tableName]+>                ++ createConstraint True an [tableName ++ "_table"] (tableName ++ "_table_01_tuple") "true"+>                ++ tl+>         x1 -> x1++================================================================================++> -- | looks for calls to function set_relvar_type and adds triggers to prevent the+> -- referenced table from being updated+> addReadonlyTriggers :: Data a => a -> a+> addReadonlyTriggers =+>     transformBi $ \x ->+>       case x of+>         (funCallView -> FunCallView an "set_relvar_type" [StringLit _ _ tableName,StringLit _ _ "readonly"]):tl+>             -> (flip map "diu" ( \t ->+>                     (CreateFunction an ("check_" ++ tableName ++ "_" ++ [t] ++ "_readonly") []+>                                     (SimpleTypeName an "trigger") Plpgsql+>                                     "$a$"+>                                     (PlpgsqlFnBody an [] [+>                                       If an+>                                         [(FunCall an "!not" [BooleanLit an False]+>                                          ,[Raise an RException+>                                            "delete on base_relvar_metadata \+>                                            \violates transition constraint \+>                                            \base_relvar_metadata_d_readonly" []])] []+>                                      ,Return an $ Just $ NullLit an])+>                                     Volatile)) ++ tl)+>         x1 -> x1++================================================================================++> -- | a numpty currying type thing for plpgsql functions+> createClientActionWrapper :: Data a => a -> a+> createClientActionWrapper =+>     transformBi $ \x ->+>       case x of+>         (funCallView -> FunCallView an "create_client_action_wrapper" [StringLit _ _ actname,StringLit _ _ actcall]):tl+>           -> (CreateFunction an ("action_" ++ actname) []+>                                     (SimpleTypeName an "void") Plpgsql+>                                     "$a$"+>                                     (PlpgsqlFnBody an [] [+>                                       let (n,as) = parseActionCall actcall+>                                       in Perform an (FunCall an ("action_" ++ n) (map (StringLit an "'") as))+>                                      ]) Volatile : tl)+>         x1 -> x1+>     where+>       parseActionCall :: String -> (String,[String])+>       parseActionCall = parseCcawac++> parseCcawac :: String -> (String,[String])+> parseCcawac s = case runParser ccawac [] "" s of+>                   Left e -> trace ("failed to parse " ++ s) $ error $ show e+>                   Right r -> r++> ccawac :: ParsecT String LexState Identity (String, [String])+> ccawac = (,)+>          <$> identifierString+>          <*> parens (sepBy ccawacarg (symbol ","))++> ccawacarg :: ParsecT String LexState Identity String+> ccawacarg = (symbol "'" *> many (noneOf "'") <* symbol "'")+>             <|> identifierString++> parens :: ParsecT String LexState Identity a -> ParsecT String LexState Identity a+> parens = between (symbol "(") (symbol ")")++> symbol :: String -> ParsecT String LexState Identity String+> symbol = P.symbol lexer++> lexer :: P.GenTokenParser String LexState Identity+> lexer = P.makeTokenParser emptyDef++================================================================================++> -- | add a trigger to each data table to raise a notify signal when changed+> addNotifyTriggers :: Data a => a -> a+> addNotifyTriggers =+>     transformBi $ \x ->+>       case x of+>         (funCallView -> FunCallView an "set_relvar_type" [StringLit _ _ tableName,StringLit _ _ "data"]):tl+>           -> (CreateFunction an (tableName ++ "_changed") []+>                                     (SimpleTypeName an "trigger") Plpgsql+>                                     "$a$"+>                                     (PlpgsqlFnBody an [] [+>                                       Notify an tableName+>                                      ,Return an $ Just $ NullLit an+>                                      ]) Volatile : tl)+>         x1 -> x1++================================================================================++> -- | wrapped for the extended constraint system - allows adding constraints+> -- which refer to multiple rows/ multiple tables.+> addConstraint :: Data a => a -> a+> addConstraint =+>     transformBi $ \x ->+>       case x of+>         (funCallView -> FunCallView an "add_constraint"+>                           [StringLit _ _ conName+>                           ,StringLit _ _ expr+>                           ,FunCall _ "!arrayctor" tbls]):tl+>           -> createConstraint True an (getStrings tbls) conName expr ++ tl+>         x1 -> x1++> parseExpressionWrap :: String -> Expression+> parseExpressionWrap s = case parseExpression "" s of+>                           Left e -> trace ("parsing expression: " ++ s) $ error $ show e+>                           Right ast -> ast++> createConstraint :: Bool+>                  -> Annotation+>                  -> [String]+>                  -> String+>                  -> String+>                  -> [Statement]+> createConstraint tr an tbls name expr =+>     CreateFunction an ("check_con_" ++ name) []+>      (SimpleTypeName an "boolean") Plpgsql "$a$"+>      (PlpgsqlFnBody an [] [+>         Return an $ Just $+>         stripAnnotations (parseExpressionWrap expr)+>       ]) Stable :+>     if tr+>       then concatMap (\t -> [DropFunction an IfExists [(t ++ "_constraint_trigger_operator",[])] Restrict+>                ,CreateFunction an (t ++ "_constraint_trigger_operator") []+>                                    (SimpleTypeName an "trigger") Plpgsql "$a$"+>                                    (PlpgsqlFnBody an [] [+>                                                        NullStatement an]) Volatile]+>                                    ) tbls+>       else []++> -- | implement key constraints so that they are integrated with the extended constraint+> -- system, uses pg keys internally.+> addKey :: Data a => a -> a+> addKey =+>     transformBi $ \x ->+>       case x of+>         (funCallView -> FunCallView an "add_key"+>                           [StringLit _ _ tableName+>                           ,StringLit _ _ columnName]):tl+>           -> createKey an tableName [columnName] ++ tl+>         (funCallView -> FunCallView an "add_key"+>                           [StringLit _ _ tableName+>                           ,FunCall _ "!arrayctor" cols]):tl+>           -> createKey an tableName (getStrings cols) ++ tl+>         x1 -> x1++> getStrings :: [Expression] -> [String]+> getStrings = map (\(StringLit _ _ c) -> c)++> createKey :: Annotation+>           -> String+>           -> [String]+>           -> [Statement]+> createKey an tableName colNames =+>    let cn = take 49 (tableName ++ "_" ++ intercalate "_" colNames) ++ "_key"+>    in createConstraint False an [tableName] cn "true"++> -- | extended inclusion dependency (I think that is the fashionable term these days).+> -- to allow 'foreign keys' to non key attributes, as well as regular foreign keys+> addForeignKey :: Data a => a -> a+> addForeignKey =+>     transformBi $ \x ->+>       case x of+>         (funCallView -> FunCallView an "add_foreign_key"+>                           [StringLit _ _ tableName+>                           ,StringLit _ _ colName+>                           ,StringLit _ _ ttableName]):tl+>           -> createFk an tableName [colName] ttableName [colName] ++ tl+>         (funCallView -> FunCallView an "add_foreign_key"+>                           [StringLit _ _ tableName+>                           ,FunCall _ "!arrayctor" cols+>                           ,StringLit _ _ ttableName]):tl+>           -> createFk an tableName (getStrings cols) ttableName (getStrings cols) ++ tl+>         (funCallView -> FunCallView an "add_foreign_key"+>                           [StringLit _ _ tableName+>                           ,StringLit _ _ colName+>                           ,StringLit _ _ ttableName+>                           ,StringLit _ _ tcolName]):tl+>           -> createFk an tableName [colName] ttableName [tcolName] ++ tl+>         (funCallView -> FunCallView an "add_foreign_key"+>                           [StringLit _ _ tableName+>                           ,FunCall _ "!arrayctor" cols+>                           ,StringLit _ _ ttableName+>                           ,FunCall _ "!arrayctor" tcols]):tl+>           -> createFk an tableName (getStrings cols) ttableName (getStrings tcols) ++ tl+>         x1 -> x1+>     where+>       createFk an tbl atts _ _  =+>           createConstraint False an [tbl] (tbl ++ "_" ++ intercalate "_" atts ++ "_fkey") "true"++> -- | convert calls to zero or one tuple to constraint+> zeroOneTuple :: Data a => a -> a+> zeroOneTuple =+>     transformBi $ \x ->+>       case x of+>         (funCallView -> FunCallView an "constrain_to_zero_or_one_tuple"+>                           [StringLit _ _ tableName]):tl+>           -> createConstraint True an [tableName] (tableName ++ "_01_tuple") "true" ++ tl+>         x1 -> x1++================================================================================++> noDelIns :: Data a => a -> a+> noDelIns =+>     transformBi $ \x ->+>       case x of+>         (funCallView -> FunCallView an "no_deletes_inserts_except_new_game"+>                           [StringLit _ _ tbl]):tl+>           -> flip map ["_no_delete","_no_insert"] (\n ->+>                CreateFunction an ("check_" ++ tbl ++ n) []+>                (SimpleTypeName an "trigger") Plpgsql "$a$"+>                (PlpgsqlFnBody an [] [+>                                  NullStatement an+>                                 ]) Stable) ++ tl+>         x1 -> x1++================================================================================++> transitionConstraints :: Data a => a -> a+> transitionConstraints =+>     transformBi $ \x ->+>       case x of+>         (funCallView -> FunCallView an "create_update_transition_tuple_constraint"+>                           [StringLit _ _ _+>                           ,StringLit _ _ cn+>                           ,StringLit _ _ _]):tl+>           -> addTrigger an cn ++ tl+>         (funCallView -> FunCallView an "create_insert_transition_tuple_constraint"+>                           [StringLit _ _ _+>                           ,StringLit _ _ cn+>                           ,StringLit _ _ _]):tl+>           -> addTrigger an cn ++ tl+>         (funCallView -> FunCallView an "create_delete_transition_tuple_constraint"+>                           [StringLit _ _ _+>                           ,StringLit _ _ cn+>                           ,StringLit _ _ _]):tl+>           -> addTrigger an cn ++ tl+>         x1 -> x1+>     where+>       addTrigger an n =+>           [CreateFunction an ("check_" ++ n) []+>                (SimpleTypeName an "trigger") Plpgsql "$a$"+>                (PlpgsqlFnBody an [] [+>                 NullStatement an+>                 ]) Stable]++================================================================================++generate_spell_choice_actions++quite dynamic: need to read the data from the spells_mr table to+generate the names of the functions++approach:+first: remove the create function generate_spell_choice_actions, the+select generate_spel..., and the drop function so these aren't used at+all+second: at the point where generate_spell_choice_actions was called,+insert the create functions. To do this need to get the copydata for+the copy statement which set up the data in spells_mr, then read the+first cell from each line in the copy data string.++additional hack: just hardcode the spell names here since they are+unlikely to change for quite a while++> getSpellNames :: Data a => a -> [String]+> getSpellNames _ = ["chaos"+>                   ,"dark_citadel"+>                   ,"dark_power"+>                   ,"decree"+>                   ,"disbelieve"+>                   ,"eagle"+>                   ,"elf"+>                   ,"faun"+>                   ,"ghost"+>                   ,"giant_rat"+>                   ,"giant"+>                   ,"goblin"+>                   ,"golden_dragon"+>                   ,"gooey_blob"+>                   ,"gorilla"+>                   ,"green_dragon"+>                   ,"gryphon"+>                   ,"harpy"+>                   ,"horse"+>                   ,"hydra"+>                   ,"justice"+>                   ,"king_cobra"+>                   ,"large_chaos"+>                   ,"large_law"+>                   ,"law"+>                   ,"lightning"+>                   ,"lion"+>                   ,"magic_armour"+>                   ,"magic_bolt"+>                   ,"magic_bow"+>                   ,"magic_castle"+>                   ,"magic_fire"+>                   ,"magic_knife"+>                   ,"magic_shield"+>                   ,"magic_sword"+>                   ,"magic_wings"+>                   ,"magic_wood"+>                   ,"manticore"+>                   ,"ogre"+>                   ,"orc"+>                   ,"pegasus"+>                   ,"raise_dead"+>                   ,"red_dragon"+>                   ,"shadow_form"+>                   ,"shadow_wood"+>                   ,"skeleton"+>                   ,"spectre"+>                   ,"subversion"+>                   ,"turmoil"+>                   ,"unicorn"+>                   ,"vampire"+>                   ,"vengeance"+>                   ,"wall"+>                   ,"wraith"+>                   ,"zombie"]+++> replaceGenerateSpellChoiceActions :: Data a => a -> a+> replaceGenerateSpellChoiceActions d = let sn = getSpellNames d+>                                       in replaceGenerateSpellChoiceActionsInt sn d++> replaceGenerateSpellChoiceActionsInt :: Data a => [String] -> a -> a+> replaceGenerateSpellChoiceActionsInt spellNames =+>     transformBi $ \x ->+>       case x of+>         (funCallView -> FunCallView an "generate_spell_choice_actions" []):tl+>           -> map (createChoiceFn an) spellNames ++ tl+>         (CreateFunction _ "generate_spell_choice_actions" _ _ _ _ _ _):tl+>           -> tl+>         (DropFunction _ _ [("generate_spell_choice_actions",[])] _):tl+>           -> tl+>         x1 -> x1+>     where+>       createChoiceFn an sn =+>         CreateFunction an ("action_choose_" ++ sn ++ "_spell")+>                        []+>                        (SimpleTypeName [] "void")+>                        Plpgsql+>                        "$$"+>                        (PlpgsqlFnBody an [] [+>                                            NullStatement an+>                                           ]) Volatile++CREATE FUNCTION action_choose_horse_spell() RETURNS void+    LANGUAGE plpgsql+    AS $$+begin+  perform check_can_run_action('choose_horse_spell');+  perform action_choose_spell('horse');+end;+$$;+
+ Database/HsSqlPpp/Here.lhs view
@@ -0,0 +1,15 @@++Multiline string support, mainly used to enter multiline sql strings++robbed from http://old.nabble.com/Multi-line-string-literals-are-both-easy--and--elegant-in-Haskell-td19959973.html++> {-# OPTIONS_HADDOCK hide #-}++> module Database.HsSqlPpp.Here where++> import Language.Haskell.TH.Quote+> --import Language.Haskell.TH.Syntax+> import Language.Haskell.TH.Lib++> here :: QuasiQuoter+> here = QuasiQuoter (litE . stringL) (litP . stringL)
+ Database/HsSqlPpp/HsText/Commands.lhs view
@@ -0,0 +1,46 @@++> module Database.HsSqlPpp.HsText.Commands+>     (defaultCommands+>     ,makeFile+>     ,shell+>     ,wrapCommand+>     ) where++> import Data.Char+> import Data.List+> import System.Exit+> import System.Process (readProcessWithExitCode)+> import System.FilePath++> import Control.Monad.Error+++> defaultCommands :: [(String,String -> IO String)]+> defaultCommands = [("file", makeFile)+>                   ,("shell", shell)]++> makeFile :: String -> IO String+> makeFile s =+>   let (fn,content) = break ws $ dropWhile space s+>   in do+>     writeFile fn content+>     return $+>      "File " ++ fn ++ "\n\n"+>      ++ "~~~~~~~~~~~~{" ++ takeExtension fn ++ "}"+>      ++ content ++ "\n~~~~~~~~~~~~\n\n"+>   where+>     ws = (`elem` " \n\t")+>     space = (==' ')++> shell :: String -> IO String+> shell s = {-let (c:as) = words s+>           in -} do+>              (ex,o,e) <- readProcessWithExitCode "bash" ["-c", ("PATH=$PATH:~/wd/hssqlppp/trunk " ++ s)] ""+>              return $ o ++ e ++ case ex of+>                                         ExitSuccess -> ""+>                                         ExitFailure i -> "\nErrorCode: " ++ show i ++ "\n"++PATH=$PATH:~/wd/hssqlppp/trunk && HsSqlSystem++> wrapCommand :: String -> String -> (String -> IO String) -> (String -> IO String)+> wrapCommand pre post c l = c l >>= \m -> return $ pre ++ m ++ post
+ Database/HsSqlPpp/HsText/HsText.lhs view
@@ -0,0 +1,72 @@+++> module Database.HsSqlPpp.HsText.HsText+>     (hsTextify+>     ,defaultCommands+>     ,makeFile+>     ,shell+>     ,wrapCommand+>     ) where++> import Text.Parsec hiding(many, optional, (<|>))++> import Data.Char+> import Data.List+> import System.Directory++> import Control.Applicative+> import Control.Monad.Identity+> import Control.Monad.Error+> import Control.Exception (bracket)++> import Database.HsSqlPpp.HsText.Commands++> data TextChunk = TextChunk String+>                | CommandInfo String String+>                  deriving Show++> type Command = String -> IO String++> hsTextify :: [(String, Command)] -> String -> String -> IO (Either String String)+> hsTextify cmds folder txt = do+>   cd <- getCurrentDirectory+>   setCurrentDirectory folder+>   bracket (return ())+>           (\_ -> setCurrentDirectory cd)+>    $ return $ runErrorT $+>        liftM concat+>          (either (throwError . show) return (parseText txt) >>=+>            mapM (liftIO . processCommand cmds))++> processCommand :: [(String, Command)] -> TextChunk -> IO String+> processCommand _ (TextChunk s) = return s+> processCommand cmds (CommandInfo c a) = do+>   let cr = lookup (map toLower c) cmds+>   case cr of+>     Nothing -> return $ "Command not found: " ++ c+>     Just f -> catchEx (f a)++> catchEx :: IO String -> IO String+> catchEx s = catch s (\i -> return $ "ERROR: " ++ show i)++================================================================================++parsing++> parseText :: String -> Either ParseError [TextChunk]+> parseText = runParser (many textChunk) () ""++> textChunk :: ParsecT String () Identity TextChunk+> textChunk = command <|> nonCommand++> command :: ParsecT String () Identity TextChunk+> command = CommandInfo+>           <$> (string "<%Command " *> many (noneOf " "))+>           <*> manyTill anyChar (try (string "%>"))++> nonCommand :: ParsecT String () Identity TextChunk+> nonCommand = TextChunk+>              <$> ((:) <$> anyChar <*>+>                   manyTill anyChar+>                      (try (lookAhead(string "<%Command ") >> return ())+>                       <|> eof))
Database/HsSqlPpp/Parsing/Lexer.lhs view
@@ -19,12 +19,16 @@ >              ,Tok(..) >              ,lexSqlFile >              ,lexSqlText+>              ,lexSqlTextWithPosition+>              ,identifierString+>              ,LexState >              ) where  > import Text.Parsec hiding(many, optional, (<|>)) > import qualified Text.Parsec.Token as P > import Text.Parsec.Language > import Text.Parsec.String+> import Text.Parsec.Pos  > import Control.Applicative > import Control.Monad.Identity@@ -53,17 +57,23 @@ >          | CopyPayloadTok String -- support copy from stdin; with inline data >            deriving (Eq,Show) -> type ParseState = [Tok]+> type LexState = [Tok] -> lexSqlFile :: FilePath -> IO (Either ExtendedError [Token])+> lexSqlFile :: FilePath -> IO (Either ParseErrorExtra [Token]) > lexSqlFile f = do >   te <- readFile f->   let x = runParser sqlTokens [] f te --parseFromFile sqlTokens f->   return $ convertToExtendedError x f te+>   let x = runParser sqlTokens [] f te+>   return $ toParseErrorExtra x Nothing te -> lexSqlText :: String -> Either ExtendedError [Token]-> lexSqlText s = convertToExtendedError (runParser sqlTokens [] "" s) "" s+> lexSqlText :: String -> String -> Either ParseErrorExtra [Token]+> lexSqlText f s = toParseErrorExtra (runParser sqlTokens [] f s) Nothing s +> lexSqlTextWithPosition :: String -> Int -> Int -> String -> Either ParseErrorExtra [Token]+> lexSqlTextWithPosition f l c s =+>   toParseErrorExtra (runParser (do+>                                 setPosition (newPos f l c)+>                                 sqlTokens) [] f s) (Just (l,c)) s+ ================================================================================  = lexers@@ -71,7 +81,7 @@ lexer for tokens, contains a hack for copy from stdin with inline table data. -> sqlTokens :: ParsecT String ParseState Identity [Token]+> sqlTokens :: ParsecT String LexState Identity [Token] > sqlTokens = >   setState [] >> >   whiteSpace >>@@ -86,7 +96,7 @@ seen 'from stdin;', if so, we read the copy payload as one big token, otherwise we read a normal token. -> sqlToken :: ParsecT String ParseState Identity Token+> sqlToken :: ParsecT String LexState Identity Token > sqlToken = do >            sp <- getPosition >            sta <- getState@@ -113,7 +123,7 @@  == specialized token parsers -> sqlString :: ParsecT String ParseState Identity Tok+> sqlString :: ParsecT String LexState Identity Tok > sqlString = stringQuotes <|> stringLD >   where >     --parse a string delimited by single quotes@@ -144,10 +154,10 @@ >                       (try $ char '$' <* string tag <* char '$') >                return $ StringTok ("$" ++ tag ++ "$") s -> idString :: ParsecT String ParseState Identity Tok+> idString :: ParsecT String LexState Identity Tok > idString = IdStringTok <$> identifierString -> positionalArg :: ParsecT String ParseState Identity Tok+> positionalArg :: ParsecT String LexState Identity Tok > positionalArg = char '$' >> PositionalArgTok <$> integer  @@ -190,7 +200,7 @@ A single * will lex as an identifier rather than a symbol, the parser deals with this. -> sqlSymbol :: ParsecT String ParseState Identity Tok+> sqlSymbol :: ParsecT String LexState Identity Tok > sqlSymbol = >   SymbolTok <$> lexeme (choice [ >                          replicate 1 <$> oneOf "()[],;"@@ -201,10 +211,10 @@ >                         ,many1 (oneOf "+-*/<>=~!@#%^&|`?") >                         ]) -> sqlFloat :: ParsecT String ParseState Identity Tok+> sqlFloat :: ParsecT String LexState Identity Tok > sqlFloat = FloatTok <$> float -> sqlInteger :: ParsecT String ParseState Identity Tok+> sqlInteger :: ParsecT String LexState Identity Tok > sqlInteger = IntegerTok <$> integer  ================================================================================@@ -216,7 +226,7 @@ distinguished until during proper parsing, and * and qualifiers aren't really examined until type checking -> identifierString :: ParsecT String ParseState Identity String+> identifierString :: ParsecT String LexState Identity String > identifierString = lexeme $ choice [ >                     "*" <$ symbol "*" >                    ,do@@ -225,13 +235,14 @@ >                      case b of Nothing -> return a >                                Just c -> return $ a ++ c] >   where->     nonStarPart = (letter <|> char '_') <:> secondOnwards+>     nonStarPart = idpart <|> (char '"' *> many (noneOf "\"") <* char '"')+>                   where idpart = (letter <|> char '_') <:> secondOnwards >     secondOnwards = many (alphaNum <|> char '_')  parse the block of inline data for a copy from stdin, ends with \. on its own on a line -> copyPayload :: ParsecT String ParseState Identity Tok+> copyPayload :: ParsecT String LexState Identity Tok > copyPayload = CopyPayloadTok <$> lexeme (getLinesTillMatches "\\.\n") >   where >     getLinesTillMatches s = do@@ -250,26 +261,26 @@  = parsec pass throughs -> symbol :: String -> ParsecT String ParseState Identity String+> symbol :: String -> ParsecT String LexState Identity String > symbol = P.symbol lexer -> integer :: ParsecT String ParseState Identity Integer+> integer :: ParsecT String LexState Identity Integer > integer = lexeme $ P.integer lexer -> float :: ParsecT String ParseState Identity Double+> float :: ParsecT String LexState Identity Double > float = lexeme $ P.float lexer -> whiteSpace :: ParsecT String ParseState Identity ()+> whiteSpace :: ParsecT String LexState Identity () > whiteSpace= P.whiteSpace lexer -> lexeme :: ParsecT String ParseState Identity a->           -> ParsecT String ParseState Identity a+> lexeme :: ParsecT String LexState Identity a+>           -> ParsecT String LexState Identity a > lexeme = P.lexeme lexer  this lexer isn't really used as much as it could be, probably some of the fields are not used at all (like identifier and operator stuff) -> lexer :: P.GenTokenParser String ParseState Identity+> lexer :: P.GenTokenParser String LexState Identity > lexer = P.makeTokenParser (emptyDef { >                             P.commentStart = "/*" >                            ,P.commentEnd = "*/"
Database/HsSqlPpp/Parsing/ParseErrors.lhs view
@@ -5,47 +5,73 @@  > {-# OPTIONS_HADDOCK hide #-} -> module Database.HsSqlPpp.Parsing.ParseErrors (convertToExtendedError, ExtendedError(..)) where+> module Database.HsSqlPpp.Parsing.ParseErrors+>     (toParseErrorExtra+>     ,ParseErrorExtra(..)) where  > import Text.Parsec+> import Control.Monad.Error+> import Data.Maybe -> showEr :: ParseError -> String -> String -> String-> showEr er fn src =->     let  pos  = errorPos er->          lineNo = sourceLine pos->          ls = lines src+> showPE :: ParseError -> Maybe (Int,Int) -> String -> String+> showPE pe sp src = show pe ++ "\n" ++ pePosToEmacs pe ++ "\n" ++ peToContext pe sp src++> pePosToEmacs :: ParseError -> String+> pePosToEmacs pe = let p = errorPos pe+>                       f = sourceName p+>                       l = sourceLine p+>                       c = sourceColumn p+>                   in f ++ ":" ++ show l ++ ":" ++ show c ++ ":"++> peToContext :: ParseError -> Maybe (Int,Int) -> String -> String+> peToContext pe sp src =+>      let ls = lines src >          line = safeGet ls(lineNo - 1) >          prelines = map (safeGet ls) [(lineNo - 5) .. (lineNo - 2)] >          postlines = map (safeGet ls) [lineNo .. (lineNo + 5)]->          colNo = sourceColumn pos->          highlightLine = replicate (colNo - 1) ' ' ++ "^"+>          caretLine = replicate (colNo - 1) ' ' ++ "^" >          errorHighlightText = prelines->                               ++ [line, highlightLine, "ERROR HERE"]+>                               ++ [line, caretLine, "ERROR HERE"] >                               ++ postlines->     in "\n---------------------\n" ++ show er->        ++ "\nFILENAMESTUFF:\n" ++ fn ++ ":" ++ show lineNo ++ ":" ++ show colNo->        ++ "\n------------\nCheck it out:\n"->        ++ unlines (trimLines errorHighlightText)->        ++ "\n-----------------\n"+>     in "\nContext:\n"+>        ++ unlines (trimLines errorHighlightText) ++ "\n" >     where >       safeGet a i = if i < 0 || i >= length a >                       then "" >                       else a !! i >       trimLines = trimStartLines . reverse . trimStartLines . reverse >       trimStartLines = dropWhile (=="")+>       pos = errorPos pe+>       lineNo = sourceLine pos - adjLine+>       colNo = sourceColumn pos+>       adjLine = case sp of+>                         Just (l, _) -> l - 1+>                         Nothing -> 0 -give access to the nicer error text via Show+> -- | Simple wrapper to allow showing the source context of a ParseError+> data ParseErrorExtra = ParseErrorExtra {+>                                        -- | wrapped error+>                                        parseErrorError :: ParseError+>                                        -- | source position+>                                        -- adjustment to get the+>                                        -- context bit in error+>                                        -- messages right - this is+>                                        -- the same as what is passed+>                                        -- into parseSqlWithPosition+>                                       ,parseErrorPosition :: (Maybe (Int, Int))+>                                        -- | sql source+>                                       ,parseErrorSqlSource :: String+>     } -> data ExtendedError = ExtendedError ParseError String+> instance Show ParseErrorExtra where+>     show (ParseErrorExtra pe sp src) = showPE pe sp src -> instance Show ExtendedError where->    show (ExtendedError _ x) = x+> instance Error ParseErrorExtra where+>   noMsg = ParseErrorExtra undefined Nothing "unknown"+>   strMsg = ParseErrorExtra undefined Nothing -> convertToExtendedError :: Either ParseError b->                        -> String->                        -> String->                        -> Either ExtendedError b-> convertToExtendedError f fn src =->      case f of->             Left er -> Left $ ExtendedError er (showEr er fn src)->             Right l -> Right l++> toParseErrorExtra :: Either ParseError b -> Maybe (Int,Int) -> String -> Either ParseErrorExtra b+> toParseErrorExtra a sp src = case a of+>                                Left pe -> Left $ ParseErrorExtra pe sp src+>                                Right x -> Right x
Database/HsSqlPpp/Parsing/Parser.lhs view
@@ -35,18 +35,21 @@ > module Database.HsSqlPpp.Parsing.Parser ( >              -- * Main >               parseSql+>              ,parseSqlWithPosition >              ,parseSqlFile >              -- * Testing >              ,parseExpression >              ,parsePlpgsql >              -- * errors->              ,ExtendedError+>              ,ParseErrorExtra(..) >              ) >     where  > import Text.Parsec hiding(many, optional, (<|>), string) > import Text.Parsec.Expr > import Text.Parsec.String+> import Text.Parsec.Perm+> --import Text.Parsec.Error  > import Control.Applicative > import Control.Monad.Identity@@ -54,11 +57,15 @@ > import Data.Maybe > import Data.Char +> import Data.Generics.PlateData+> import Data.Generics hiding (Prefix,Infix)+ > import Database.HsSqlPpp.Parsing.Lexer > import Database.HsSqlPpp.Parsing.ParseErrors > import Database.HsSqlPpp.Ast.Ast > import Database.HsSqlPpp.Ast.Annotation as A > import Database.HsSqlPpp.Utils+> import Database.HsSqlPpp.Ast.Environment  The parse state is used to keep track of source positions inside function bodies, these bodies are parsed separately to the rest of the@@ -77,51 +84,60 @@  = Top level parsing functions -> parseSql :: String -- ^ a string containing the sql to parse->          -> Either ExtendedError StatementList-> parseSql s = statementsOnly $ parseIt (lexSqlText s) sqlStatements "" s startState+> parseSql :: String -- ^ filename to use in errors+>          -> String -- ^ a string containing the sql to parse+>          -> Either ParseErrorExtra StatementList+> parseSql f s = parseIt (lexSqlText f s) sqlStatements f Nothing s startState +> parseSqlWithPosition :: FilePath -- ^ filename to use in errors+>                      -> Int -- ^ adjust line number in errors by adding this+>                      -> Int -- ^ adjust column in errors by adding this+>                      -> String -- ^ a string containing the sql to parse+>                      -> Either ParseErrorExtra StatementList+> parseSqlWithPosition f l c s = parseIt (lexSqlTextWithPosition f l c s) sqlStatements f (Just (l,c)) s startState++ > parseSqlFile :: FilePath -- ^ file name of file containing sql->              -> IO (Either ExtendedError StatementList)+>              -> IO (Either ParseErrorExtra StatementList) > parseSqlFile fn = do >   sc <- readFile fn >   x <- lexSqlFile fn->   return $ statementsOnly $ parseIt x sqlStatements fn sc startState+>   return $ parseIt x sqlStatements fn Nothing sc startState  > -- | Parse expression fragment, used for testing purposes-> parseExpression :: String -- ^ sql string containing a single expression, with no+> parseExpression :: String+>                 -> String -- ^ sql string containing a single expression, with no >                           -- trailing ';'->                 -> Either ExtendedError Expression-> parseExpression s = parseIt (lexSqlText s) (expr <* eof) "" s startState+>                 -> Either ParseErrorExtra Expression+> parseExpression f s = parseIt (lexSqlText f s) (expr <* eof) f Nothing s startState  > -- | Parse plpgsql statements, used for testing purposes - > -- this can be used to parse a list of plpgsql statements which > -- aren't contained in a create function. > -- (The produced ast won't pass a type check.) > parsePlpgsql :: String->              -> Either ExtendedError StatementList-> parsePlpgsql s =  parseIt (lexSqlText s) (many plPgsqlStatement <* eof) "" s startState+>              -> String+>              -> Either ParseErrorExtra StatementList+> parsePlpgsql f s =  parseIt (lexSqlText f s) (many plPgsqlStatement <* eof) f Nothing s startState  utility function to do error handling in one place+TODO: support parsewithposition -> parseIt :: forall t s u b.(Stream s Identity t) =>->            Either ExtendedError s+> parseIt :: forall t s u b.(Stream s Identity t, Data b) =>+>            Either ParseErrorExtra s >         -> Parsec s u b >         -> SourceName+>         -> Maybe (Int,Int) >         -> String >         -> u->         -> Either ExtendedError b-> parseIt lexed parser fn src ss =+>         -> Either ParseErrorExtra b+> parseIt lexed parser fn sp src ss = >     case lexed of >                Left er -> Left er->                Right toks -> convertToExtendedError->                                (runParser parser ss fn toks) fn src--> statementsOnly :: Either ExtendedError StatementList->                -> Either ExtendedError StatementList-> statementsOnly s = case s of->                      Left er -> Left er->                      Right st -> Right st+>                Right toks -> let r1 = runParser parser ss fn toks+>                              in case toParseErrorExtra r1 sp src of+>                                   Left er -> Left er+>                                   Right t -> Right $ fixupTree t  ================================================================================ @@ -141,13 +157,22 @@ >     ,delete >     ,truncateSt >     ,copy+>     ,set+>     ,notify >     ,keyword "create" *> >              choice [ >                 createTable+>                ,createSequence >                ,createType >                ,createFunction >                ,createView->                ,createDomain]+>                ,createDomain+>                ,createLanguage+>                ,createTrigger]+>     ,keyword "alter" *>+>              choice [+>                 alterSequence+>                ,alterTable] >     ,keyword "drop" *> >              choice [ >                 dropSomething@@ -174,46 +199,38 @@ This should be changed so it can only parse an into clause when expecting a plpgsql statement. -recurses to support parsing excepts, unions, etc+recurses to support parsing excepts, unions, etc.+this recursion needs refactoring cos it's a mess  > selectStatement :: ParsecT [Token] ParseState Identity Statement > selectStatement = SelectStatement <$> pos <*> selectExpression  > selectExpression :: ParsecT [Token] ParseState Identity SelectExpression > selectExpression =->   choice [selectE, values]+>   buildExpressionParser combTable selFactor >   where->     selectE = do->       p <- pos->       keyword "select"->       s1 <- selQuerySpec p->       p1 <- pos->       choice [->         --don't know if this does associativity in the correct order for->         --statements with multiple excepts/ intersects and no parens->         CombineSelect p1 Except s1 <$> (keyword "except" *> selectExpression)->        ,CombineSelect p1 Intersect s1 <$> (keyword "intersect" *> selectExpression)->        ,CombineSelect p1 UnionAll s1 <$> (try (keyword "union"->                                              *> keyword "all") *> selectExpression)->        ,CombineSelect p1 Union s1 <$> (keyword "union" *> selectExpression)->        ,return s1]->       where->         selQuerySpec p = Select p->                    <$> option Dupes (Distinct <$ keyword "distinct")+>         selFactor = try (parens selectExpression) <|> selQuerySpec <|> values+>         combTable = [map (\(c,p) -> Infix (CombineSelect <$> pos <*> (c <$ p)) AssocLeft)+>                         [(Except, keyword "except")+>                         ,(Intersect, keyword "intersect")+>                         ,(UnionAll, try (keyword "union" *> keyword "all"))+>                         ,(Union, keyword "union")]]+>         selQuerySpec = Select <$> (pos <* keyword "select")+>                    <*> option Dupes (Distinct <$ keyword "distinct") >                    <*> selectList >                    <*> option [] from->                    <*> tryOptionMaybe whereClause+>                    <*> optionMaybe whereClause >                    <*> option [] groupBy->                    <*> tryOptionMaybe having+>                    <*> optionMaybe having >                    <*> option [] orderBy->                    <*> tryOptionMaybe limit->                    <*> tryOptionMaybe offset+>                    <*> optionMaybe limit+>                    <*> optionMaybe offset >         from = keyword "from" *> commaSep1 tref >         groupBy = keyword "group" *> keyword "by" >                   *> commaSep1 expr >         having = keyword "having" *> expr >         orderBy = keyword "order" *> keyword "by"->                   *> commaSep1 oneOrder+>                     *> commaSep1 oneOrder >         oneOrder = (,) <$> expr >                        <*> option Asc (choice [ >                                         Asc <$ keyword "asc"@@ -228,19 +245,21 @@ >         -- a sub select e.g. select a from (select b from c) >         --  - these are handled in tref >         -- then cope with joins recursively using joinpart below->         tref = threadOptionalSuffix getFirstTref joinPart->         getFirstTref = do+>         tref = buildExpressionParser [] trefFactor+>         trefFactor = threadOptionalSuffix (nonJoinTref <|> try (parens tref)) joinPart <|> parens tref+>         --tref = optParens (threadOptionalSuffix (try (parens tref) <|> nonJoinTref) joinPart)+>         nonJoinTref = try $ optParens $ do >                   p2 <- pos >                   choice [ >                          SubTref p2 >                          <$> parens selectExpression->                          <*> (optional (keyword "as") *> nkwid)->                         ,optionalSuffix->                           (TrefFun p2) (try $ identifier >>= functionCallSuffix)->                           (TrefFunAlias p2) () (optional (keyword "as") *> nkwid)->                         ,optionalSuffix->                           (Tref p2) nkwid->                           (TrefAlias p2) () (optional (keyword "as") *> nkwid)]+>                          <*> palias+>                         ,TrefFun p2+>                          <$> try (identifier >>= functionCallSuffix)+>                          <*> palias+>                         ,Tref p2+>                          <$> nkwid+>                          <*> palias] >         --joinpart: parse a join after the first part of the tableref >         --(which is a table name, aliased table name or subselect) - >         --takes this tableref as an arg so it can recurse to multiple@@ -252,11 +271,11 @@ >              --look for the join flavour first >              <$> option Unnatural (Natural <$ keyword "natural") >              <*> choice [->                 Inner <$ keyword "inner"->                ,LeftOuter <$ try (keyword "left" *> keyword "outer")->                ,RightOuter <$ try (keyword "right" *> keyword "outer")->                ,FullOuter <$ try (keyword "full" >> keyword "outer")->                ,Cross <$ keyword "cross"]+>                 LeftOuter <$ try (keyword "left" *> optional (keyword "outer"))+>                ,RightOuter <$ try (keyword "right" *> optional (keyword "outer"))+>                ,FullOuter <$ try (keyword "full" >> optional (keyword "outer"))+>                ,Cross <$ keyword "cross"+>                ,Inner <$ optional (keyword "inner")] >              --recurse back to tref to read the table >              <*> (keyword "join" *> tref) >              --now try and read the join condition@@ -264,6 +283,11 @@ >                  Just <$> (JoinOn <$> pos <*> (keyword "on" *> expr)) >                 ,Just <$> (JoinUsing <$> pos <*> (keyword "using" *> columnNameList)) >                 ,return Nothing]+>              <*> palias+>         palias = option NoAlias+>                    (optionalSuffix+>                       TableAlias (optional (keyword "as") *> nkwid)+>                       FullAlias () (parens $ commaSep1 idString)) >         nkwid = try $ do >                  x <- idString >                  --avoid all these keywords as aliases since they can@@ -286,6 +310,7 @@ >                              ,"right" >                              ,"full" >                              ,"cross"+>                              ,"join" >                              ,"natural" >                              ,"order" >                              ,"group"@@ -294,8 +319,11 @@ >                              ,"from"] >                    then fail "not keyword" >                    else return x->     values = Values <$> (pos <* keyword "values") <*> commaSep1 (parens $ commaSep1 expr)+>         values = Values <$> (pos <* keyword "values") <*> commaSep1 (parens $ commaSep1 expr) +> optParens :: ParsecT [Token] ParseState Identity a+>           -> ParsecT [Token] ParseState Identity a+> optParens p = try (parens p) <|> p  = insert, update and delete @@ -363,6 +391,21 @@ >                                                  CopyPayloadTok n -> Just n >                                                  _ -> Nothing) +> set :: ParsecT [Token] ParseState Identity Statement+> set = Set <$> pos+>           <*> (keyword "set" *> idString)+>           <*> ((keyword "to" <|> symbol "=") *>+>               commaSep1 sv)+>       where+>         sv = choice [+>               SetStr <$> pos <*> stringN+>              ,SetId <$> pos <*> idString+>              ,SetNum <$> pos <*> ((fromInteger <$> integer) <|> float)]++> notify :: ParsecT [Token] ParseState Identity Statement+> notify = Notify <$> pos+>                 <*> (keyword "notify" *> idString)+ = ddl  > createTable :: ParsecT [Token] ParseState Identity Statement@@ -379,7 +422,7 @@ >     --attribute parser, so we need the swap to feed them in the >     --right order into createtable >     readAttsAndCons = parens (swap <$> multiPerm->                                          (try tableConstr)+>                                          (try tableConstraint) >                                          tableAtt >                                          (symbol ",")) >                       where swap (a,b) = (b,a)@@ -389,44 +432,76 @@ >                <*> typeName >                <*> tryOptionMaybe (keyword "default" *> expr) >                <*> many rowConstraint->     tableConstr = choice [->                    UniqueConstraint->                    <$> pos <*> try (keyword "unique" *> columnNameList)->                    ,PrimaryKeyConstraint->                    <$> pos <*> try (keyword "primary" *> keyword "key"+>     rowConstraint = do+>        p <- pos+>        cn <- option "" (keyword "constraint" *> idString)+>        choice [+>           RowUniqueConstraint p cn <$ keyword "unique"+>          ,RowPrimaryKeyConstraint p cn <$ keyword "primary" <* keyword "key"+>          ,RowCheckConstraint p cn <$> (keyword "check" *> parens expr)+>          ,NullConstraint p cn <$ keyword "null"+>          ,NotNullConstraint p cn <$ (keyword "not" <* keyword "null")+>          ,RowReferenceConstraint p cn+>          <$> (keyword "references" *> idString)+>          <*> option Nothing (try $ parens $ Just <$> idString)+>          <*> onDelete+>          <*> onUpdate+>          ]++> onDelete,onUpdate :: ParsecT [Token] ParseState Identity Cascade+> onDelete = onSomething "delete"+> onUpdate = onSomething "update"+> onSomething :: String -> ParsecT [Token] ParseState Identity Cascade+> onSomething k = option Restrict $ try $ keyword "on"+>                 *> keyword k *> cascade++> tableConstraint :: ParsecT [Token] ParseState Identity Constraint+> tableConstraint = do+>                 p <- pos+>                 cn <- option "" (keyword "constraint" *> option "" conName)+>                 choice [+>                    UniqueConstraint p cn+>                    <$> try (keyword "unique" *> optParens columnNameList)+>                    ,PrimaryKeyConstraint p cn+>                    <$> try (keyword "primary" *> keyword "key" >                                     *> choice [ >                                             (:[]) <$> idString >                                            ,parens (commaSep1 idString)])->                    ,CheckConstraint->                    <$> pos <*> try (keyword "check" *> parens expr)->                    ,ReferenceConstraint->                    <$> pos->                    <*> try (keyword "foreign" *> keyword "key"+>                    ,CheckConstraint p cn+>                    <$>try (keyword "check" *> parens expr)+>                    ,ReferenceConstraint p cn+>                    <$> try (keyword "foreign" *> keyword "key" >                             *> parens (commaSep1 idString)) >                    <*> (keyword "references" *> idString) >                    <*> option [] (parens $ commaSep1 idString)->                    <*> onDelete->                    <*> onUpdate]->     rowConstraint =->        choice [->           RowUniqueConstraint <$> pos <* keyword "unique"->          ,RowPrimaryKeyConstraint <$> pos <* keyword "primary" <* keyword "key"->          ,RowCheckConstraint <$> pos <*> (keyword "check" *> parens expr)->          ,NullConstraint <$> pos <* keyword "null"->          ,NotNullConstraint <$> pos <* (keyword "not" <* keyword "null")->          ,RowReferenceConstraint->          <$> pos->          <*> (keyword "references" *> idString)->          <*> option Nothing (try $ parens $ Just <$> idString)->          <*> onDelete->          <*> onUpdate->          ]->     onDelete = onSomething "delete"->     onUpdate = onSomething "update"->     onSomething k = option Restrict $ try $ keyword "on"->                    *> keyword k *> cascade+>                    <*> onUpdate+>                    <*> onDelete]+>                 where+>                   conName = try $ do+>                             x <- idString+>                             if map toLower x `elem` [+>                                     "unique"+>                                    ,"primary"+>                                    ,"check"+>                                    ,"foreign"+>                                    ,"references"]+>                               then fail "not keyword"+>                               else return x  +> alterTable :: ParsecT [Token] ParseState Identity Statement+> alterTable = AlterTable <$> (pos <* keyword "table" <* optional (keyword "only"))+>                         <*> idString+>                         <*> many1 action+>              where action = choice [+>                              AlterColumnDefault+>                              <$> (pos <* keyword "alter" <* keyword "column")+>                              <*> idString+>                              <*> (keyword "set" *> keyword "default" *> expr)+>                             ,AddConstraint+>                              <$> (pos <* keyword "add")+>                              <*> tableConstraint]+ > createType :: ParsecT [Token] ParseState Identity Statement > createType = CreateType >              <$> pos <* keyword "type"@@ -435,7 +510,29 @@ >   where >     typeAtt = TypeAttDef <$> pos <*> idString <*> typeName +> createSequence :: ParsecT [Token] ParseState Identity Statement+> createSequence = do+>   p <- pos+>   keyword "sequence"+>   nm <- idString+>   (stw, incr, mx, mn, c) <- permute ((,,,,) <$?> (1,startWith)+>                                             <|?> (1,increment)+>                                             <|?> ((2::Integer) ^ (63::Integer) - 1, maxi)+>                                             <|?> (1, mini)+>                                             <|?> (1, cache))+>   return $ CreateSequence p nm incr mn mx stw c+>   where+>     startWith = keyword "start" *> optional (keyword "with") *> integer+>     increment = keyword "increment" *> optional (keyword "by") *> integer+>     maxi = (2::Integer) ^ (63::Integer) - 1 <$ try (keyword "no" <* keyword "maxvalue")+>     mini = 1 <$ try (keyword "no" <* keyword "minvalue")+>     cache = keyword "cache" *> integer +> alterSequence :: ParsecT [Token] ParseState Identity Statement+> alterSequence = AlterSequence <$> pos+>                               <*> (keyword "sequence" *> idString)+>                               <*> (keyword "owned" *> keyword "by" *> idString)+ create function, support sql functions and plpgsql functions. Parses the body in both cases and provides a statement list for the body rather than just a string.@@ -447,41 +544,35 @@ >   fnName <- idString >   params <- parens $ commaSep param >   retType <- keyword "returns" *> typeName->   keyword "as"->   bodypos <- getAdjustedPosition->   body <- stringLit->   lang <- readLang->   let (q, b) = parseBody lang body fnName bodypos->   CreateFunction p lang fnName params retType q b <$> pVol+>   ((bodypos,body), lang,vol) <-+>     permute ((,,) <$$> parseAs+>                   <||> readLang+>                   <|?> (Volatile,pVol))+>   case parseBody lang body bodypos of+>        Left er -> fail er+>        Right (q,b) -> return $ CreateFunction p fnName params retType lang q b vol >     where+>         parseAs = do+>                    keyword "as"+>                    bodypos <- getAdjustedPosition+>                    body <- stringLit+>                    return (bodypos,body) >         pVol = matchAKeyword [("volatile", Volatile) >                              ,("stable", Stable) >                              ,("immutable", Immutable)] >         readLang = keyword "language" *> matchAKeyword [("plpgsql", Plpgsql) >                                                        ,("sql",Sql)]->         parseBody lang body fnName bodypos =+>         parseBody :: Language -> Expression -> MySourcePos -> Either String (String, FnBody)+>         parseBody lang body bodypos@(fileName,line,col) = >             case (parseIt->                   (lexSqlText (extrStr body))+>                   (lexSqlTextWithPosition fileName line col (extrStr body)) >                   (functionBody lang)->                   ("function " ++ fnName)+>                   fileName+>                   (Just (line,col)) >                   (extrStr body) >                   [bodypos]) of->                      Left er@(ExtendedError e _) ->->                               -- don't know how to change the->                               --position of the error we've been->                               --given, so add some information to->                               --show the position of the containing->                               --function and the adjusted absolute->                               --position of this error->                               let ep = toMySp $ errorPos e->                                   (fn,fp,fc) = bodypos->                                   fnBit = "in function " ++ fnName ++ "\n"->                                           ++ fn ++ ":" ++ show fp ++ ":" ++ show fc ++ ":\n"->                                   (_,lp,lc) = adjustPosition bodypos ep->                                   lineBit = "on line\n"->                                             ++ fn ++ ":" ++ show lp ++ ":" ++ show lc ++ ":\n"->                               in error $ show er ++ "\n" ++ fnBit ++ lineBit->                      Right body' -> (quoteOfString body, body')+>                      Left er@(ParseErrorExtra _ _ _) -> Left $ show er+>                      Right body' -> Right (quoteOfString body, body')  sql function is just a list of statements, the last one has the trailing semicolon optional@@ -536,6 +627,7 @@ >                <$> pos <* keyword "domain" >                <*> idString >                <*> (tryOptionMaybe (keyword "as") *> typeName)+>                <*> option "" (keyword "constraint" *> idString) >                <*> tryOptionMaybe (keyword "check" *> parens expr)  > dropSomething :: ParsecT [Token] ParseState Identity Statement@@ -558,7 +650,7 @@ >                return $ DropFunction p i e r >                where >                  pFun = (,) <$> idString->                             <*> parens (many idString)+>                             <*> parens (many typeName)  > parseDrop :: ParsecT [Token] ParseState Identity a >           -> ParsecT [Token] ParseState Identity (IfExists, [a], Cascade)@@ -571,6 +663,49 @@ >                  (try $ IfExists <$ (keyword "if" >                                      *> keyword "exists")) +> createLanguage :: ParsecT [Token] ParseState Identity Statement+> createLanguage =+>   CreateLanguage <$> pos+>                  <*> (optional (keyword "procedural") *>+>                       keyword "language" *>+>                       idString)++> createTrigger :: ParsecT [Token] ParseState Identity Statement+> createTrigger =+>   CreateTrigger <$> pos+>                 <*> (keyword "trigger" *> idString)+>                 <*> twhen+>                 <*> tevents+>                 <*> (keyword "on" *> idString)+>                 <*> tfiring+>                 <*> (keyword "execute" *> keyword "procedure"+>                      *> idString)+>                 <*> parens (commaSep expr)+>   where+>     twhen = choice [TriggerBefore <$ keyword "before"+>                    ,TriggerAfter <$ keyword "after"]+>     tevents :: ParsecT [Token] ParseState Identity [TriggerEvent]+>     tevents = sepBy1 (choice [+>                TInsert <$ keyword "insert"+>               ,TUpdate <$ keyword "update"+>               ,TDelete <$ keyword "delete"]) (keyword "or")+>     tfiring = option EachStatement+>                 (keyword "for" *> optional (keyword "each") *>+>                 choice [+>                   EachRow <$ keyword "row"+>                  ,EachStatement <$ keyword "statement"])++[ FOR [ EACH ] { ROW | STATEMENT } ]++    | CreateTrigger ann:Annotation+                    name:String+                    wh : TriggerWhen+                    events: {[TriggerEvent]}+                    tbl : String+                    firing : TriggerFire+                    fnName : String+                    fnArgs : {[Expression]}+ ================================================================================  = component parsers for sql statements@@ -607,11 +742,16 @@ >             SetOfTypeName <$> pos <*> (keyword "setof" *> typeName) >            ,do >              p <- pos->              s <- map toLower <$> idString+>              s <- map toLower <$> pTypeNameString >              choice [ >                PrecTypeName p s <$> parens integer >               ,ArrayTypeName p (SimpleTypeName p s) <$ symbol "[" <* symbol "]" >               ,return $ SimpleTypeName p s]]+>            where+>              --todo: add special cases for the other type names with spaces in them+>              pTypeNameString = ("double precision" <$ try (keyword "double"+>                                                            <* keyword "precision"))+>                              <|> idString  > cascade :: ParsecT [Token] ParseState Identity Cascade > cascade = option Restrict (choice [@@ -782,6 +922,7 @@ try a few random things which can't start a different expression  >               ,positionalArg+>               ,placeholder >               ,stringLit  >               ,floatLit@@ -839,8 +980,8 @@ >         ,[binary "+" AssocLeft >          ,binary "-" AssocLeft] >          --should be is isnull and notnull->         ,[postfixks ["is", "not", "null"] "!isNotNull"->          ,postfixks ["is", "null"] "!isNull"]+>         ,[postfixks ["is", "not", "null"] "!isnotnull"+>          ,postfixks ["is", "null"] "!isnull"] >          --other operators all added in this list according to the pg docs: >         ,[binary "<->" AssocNone >          ,binary "<=" AssocRight@@ -858,7 +999,9 @@ >          ,binary ">" AssocNone] >         ,[binary "=" AssocRight >          ,binary "<>" AssocNone]->         ,[prefixk "not" "!not"]+>         ,[notNot+>          ,prefixk "not" "!not"+>          ] >         ,[binaryk "and" "!and" AssocLeft >          ,binaryk "or" "!or" AssocLeft]] >     where@@ -878,6 +1021,14 @@ >         ctor $ try $ do >           f <- FunCall <$> pos <*> (t <$ opParse) >           return (\l -> f [l])+>       --hack - haven't worked out why parsec buildexpression parser won't parse+>       -- something like "not not EXPR" without parens so hack here+>       notNot = Prefix (try $ do+>                          p1 <- pos+>                          keyword "not"+>                          p2 <- pos+>                          keyword "not"+>                          return (\l -> FunCall p1 "!not" [FunCall p2 "!not" [l]]))  == factor parsers @@ -915,7 +1066,7 @@ > rowCtor :: ParsecT [Token] ParseState Identity Expression > rowCtor = FunCall >           <$> pos->           <*> return "!rowCtor"+>           <*> return "!rowctor" >           <*> choice [ >            keyword "row" *> parens (commaSep expr) >           ,parens $ commaSep2 expr]@@ -957,14 +1108,14 @@  > arrayLit :: ParsecT [Token] ParseState Identity Expression > arrayLit = FunCall <$> pos <* keyword "array"->                    <*> return "!arrayCtor"+>                    <*> return "!arrayctor" >                    <*> squares (commaSep expr)  > arraySubSuffix :: Expression -> ParsecT [Token] ParseState Identity Expression > arraySubSuffix e = case e of >                      Identifier _ "array" -> fail "can't use array as identifier name" >                      _ -> FunCall <$> pos->                                   <*> return "!arraySub"+>                                   <*> return "!arraysub" >                                   <*> ((e:) <$> squares (commaSep1 expr))  supports basic window functions of the form@@ -985,10 +1136,19 @@ >                    <*> option Asc (try $ choice [ >                                             Asc <$ keyword "asc" >                                            ,Desc <$ keyword "desc"])->                            <* symbol ")"+>                    <*> frm+>                    <* symbol ")" >   where >     orderBy1 = keyword "order" *> keyword "by" *> commaSep1 expr >     partitionBy = keyword "partition" *> keyword "by" *> commaSep1 expr+>     frm = option FrameUnboundedPreceding $ choice $ map (\(a,b) -> a <$ try (ks b)) [+>            (FrameUnboundedPreceding, ["range","unbounded","preceding"])+>           ,(FrameUnboundedPreceding, ["range","between","unbounded","preceding","and","current","row"])+>           ,(FrameUnboundedFull, ["range","between","unbounded","preceding","and","unbounded","following"])+>           ,(FrameUnboundedFull, ["rows","between","unbounded","preceding","and","unbounded","following"])+>           ,(FrameRowsUnboundedPreceding, ["rows","unbounded","preceding"])+>           ,(FrameRowsUnboundedPreceding, ["rows","between","unbounded","preceding","and","current","row"])]+>     ks = mapM keyword  > betweenSuffix :: Expression -> ParsecT [Token] ParseState Identity Expression > betweenSuffix a = do@@ -1019,7 +1179,9 @@ >                dodgyParseElement = factor  > functionCallSuffix :: Expression -> ParsecT [Token] ParseState Identity Expression-> functionCallSuffix (Identifier _ fnName) = pos >>= \p -> FunCall p fnName <$> parens (commaSep expr)+> functionCallSuffix (Identifier _ fnName) =+>   pos >>= \p -> FunCall p fnName+>                 <$> parens (optional (keyword "all" <|> keyword "distinct") *> commaSep expr) > functionCallSuffix s = error $ "internal error: cannot make functioncall from " ++ show s  > castKeyword :: ParsecT [Token] ParseState Identity Expression@@ -1047,6 +1209,13 @@ > identifier :: ParsecT [Token] ParseState Identity Expression > identifier = Identifier <$> pos <*> idString +try $ do+ >   p <- pos+ >   i <- idString+ >   if i `elem` ["not"]+ >     then fail "can't use keyword"+ >     else return $ Identifier p i+ ================================================================================  = Utility parsers@@ -1067,6 +1236,7 @@  > idString :: MyParser String > idString = mytoken (\tok -> case tok of+>                                      IdStringTok "not" -> Nothing >                                      IdStringTok i -> Just i >                                      _ -> Nothing) @@ -1085,6 +1255,10 @@ >                                     PositionalArgTok n -> Just n >                                     _ -> Nothing) +> placeholder :: ParsecT [Token] ParseState Identity Expression+> placeholder = Placeholder [] <$ symbol "?"++ > float :: MyParser Double > float = mytoken (\tok -> case tok of >                                     FloatTok n -> Just n@@ -1096,6 +1270,13 @@ >                            StringTok d s -> Just $ StringLit [] d s >                            _ -> Nothing) +> stringN :: MyParser String+> stringN = mytoken (\tok ->+>                   case tok of+>                            StringTok _ s -> Just s+>                            _ -> Nothing)++ couple of helper functions which extract the actual string from a StringLD or StringL, and the delimiters which were used (either ' or a dollar tag)@@ -1294,3 +1475,36 @@ >   showToken (_,tok)   = show tok >   posToken  (posi,_)  = posi >   testToken (_,tok)   = test tok++================================================================================++= fixup tree++this is where some generics code is used to transform the parse trees+to alter the nodes used where it's too difficult to do whilst+parsing. The only item at the moment that needs this treatment is te+any/some/all construct which looks like this:+expr operator [any|some|all] (expr)++This gets parsed as+funcall operator [expr1,funcall [any|some|all] [expr2,...]]+and we want to transform it to+liftoperator operator any|some|all [expr1, expr2,...]+not doing anything if the funcall name isn't any,some,all+any other checks are left to the type checking stage+(e.g. there can only be one expression in the expr2 part, and it must+be an array or subselect, etc)++> fixupTree :: Data a => a -> a+> fixupTree =+>     transformBi $ \x ->+>       case x of+>              FunCall an op (expr1:FunCall _ nm expr2s:expr3s)+>                | isOperatorName op && map toLower nm `elem` ["any", "some", "all"]+>                -> LiftOperator an op flav (expr1:expr2s ++ expr3s)+>                   where flav = case (map toLower nm) of+>                                  "any" -> LiftAny+>                                  "some" -> LiftAny+>                                  "all" -> LiftAll+>                                  z -> error $ "internal error in parsing lift transform: " ++ z+>              x1 -> x1
Database/HsSqlPpp/PrettyPrinter/AnnotateSource.lhs view
@@ -26,11 +26,11 @@  > import Data.List > import Data.Maybe-> import Debug.Trace+> --import Debug.Trace  > import Database.HsSqlPpp.Ast.Ast > import Database.HsSqlPpp.Ast.Annotation-> import Database.HsSqlPpp.Ast.Annotator+> import Database.HsSqlPpp.Ast.TypeChecker  > annotateSource :: Bool -> String -> StatementList -> String > annotateSource doErrs src aast =
Database/HsSqlPpp/PrettyPrinter/PrettyPrinter.lhs view
@@ -24,6 +24,8 @@  > import Text.PrettyPrint > import Data.Maybe+> import Data.Char+> import Data.List  > import Database.HsSqlPpp.Ast.Ast > import Database.HsSqlPpp.Ast.Annotation@@ -59,7 +61,7 @@  > convStatement ca (SelectStatement ann s) = >   convPa ca ann <+>->   convSelectExpression True s <> statementEnd+>   convSelectExpression True True s <> statementEnd  == dml @@ -67,7 +69,7 @@ >   convPa pa ann <+> >   text "insert into" <+> text tb >   <+> ifNotEmpty (parens . hcatCsvMap text) atts->   $+$ convSelectExpression True idata+>   $+$ convSelectExpression True True idata >   $+$ convReturning rt >   <> statementEnd @@ -115,40 +117,53 @@ >         text n <+> convTypeName t >         <+> maybeConv (\e -> text "default" <+> convExp e) def >         <+> hsep (map (\e -> (case e of->                                 NullConstraint _ -> text "null"->                                 NotNullConstraint _ -> text "not null"->                                 RowCheckConstraint _ ew ->->                                     text "check" <+> parens (convExp ew)->                                 RowUniqueConstraint _ -> text "unique"->                                 RowPrimaryKeyConstraint _ -> text "primary key"->                                 RowReferenceConstraint _ tb att ondel onupd ->+>                                 NullConstraint _ cn -> mname cn <+> text "null"+>                                 NotNullConstraint _ cn -> mname cn <+> text "not null"+>                                 RowCheckConstraint _ cn ew ->+>                                     mname cn <+> text "check" <+> parens (convExp ew)+>                                 RowUniqueConstraint _ cn -> mname cn <+> text "unique"+>                                 RowPrimaryKeyConstraint _ cn -> mname cn <+> text "primary key"+>                                 RowReferenceConstraint _ cn tb att ondel onupd ->+>                                     mname cn <+> >                                     text "references" <+> text tb >                                     <+> maybeConv (parens . text) att >                                     <+> text "on delete" <+> convCasc ondel >                                     <+> text "on update" <+> convCasc onupd >                         )) cons)->       convCon (UniqueConstraint _ c) = text "unique"->                                      <+> parens (hcatCsvMap text c)->       convCon (PrimaryKeyConstraint _ p) = text "primary key"->                                          <+> parens (hcatCsvMap text p)->       convCon (CheckConstraint _ c) = text "check" <+> parens (convExp c)->       convCon (ReferenceConstraint _ at tb rat ondel onupd) =->         text "foreign key" <+> parens (hcatCsvMap text at)->         <+> text "references" <+> text tb->         <+> ifNotEmpty (parens . hcatCsvMap text) rat->         <+> text "on delete" <+> convCasc ondel->         <+> text "on update" <+> convCasc onupd +> convStatement ca (AlterTable ann name act) =+>     convPa ca ann <+>+>     text "alter table" <+> text name+>     <+> hcatCsvMap convAct act <> statementEnd+>     where+>       convAct (AlterColumnDefault _ nm def) =+>           text "alter column" <+> text nm <+> text "set default" <+> convExp def+>       convAct (AddConstraint _ con) =+>           text "add constraint" <+> convCon con +> convStatement ca (CreateSequence ann nm incr _ _ start cache) =+>     convPa ca ann <+>+>     text "create sequence" <+> text nm <+>+>     text "increment" <+> text (show incr) <+>+>     text "no minvalue" <+>+>     text "no maxvalue" <+>+>     text "start" <+> text (show start) <+>+>     text "cache" <+> text (show cache) <> statementEnd +> convStatement ca (AlterSequence ann nm o) =+>     convPa ca ann <+>+>     text "alter sequence" <+> text nm+>     <+> text "owned by" <+> text o <> statementEnd++ > convStatement ca (CreateTableAs ann t sel) = >     convPa ca ann <+> >     text "create table" >     <+> text t <+> text "as"->     $+$ convSelectExpression True sel+>     $+$ convSelectExpression True True sel >     <> statementEnd -> convStatement ca (CreateFunction ann lang name args retType qt body vol) =+> convStatement ca (CreateFunction ann name args retType lang qt body vol) = >     convPa ca ann <+> >     text "create function" <+> text name >     <+> parens (hcatCsvMap convParamDef args)@@ -185,14 +200,17 @@ > convStatement ca (CreateView ann name sel) = >     convPa ca ann <+> >     text "create view" <+> text name <+> text "as"->     $+$ nest 2 (convSelectExpression True sel) <> statementEnd+>     $+$ nest 2 (convSelectExpression True True sel) <> statementEnd -> convStatement ca (CreateDomain ann name tp ex) =+> convStatement ca (CreateDomain ann name tp n ex) = >     convPa ca ann <+> >     text "create domain" <+> text name <+> text "as"->     <+> convTypeName tp <+> checkExp ex <> statementEnd+>     <+> convTypeName tp <+> cname <+> checkExp ex <> statementEnd >     where >       checkExp = maybeConv (\e -> text "check" <+> parens (convExp e))+>       cname = if n == ""+>                then empty+>                else text "constraint" <+> text n  > convStatement ca (DropFunction ann ifExists fns casc) = >   convPa ca ann <+>@@ -202,7 +220,7 @@ >   <+> convCasc casc >   <> statementEnd >   where->     doFunction (name,types) = text name <> parens (hcatCsvMap text types)+>     doFunction (name,types) = text name <> parens (hcatCsvMap convTypeName types)  > convStatement ca (DropSomething ann dropType ifExists names casc) = >     convPa ca ann <+>@@ -224,6 +242,27 @@ >           (map (\(TypeAttDef _ n t) -> text n <+> convTypeName t)  atts))) >     $+$ rparen <> statementEnd +> convStatement ca (CreateLanguage ann name) =+>     convPa ca ann <+>+>     text "create language" <+> text name <> statementEnd++> convStatement ca (CreateTrigger ann name wh events tbl firing fnName fnArgs) =+>     convPa ca ann <+>+>     text "create trigger" <+> text name+>     <+> text (case wh of+>                       TriggerBefore -> "before"+>                       TriggerAfter -> "after")+>     <+> hcat (map text $ intersperse " or " $ map (\e -> case e of+>                                                    TInsert -> "insert"+>                                                    TUpdate -> "update"+>                                                    TDelete -> "delete") events)+>     <+> text "on" <+> text tbl+>     <+> text "for" <+> text (case firing of+>                                         EachRow -> "row"+>                                         EachStatement -> "statement")+>     <+> text "execute procedure" <+> text fnName+>     <> parens (hcatCsvMap convExp fnArgs) <> statementEnd+ == plpgsql  > convStatement ca (NullStatement ann) = convPa ca ann <+> text "null" <> statementEnd@@ -243,7 +282,7 @@ > convStatement ca (ReturnQuery ann sel) = >     convPa ca ann <+> >     text "return" <+> text "query"->     <+> convSelectExpression True sel <> statementEnd+>     <+> convSelectExpression True True sel <> statementEnd  > convStatement ca (Raise ann rt st exps) = >     convPa ca ann <+>@@ -259,7 +298,7 @@ > convStatement ca (ForSelectStatement ann i sel stmts) = >     convPa ca ann <+> >     text "for" <+> text i <+> text "in"->     <+> convSelectExpression True sel <+> text "loop"+>     <+> convSelectExpression True True sel <+> text "loop" >     $+$ convNestedStatements ca stmts >     $+$ text "end loop" <> statementEnd @@ -329,7 +368,18 @@ >                           <+> text "then" $+$ convNestedStatements ca sts >       convElseSt = ifNotEmpty (\s -> text "else" $+$ convNestedStatements ca s) +== misc +> convStatement _ (Set _ n vs) =+>   text "set" <+> text n <+> text "=" <+> hcatCsvMap (text . dv) vs <> statementEnd+>   where+>     dv (SetStr _ s) = "'" ++ s ++ "'"+>     dv (SetId _ i) = i+>     dv (SetNum _ nm) = show nm++> convStatement _ (Notify _ n) =+>   text "notify" <+> text n  <> statementEnd+ > statementEnd :: Doc > statementEnd = semi <> newline @@ -339,29 +389,29 @@  == selects -> convSelectExpression :: Bool -> SelectExpression -> Doc-> convSelectExpression writeSelect (Select _ dis l tb wh grp hav->                                 ord lim off) =+> convSelectExpression :: Bool -> Bool -> SelectExpression -> Doc+> convSelectExpression writeSelect _ (Select _ dis l tb wh grp hav+>                                 order lim off) = >   text (if writeSelect then "select" else "") >   <+> (case dis of >          Dupes -> empty >          Distinct -> text "distinct") >   <+> convSelList l->   $+$ (if null tb->          then empty->          else nest 2 (text "from" <+> hcatCsvMap convTref tb))->   $+$ convWhere wh+>   $+$ nest 2 (+>               (if null tb+>                  then empty+>                  else text "from" <+> hcatCsvMap convTref tb)+>               $+$ convWhere wh) >   <+> ifNotEmpty (\g -> text "group by" <+> hcatCsvMap convExp g) grp >   <+> maybeConv (\h -> text "having" <+> convExp h) hav >   <+> ifNotEmpty (\o -> text "order by" <+> hcatCsvMap (\(oe,od) -> convExp oe->                   <+> convDir od) o) ord+>                   <+> convDir od) o) order >   <+> maybeConv (\lm -> text "limit" <+> convExp lm) lim >   <+> maybeConv (\offs -> text "offset" <+> convExp offs) off >   where->     convTref (Tref _ f) = text f->     convTref (TrefAlias _ f a) = text f <+> text a->     convTref (JoinedTref _ t1 nat jt t2 ex) =->         convTref t1+>     convTref (Tref _ f a) = text f <+> convTrefAlias a+>     convTref (JoinedTref _ t1 nat jt t2 ex a) =+>         parens (convTref t1 >         $+$ (case nat of >                       Natural -> text "natural" >                       Unnatural -> empty)@@ -374,31 +424,32 @@ >         <+> text "join" >         <+> convTref t2 >         <+> maybeConv (nest 2 . convJoinExpression) ex+>         <+> convTrefAlias a) >         where >           convJoinExpression (JoinOn _ e) = text "on" <+> convExp e >           convJoinExpression (JoinUsing _ ids) = >               text "using" <+> parens (hcatCsvMap text ids)  >     convTref (SubTref _ sub alias) =->         parens (convSelectExpression True sub)->         <+> text "as" <+> text alias->     convTref (TrefFun _ f@(FunCall _ _ _)) = convExp f->     convTref (TrefFun _ x) =->         error $ "internal error: node not supported in function tref: " ++ show x->     convTref (TrefFunAlias _ f@(FunCall _ _ _) a) =->         convExp f <+> text "as" <+> text a->     convTref (TrefFunAlias _ x _) =+>         parens (convSelectExpression True True sub)+>         <+> text "as" <+> convTrefAlias alias+>     convTref (TrefFun _ f@(FunCall _ _ _) a) = convExp f <+> convTrefAlias a+>     convTref (TrefFun _ x _) = >         error $ "internal error: node not supported in function tref: " ++ show x+>     convTrefAlias NoAlias = empty+>     convTrefAlias (TableAlias t) = text t+>     convTrefAlias (FullAlias t s) = text t <+> parens (hcatCsvMap text s) -> convSelectExpression writeSelect (CombineSelect _ tp s1 s2) =->   convSelectExpression writeSelect s1->   $+$ (case tp of->          Except -> text "except"->          Union -> text "union"->          UnionAll -> text "union" <+> text "all"->          Intersect -> text "intersect")->   $+$ convSelectExpression True s2-> convSelectExpression _ (Values _ expss) =+> convSelectExpression writeSelect topLev (CombineSelect _ tp s1 s2) =+>   let p = convSelectExpression writeSelect False s1+>           $+$ (case tp of+>                        Except -> text "except"+>                        Union -> text "union"+>                        UnionAll -> text "union" <+> text "all"+>                        Intersect -> text "intersect")+>           $+$ convSelectExpression True False s2+>   in if topLev then p else parens p+> convSelectExpression _ _ (Values _ expss) = >   text "values" $$ nest 2 (vcat $ csv $ map (parens . csvExp) expss)  > convDir :: Direction -> Doc@@ -426,6 +477,29 @@  == ddl +> convCon :: Constraint -> Doc+> convCon (UniqueConstraint _ n c) =+>         mname n <+> text "unique"+>         <+> parens (hcatCsvMap text c)+> convCon (PrimaryKeyConstraint _ n p) =+>         mname n <+>+>         text "primary key"+>         <+> parens (hcatCsvMap text p)+> convCon (CheckConstraint _ n c) = mname n <+> text "check" <+> parens (convExp c)+> convCon (ReferenceConstraint _ n at tb rat ondel onupd) =+>         mname n <+>+>         text "foreign key" <+> parens (hcatCsvMap text at)+>         <+> text "references" <+> text tb+>         <+> ifNotEmpty (parens . hcatCsvMap text) rat+>         <+> text "on update" <+> convCasc onupd+>         <+> text "on delete" <+> convCasc ondel++> mname :: String -> Doc+> mname n = if n == ""+>           then empty+>           else text "constraint" <+> text n++ > convReturning :: Maybe SelectList -> Doc > convReturning l = case l of >                 Nothing -> empty@@ -450,7 +524,19 @@ = Expressions  > convExp :: Expression -> Doc-> convExp (Identifier _ i) = text i+> convExp (Identifier _ i) =+>   if quotesNeeded+>      then text $ "\"" ++ i ++ "\""+>      else text i+>   where+>     --needs some work - quotes needed if contains invalid unquoted+>     --chars, or maybe if matches keyword or similar+>     quotesNeeded = case i of+>                      x:_ | not (isLetter x || x `elem` "_*") -> True+>                      _ | all okChar i -> False+>                        | otherwise -> True+>                    where+>                      okChar x =isAlphaNum x || x `elem` "*_." > convExp (IntegerLit _ n) = integer n > convExp (FloatLit _ n) = double n > convExp (StringLit _ tag s) = text tag <> text replaceQuotes <> text tag@@ -462,7 +548,7 @@ > convExp (FunCall _ n es) = >     --check for special operators >    case n of->      "!arrayCtor" -> text "array" <> brackets (csvExp es)+>      "!arrayctor" -> text "array" <> brackets (csvExp es) >      "!between" -> convExp (head es) <+> text "between" >                    <+> parens (convExp (es !! 1)) >                   <+> text "and"@@ -471,10 +557,10 @@ >                      <> parens (convExp (head es) >                                 <+> text "from" <+> convExp (es !! 1) >                                 <+> text "for" <+> convExp (es !! 2))->      "!arraySub" -> case es of+>      "!arraysub" -> case es of >                        ((Identifier _ i):es1) -> text i <> brackets (csvExp es1) >                        _ -> parens (convExp (head es)) <> brackets (csvExp (tail es))->      "!rowCtor" -> text "row" <> parens (hcatCsvMap convExp es)+>      "!rowctor" -> text "row" <> parens (hcatCsvMap convExp es) >      _ | isOperatorName n -> >         case getOperatorType defaultTemplate1Environment n of >                           BinaryOp ->@@ -484,7 +570,7 @@ >                           PrefixOp -> parens (text (if n == "u-" >                                                        then "-" >                                                        else filterKeyword n)->                                                <+> convExp (head es))+>                                                <+> parens (convExp (head es))) >                           PostfixOp -> parens (convExp (head es) <+> text (filterKeyword n)) >        | otherwise -> text n <> parens (csvExp es) >    where@@ -492,8 +578,8 @@ >                          "!and" -> "and" >                          "!or" -> "or" >                          "!not" -> "not"->                          "!isNull" -> "is null"->                          "!isNotNull" -> "is not null"+>                          "!isnull" -> "is null"+>                          "!isnotnull" -> "is not null" >                          "!like" -> "like" >                          x -> x @@ -502,24 +588,36 @@ >   convExp att <+> (if not t then text "not" else empty) <+> text "in" >   <+> parens (case lst of >                        InList _ expr -> csvExp expr->                        InSelect _ sel -> convSelectExpression True sel)-> convExp (ScalarSubQuery _ s) = parens (convSelectExpression True s)+>                        InSelect _ sel -> convSelectExpression True True sel)+> convExp (LiftOperator _ op flav args) =+>   convExp (head args) <+> text op+>   <+> text (case flav of+>               LiftAny -> "any"+>               LiftAll -> "all")+>   <+> parens (convExp $ head $ tail args)+> convExp (ScalarSubQuery _ s) = parens (convSelectExpression True True s) > convExp (NullLit _) = text "null"-> convExp (WindowFn _ fn partition order asc) =+> convExp (WindowFn _ fn part order asc frm) = >   convExp fn <+> text "over" >   <+> (if hp || ho >        then >           parens ((if hp->                      then text "partition by" <+> csvExp partition+>                      then text "partition by" <+> csvExp part >                      else empty) >                   <+> (if ho >                          then text "order by" <+> csvExp order >                               <+> convDir asc->                          else empty))+>                          else empty)+>                   <+> convFrm) >        else empty) >   where->     hp = not (null partition)+>     hp = not (null part) >     ho = not (null order)+>     convFrm = case frm of+>                 FrameUnboundedPreceding -> text "range unbounded preceding"+>                 FrameUnboundedFull -> text "range between unbounded preceding and unbounded following"+>                 FrameRowsUnboundedPreceding -> text "rows unbounded preceding"+ > convExp (Case _ whens els) = >   text "case" >   $+$ nest 2 (vcat (map convWhen whens)@@ -541,7 +639,8 @@ >             <+> text "then" <+> convExp ex2  > convExp (PositionalArg _ a) = text "$" <> integer a-> convExp (Exists _ s) = text "exists" <+> parens (convSelectExpression True s)+> convExp (Placeholder _) = text "?"+> convExp (Exists _ s) = text "exists" <+> parens (convSelectExpression True True s) > convExp (Cast _ ex t) = text "cast" <> parens (convExp ex >                                              <+> text "as" >                                              <+> convTypeName t)
− Database/HsSqlPpp/Tests/AstCheckTests.lhs
@@ -1,742 +0,0 @@-sCopyright 2009 Jake Wheat--Set of tests to check the type checking code--> module Database.HsSqlPpp.Tests.AstCheckTests (astCheckTests) where--> import Test.HUnit-> import Test.Framework-> import Test.Framework.Providers.HUnit-> import Data.Char-> --import Debug.Trace--> import Database.HsSqlPpp.Parsing.Parser-> import Database.HsSqlPpp.Ast.Annotator-> import Database.HsSqlPpp.Ast.Annotation-> import Database.HsSqlPpp.Ast.Environment-> import Database.HsSqlPpp.Ast.SqlTypes--> astCheckTests :: Test.Framework.Test-> astCheckTests = testGroup "astCheckTests" [->     --testGroup "test test"->     --(mapAttr [->     --  p "select 1;" []->     -- ])--this is disabled because the messages are getting a rethink, the code-that supports this test passing is commented out also--> {-->    ,testGroup "loop tests"->     (mapAttr [] {-->       p "create function cont_test1() returns void as $$\n\->         \declare\n\->         \  r record;\n\->         \begin\n\->         \  for r in select a from b loop\n\->         \    null;\n\->         \    continue;\n\->         \  end loop;\n\->         \end;\n\->         \$$ language plpgsql volatile;\n" []->      ,p "create function cont_test2() returns void as $$\n\->         \begin\n\->         \    continue;\n\->         \end;\n\->         \$$ language plpgsql volatile;\n" [Error ("",3,5) ContinueNotInLoop]->      ]-}->      )-}-->    testGroup "basic literal types"->     (mapExprType [->       p "1" $ Right typeInt->      ,p "1.0" $ Right typeNumeric->      ,p "'test'" $ Right UnknownStringLit->      ,p "true" $ Right typeBool->      ,p "array[1,2,3]" $ Right (ArrayType typeInt)->      ,p "array['a','b']" $ Right (ArrayType (ScalarType "text"))->      ,p "array[1,'b']" $ Right (ArrayType typeInt)->      ,p "array[1,true]" $ Left [IncompatibleTypeSet [typeInt,typeBool]]->      ])->->    ,testGroup "some expressions"->     (mapExprType [->       p "1=1" $ Right typeBool->      ,p "1=true" $ Left [NoMatchingOperator "=" [typeInt,typeBool]]->      ,p "substring('aqbc' from 2 for 2)" $ Right (ScalarType "text")-->      ,p "substring(3 from 2 for 2)" $ Left->                                      [NoMatchingOperator "!substring"->                                       [ScalarType "int4"->                                       ,ScalarType "int4"->                                       ,ScalarType "int4"]]->      ,p "substring('aqbc' from 2 for true)" $ Left->                     [NoMatchingOperator "!substring"->                      [UnknownStringLit->                      ,ScalarType "int4"->                      ,ScalarType "bool"]]-->      ,p "3 between 2 and 4" $ Right typeBool->      ,p "3 between true and 4" $ Left->                                [NoMatchingOperator ">="->                                 [typeInt->                                 ,typeBool]]-->      ,p "array[1,2,3][2]" $ Right typeInt->      ,p "array['a','b'][1]" $ Right (ScalarType "text")-- >      ,p "array['a','b'][true]" (TypeError ("",0,0)- >                                   (WrongType- >                                    typeInt- >                                    UnknownStringLit))-->      ,p "not true" $ Right typeBool->      ,p "not 1" $ Left->                  [NoMatchingOperator "!not" [typeInt]]-->      ,p "@ 3" $ Right typeInt->      ,p "@ true" $ Left->                  [NoMatchingOperator "@" [ScalarType "bool"]]-->      ,p "-3" $ Right typeInt->      ,p "-'a'" $ Left->                  [NoMatchingOperator "-" [UnknownStringLit]]-->      ,p "4-3" $ Right typeInt-->      --,p "1 is null" typeBool->      --,p "1 is not null" typeBool-->      ,p "1+1" $ Right typeInt->      ,p "1+1" $ Right typeInt->      ,p "31*511" $ Right typeInt->      ,p "5/2" $ Right typeInt->      ,p "2^10" $ Right typeFloat8->      ,p "17%5" $ Right typeInt-->      ,p "3 and 4" $ Left->                   [NoMatchingOperator "!and" [typeInt,typeInt]]-->      ,p "True and False" $ Right typeBool->      ,p "false or true" $ Right typeBool-->      ,p "lower('TEST')" $ Right (ScalarType "text")->      ,p "lower(1)" $ Left [NoMatchingOperator "lower" [typeInt]]->      ])-->    ,testGroup "special functions"->     (mapExprType [->       p "coalesce(null,1,2,null)" $ Right typeInt->      ,p "coalesce('3',1,2,null)" $ Right typeInt->      ,p "coalesce('3',1,true,null)"->             $ Left [IncompatibleTypeSet [UnknownStringLit->                                 ,ScalarType "int4"->                                 ,ScalarType "bool"->                                 ,UnknownStringLit]]->      ,p "nullif('hello','hello')" $ Right (ScalarType "text")->      ,p "nullif(3,4)" $ Right typeInt->      ,p "nullif(true,3)"->             $ Left [NoMatchingOperator "nullif" [ScalarType "bool"->                                           ,ScalarType "int4"]]->      ,p "greatest(3,5,6,4,3)" $ Right typeInt->      ,p "least(3,5,6,4,3)" $ Right typeInt->      ,p "least(5,true)"->             $ Left [IncompatibleTypeSet [ScalarType "int4"->                                               ,ScalarType "bool"]]->      ])--implicit casting and function/operator choice tests:-check when multiple implicit and one exact match on num args-check multiple matches with num args, only one with implicit conversions-check multiple implicit matches with one preferred-check multiple implicit matches with one preferred highest count-check casts from unknown string lits-->    ,testGroup "some expressions"->     (mapExprType [->       p "3 + '4'" $ Right typeInt->      ,p "3.0 + '4'" $ Right typeNumeric->      ,p "'3' + '4'" $ Left [NoMatchingOperator "+" [UnknownStringLit->                                               ,UnknownStringLit]]->      ])->-->    ,testGroup "random expressions"->     (mapExprType [->       p "exists (select 1 from pg_type)" $ Right typeBool->      ,p "exists (select testit from pg_type)"->        $ Left [UnrecognisedIdentifier "testit"]->     ])--rows different lengths-rows match types pairwise, same and different types-rows implicit cast from unknown-rows don't match types--->    ,testGroup "row comparison expressions"->     (mapExprType [->       p "row(1)" $ Right (RowCtor [typeInt])->      ,p "row(1,2)" $ Right (RowCtor [typeInt,typeInt])->      ,p "row('t1','t2')" $ Right (RowCtor [UnknownStringLit,UnknownStringLit])->      ,p "row(true,1,'t3')" $ Right (RowCtor [typeBool, typeInt,UnknownStringLit])->      ,p "(true,1,'t3',75.3)" $ Right (RowCtor [typeBool,typeInt->                                       ,UnknownStringLit,typeNumeric])->      ,p "row(1) = row(2)" $ Right typeBool->      ,p "row(1,2) = row(2,1)" $ Right typeBool->      ,p "(1,2) = (2,1)" $ Right typeBool->      ,p "(1,2,3) = (2,1)" $ Left [ValuesListsMustBeSameLength]->      ,p "('1',2) = (2,'1')" $ Right typeBool->      ,p "(1,true) = (2,1)" $ Left [IncompatibleTypeSet [ScalarType "bool",ScalarType "int4"]]->      ,p "(1,2) <> (2,1)" $ Right typeBool->      ,p "(1,2) >= (2,1)" $ Right typeBool->      ,p "(1,2) <= (2,1)" $ Right typeBool->      ,p "(1,2) > (2,1)" $ Right typeBool->      ,p "(1,2) < (2,1)" $ Right typeBool->     ])---->    ,testGroup "case expressions"->     (mapExprType [->       p "case\n\->         \ when true then 1\n\->         \end" $ Right typeInt->      ,p "case\n\->         \ when 1=2 then 'stuff'\n\->         \ when 2=3 then 'blah'\n\->         \ else 'test'\n\->         \end" $ Right (ScalarType "text")->      ,p "case\n\->         \ when 1=2 then 'stuff'\n\->         \ when true=3 then 'blah'\n\->         \ else 'test'\n\->         \end" $ Left [NoMatchingOperator "=" [typeBool,typeInt]]->      ,p "case\n\->         \ when 1=2 then true\n\->         \ when 2=3 then false\n\->         \ else 1\n\->         \end" $ Left [IncompatibleTypeSet [typeBool->                                         ,typeBool->                                         ,typeInt]]->      ,p "case\n\->         \ when 1=2 then false\n\->         \ when 2=3 then 1\n\->         \ else true\n\->         \end" $ Left [IncompatibleTypeSet [typeBool->                                           ,typeInt->                                           ,typeBool]]-->      ,p "case 1 when 2 then 3 else 4 end" $ Right typeInt->      ,p "case 1 when true then 3 else 4 end"->             $ Left [IncompatibleTypeSet [ScalarType "int4"->                                          ,ScalarType "bool"]]->      ,p "case 1 when 2 then true else false end" $ Right typeBool->      ,p "case 1 when 2 then 3 else false end"->             $ Left [IncompatibleTypeSet [ScalarType "int4"->                                          ,ScalarType "bool"]]-->      ])-->    ,testGroup "polymorphic functions"->     (mapExprType [->       p "array_append(ARRAY[1,2], 3)"->         $ Right (ArrayType typeInt)->      ,p "array_append(ARRAY['a','b'], 'c')"->         $ Right (ArrayType $ ScalarType "text")->      ,p "array_append(ARRAY['a'::int,'b'], 'c')"->         $ Right (ArrayType typeInt)->      ])--todo:---->    ,testGroup "cast expressions"->     (mapExprType [->       p "cast ('1' as integer)"->         $ Right typeInt->      ,p "cast ('1' as baz)"->         $ Left [UnknownTypeName "baz"]->      ,p "array[]"->         $ Left [TypelessEmptyArray]->      --todo: figure out how to do this->      --,p "array[] :: text[]"->      --   (ArrayType (ScalarType "text"))-->      ])-->    ,testGroup "simple selects"->     (mapStatementInfo [->       p "select 1;" $ Right [Just $ SelectInfo $ SetOfType $->                              UnnamedCompositeType [("?column?", typeInt)]]->      ,p "select 1 as a;" $->         Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("a", typeInt)]]->      ,p "select 1,2;" $->         Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("?column?", typeInt)->                                                 ,("?column?", typeInt)]]->      ,p "select 1 as a, 2 as b;" $->         Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("a", typeInt)->                                                 ,("b", typeInt)]]->      ,p "select 1+2 as a, 'a' || 'b';" $->         Right [Just $ SelectInfo $ SetOfType $->                UnnamedCompositeType [("a", typeInt)->                                     ,("?column?", ScalarType "text")]]->      ,p "values (1,2);" $ Right [Just $ SelectInfo $ SetOfType $->                          UnnamedCompositeType->                          [("column1", typeInt)->                          ,("column2", typeInt)]]->      ,p "values (1,2),('3', '4');" $ Right [Just $ SelectInfo $ SetOfType $->                                      UnnamedCompositeType->                                      [("column1", typeInt)->                                      ,("column2", typeInt)]]->      ,p "values (1,2),('a', true);" $ Left [IncompatibleTypeSet [typeInt->                                                                 ,typeBool]]->      ,p "values ('3', '4'),(1,2);" $ Right [Just $ SelectInfo $ SetOfType $->                                      UnnamedCompositeType->                                      [("column1", typeInt)->                                      ,("column2", typeInt)]]->      ,p "values ('a', true),(1,2);" $ Left [IncompatibleTypeSet [typeBool->                                                                 ,typeInt]]->      ,p "values ('a'::text, '2'::int2),('1','2');" $ Right [Just $ SelectInfo $ SetOfType $->                                      UnnamedCompositeType->                                      [("column1", ScalarType "text")->                                      ,("column2", typeSmallInt)]]->      ,p "values (1,2,3),(1,2);" $ Left [ValuesListsMustBeSameLength]->      ])-->    ,testGroup "simple combine selects"->     (mapStatementInfo [->      p "select 1,2  union select '3', '4';" $ Right [Just $ SelectInfo $ SetOfType $->                                      UnnamedCompositeType->                                      [("?column?", typeInt)->                                      ,("?column?", typeInt)]]->      ,p "select 1,2 intersect select 'a', true;" $ Left [IncompatibleTypeSet [typeInt->                                                         ,typeBool]]->      ,p "select '3', '4' except select 1,2;" $ Right [Just $ SelectInfo $ SetOfType $->                                      UnnamedCompositeType->                                      [("?column?", typeInt)->                                      ,("?column?", typeInt)]]->      ,p "select 'a', true union select 1,2;"->                                      $ Left [IncompatibleTypeSet [typeBool->                                                         ,typeInt]]->      ,p "select 'a'::text, '2'::int2 intersect select '1','2';" $ Right [Just $ SelectInfo $ SetOfType $->                                      UnnamedCompositeType->                                      [("text", ScalarType "text")->                                      ,("int2", typeSmallInt)]]->      ,p "select 1,2,3 except select 1,2;" $ Left [ValuesListsMustBeSameLength]->      ,p "select '3' as a, '4' as b except select 1,2;" $ Right [Just $ SelectInfo $ SetOfType $->                                      UnnamedCompositeType->                                      [("a", typeInt)->                                      ,("b", typeInt)]]->      ])--->    ,testGroup "simple selects from"->     (mapStatementInfo [->       p "select a from (select 1 as a, 2 as b) x;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("a", typeInt)]]->      ,p "select b from (select 1 as a, 2 as b) x;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("b", typeInt)]]->      ,p "select c from (select 1 as a, 2 as b) x;"->         $ Left [UnrecognisedIdentifier "c"]->      ,p "select typlen from pg_type;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("typlen", typeSmallInt)]]->      ,p "select oid from pg_type;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("oid", ScalarType "oid")]]->      ,p "select p.oid from pg_type p;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("oid", ScalarType "oid")]]->      ,p "select typlen from nope;"->         $ Left [UnrecognisedIdentifier "typlen",UnrecognisedRelation "nope"]->      ,p "select generate_series from generate_series(1,7);"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("generate_series", typeInt)]]--check aliasing-->      ,p "select generate_series.generate_series from generate_series(1,7);"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("generate_series", typeInt)]]->      ,p "select g from generate_series(1,7) g;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("g", typeInt)]]->      ,p "select g.g from generate_series(1,7) g;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("g", typeInt)]]->      ,p "select generate_series.g from generate_series(1,7) g;"->         $ Left [UnrecognisedCorrelationName "generate_series"]->      ,p "select g.generate_series from generate_series(1,7) g;"->         $ Left [UnrecognisedIdentifier "g.generate_series"]--->      ,p "select * from pg_attrdef;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType->          [("adrelid",ScalarType "oid")->          ,("adnum",ScalarType "int2")->          ,("adbin",ScalarType "text")->          ,("adsrc",ScalarType "text")]]->      ,p "select abs from abs(3);"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("abs", typeInt)]]->         --todo: these are both valid,->         --the second one means select 3+generate_series from generate_series(1,7)->         --  select generate_series(1,7);->         -- select 3 + generate_series(1,7);->      ])--->    ,testGroup "simple selects from 2"->     (mapStatementInfoEnv [->       t "select a,b from testfunc();"->         (makeEnv->              [EnvCreateComposite "testType" [("a", ScalarType "text")->                                             ,("b", typeInt)->                                             ,("c", typeInt)]->              ,EnvCreateFunction FunName "testfunc"  [] (SetOfType $ CompositeType "testType")])->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType->                  [("a",ScalarType "text"),("b",ScalarType "int4")]]-->      ,t "select testfunc();"->         (makeEnv->              [EnvCreateFunction FunName "testfunc"  [] $ Pseudo Void])->         $ Right [Just $ SelectInfo $ Pseudo Void]-->      ])-->    ,testGroup "simple join selects"->     (mapStatementInfo [->       p "select * from (select 1 as a, 2 as b) a\n\->         \  cross join (select true as c, 4.5 as d) b;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("a", typeInt)->                                           ,("b", typeInt)->                                           ,("c", typeBool)->                                           ,("d", typeNumeric)]]->      ,p "select * from (select 1 as a, 2 as b) a\n\->         \  inner join (select true as c, 4.5 as d) b on true;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("a", typeInt)->                                           ,("b", typeInt)->                                           ,("c", typeBool)->                                           ,("d", typeNumeric)]]->      ,p "select * from (select 1 as a, 2 as b) a\n\->         \  inner join (select 1 as a, 4.5 as d) b using(a);"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("a", typeInt)->                                           ,("b", typeInt)->                                           ,("d", typeNumeric)]]->      ,p "select * from (select 1 as a, 2 as b) a\n\->         \ natural inner join (select 1 as a, 4.5 as d) b;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("a", typeInt)->                                           ,("b", typeInt)->                                           ,("d", typeNumeric)]]->         --check the attribute order->      ,p "select * from (select 2 as b, 1 as a) a\n\->         \ natural inner join (select 4.5 as d, 1 as a) b;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("a", typeInt)->                                           ,("b", typeInt)->                                           ,("d", typeNumeric)]]->      ,p "select * from (select 1 as a, 2 as b) a\n\->         \ natural inner join (select true as a, 4.5 as d) b;"->         $ Left [IncompatibleTypeSet [ScalarType "int4"->                                      ,ScalarType "bool"]]->      ])-->    ,testGroup "simple scalar identifier qualification"->     (mapStatementInfo [->       p "select a.* from \n\->         \(select 1 as a, 2 as b) a \n\->         \cross join (select 3 as c, 4 as d) b;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("a", typeInt)->                                           ,("b", typeInt)]]->      ,p "select nothere.* from \n\->         \(select 1 as a, 2 as b) a \n\->         \cross join (select 3 as c, 4 as d) b;"->         $ Left [UnrecognisedCorrelationName "nothere"]->      ,p "select a.b,b.c from \n\->         \(select 1 as a, 2 as b) a \n\->         \natural inner join (select 3 as a, 4 as c) b;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("b", typeInt)->                                           ,("c", typeInt)]]->      ,p "select a.a,b.a from \n\->         \(select 1 as a, 2 as b) a \n\->         \natural inner join (select 3 as a, 4 as c) b;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("a", typeInt)->                                           ,("a", typeInt)]]-->      ,p "select pg_attrdef.adsrc from pg_attrdef;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("adsrc", ScalarType "text")]]-->      ,p "select a.adsrc from pg_attrdef a;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("adsrc", ScalarType "text")]]-->      ,p "select pg_attrdef.adsrc from pg_attrdef a;"->         $ Left [UnrecognisedCorrelationName "pg_attrdef"]-->      ,p "select a from (select 2 as b, 1 as a) a\n\->         \natural inner join (select 4.5 as d, 1 as a) b;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("a", typeInt)]]--select g.fn from fn() g--->      ])-->    ,testGroup "aggregates"->     (mapStatementInfo [->        p "select max(prorettype::int) from pg_proc;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("max", typeInt)]]->      ])-->    ,testGroup "simple wheres"->     (mapStatementInfo [->       p "select 1 from pg_type where true;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("?column?", typeInt)]]->      ,p "select 1 from pg_type where 1;"->         $ Left [ExpressionMustBeBool]->      ,p "select typname from pg_type where typbyval;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("typname", ScalarType "name")]]->      ,p "select typname from pg_type where typtype = 'b';"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("typname", ScalarType "name")]]->      ,p "select typname from pg_type where what = 'b';"->         $ Left [UnrecognisedIdentifier "what"]->      ])--TODO: check identifier stacking working, then remove the pg_namespace-qualifier before oid and this should still work-->    ,testGroup "subqueries"->     (mapStatementInfo [->       p "select relname as relvar_name\n\->         \    from pg_class\n\->         \    where ((relnamespace =\n\->         \           (select oid\n\->         \              from pg_namespace\n\->         \              where (nspname = 'public'))) and (relkind = 'r'));"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("relvar_name",ScalarType "name")]]->      ,p "select relname from pg_class where relkind in ('r', 'v');"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("relname",ScalarType "name")]]->      ,p "select * from generate_series(1,7) g\n\->         \where g not in (select * from generate_series(3,5));"->         $ Right [Just $ SelectInfo $ SetOfType (UnnamedCompositeType [("g",ScalarType "int4")])]->      ])--identifiers in select parts-->{-    ,testGroup "select part identifiers"->     (mapStatementInfo [->       p "select relname,attname from pg_class\n\->         \inner join pg_attribute\n\->         \on pg_attribute.attrelid = pg_class.oid;"->         $ Right [Just $ SelectInfo $ SetOfType $ UnnamedCompositeType [("relvar_name",ScalarType "name")]]->      ])-}----insert-->    ,testGroup "insert"->     (mapStatementInfo [->       p "insert into nope (a,b) values (c,d);"->         $ Left [UnrecognisedRelation "nope",UnrecognisedIdentifier "c",UnrecognisedIdentifier "d"]->      ,p "insert into pg_attrdef (adrelid,adnum,adbin,adsrc)\n\->         \values (1,2, 'a', 'b');"->         $ Right [Just $ InsertInfo "pg_attrdef"->          (UnnamedCompositeType [("adrelid",ScalarType "oid")->                                 ,("adnum",ScalarType "int2")->                                 ,("adbin",ScalarType "text")->                                 ,("adsrc",ScalarType "text")])]->      ,p "insert into pg_attrdef\n\->         \values (1,2, 'a', 'b');"->         $ Right [Just $ InsertInfo "pg_attrdef"->          (UnnamedCompositeType [("adrelid",ScalarType "oid")->                                 ,("adnum",ScalarType "int2")->                                 ,("adbin",ScalarType "text")->                                 ,("adsrc",ScalarType "text")])]->      ,p "insert into pg_attrdef (hello,adnum,adbin,adsrc)\n\->         \values (1,2, 'a', 'b');"->         $ Left [UnrecognisedIdentifier "hello"]->      ,p "insert into pg_attrdef (adrelid,adnum,adbin,adsrc)\n\->         \values (1,true, 'a', 'b');"->         $ Left [IncompatibleTypes (ScalarType "int2") (ScalarType "bool")]->      ,p "insert into pg_attrdef (adrelid,adnum,adbin,adsrc)\n\->         \values (1,true, 'a', 'b','c');"->         $ Left [WrongNumberOfColumns]-->      ])-->    ,testGroup "update"->     (mapStatementInfo [->       p "update nope set a = 1;"->         $ Left [UnrecognisedRelation "nope"]->      ,p "update pg_attrdef set adsrc = '' where 1;"->         $ Left [ExpressionMustBeBool]->      ,p "update pg_attrdef set (adbin,adsrc) = ('a','b','c');"->         $ Left [WrongNumberOfColumns]->      ,p "update pg_attrdef set (adrelid,adsrc) = (true,'b');"->         $ Left [IncompatibleTypes (ScalarType "oid") typeBool]->      ,p "update pg_attrdef set (shmadrelid,adsrc) = ('a','b');"->         $ Left [UnrecognisedIdentifier "shmadrelid"]->      ,p "update pg_attrdef set adsrc='';"->         $ Right [Just $ UpdateInfo "pg_attrdef" (UnnamedCompositeType [("adsrc",ScalarType "text")])]->      ,p "update pg_attrdef set adsrc='' where 1=2;"->         $ Right [Just $ UpdateInfo "pg_attrdef" (UnnamedCompositeType [("adsrc",ScalarType "text")])]->       -- TODO: actually, pg doesn't support this so need to generate error instead->      ,p "update pg_attrdef set (adbin,adsrc) = ((select 'a','b'));"->         $ Right [Just $ UpdateInfo "pg_attrdef" (UnnamedCompositeType [("adbin",ScalarType "text"),("adsrc",ScalarType "text")])]->      ])-->    ,testGroup "delete"->     (mapStatementInfo [->       p "delete from nope;"->         $ Left [UnrecognisedRelation "nope"]->      ,p "delete from pg_attrdef where 1=2;"->         $ Right [Just $ DeleteInfo "pg_attrdef"]->      ,p "delete from pg_attrdef where 1;"->         $ Left [ExpressionMustBeBool]->      ])---================================================================================-->    ,testGroup "creates"->     (mapStatementInfoEu [->       t "create table t1 (\n\->         \   a int,\n\->         \   b text\n\->         \);"->         (Right [Nothing])->         [[EnvCreateTable "t1" [("a",ScalarType "int4")->                               ,("b",ScalarType "text")]->           []]]->      ,t "create type t1 as (\n\->         \   a int,\n\->         \   b text\n\->         \);"->         (Right [Nothing])->         [[EnvCreateComposite "t1" [("a",ScalarType "int4")->                                   ,("b",ScalarType "text")]]]-->      ,t "create domain t1 as text;"->         (Right [Nothing])->         [[EnvCreateDomain (ScalarType "t1") (ScalarType "text")]]--->      ,t "create view v1 as select * from pg_attrdef;"->         (Right [Nothing])->         [[EnvCreateView "v1" [("adrelid",ScalarType "oid")->                              ,("adnum",ScalarType "int2")->                              ,("adbin",ScalarType "text")->                              ,("adsrc",ScalarType "text")]]]-->      ,t "create function t1(text) returns text as $$\n\->         \null;\n\->         \$$ language sql stable;"->         (Right [Nothing])->         [[EnvCreateFunction FunName "t1" [ScalarType "text"]->                             (ScalarType "text")]]-->      ])--================================================================================--check the identifier resolution for functions:-parameters-variable declarations-select expressions inside these:-refer to param-refer to variable-override var with var-override var with select iden-todo: override var with param, override select iden with param--check var defs:-check type exists-check type of initial values-->    ,testGroup "create function identifier resolution"->     (mapStatementInfo [->       p "create function t1(stuff text) returns text as $$\n\->         \begin\n\->         \  return stuff || ' and stuff';\n\->         \end;\n\->         \$$ language plpgsql stable;"->         (Right [Nothing])->      ,p "create function t1(stuff text) returns text as $$\n\->         \begin\n\->         \  return badstuff || ' and stuff';\n\->         \end;\n\->         \$$ language plpgsql stable;"->         (Left [UnrecognisedIdentifier "badstuff"])->      ,p "create function t1() returns text as $$\n\->         \declare\n\->         \  stuff text;\n\->         \begin\n\->         \  return stuff || ' and stuff';\n\->         \end;\n\->         \$$ language plpgsql stable;"->         (Right [Nothing])->      ])->->    ]->         where->           --mapAttr = map $ uncurry checkAttrs->           p a b = (a,b)->           t a b c = (a,b,c)->           mapExprType = map (uncurry $ checkExpressionType defaultTemplate1Environment)->           --mapStatementType = map $ uncurry checkStatementType->           mapStatementInfo = map $ uncurry checkStatementInfo->           mapStatementInfoEu = map (\(a,b,c) ->  checkStatementInfoEu a b c)->           {-mapExprEnvType = map (\(a,b,c) -> checkExpressionType b a c)-}->           makeEnv eu = case updateEnvironment defaultTemplate1Environment eu of->                         Left x -> error $ show x->                         Right e -> e->           mapStatementInfoEnv = map (\(a,b,c) -> checkStatementInfoEnv b a c)--> checkExpressionType :: Environment -> String -> Either [TypeError] Type -> Test.Framework.Test-> checkExpressionType env src typ = testCase ("typecheck " ++ src) $->   let ast = case parseExpression src of->                                      Left e -> error $ show e->                                      Right l -> l->       aast = annotateExpression env ast->       ty = getTopLevelTypes [aast]->       er = concatMap snd $ getTypeErrors aast->   in case (length er, length ty) of->        (0,0) -> assertFailure "didn't get any types?"->        (0,1) -> assertEqual ("typecheck " ++ src) typ $ Right $ head ty->        (0,_) -> assertFailure "got too many types"->        _ -> assertEqual ("typecheck " ++ src) typ $ Left er--> checkStatementInfo :: String -> Either [TypeError] [Maybe StatementInfo] -> Test.Framework.Test-> checkStatementInfo src sis = testCase ("typecheck " ++ src) $->   let ast = case parseSql src of->                               Left e -> error $ show e->                               Right l -> l->       aast = annotateAst ast->       is = getTopLevelInfos aast->       er = concatMap snd $ getTypeErrors aast->   in {-trace (show $ map getAnnotation aast) $-} case (length er, length is) of->        (0,0) -> assertFailure "didn't get any infos?"->        (0,_) -> assertEqual ("typecheck " ++ src) sis $ Right is->        _ -> assertEqual ("typecheck " ++ src) sis $ Left er--> checkStatementInfoEnv :: Environment -> String -> Either [TypeError] [Maybe StatementInfo] -> Test.Framework.Test-> checkStatementInfoEnv env src sis = testCase ("typecheck " ++ src) $->   let ast = case parseSql src of->                               Left e -> error $ show e->                               Right l -> l->       aast = annotateAstEnv env ast->       is = getTopLevelInfos aast->       er = concatMap snd $ getTypeErrors aast->   in {-trace (show aast) $-} case (length er, length is) of->        (0,0) -> assertFailure "didn't get any infos?"->        (0,_) -> assertEqual ("typecheck " ++ src) sis $ Right is->        _ -> assertEqual ("typecheck " ++ src) sis $ Left er--> checkStatementInfoEu :: String -> Either [TypeError] [Maybe StatementInfo] -> [[EnvironmentUpdate]] -> Test.Framework.Test-> checkStatementInfoEu src sis eu = testCase ("typecheck " ++ src) $->   let ast = case parseSql src of->                               Left e -> error $ show e->                               Right l -> l->       aast = annotateAst ast->       is = getTopLevelInfos aast->       er = concatMap snd $ getTypeErrors aast->       eu' = getTopLevelEnvUpdates aast->   in {-trace (show aast) $-} case (length er, length is, length eu') of->        (0,0,0) -> assertFailure "didn't get any infos or envupdates?"->        (0,_,_) -> do->          assertEqual ("typecheck " ++ src) sis $ Right is->          assertEqual ("eu " ++ src) eu eu'->        _ -> assertEqual ("typecheck " ++ src) sis $ Left er
+ Database/HsSqlPpp/Tests/ExtensionTests.lhs view
@@ -0,0 +1,182 @@+Copyright 2009 Jake Wheat++Set of tests for the extensions++> {-# LANGUAGE RankNTypes,FlexibleContexts #-}++> module Database.HsSqlPpp.Tests.ExtensionTests (extensionTests) where++> import Test.HUnit+> import Test.Framework+> import Test.Framework.Providers.HUnit+> import Data.Char+> import Control.Monad.Error+> --import Debug.Trace++> import Database.HsSqlPpp.Parsing.Parser+> import Database.HsSqlPpp.Ast.Annotation+> import Database.HsSqlPpp.Extensions.ChaosExtensions+> import Database.HsSqlPpp.Ast.Ast+> --import Database.HsSqlPpp.PrettyPrinter.PrettyPrinter++> extensionTests :: Test.Framework.Test+> extensionTests =+>   testGroup "extensionTests" (mapCheckExtension [+>     t rewriteCreateVars+>       "select create_var('varname','vartype');"+>       "create table varname_table (\n\+>       \  varname vartype);\n\+>       \create function get_varname() returns vartype as $a$\n\+>       \  select * from varname_table;\n\+>       \$a$ language sql stable;\n\+>       \create function check_con_varname_table_varname_key() returns boolean as $a$\n\+>       \begin\n\+>       \  return true;\n\+>       \end;\n\+>       \$a$ language plpgsql stable;\n\+>       \/*drop function if exists varname_table_constraint_trigger_operator();\n\+>       \create function varname_table_constraint_trigger_operator() returns trigger as $a$\n\+>       \begin\n\+>       \  null;\n\+>       \end;\n\+>       \$a$ language plpgsql;*/\n\+>       \create function check_con_varname_table_01_tuple() returns boolean as $a$\n\+>       \begin\n\+>       \  return true;\n\+>       \end;\n\+>       \$a$ language plpgsql stable;\n\+>       \drop function if exists varname_table_constraint_trigger_operator();\n\+>       \create function varname_table_constraint_trigger_operator() returns trigger as $a$\n\+>       \begin\n\+>       \  null;\n\+>       \end;\n\+>       \$a$ language plpgsql;"++>    ,t addReadonlyTriggers+>       "select set_relvar_type('stuff','readonly');"+>       "create function check_stuff_d_readonly() returns trigger as $a$\n\+>       \begin\n\+>       \  if (not (false)) then\n\+>       \    raise exception 'delete on base_relvar_metadata violates transition constraint base_relvar_metadata_d_readonly';\n\+>       \  end if;\n\+>       \return null;\n\+>       \end;\n\+>       \$a$ language plpgsql volatile;\n\+>       \create function check_stuff_i_readonly() returns trigger as $a$\n\+>       \begin\n\+>       \  if (not (false)) then\n\+>       \       raise exception 'delete on base_relvar_metadata violates transition constraint base_relvar_metadata_d_readonly';\n\+>       \  end if;\n\+>       \  return null;\n\+>       \end;\n\+>       \$a$ language plpgsql volatile;\n\+>       \create function check_stuff_u_readonly() returns trigger as $a$\n\+>       \begin\n\+>       \  if (not (false)) then\n\+>       \       raise exception 'delete on base_relvar_metadata violates transition constraint base_relvar_metadata_d_readonly';\n\+>       \  end if;\n\+>       \  return null;\n\+>       \end;\n\+>       \$a$ language plpgsql volatile;"++>    ,t createClientActionWrapper+>       "select create_client_action_wrapper('actname', $$actcall()$$);"+>       "create function action_actname() returns void as $a$\n\+>       \begin\n\+>       \  perform action_actcall();\n\+>       \end;\n\+>       \$a$ language plpgsql;"+>    ,t createClientActionWrapper+>       "select create_client_action_wrapper('actname', $$actcall('test')$$);"+>       "create function action_actname() returns void as $a$\n\+>       \begin\n\+>       \  perform action_actcall('test');\n\+>       \end;\n\+>       \$a$ language plpgsql;"+>    ,t addNotifyTriggers+>       "select set_relvar_type('stuff','data');"+>       "create function stuff_changed() returns trigger as $a$\n\+>       \begin\n\+>       \  notify stuff;\n\+>       \  return null;\n\+>       \end;\n\+>       \$a$ language plpgsql;"+>    ,t addConstraint+>       "select add_constraint('name', 'true', array['t1', 't2']);"+>       "create function check_con_name() returns boolean as $a$\n\+>       \begin\n\+>       \  return true;\n\+>       \end;\n\+>       \$a$ language plpgsql stable;\n\+>       \drop function if exists t1_constraint_trigger_operator();\n\+>       \create function t1_constraint_trigger_operator() returns trigger as $a$\n\+>       \begin\n\+>       \  null;\n\+>       \end;\n\+>       \$a$ language plpgsql;\n\+>       \drop function if exists t2_constraint_trigger_operator();\n\+>       \create function t2_constraint_trigger_operator() returns trigger as $a$\n\+>       \begin\n\+>       \  null;\n\+>       \end;\n\+>       \$a$ language plpgsql;"+>    ,t addKey+>       "select add_key('tbl', 'attr');"+>       "create function check_con_tbl_attr_key() returns boolean as $a$\n\+>       \begin\n\+>       \  return true;\n\+>       \end;\n\+>       \$a$ language plpgsql stable;\n\+>       \/*drop function if exists tbl_constraint_trigger_operator();\n\+>       \create function tbl_constraint_trigger_operator() returns trigger as $a$\n\+>       \begin\n\+>       \  null;\n\+>       \end;\n\+>       \$a$ language plpgsql;*/"+>    ,t addKey+>       "select add_key('tbl', array['attr1','attr2']);"+>       "create function check_con_tbl_attr1_attr2_key() returns boolean as $a$\n\+>       \begin\n\+>       \  return true;\n\+>       \end;\n\+>       \$a$ language plpgsql stable;\n\+>       \/*drop function if exists tbl_constraint_trigger_operator();\n\+>       \create function tbl_constraint_trigger_operator() returns trigger as $a$\n\+>       \begin\n\+>       \  null;\n\+>       \end;\n\+>       \$a$ language plpgsql;*/"+>    ,t zeroOneTuple+>       "select constrain_to_zero_or_one_tuple('tbl');"+>       "create function check_con_tbl_01_tuple() returns boolean as $a$\n\+>       \begin\n\+>       \  return true;\n\+>       \end;\n\+>       \$a$ language plpgsql stable;\n\+>       \drop function if exists tbl_constraint_trigger_operator();\n\+>       \create function tbl_constraint_trigger_operator() returns trigger as $a$\n\+>       \begin\n\+>       \  null;\n\+>       \end;\n\+>       \$a$ language plpgsql;"+++add_foreign_key+constrain zero one+add constraint++>    ])++>   where+>     t a b c = (a,b,c)+>     mapCheckExtension = map (\(a,b,c) ->  checkExtension a b c)+>     checkExtension :: (StatementList -> StatementList) -> String -> String -> Test.Framework.Test+>     checkExtension f stxt ttxt = testCase ("check " ++ stxt) $+>       case (do+>             sast <- parseSql "" stxt+>             let esast = f sast+>             --trace (printSql esast) $ return ()+>             tast <- parseSql "" ttxt+>             return (tast,esast)) of+>         Left e -> assertFailure $ show e+>         Right (ts,es) -> assertEqual "" (stripAnnotations ts) (stripAnnotations es)
+ Database/HsSqlPpp/Tests/ParameterizedStatementTests.lhs view
@@ -0,0 +1,76 @@+Copyright 2010 Jake Wheat++Tests for the infrastructure to create type safe access to databases -+the information needed is gathered during typechecking and exposed+in the StatementType annotation.++> module Database.HsSqlPpp.Tests.ParameterizedStatementTests (parameterizedStatementTests) where++> import Test.HUnit+> import Test.Framework+> import Test.Framework.Providers.HUnit+> import Data.Char++> import Database.HsSqlPpp.Ast.SqlTypes+> import Database.HsSqlPpp.Ast.Annotation+> import Database.HsSqlPpp.Parsing.Parser+> import Database.HsSqlPpp.Ast.TypeChecker+> import Database.HsSqlPpp.Ast.Environment++> data Item = Group String [Item]+>           | Statements [(String, [EnvironmentUpdate], StatementType)]++> parameterizedStatementTests :: [Test.Framework.Test]+> parameterizedStatementTests = itemToTft testData++> testData :: Item+> testData =+>   Group "parameterized statement tests" [+>     Group "simple selects" [ Statements [+>        ("select test();"+>        ,[EnvCreateFunction FunName "test" [] (Pseudo Void) False]+>        ,StatementType [] [])+>       ,("select adnum,adbin from pg_attrdef;"+>        ,[]+>        ,StatementType [] [("adnum", ScalarType "int2")+>                          ,("adbin", ScalarType "text")])]+>     ]+>    ,Group "simple fn calls" [ Statements [+>        ("select test($1);"+>        ,[EnvCreateFunction FunName "test" [ScalarType "int4"] (ScalarType "text") False]+>        ,StatementType [ScalarType "int4"] [("test",ScalarType "text")])+>       ,("select test(?);"+>        ,[EnvCreateFunction FunName "test" [ScalarType "int4"] (ScalarType "text") False]+>        ,StatementType [ScalarType "int4"] [("test",ScalarType "text")])+>        ]+>     ]+>   ]++select a,b from c where d=e group by f having  g=h orderby i limit j offset k;+select function(a,b);+insert into a (b,c) values (d,e) returning f,g+update a set b=c,d=e where f=g returning h,i+delete from t where a=b returning c,d++> testStatementType :: String -> [EnvironmentUpdate] -> StatementType -> Test.Framework.Test+> testStatementType src eu st = testCase ("typecheck " ++ src) $+>   let ast = case parseSql "" src of+>                               Left e -> error $ show e+>                               Right l -> l+>   in case typeCheckPS makeEnv (head ast) of+>        Left e -> error $ show e+>        Right aast -> let is = getTopLevelInfos [aast]+>                          er = concatMap snd $ getTypeErrors [aast]+>                      in case is of+>                                 _ | not (null er) -> assertFailure $ show er+>                                 [Just is1] -> assertEqual ("typecheck " ++ src) st is1+>                                 _ -> assertFailure ("expected onne statementinfo, got " ++ show is)+>   where+>     makeEnv = case updateEnvironment defaultTemplate1Environment eu of+>                         Left x -> error $ show x+>                         Right e -> e++> itemToTft :: Item -> [Test.Framework.Test]+> itemToTft (Statements es) = map (\(a,b,c) -> testStatementType a b c) es+> itemToTft (Group s is) = [testGroup s $ concatMap itemToTft is]+
Database/HsSqlPpp/Tests/ParserTests.lhs view
@@ -7,35 +7,43 @@  There are no tests for invalid sql at the moment. +temporarily disabled because of haddock issue:+{-# LANGUAGE QuasiQuotes #-}+ > module Database.HsSqlPpp.Tests.ParserTests (parserTests) where  > import Test.HUnit > import Test.Framework > import Test.Framework.Providers.HUnit > import Data.Char+> import Data.Generics +> -- import Database.HsSqlPpp.Here+ > import Database.HsSqlPpp.Ast.Ast > import Database.HsSqlPpp.Ast.Annotation-> import Database.HsSqlPpp.Ast.Annotation > import Database.HsSqlPpp.Parsing.Parser > import Database.HsSqlPpp.PrettyPrinter.PrettyPrinter -> parserTests :: Test.Framework.Test-> parserTests =->   testGroup "parserTests" [ -================================================================================+> data Item = Expressions [(String, Expression)]+>           | Statements [(String, [Statement])]+>           | PlpgsqlStatements [(String, [Statement])]+>           | Group String [Item] -uses a whole bunch of shortcuts (at the bottom of main) to make this-code more concise. Could probably use a few more.+> parserTests :: [Test.Framework.Test]+> parserTests = itemToTft parserTestData ->     testGroup "parse expression"->     (mapExpr [+> parserTestData :: Item+> parserTestData =+>   Group "parserTests" [ -start with some really basic expressions, we just use the expression-parser rather than the full sql statement parser. (the expression parser-requires a single expression followed by eof.)+================================================================================ +expressions++>    Group "parse expressions" [+>     Group "basic expressions" [Expressions [ >       p "1" (IntegerLit [] 1) >      ,p "-1" (FunCall [] "u-" [IntegerLit [] 1]) >      ,p "1.1" (FloatLit [] 1.1)@@ -45,43 +53,45 @@ >      ,p "1+1+1" (FunCall [] "+" [FunCall [] "+" [IntegerLit [] 1 >                                         ,IntegerLit [] 1] >                             ,IntegerLit [] 1])+>      ]] ++>    ,Group "parens" [Expressions [+ check some basic parens use wrt naked values and row constructors these tests reflect how pg seems to interpret the variants. ->      ,p "(1)" (IntegerLit [] 1)->      ,p "row ()" (FunCall [] "!rowCtor" [])->      ,p "row (1)" (FunCall [] "!rowCtor" [IntegerLit [] 1])->      ,p "row (1,2)" (FunCall [] "!rowCtor" [IntegerLit [] 1,IntegerLit [] 2])->      ,p "(1,2)" (FunCall [] "!rowCtor" [IntegerLit [] 1,IntegerLit [] 2])+>       p "(1)" (IntegerLit [] 1)+>      ,p "row ()" (FunCall [] "!rowctor" [])+>      ,p "row (1)" (FunCall [] "!rowctor" [IntegerLit [] 1])+>      ,p "row (1,2)" (FunCall [] "!rowctor" [IntegerLit [] 1,IntegerLit [] 2])+>      ,p "(1,2)" (FunCall [] "!rowctor" [IntegerLit [] 1,IntegerLit [] 2])+>      ]] +>    ,Group "more basic expressions" [Expressions [+ test some more really basic expressions ->      ,p "'test'" (stringQ "test")+>       p "'test'" (stringQ "test") >      ,p "''" (stringQ "") >      ,p "hello" (Identifier [] "hello") >      ,p "helloTest" (Identifier [] "helloTest") >      ,p "hello_test" (Identifier [] "hello_test")->      --,p "\"this is an identifier\"" (Identifier [] "this is an identifier")+>      ,p "\"this is an identifier\"" (Identifier [] "this is an identifier") >      ,p "hello1234" (Identifier [] "hello1234") >      ,p "true" (BooleanLit [] True) >      ,p "false" (BooleanLit [] False) >      ,p "null" (NullLit [])--array selector-->      ,p "array[1,2]" (FunCall [] "!arrayCtor" [IntegerLit [] 1, IntegerLit [] 2])--array subscripting-->      ,p "a[1]" (FunCall [] "!arraySub" [Identifier [] "a", IntegerLit [] 1])+>      ]] -we just produce a ast, so no type checking or anything like that is-done+>    ,Group "array ctor and selector" [Expressions [+>       p "array[1,2]" (FunCall [] "!arrayctor" [IntegerLit [] 1, IntegerLit [] 2])+>      ,p "a[1]" (FunCall [] "!arraysub" [Identifier [] "a", IntegerLit [] 1]) -some operator tests+>      ]] ->      ,p "1 + tst1" (FunCall [] "+" [IntegerLit [] 1+>    ,Group "simple operators" [Expressions [+>       p "1 + tst1" (FunCall [] "+" [IntegerLit [] 1 >                                ,Identifier [] "tst1"]) >      ,p "tst1 + 1" (FunCall [] "+" [Identifier [] "tst1" >                                ,IntegerLit [] 1])@@ -92,6 +102,8 @@ >      ,p "'stuff'::text" (Cast [] (stringQ "stuff") (SimpleTypeName [] "text")) >      ,p "245::float(24)" (Cast [] (IntegerLit [] 245) (PrecTypeName [] "float" 24)) +>      ,p "245::double precision" (Cast [] (IntegerLit [] 245) (SimpleTypeName [] "double precision"))+ >      ,p "a between 1 and 3" >         (FunCall [] "!between" [Identifier [] "a", IntegerLit [] 1, IntegerLit [] 3]) >      ,p "cast(a as text)"@@ -107,34 +119,41 @@ >          FunCall [] "-" [IntegerLit [] 5,IntegerLit [] 3]]) >      ,p "a like b" >         (FunCall [] "!like" [Identifier [] "a", Identifier [] "b"])--some function call tests+>      ]] ->      ,p "fn()" (FunCall [] "fn" [])+>    ,Group "function calls" [Expressions [+>       p "fn()" (FunCall [] "fn" []) >      ,p "fn(1)" (FunCall [] "fn" [IntegerLit [] 1]) >      ,p "fn('test')" (FunCall [] "fn" [stringQ "test"]) >      ,p "fn(1,'test')" (FunCall [] "fn" [IntegerLit [] 1, stringQ "test"]) >      ,p "fn('test')" (FunCall [] "fn" [stringQ "test"])--simple whitespace sanity checks+>      ]] ->      ,p "fn (1)" (FunCall [] "fn" [IntegerLit [] 1])+>    ,Group "simple whitespace sanity checks" [Expressions [+>       p "fn (1)" (FunCall [] "fn" [IntegerLit [] 1]) >      ,p "fn( 1)" (FunCall [] "fn" [IntegerLit [] 1]) >      ,p "fn(1 )" (FunCall [] "fn" [IntegerLit [] 1]) >      ,p "fn(1) " (FunCall [] "fn" [IntegerLit [] 1]) -null stuff+>      ]] ->      ,p "not null" (FunCall [] "!not" [NullLit []])->      ,p "a is null" (FunCall [] "!isNull" [Identifier [] "a"])->      ,p "a is not null" (FunCall [] "!isNotNull" [Identifier [] "a"])+>    ,Group "null stuff" [Expressions [+>       p "not null" (FunCall [] "!not" [NullLit []])+>      ,p "a is null" (FunCall [] "!isnull" [Identifier [] "a"])+>      ,p "a is not null" (FunCall [] "!isnotnull" [Identifier [] "a"]) -some slightly more complex stuff+>      ,p "not not true" (FunCall [] "!not"+>                          [FunCall [] "!not"+>                           [BooleanLit [] True]])+>      ]] ->      ,p "case when a,b then 3\n\->         \     when c then 4\n\->         \     else 5\n\->         \end"+>    ,Group "case expressions" [Expressions [+>       p -- [$here|+>          "case when a,b then 3\n\+>          \     when c then 4\n\+>          \     else 5\n\+>          \end"+>          --    |] >         (Case [] [([Identifier [] "a", Identifier [] "b"], IntegerLit [] 3) >               ,([Identifier [] "c"], IntegerLit [] 4)] >          (Just $ IntegerLit [] 5))@@ -143,49 +162,51 @@ >         (CaseSimple [] (IntegerLit [] 1) >            [([IntegerLit [] 2], IntegerLit [] 3)] >          (Just $ IntegerLit [] 4))---positional args used in sql and sometimes plpgsql functions-->      ,p "$1" (PositionalArg [] 1)-->      ,p "exists (select 1 from a)"->       (Exists [] (selectFrom [SelExp [] (IntegerLit [] 1)] (Tref [] "a")))-- >       (Exists (makeSelect {- >                 selSelectList = sle [(IntegerLit [] 1)]- >                ,selTref = Just $ Tref "a"}))-+>      ]] -selectFrom [SelExp [] (IntegerLit [] 1)] (Tref "a")))+>    ,Group "positional args" [Expressions [+>       p "$1" (PositionalArg [] 1)+>      ,p "?" (Placeholder [])+>      ,p "a = ?" (FunCall [] "=" [Identifier [] "a",Placeholder []])+>      ]] -in variants, including using row constructors+>    ,Group "exists" [Expressions [+>       p "exists (select 1 from a)"+>       (Exists [] (selectFrom [SelExp [] (IntegerLit [] 1)] (Tref [] "a" NoAlias)))+>      ]] ->      ,p "t in (1,2)"+>    ,Group "in variants" [Expressions [+>       p "t in (1,2)" >       (InPredicate [] (Identifier [] "t") True (InList [] [IntegerLit [] 1,IntegerLit [] 2])) >      ,p "t not in (1,2)" >       (InPredicate [] (Identifier [] "t") False (InList [] [IntegerLit [] 1,IntegerLit [] 2])) >      ,p "(t,u) in (1,2)"->       (InPredicate [] (FunCall [] "!rowCtor" [Identifier [] "t",Identifier [] "u"]) True+>       (InPredicate [] (FunCall [] "!rowctor" [Identifier [] "t",Identifier [] "u"]) True >        (InList [] [IntegerLit [] 1,IntegerLit [] 2]))+>      ,p "3 = any (array[1,2])"+>       (LiftOperator [] "=" LiftAny [IntegerLit [] 3+>                                     ,FunCall [] "!arrayctor" [IntegerLit [] 1+>                                                              ,IntegerLit [] 2]])+>      ,p "3 = all (array[1,2,4])"+>       (LiftOperator [] "=" LiftAll [IntegerLit [] 3+>                                     ,FunCall [] "!arrayctor" [IntegerLit [] 1+>                                                              ,IntegerLit [] 2+>                                                              ,IntegerLit [] 4]])+>      ]] ->      ,p "a < b"+>    ,Group "comparison operators" [Expressions [+>       p "a < b" >       (FunCall [] "<" [Identifier [] "a", Identifier [] "b"]) >      ,p "a <> b" >       (FunCall [] "<>" [Identifier [] "a", Identifier [] "b"]) >      ,p "a != b" >       (FunCall [] "<>" [Identifier [] "a", Identifier [] "b"])-->      ])---================================================================================+>      ]]  test some string parsing, want to check single quote behaviour, and dollar quoting, including nesting. ->     ,testGroup "string parsing"->     (mapExpr [+>    ,Group "string parsing" [Expressions [ >       p "''" (stringQ "") >      ,p "''''" (stringQ "'") >      ,p "'test'''" (stringQ "test'")@@ -196,132 +217,224 @@ >      ,p "$st$test$st$" (StringLit [] "$st$" "test") >      ,p "$outer$te$$yup$$st$outer$" (StringLit [] "$outer$" "te$$yup$$st") >      ,p "'spl$$it'" (stringQ "spl$$it")->      ])+>      ]]+>      ]  ================================================================================ -first statement, pretty simple+select statements ->     ,testGroup "select expression"->     (mapSql [+>   ,Group "simple select statements" [+>     Group "select no table" [Statements [ >       p "select 1;" [SelectStatement [] $ selectE (SelectList [] [SelExp [] (IntegerLit [] 1)] [])]->      ])--================================================================================--test a whole bunch more select statements-->     ,testGroup "select from table"->     (mapSql [+>      ]]+>    ,Group "select from table" [Statements [ >       p "select * from tbl;"->       [SelectStatement [] $ selectFrom (selIL ["*"]) (Tref [] "tbl")]+>       [SelectStatement [] $ selectFrom (selIL ["*"]) (Tref [] "tbl" NoAlias)] >      ,p "select a,b from tbl;"->       [SelectStatement [] $ selectFrom (selIL ["a", "b"]) (Tref [] "tbl")]+>       [SelectStatement [] $ selectFrom (selIL ["a", "b"]) (Tref [] "tbl" NoAlias)]  >      ,p "select a,b from inf.tbl;"->       [SelectStatement [] $ selectFrom (selIL ["a", "b"]) (Tref [] "inf.tbl")]+>       [SelectStatement [] $ selectFrom (selIL ["a", "b"]) (Tref [] "inf.tbl" NoAlias)]  >      ,p "select distinct * from tbl;"->       [SelectStatement [] $ Select [] Distinct (SelectList [] (selIL ["*"]) []) [Tref [] "tbl"]+>       [SelectStatement [] $ Select [] Distinct (SelectList [] (selIL ["*"]) []) [Tref [] "tbl" NoAlias] >        Nothing [] Nothing [] Nothing Nothing]  >      ,p "select a from tbl where b=2;" >       [SelectStatement [] $ selectFromWhere >         (selIL ["a"])->         (Tref [] "tbl")+>         (Tref [] "tbl" NoAlias) >         (FunCall [] "=" >          [Identifier [] "b", IntegerLit [] 2])] >      ,p "select a from tbl where b=2 and c=3;" >       [SelectStatement [] $ selectFromWhere >         (selIL ["a"])->         (Tref [] "tbl")+>         (Tref [] "tbl" NoAlias) >         (FunCall [] "!and" >          [FunCall [] "="  [Identifier [] "b", IntegerLit [] 2] >          ,FunCall [] "=" [Identifier [] "c", IntegerLit [] 3]])] ->      ,p "select a from tbl\n\+>      ]]++>    ,Group "more select statements" [Statements [+>       p "select a from tbl\n\ >         \except\n\ >         \select a from tbl1;" >       [SelectStatement [] $ CombineSelect [] Except->        (selectFrom (selIL ["a"]) (Tref [] "tbl"))->        (selectFrom (selIL ["a"]) (Tref [] "tbl1"))]+>        (selectFrom (selIL ["a"]) (Tref [] "tbl" NoAlias))+>        (selectFrom (selIL ["a"]) (Tref [] "tbl1" NoAlias))] >      ,p "select a from tbl where true\n\ >         \except\n\ >         \select a from tbl1 where true;" >       [SelectStatement [] $ CombineSelect [] Except->        (selectFromWhere (selIL ["a"]) (Tref [] "tbl") (BooleanLit [] True))->        (selectFromWhere (selIL ["a"]) (Tref [] "tbl1") (BooleanLit [] True))]+>        (selectFromWhere (selIL ["a"]) (Tref [] "tbl" NoAlias) (BooleanLit [] True))+>        (selectFromWhere (selIL ["a"]) (Tref [] "tbl1" NoAlias) (BooleanLit [] True))] >      ,p "select a from tbl\n\ >         \union\n\ >         \select a from tbl1;" >       [SelectStatement [] $ CombineSelect [] Union->        (selectFrom (selIL ["a"]) (Tref [] "tbl"))->        (selectFrom (selIL ["a"]) (Tref [] "tbl1"))]+>        (selectFrom (selIL ["a"]) (Tref [] "tbl" NoAlias))+>        (selectFrom (selIL ["a"]) (Tref [] "tbl1" NoAlias))] >      ,p "select a from tbl\n\ >         \union all\n\ >         \select a from tbl1;" >       [SelectStatement [] $ CombineSelect [] UnionAll->        (selectFrom (selIL ["a"]) (Tref [] "tbl"))->        (selectFrom (selIL ["a"]) (Tref [] "tbl1"))]+>        (selectFrom (selIL ["a"]) (Tref [] "tbl" NoAlias))+>        (selectFrom (selIL ["a"]) (Tref [] "tbl1" NoAlias))] +>      ,p "(select 1 union select 2) union select 3;"+>       [SelectStatement []+>        (CombineSelect [] Union+>         (CombineSelect [] Union+>          (selectE (SelectList [] [SelExp [] (IntegerLit [] 1)] []))+>          (selectE (SelectList [] [SelExp [] (IntegerLit [] 2)] [])))+>         (selectE (SelectList [] [SelExp [] (IntegerLit [] 3)] [])))]++>      ,p "select 1 union (select 2 union select 3);"+>       [SelectStatement []+>        (CombineSelect [] Union+>         (selectE (SelectList [] [SelExp [] (IntegerLit [] 1)] []))+>         (CombineSelect [] Union+>          (selectE (SelectList [] [SelExp [] (IntegerLit [] 2)] []))+>          (selectE (SelectList [] [SelExp [] (IntegerLit [] 3)] []))))]+ >      ,p "select a as b from tbl;"->       [SelectStatement [] $ selectFrom [SelectItem [] (Identifier [] "a") "b"] (Tref [] "tbl")]+>       [SelectStatement [] $ selectFrom [SelectItem [] (Identifier [] "a") "b"] (Tref [] "tbl" NoAlias)] >      ,p "select a + b as b from tbl;" >       [SelectStatement [] $ selectFrom >        [SelectItem [] >         (FunCall [] "+" >          [Identifier [] "a", Identifier [] "b"]) "b"]->        (Tref [] "tbl")]+>        (Tref [] "tbl" NoAlias)] >      ,p "select a.* from tbl a;"->       [SelectStatement [] $ selectFrom (selIL ["a.*"]) (TrefAlias [] "tbl" "a")]+>       [SelectStatement [] $ selectFrom (selIL ["a.*"]) (Tref [] "tbl" (TableAlias "a"))] ->      ,p "select a from b inner join c on b.a=c.a;"->       [SelectStatement [] $ selectFrom->        (selIL ["a"])->        (JoinedTref [] (Tref [] "b") Unnatural Inner (Tref [] "c")->           (Just (JoinOn []->            (FunCall [] "=" [Identifier [] "b.a", Identifier [] "c.a"]))))]+>      ,p "select a.* from tbl a(b,c);"+>       [SelectStatement [] $ selectFrom (selIL ["a.*"]) (Tref [] "tbl" (FullAlias "a" ["b","c"]))]+ >      ,p "select * from t1 a, t2 b;" >             [SelectStatement [] >              (Select [] Dupes >               (SelectList [] >                [SelExp [] (Identifier [] "*")] [])->               [TrefAlias [] "t1" "a",TrefAlias [] "t2" "b"]+>               [Tref [] "t1" (TableAlias "a"),Tref [] "t2" (TableAlias "b")] >               Nothing [] Nothing [] Nothing Nothing)]+>      ,p "select a from b inner join c on b.a=c.a;"+>       [SelectStatement [] $ selectFrom+>        (selIL ["a"])+>        (JoinedTref [] (Tref [] "b" NoAlias) Unnatural Inner (Tref [] "c" NoAlias)+>           (Just (JoinOn []+>            (FunCall [] "=" [Identifier [] "b.a", Identifier [] "c.a"]))) NoAlias)] >      ,p "select a from b inner join c as d on b.a=d.a;" >       [SelectStatement [] $ selectFrom >        (selIL ["a"])->        (JoinedTref [] (Tref [] "b") Unnatural Inner (TrefAlias [] "c" "d")+>        (JoinedTref [] (Tref [] "b" NoAlias) Unnatural Inner (Tref [] "c" (TableAlias "d")) >           (Just (JoinOn []->            (FunCall [] "=" [Identifier [] "b.a", Identifier [] "d.a"]))))]+>            (FunCall [] "=" [Identifier [] "b.a", Identifier [] "d.a"]))) NoAlias)]  >      ,p "select a from b inner join c using(d,e);" >       [SelectStatement [] $ selectFrom >        (selIL ["a"])->        (JoinedTref [] (Tref [] "b") Unnatural Inner (Tref [] "c")->           (Just (JoinUsing [] ["d","e"])))]+>        (JoinedTref [] (Tref [] "b" NoAlias) Unnatural Inner (Tref [] "c" NoAlias)+>           (Just (JoinUsing [] ["d","e"])) NoAlias)]  >      ,p "select a from b natural inner join c;" >       [SelectStatement [] $ selectFrom >        (selIL ["a"])->        (JoinedTref [] (Tref [] "b") Natural Inner (Tref [] "c") Nothing)]+>        (JoinedTref [] (Tref [] "b" NoAlias) Natural Inner (Tref [] "c" NoAlias) Nothing NoAlias)] >      ,p "select a from b left outer join c;" >       [SelectStatement [] $ selectFrom >        (selIL ["a"])->        (JoinedTref [] (Tref [] "b") Unnatural LeftOuter (Tref [] "c") Nothing)]+>        (JoinedTref [] (Tref [] "b" NoAlias) Unnatural LeftOuter (Tref [] "c" NoAlias) Nothing NoAlias)] >      ,p "select a from b full outer join c;" >       [SelectStatement [] $ selectFrom >        (selIL ["a"])->        (JoinedTref [] (Tref [] "b") Unnatural FullOuter (Tref [] "c") Nothing)]+>        (JoinedTref [] (Tref [] "b" NoAlias) Unnatural FullOuter (Tref [] "c" NoAlias) Nothing NoAlias)] >      ,p "select a from b right outer join c;" >       [SelectStatement [] $ selectFrom >        (selIL ["a"])->        (JoinedTref [] (Tref [] "b") Unnatural RightOuter (Tref [] "c") Nothing)]+>        (JoinedTref [] (Tref [] "b" NoAlias) Unnatural RightOuter (Tref [] "c" NoAlias) Nothing NoAlias)] >      ,p "select a from b cross join c;" >       [SelectStatement [] $ selectFrom >        (selIL ["a"])->        (JoinedTref [] (Tref [] "b") Unnatural Cross (Tref [] "c") Nothing)]+>        (JoinedTref [] (Tref [] "b" NoAlias) Unnatural Cross (Tref [] "c" NoAlias) Nothing NoAlias)] +>      ,p "select a from (b natural join c);"+>       [SelectStatement [] $ selectFrom+>        (selIL ["a"])+>        (JoinedTref [] (Tref [] "b" NoAlias) Natural Inner (Tref [] "c" NoAlias) Nothing NoAlias)]++>      ,p "select x from ((a cross join b) cross join c);"+>        [SelectStatement []+>         (selectFrom (selIL ["x"])+>          (JoinedTref []+>          (JoinedTref []+>           (Tref [] "a" NoAlias)+>            Unnatural Cross+>           (Tref [] "b" NoAlias)+>           Nothing NoAlias)+>          Unnatural Cross+>          (Tref [] "c" NoAlias)+>          Nothing NoAlias))]++>      ,p "select x from (a cross join (b cross join c));"+>        [SelectStatement []+>         (selectFrom (selIL ["x"])+>          (JoinedTref []+>           (Tref [] "a" NoAlias)+>           Unnatural Cross+>           (JoinedTref []+>            (Tref [] "b" NoAlias)+>            Unnatural Cross+>            (Tref [] "c" NoAlias)+>            Nothing NoAlias)+>           Nothing NoAlias))]++>      ,p "select x from ((a cross join b) cross join c);"+>        [SelectStatement []+>         (selectFrom (selIL ["x"])+>          (JoinedTref []+>          (JoinedTref []+>           (Tref [] "a" NoAlias)+>            Unnatural Cross+>           (Tref [] "b" NoAlias)+>           Nothing NoAlias)+>          Unnatural Cross+>          (Tref [] "c" NoAlias)+>          Nothing NoAlias))]++>      ,p "select x from (a cross join b) cross join c;"+>        [SelectStatement []+>         (selectFrom (selIL ["x"])+>          (JoinedTref []+>          (JoinedTref []+>           (Tref [] "a" NoAlias)+>            Unnatural Cross+>           (Tref [] "b" NoAlias)+>           Nothing NoAlias)+>          Unnatural Cross+>          (Tref [] "c" NoAlias)+>          Nothing NoAlias))]++>      ,p "select x from ((a cross join b) cross join c) cross join d;"+>        [SelectStatement []+>         (selectFrom (selIL ["x"])+>          (JoinedTref []+>           (JoinedTref []+>            (JoinedTref []+>             (Tref [] "a" NoAlias)+>             Unnatural Cross+>             (Tref [] "b" NoAlias)+>             Nothing NoAlias)+>            Unnatural Cross+>            (Tref [] "c" NoAlias)+>            Nothing NoAlias)+>           Unnatural Cross+>           (Tref [] "d" NoAlias)+>           Nothing NoAlias))]++ >      ,p "select a from b\n\ >         \    inner join c\n\ >         \      on true\n\@@ -330,95 +443,95 @@ >       [SelectStatement [] $ selectFrom >        [SelExp [] (Identifier [] "a")] >        (JoinedTref []->         (JoinedTref [] (Tref [] "b") Unnatural Inner (Tref [] "c")->          (Just $ JoinOn [] (BooleanLit [] True)))->         Unnatural Inner (Tref [] "d")+>         (JoinedTref [] (Tref [] "b" NoAlias) Unnatural Inner (Tref [] "c" NoAlias)+>          (Just $ JoinOn [] (BooleanLit [] True)) NoAlias)+>         Unnatural Inner (Tref [] "d" NoAlias) >         (Just  $ JoinOn [] (FunCall [] "="->                [IntegerLit [] 1, IntegerLit [] 1])))]+>                [IntegerLit [] 1, IntegerLit [] 1])) NoAlias)]  >      ,p "select row_number() over(order by a) as place from tbl;" >       [SelectStatement [] $ selectFrom [SelectItem [] >                    (WindowFn [] >                     (FunCall [] "row_number" []) >                     []->                     [Identifier [] "a"] Asc)+>                     [Identifier [] "a"] Asc FrameUnboundedPreceding) >                    "place"]->        (Tref [] "tbl")]+>        (Tref [] "tbl" NoAlias)] >      ,p "select row_number() over(order by a asc) as place from tbl;" >       [SelectStatement [] $ selectFrom [SelectItem [] >                    (WindowFn [] >                     (FunCall [] "row_number" []) >                     []->                     [Identifier [] "a"] Asc)+>                     [Identifier [] "a"] Asc FrameUnboundedPreceding) >                    "place"]->        (Tref [] "tbl")]+>        (Tref [] "tbl" NoAlias)] >      ,p "select row_number() over(order by a desc) as place from tbl;" >       [SelectStatement [] $ selectFrom [SelectItem [] >                    (WindowFn [] >                     (FunCall [] "row_number" []) >                     []->                     [Identifier [] "a"] Desc)+>                     [Identifier [] "a"] Desc FrameUnboundedPreceding) >                    "place"]->        (Tref [] "tbl")]+>        (Tref [] "tbl" NoAlias)] >      ,p "select row_number()\n\ >         \over(partition by (a,b) order by c) as place\n\ >         \from tbl;" >       [SelectStatement [] $ selectFrom [SelectItem [] >                    (WindowFn [] >                     (FunCall [] "row_number" [])->                     [FunCall [] "!rowCtor" [Identifier [] "a",Identifier [] "b"]]->                     [Identifier [] "c"] Asc)+>                     [FunCall [] "!rowctor" [Identifier [] "a",Identifier [] "b"]]+>                     [Identifier [] "c"] Asc FrameUnboundedPreceding) >                    "place"]->        (Tref [] "tbl")]+>        (Tref [] "tbl" NoAlias)]  >      ,p "select * from a natural inner join (select * from b) as a;" >       [SelectStatement [] $ selectFrom >        (selIL ["*"])->        (JoinedTref [] (Tref [] "a") Natural+>        (JoinedTref [] (Tref [] "a" NoAlias) Natural >         Inner (SubTref [] (selectFrom >                         (selIL ["*"])->                         (Tref [] "b")) "a")->         Nothing)]+>                         (Tref [] "b" NoAlias)) (TableAlias "a"))+>         Nothing NoAlias)]  >      ,p "select * from a order by c;" >       [SelectStatement [] $ Select []  Dupes >        (sl (selIL ["*"]))->        [Tref [] "a"]->        Nothing [] Nothing [(Identifier [] "c", Asc)] Nothing Nothing]+>        [Tref [] "a" NoAlias]+>        Nothing [] Nothing [(Identifier [] "c",Asc)] Nothing Nothing]  >      ,p "select *\n\ >            \from Adventure\n\ >            \order by Clicks desc, AdventureID;" >       [SelectStatement [] $ Select [] Dupes >        (sl (selIL ["*"]))->        [Tref [] "Adventure"]+>        [Tref [] "Adventure" NoAlias] >        Nothing [] Nothing [(Identifier [] "Clicks",Desc) >                           ,(Identifier [] "AdventureID",Asc)] Nothing Nothing]  >      ,p "select * from a order by c,d asc;" >       [SelectStatement [] $ Select [] Dupes >        (sl (selIL ["*"]))->        [Tref [] "a"]->        Nothing [] Nothing [(Identifier [] "c",Asc)->                           ,(Identifier [] "d",Asc)] Nothing Nothing]+>        [Tref [] "a" NoAlias]+>        Nothing [] Nothing [(Identifier [] "c", Asc)+>                           ,(Identifier [] "d", Asc)] Nothing Nothing]  >      ,p "select * from a order by c,d desc;" >       [SelectStatement [] $ Select [] Dupes >        (sl (selIL ["*"]))->        [Tref [] "a"]+>        [Tref [] "a" NoAlias] >        Nothing [] Nothing [(Identifier [] "c", Asc) >                           ,(Identifier [] "d", Desc)] Nothing Nothing]  >      ,p "select * from a order by c limit 1;" >       [SelectStatement [] $ Select [] Dupes >        (sl (selIL ["*"]))->        [Tref [] "a"]+>        [Tref [] "a" NoAlias] >        Nothing [] Nothing [(Identifier [] "c",Asc)] (Just (IntegerLit [] 1)) Nothing]  >      ,p "select * from a order by c offset 3;" >       [SelectStatement [] $ Select [] Dupes >        (sl (selIL ["*"]))->        [Tref [] "a"]+>        [Tref [] "a" NoAlias] >        Nothing [] Nothing [(Identifier [] "c",Asc)] Nothing (Just $ IntegerLit [] 3)]  >      ,p "select a from (select b from c) as d;"@@ -426,26 +539,26 @@ >          (selIL ["a"]) >          (SubTref [] (selectFrom >                    (selIL ["b"])->                    (Tref [] "c"))->           "d")]+>                    (Tref [] "c" NoAlias))+>           (TableAlias "d"))]  >      ,p "select * from gen();"->         [SelectStatement [] $ selectFrom (selIL ["*"]) (TrefFun [] $ FunCall [] "gen" [])]+>         [SelectStatement [] $ selectFrom (selIL ["*"]) (TrefFun [] (FunCall [] "gen" []) NoAlias)] >      ,p "select * from gen() as t;" >       [SelectStatement [] $ selectFrom >        (selIL ["*"])->        (TrefFunAlias [] (FunCall [] "gen" []) "t")]+>        (TrefFun [] (FunCall [] "gen" [])(TableAlias  "t"))]  >      ,p "select a, count(b) from c group by a;" >         [SelectStatement [] $ Select [] Dupes >          (sl [selI "a", SelExp [] (FunCall [] "count" [Identifier [] "b"])])->          [Tref [] "c"] Nothing [Identifier [] "a"]+>          [Tref [] "c" NoAlias] Nothing [Identifier [] "a"] >          Nothing [] Nothing Nothing]  >      ,p "select a, count(b) as cnt from c group by a having cnt > 4;" >         [SelectStatement [] $ Select [] Dupes >          (sl [selI "a", SelectItem [] (FunCall [] "count" [Identifier [] "b"]) "cnt"])->          [Tref [] "c"] Nothing [Identifier [] "a"]+>          [Tref [] "c" NoAlias] Nothing [Identifier [] "a"] >          (Just $ FunCall [] ">" [Identifier [] "cnt", IntegerLit [] 4]) >          [] Nothing Nothing] @@ -455,33 +568,19 @@ >          (SubTref [] (selectE $ SelectList [] >                                [SelectItem [] (IntegerLit [] 1) "a" >                                ,SelectItem [] (IntegerLit [] 2) "b"] [])->                   "x")]->      ])--================================================================================--one sanity check for parsing multiple statements+>                   (TableAlias "x"))]+>      ]] ->     ,testGroup "multiple statements"->     (mapSql [+>    ,Group "multiple statements" [Statements [ >       p "select 1;\nselect 2;" [SelectStatement [] $ selectE $ sl [SelExp [] (IntegerLit [] 1)] >                                ,SelectStatement [] $ selectE $ sl [SelExp [] (IntegerLit [] 2)]]->      ])--================================================================================--test comment behaviour+>      ]] ->     ,testGroup "comments"->     (mapSql [+>    ,Group "comments" [Statements [ >       p "" [] >      ,p "-- this is a test" [] >      ,p "/* this is\n\ >         \a test*/" []--maybe some people actually put block comments inside parts of-statements when they program?- >      ,p "select 1;\n\ >         \-- this is a test\n\ >         \select -- this is a test\n\@@ -495,21 +594,19 @@ >                     [SelectStatement [] $ selectE $ sl [SelExp [] (IntegerLit [] 1)] >                     ,SelectStatement [] $ selectE $ sl [SelExp [] (IntegerLit [] 2)] >                     ]->      ])+>      ]]+>      ]  ================================================================================  dml statements ->     ,testGroup "dml"->     (mapSql [--simple insert-+>    ,Group "dml" [+>      Group "insert" [Statements [ >       p "insert into testtable\n\ >         \(columna,columnb)\n\ >         \values (1,2);\n"->       [Insert []+>        [Insert [] >         "testtable" >         ["columna", "columnb"] >         (Values [] [[IntegerLit [] 1, IntegerLit [] 2]])@@ -537,7 +634,7 @@ >      ,p "insert into a\n\ >          \    select b from c;" >       [Insert [] "a" []->        (selectFrom [selI "b"] (Tref [] "c"))+>        (selectFrom [selI "b"] (Tref [] "c" NoAlias)) >        Nothing]  >      ,p "insert into testtable\n\@@ -548,10 +645,10 @@ >         ["columna", "columnb"] >         (Values [] [[IntegerLit [] 1, IntegerLit [] 2]]) >         (Just $ sl [selI "id"])]--updates+>      ]] ->      ,p "update tb\n\+>     ,Group "update" [Statements [+>       p "update tb\n\ >         \  set x = 1, y = 2;" >       [Update [] "tb" [SetClause [] "x" (IntegerLit [] 1) >                    ,SetClause [] "y" (IntegerLit [] 2)]@@ -580,10 +677,10 @@ >                     ["x","y"] >                     [IntegerLit [] 1,IntegerLit [] 2]] >        Nothing Nothing]--delete+>      ]] ->      ,p "delete from tbl1 where x = true;"+>     ,Group "delete" [Statements [+>       p "delete from tbl1 where x = true;" >       [Delete [] "tbl1" (Just $ FunCall [] "=" >                                [Identifier [] "x", BooleanLit [] True]) >        Nothing]@@ -591,16 +688,20 @@ >       [Delete [] "tbl1" (Just $ FunCall [] "=" >                                [Identifier [] "x", BooleanLit [] True]) >        (Just $ sl [selI "id"])]+>      ]] ->     ,p "truncate test;"+>     ,Group "truncate" [Statements [+>       p "truncate test;" >        [Truncate [] ["test"] ContinueIdentity Restrict] ->     ,p "truncate table test, test2 restart identity cascade;"+>      ,p "truncate table test, test2 restart identity cascade;" >        [Truncate [] ["test","test2"] RestartIdentity Cascade]+>      ]]  copy, bit crap at the moment ->      ,p "copy tbl(a,b) from stdin;\n\+>     ,Group "copy" [Statements [+>       p "copy tbl(a,b) from stdin;\n\ >         \bat\tt\n\ >         \bear\tf\n\ >         \\\.\n"@@ -608,17 +709,14 @@ >        ,CopyData [] "\ >         \bat\tt\n\ >         \bear\tf\n"]->      ])+>      ]]  ================================================================================ -some ddl-->     ,testGroup "create"->     (mapSql [--create table tests+ddl statements +>    ,Group "ddl" [+>      Group "simple tables" [Statements [ >       p "create table test (\n\ >         \  fielda text,\n\ >         \  fieldb int\n\@@ -638,15 +736,22 @@ >       [CreateTableAs [] "tbl" >        (selectE (SelectList [] [SelExp [] (IntegerLit [] 1)] []))] -other creates ->      ,p "create view v1 as\n\+>      ,p "alter table a alter column b set default 1;"+>       [AlterTable [] "a" [AlterColumnDefault [] "b" (IntegerLit [] 1)]]++>      ,p "alter table a add constraint unique(b);"+>       [AlterTable [] "a" [AddConstraint [] (UniqueConstraint [] "" ["b"])]]+>      ]]++>     ,Group "others" [Statements [+>       p "create view v1 as\n\ >         \select a,b from t;" >       [CreateView [] >        "v1"->        (selectFrom [selI "a", selI "b"] (Tref [] "t"))]+>        (selectFrom [selI "a", selI "b"] (Tref [] "t" NoAlias))] >      ,p "create domain td as text check (value in ('t1', 't2'));"->       [CreateDomain [] "td" (SimpleTypeName [] "text")+>       [CreateDomain [] "td" (SimpleTypeName [] "text") "" >        (Just (InPredicate [] (Identifier [] "value") True >               (InList [] [stringQ "t1" ,stringQ "t2"])))] >      ,p "create type tp1 as (\n\@@ -656,9 +761,21 @@ >       [CreateType [] "tp1" [TypeAttDef [] "f1" (SimpleTypeName [] "text") >                         ,TypeAttDef [] "f2" (SimpleTypeName [] "text")]] -drops+>      ,p "create sequence s start with 5 increment by 4 no maxvalue no minvalue cache 1;"+>         [CreateSequence [] "s" 4 1 ((2::Integer) ^ (63::Integer) - 1) 5 1] ->      ,p "drop domain t;"+>      ,p "alter sequence s owned by a.b;"+>         [AlterSequence [] "s" "a.b"]++>      ,p "create trigger tr\n\+>          \after insert or delete on tb\n\+>          \for each statement\n\+>          \execute procedure fb();"+>         [CreateTrigger [] "tr" TriggerAfter [TInsert,TDelete] "tb" EachStatement "fb" []]+>      ]]++>     ,Group "drops" [Statements [+>       p "drop domain t;" >       [DropSomething [] Domain Require ["t"] Restrict] >      ,p "drop domain if exists t,u cascade;" >       [DropSomething [] Domain IfExists ["t", "u"] Cascade]@@ -672,38 +789,33 @@ >      ,p "drop view t;" >       [DropSomething [] View Require ["t"] Restrict] ->      ])--constraints-->     ,testGroup "constraints"->     (mapSql [--nulls+>      ]] +>     ,Group "constraints" [+>       Group "nulls" [Statements [ >       p "create table t1 (\n\ >         \ a text null\n\ >         \);" >         [CreateTable [] "t1" [AttributeDef [] "a" (SimpleTypeName [] "text")->                            Nothing [NullConstraint []]]+>                            Nothing [NullConstraint [] ""]] >          []] >      ,p "create table t1 (\n\ >         \ a text not null\n\ >         \);" >         [CreateTable [] "t1" [AttributeDef [] "a" (SimpleTypeName [] "text")->                            Nothing [NotNullConstraint []]]+>                            Nothing [NotNullConstraint [] ""]] >          []]--unique table+>      ]] ->      ,p "create table t1 (\n\+>      ,Group "unique" [Statements [+>       p "create table t1 (\n\ >         \ x int,\n\ >         \ y int,\n\ >         \ unique (x,y)\n\ >         \);" >         [CreateTable [] "t1" [att "x" "int" >                           ,att "y" "int"]->          [UniqueConstraint [] ["x","y"]]]+>          [UniqueConstraint [] "" ["x","y"]]]  test arbitrary ordering @@ -714,7 +826,7 @@ >         \);" >         [CreateTable [] "t1" [att "x" "int" >                           ,att "y" "int"]->          [UniqueConstraint [] ["x"]]]+>          [UniqueConstraint [] "" ["x"]]]  unique row @@ -722,14 +834,14 @@ >         \ x int unique\n\ >         \);" >         [CreateTable [] "t1" [AttributeDef [] "x" (SimpleTypeName [] "int") Nothing->                            [RowUniqueConstraint []]][]]+>                            [RowUniqueConstraint [] ""]][]]  >      ,p "create table t1 (\n\ >         \ x int unique not null\n\ >         \);" >         [CreateTable [] "t1" [AttributeDef [] "x" (SimpleTypeName [] "int") Nothing->                            [RowUniqueConstraint []->                            ,NotNullConstraint []]][]]+>                            [RowUniqueConstraint [] ""+>                            ,NotNullConstraint [] ""]][]]  quick sanity check @@ -737,16 +849,16 @@ >         \ x int not null unique\n\ >         \);" >         [CreateTable [] "t1" [AttributeDef [] "x" (SimpleTypeName [] "int") Nothing->                            [NotNullConstraint []->                            ,RowUniqueConstraint []]][]]--primary key row, table+>                            [NotNullConstraint [] ""+>                            ,RowUniqueConstraint [] ""]][]]+>      ]] ->      ,p "create table t1 (\n\+>      ,Group "primary key" [Statements [+>       p "create table t1 (\n\ >         \ x int primary key\n\ >         \);" >         [CreateTable [] "t1" [AttributeDef [] "x" (SimpleTypeName [] "int") Nothing->                            [RowPrimaryKeyConstraint []]][]]+>                            [RowPrimaryKeyConstraint [] ""]][]]  >      ,p "create table t1 (\n\ >         \ x int,\n\@@ -755,16 +867,17 @@ >         \);" >         [CreateTable [] "t1" [att "x" "int" >                           ,att "y" "int"]->          [PrimaryKeyConstraint [] ["x", "y"]]]+>          [PrimaryKeyConstraint [] "" ["x", "y"]]] -check row, table+>      ]] ->      ,p "create table t (\n\+>      ,Group "check" [Statements [+>       p "create table t (\n\ >         \f text check (f in('a', 'b'))\n\ >         \);" >         [CreateTable [] "t" >          [AttributeDef [] "f" (SimpleTypeName [] "text") Nothing->           [RowCheckConstraint [] (InPredicate []+>           [RowCheckConstraint [] "" (InPredicate [] >                                   (Identifier [] "f") True >                                   (InList [] [stringQ "a", stringQ "b"]))]] []] @@ -775,36 +888,37 @@ >         \);" >         [CreateTable [] "t1" [att "x" "int" >                           ,att "y" "int"]->          [CheckConstraint [] (FunCall [] ">" [Identifier [] "x", Identifier [] "y"])]]--row, whole load of constraints, todo: add reference here+>          [CheckConstraint [] "" (FunCall [] ">" [Identifier [] "x", Identifier [] "y"])]]+>      ]] ->      ,p "create table t (\n\+>      ,Group "misc" [Statements [+>       p "create table t (\n\ >         \f text not null unique check (f in('a', 'b'))\n\ >         \);" >         [CreateTable [] "t" >          [AttributeDef [] "f" (SimpleTypeName [] "text") Nothing->           [NotNullConstraint []->            ,RowUniqueConstraint []->            ,RowCheckConstraint [] (InPredicate []+>           [NotNullConstraint [] ""+>            ,RowUniqueConstraint [] ""+>            ,RowCheckConstraint [] "" (InPredicate [] >                                    (Identifier [] "f") True >                                    (InList [] [stringQ "a" >                                            ,stringQ "b"]))]] []] -reference row, table+>      ]] ->      ,p "create table t1 (\n\+>      ,Group "references" [Statements [+>       p "create table t1 (\n\ >         \ x int references t2\n\ >         \);" >         [CreateTable [] "t1" [AttributeDef [] "x" (SimpleTypeName [] "int") Nothing->                            [RowReferenceConstraint [] "t2" Nothing+>                            [RowReferenceConstraint [] "" "t2" Nothing >                             Restrict Restrict]][]]  >      ,p "create table t1 (\n\ >         \ x int references t2(y)\n\ >         \);" >         [CreateTable [] "t1" [AttributeDef [] "x" (SimpleTypeName [] "int") Nothing->                            [RowReferenceConstraint [] "t2" (Just "y")+>                            [RowReferenceConstraint [] "" "t2" (Just "y") >                             Restrict Restrict]][]]  @@ -815,7 +929,7 @@ >         \);" >         [CreateTable [] "t1" [att "x" "int" >                           ,att "y" "int"]->          [ReferenceConstraint [] ["x", "y"] "t2" []+>          [ReferenceConstraint [] "" ["x", "y"] "t2" [] >           Restrict Restrict]]  >      ,p "create table t1 (\n\@@ -825,48 +939,44 @@ >         \);" >         [CreateTable [] "t1" [att "x" "int" >                           ,att "y" "int"]->          [ReferenceConstraint [] ["x", "y"] "t2" ["z", "w"]+>          [ReferenceConstraint [] "" ["x", "y"] "t2" ["z", "w"] >           Restrict Restrict]]  >      ,p "create table t1 (\n\ >         \ x int references t2 on delete cascade\n\ >         \);" >         [CreateTable [] "t1" [AttributeDef [] "x" (SimpleTypeName [] "int") Nothing->                            [RowReferenceConstraint [] "t2" Nothing+>                            [RowReferenceConstraint [] "" "t2" Nothing >                             Cascade Restrict]][]]  >      ,p "create table t1 (\n\ >         \ x int references t2 on update cascade\n\ >         \);" >         [CreateTable [] "t1" [AttributeDef [] "x" (SimpleTypeName [] "int") Nothing->                            [RowReferenceConstraint [] "t2" Nothing+>                            [RowReferenceConstraint [] "" "t2" Nothing >                             Restrict Cascade]][]]  >      ,p "create table t1 (\n\ >         \ x int,\n\ >         \ y int,\n\->         \ foreign key (x,y) references t2 on delete cascade on update cascade\n\+>         \ foreign key (x,y) references t2 on update cascade on delete cascade\n\ >         \);" >         [CreateTable [] "t1" [att "x" "int" >                           ,att "y" "int"]->          [ReferenceConstraint [] ["x", "y"] "t2" []+>          [ReferenceConstraint [] "" ["x", "y"] "t2" [] >           Cascade Cascade]] ->      ])--================================================================================--test functions-->     ,testGroup "functions"->     (mapSql [+>      ]]+>      ]]+>    ,Group "functions" [+>      Group "basics" [Statements [ >       p "create function t1(text) returns text as $$\n\ >         \select a from t1 where b = $1;\n\ >         \$$ language sql stable;"->       [CreateFunction [] Sql "t1" [ParamDefTp [] $ SimpleTypeName [] "text"]->        (SimpleTypeName [] "text") "$$"+>       [CreateFunction [] "t1" [ParamDefTp [] $ SimpleTypeName [] "text"]+>        (SimpleTypeName [] "text") Sql "$$" >        (SqlFnBody []->         [SelectStatement [] $ selectFromWhere [SelExp [] (Identifier [] "a")] (Tref [] "t1")+>         [SelectStatement [] $ selectFromWhere [SelExp [] (Identifier [] "a")] (Tref [] "t1" NoAlias) >          (FunCall [] "=" >           [Identifier [] "b", PositionalArg [] 1])]) >        Stable]@@ -878,7 +988,7 @@ >         \  null;\n\ >         \end;\n\ >         \$$ language plpgsql volatile;"->       [CreateFunction [] Plpgsql "fn" [] (SimpleTypeName [] "void") "$$"+>       [CreateFunction [] "fn" [] (SimpleTypeName [] "void") Plpgsql "$$" >        (PlpgsqlFnBody [] [VarDef [] "a" (SimpleTypeName [] "int") Nothing >                          ,VarDef [] "b" (SimpleTypeName [] "text") Nothing] >         [NullStatement []])@@ -891,7 +1001,7 @@ >         \  null;\n\ >         \end;\n\ >         \$$ language plpgsql volatile;"->       [CreateFunction [] Plpgsql "fn" [] (SimpleTypeName [] "void") "$$"+>       [CreateFunction [] "fn" [] (SimpleTypeName [] "void") Plpgsql "$$" >        (PlpgsqlFnBody [] [VarDef [] "a" (SimpleTypeName [] "int") Nothing >                          ,VarDef [] "b" (SimpleTypeName [] "text") Nothing] >         [NullStatement []])@@ -903,9 +1013,9 @@ >         \  null;\n\ >         \end;\n\ >         \$$ language plpgsql immutable;"->       [CreateFunction [] Plpgsql "fn"+>       [CreateFunction [] "fn" >        [ParamDef [] "a" $ ArrayTypeName [] $ SimpleTypeName [] "text"]->        (ArrayTypeName [] $ SimpleTypeName [] "int") "$$"+>        (ArrayTypeName [] $ SimpleTypeName [] "int") Plpgsql "$$" >        (PlpgsqlFnBody [] >         [VarDef [] "b" (ArrayTypeName [] $ SimpleTypeName [] "xtype") (Just $ stringQ "{}")] >         [NullStatement []])@@ -917,7 +1027,7 @@ >         \  null;\n\ >         \end;\n\ >         \' language plpgsql stable;"->       [CreateFunction [] Plpgsql "fn" [] (SimpleTypeName [] "void") "'"+>       [CreateFunction [] "fn" [] (SimpleTypeName [] "void") Plpgsql "'" >        (PlpgsqlFnBody [] [VarDef [] "a" (SimpleTypeName [] "int") (Just $ IntegerLit [] 3)] >         [NullStatement []]) >        Stable]@@ -926,8 +1036,8 @@ >         \  null;\n\ >         \end;\n\ >         \$$ language plpgsql stable;"->       [CreateFunction [] Plpgsql "fn" []->        (SetOfTypeName [] $ SimpleTypeName [] "int") "$$"+>       [CreateFunction [] "fn" []+>        (SetOfTypeName [] $ SimpleTypeName [] "int") Plpgsql "$$" >        (PlpgsqlFnBody [] [] [NullStatement []]) >        Stable] >      ,p "create function fn() returns void as $$\n\@@ -935,26 +1045,18 @@ >         \  null;\n\ >         \end\n\ >         \$$ language plpgsql stable;"->       [CreateFunction [] Plpgsql "fn" []->        (SimpleTypeName [] "void") "$$"+>       [CreateFunction [] "fn" []+>        (SimpleTypeName [] "void") Plpgsql "$$" >        (PlpgsqlFnBody [] [] [NullStatement []]) >        Stable] >      ,p "drop function test(text);"->       [DropFunction [] Require [("test",["text"])] Restrict]+>       [DropFunction [] Require [("test",[SimpleTypeName [] "text"])] Restrict] >      ,p "drop function if exists a(),test(text) cascade;" >       [DropFunction [] IfExists [("a",[])->                           ,("test",["text"])] Cascade]->      ])--================================================================================--test non sql plpgsql statements-->     ,testGroup "plpgsqlStatements"->     (mapPlpgsql [--simple statements+>                           ,("test",[SimpleTypeName [] "text"])] Cascade]+>     ]] +>     ,Group "simple plpgsql statements" [PlpgsqlStatements [ >       p "success := true;" >       [Assignment [] "success" (BooleanLit [] True)] >      ,p "success = true;"@@ -966,7 +1068,7 @@ >      ,p "return next 1;" >       [ReturnNext [] $ IntegerLit [] 1] >      ,p "return query select a from b;"->       [ReturnQuery [] $ selectFrom [selI "a"] (Tref [] "b")]+>       [ReturnQuery [] $ selectFrom [selI "a"] (Tref [] "b" NoAlias)] >      ,p "raise notice 'stuff %', 1;" >       [Raise [] RNotice "stuff %" [IntegerLit [] 1]] >      ,p "perform test();"@@ -979,10 +1081,10 @@ >                                 ,stringQ "_and_stuff"]]] >      ,p "select into a,b c,d from e;" >       [SelectStatement [] $ Select [] Dupes (SelectList [] [selI "c", selI "d"] ["a", "b"])->                   [Tref [] "e"] Nothing [] Nothing [] Nothing Nothing]+>                   [Tref [] "e" NoAlias] Nothing [] Nothing [] Nothing Nothing] >      ,p "select c,d into a,b from e;" >       [SelectStatement [] $ Select [] Dupes (SelectList [] [selI "c", selI "d"] ["a", "b"])->                   [Tref [] "e"] Nothing [] Nothing [] Nothing Nothing]+>                   [Tref [] "e" NoAlias] Nothing [] Nothing [] Nothing Nothing]  >      ,p "execute s;" >       [Execute [] (Identifier [] "s")]@@ -990,19 +1092,19 @@ >       [ExecuteInto [] (Identifier [] "s") ["r"]]  >      ,p "continue;" [ContinueStatement []]--complicated statements+>     ]] ->      ,p "for r in select a from tbl loop\n\+>     ,Group "other plpgsql statements" [PlpgsqlStatements [+>       p "for r in select a from tbl loop\n\ >         \null;\n\ >         \end loop;"->       [ForSelectStatement [] "r" (selectFrom  [selI "a"] (Tref [] "tbl"))+>       [ForSelectStatement [] "r" (selectFrom  [selI "a"] (Tref [] "tbl" NoAlias)) >        [NullStatement []]] >      ,p "for r in select a from tbl where true loop\n\ >         \null;\n\ >         \end loop;" >       [ForSelectStatement [] "r"->        (selectFromWhere [selI "a"] (Tref [] "tbl") (BooleanLit [] True))+>        (selectFromWhere [selI "a"] (Tref [] "tbl" NoAlias) (BooleanLit [] True)) >        [NullStatement []]] >      ,p "for r in 1 .. 10 loop\n\ >         \null;\n\@@ -1054,79 +1156,105 @@ >       [([Identifier [] "b"], [NullStatement []]) >       ,([Identifier [] "c", Identifier [] "d"], [NullStatement []])] >       [NullStatement []]]->      ])->        --,testProperty "random expression" prop_expression_ppp->        -- ,testProperty "random statements" prop_statements_ppp->     ]->         where->           mapExpr = map $ uncurry checkParseExpression->           mapSql = map $ uncurry checkParse->           mapPlpgsql = map $ uncurry checkParsePlpgsql->           p a b = (a,b)->           selIL = map selI->           selI = SelExp [] . Identifier []->           sl a = SelectList [] a []->           selectE selList = Select [] Dupes selList->                             [] Nothing [] Nothing [] Nothing Nothing->           selectFrom selList frm =->             Select [] Dupes (SelectList [] selList [])->                    [frm] Nothing [] Nothing [] Nothing Nothing->           selectFromWhere selList frm whr =->             Select [] Dupes (SelectList [] selList [])->                    [frm] (Just whr) [] Nothing [] Nothing Nothing->           stringQ = StringLit [] "'"->           att n t = AttributeDef [] n (SimpleTypeName [] t) Nothing [] +>     ]]++>    ,Group "misc" [Statements [+>       p "SET search_path TO my_schema, public;"+>         [Set [] "search_path" [SetId [] "my_schema"+>                               ,SetId [] "public"]]+>      ,p "SET t1 = 3;"+>         [Set [] "t1" [SetNum [] 3]]+>      ,p "SET t1 = 'stuff';"+>         [Set [] "t1" [SetStr [] "stuff"]]+>      ,p "create language plpgsql;"+>         [CreateLanguage [] "plpgsql"]++>     ]]++>     ]]]+ ================================================================================ -Unit test helpers+shortcuts for constructing test data and asts -parse and then pretty print and parse a statement+> p :: t -> t1 -> (t, t1)+> p a b = (a,b) -> checkParse :: String -> [Statement] -> Test.Framework.Test-> checkParse src ast = parseUtil1 src ast parseSql+> stringQ :: String -> Expression+> stringQ = StringLit [] "'" -parse and then pretty print and parse an expression+> selectFrom :: SelectItemList+>            -> TableRef+>            -> SelectExpression+> selectFrom selList frm = Select [] Dupes (SelectList [] selList [])+>                            [frm] Nothing [] Nothing [] Nothing Nothing -> checkParseExpression :: String -> Expression -> Test.Framework.Test-> checkParseExpression src ast = parseUtil src ast->                                  parseExpression printExpression+> selectE :: SelectList -> SelectExpression+> selectE selList = Select [] Dupes selList+>                     [] Nothing [] Nothing [] Nothing Nothing -> checkParsePlpgsql :: String -> [Statement] -> Test.Framework.Test-> checkParsePlpgsql src ast = parseUtil1 src ast parsePlpgsql+> selIL :: [String] -> [SelectItem]+> selIL = map selI - > parseUtil :: (Show t, Eq b, Show b, Data b, Annotated b) =>- >              String- >           -> b- >           -> (String -> Either t b)- >           -> (b -> String)- >           -> Test.Framework.Test+> selI :: String -> SelectItem+> selI = SelExp [] . Identifier [] -> parseUtil src ast parser printer = testCase ("parse " ++ src) $ do->   let ast' = case parser src of->               Left er -> error $ show er->               Right l -> l->   assertEqual ("parse " ++ src) ast $ stripAnnotations ast'->   -- pretty print then parse to check->   let pp = printer ast->   let ast'' = case parser pp of->               Left er -> error $ "reparse\n" ++ show er ++ "\n" -- ++ pp ++ "\n"->               Right l -> l->   assertEqual ("reparse " ++ pp) ast $ stripAnnotations ast''+> sl :: SelectItemList -> SelectList+> sl a = SelectList [] a [] -> parseUtil1 :: (Show a) => String->            -> [Statement]->            -> (String -> Either a StatementList)->            -> Test.Framework.Test-> parseUtil1 src ast parser = testCase ("parse " ++ src) $ do->   let ast' = case parser src of->               Left er -> error $ show er->               Right l -> l->   assertEqual ("parse " ++ src) ast $ map stripAnnotations ast'->   -- pretty print then parse to check->   let pp = printSql ast'->   let ast'' = case parser pp of->               Left er -> error $ "reparse\n" ++ show er ++ "\n" -- ++ pp ++ "\n"->               Right l -> l->   assertEqual ("reparse " ++ pp) ast $ map stripAnnotations ast''+> selectFromWhere :: SelectItemList+>                 -> TableRef+>                 -> Expression+>                 -> SelectExpression+> selectFromWhere selList frm whr =+>     Select [] Dupes (SelectList [] selList [])+>                [frm] (Just whr) [] Nothing [] Nothing Nothing +> att :: String -> String -> AttributeDef+> att n t = AttributeDef [] n (SimpleTypeName [] t) Nothing []+++================================================================================++Unit test helpers++> itemToTft :: Item -> [Test.Framework.Test]+> itemToTft (Expressions es) = map (uncurry testParseExpression) es+> itemToTft (PlpgsqlStatements es) = map (uncurry testParsePlpgsqlStatements) es+> itemToTft (Statements es) = map (uncurry testParseStatements) es+> itemToTft (Group s is) = [testGroup s $ concatMap itemToTft is]+++> testParseExpression :: String -> Expression -> Test.Framework.Test+> testParseExpression src ast = parseUtil src ast+>                                  (parseExpression "") printExpression++> testParseStatements :: String -> [Statement] -> Test.Framework.Test+> testParseStatements src ast = parseUtil src ast (parseSql "") printSql++> testParsePlpgsqlStatements :: String -> [Statement] -> Test.Framework.Test+> testParsePlpgsqlStatements src ast = parseUtil src ast (parsePlpgsql "") printSql++> parseUtil :: (Show t, Eq b, Show b, Data b) =>+>              String+>           -> b+>           -> (String -> Either t b)+>           -> (b -> String)+>           -> Test.Framework.Test+> parseUtil src ast parser printer = testCase ("parse " ++ src) $+>   case parser src of+>     Left er -> assertFailure $ show er+>     Right ast' -> do+>       assertEqual ("parse " ++ src) ast $ stripAnnotations ast'+>       case parser (printer ast) of+>         Left er -> assertFailure $ "reparse\n" ++ show er ++ "\n" -- ++ pp ++ "\n"+>         Right ast'' -> assertEqual ("reparse " ++ printer ast) ast $ stripAnnotations ast''++TODO+new idea for testing:+parsesql -> ast1+parse, pretty print, parse -> ast2+load into pg, pg_dump, parse -> ast3+parse, pretty print, load into pg, pg_dump, parse -> ast4+check all these asts are the same
+ Database/HsSqlPpp/Tests/RoundtripTests.lhs view
@@ -0,0 +1,53 @@+Copyright 2010 Jake Wheat++Test sql by typechecking it, then running it through Postgres and comparing.++Stage 1:+read sql files: produce catalog using type checker+load sql files into postgres using psql+read catalog from psql and compare with catalog from typechecker+stage 2:+as above, but load via databaseloader+stage 3:+load using database loader+dump using pg_dump+attempt to compare original ast to ast of dump+++> module Database.HsSqlPpp.Tests.RoundtripTests (roundtripTests) where++> import Test.HUnit+> import Test.Framework+> import Test.Framework.Providers.HUnit++> import Database.HsSqlPpp.Parsing.Parser+> import Database.HsSqlPpp.Ast.Environment+> import Database.HsSqlPpp.Ast.TypeChecker+> import Database.HsSqlPpp.Commands.CommandComponents++> data Item = Group String [Item]+>           | Src [(String,String)]++> roundtripTests :: [Test.Framework.Test]+> roundtripTests = itemToTft roundtripTestData++> roundtripTestData :: Item+> roundtripTestData =+>   Group "round trip tests" []++> itemToTft :: Item -> [Test.Framework.Test]+> itemToTft (Group s is) = [testGroup s $ concatMap itemToTft is]+> itemToTft (Src ss) = map (uncurry testRoundtrip) ss++> testRoundtrip :: String -> String -> Test.Framework.Test+> testRoundtrip name sql = testCase ("test " ++ name) $+>   checkStage1+>   where+>     checkStage1 = do+>       cat1 <- getCatalog sql+>       return ()++ > getCatalog :: String -> EitherEnvironment++> getCatalog sql = +>   parseSql1 "" sql >>= typeCheckC defaultTemplate1Environment >>= lfst
+ Database/HsSqlPpp/Tests/TypeCheckTests.lhs view
@@ -0,0 +1,1104 @@+Copyright 2009 Jake Wheat++Set of tests to check the type checking code. Includes some tests for+sql which doesn't type check.+++> module Database.HsSqlPpp.Tests.TypeCheckTests (typeCheckTests) where++> import Test.HUnit+> import Test.Framework+> import Test.Framework.Providers.HUnit+> import Data.Char+> import Data.List++> import Database.HsSqlPpp.Parsing.Parser+> import Database.HsSqlPpp.Ast.TypeChecker+> import Database.HsSqlPpp.Ast.Annotation+> import Database.HsSqlPpp.Ast.Environment+> import Database.HsSqlPpp.Ast.SqlTypes++> data Item = Expressions [(String, Either [TypeError] Type)]+>           | StatementTypes [(String, Either [TypeError] [Maybe StatementType])]+>           | EnvUpStatementTypes [(String+>                                  ,[EnvironmentUpdate]+>                                  ,Either [TypeError] [Maybe StatementType])]+>           | DdlStatements [(String, [[EnvironmentUpdate]])]+>           | DdlStatementsEnv [(String, [EnvironmentUpdate])]+>           | Group String [Item]++> typeCheckTests :: [Test.Framework.Test]+> typeCheckTests = itemToTft typeCheckTestData++> typeCheckTestData :: Item+> typeCheckTestData =+>   Group "astCheckTests" [++>    Group "basic literal types" [ Expressions [+>       p "1" $ Right typeInt+>      ,p "1.0" $ Right typeNumeric+>      ,p "'test'" $ Right UnknownType+>      ,p "true" $ Right typeBool+>      ,p "array[1,2,3]" $ Right (ArrayType typeInt)+>      ,p "array['a','b']" $ Right (ArrayType (ScalarType "text"))+>      ,p "array[1,'b']" $ Right (ArrayType typeInt)+>      ,p "array[1,true]" $ Left [NoMatchingOperator "!arrayctor" [ScalarType "int4",ScalarType "bool"]]+>      ]]++>   ,Group "some expressions" [ Expressions [+>       p "1=1" $ Right typeBool+>      ,p "1=true" $ Left [NoMatchingOperator "=" [typeInt,typeBool]]+>      ,p "substring('aqbc' from 2 for 2)" $ Right (ScalarType "text")++>      ,p "substring(3 from 2 for 2)" $ Left+>                                      [NoMatchingOperator "!substring"+>                                       [ScalarType "int4"+>                                       ,ScalarType "int4"+>                                       ,ScalarType "int4"]]+>      ,p "substring('aqbc' from 2 for true)" $ Left+>                     [NoMatchingOperator "!substring"+>                      [UnknownType+>                      ,ScalarType "int4"+>                      ,ScalarType "bool"]]++>      ,p "3 between 2 and 4" $ Right typeBool+>      ,p "3 between true and 4" $ Left+>                                [NoMatchingOperator ">="+>                                 [typeInt+>                                 ,typeBool]]++>      ,p "array[1,2,3][2]" $ Right typeInt+>      ,p "array['a','b'][1]" $ Right (ScalarType "text")++ >      ,p "array['a','b'][true]" (TypeError ("",0,0)+ >                                   (WrongType+ >                                    typeInt+ >                                    UnknownType))++>      ,p "not true" $ Right typeBool+>      ,p "not 1" $ Left+>                  [NoMatchingOperator "!not" [typeInt]]++>      ,p "@ 3" $ Right typeInt+>      ,p "@ true" $ Left+>                  [NoMatchingOperator "@" [ScalarType "bool"]]++>      ,p "-3" $ Right typeInt+>      ,p "-'a'" $ Left+>                  [NoMatchingOperator "-" [UnknownType]]++>      ,p "4-3" $ Right typeInt++>      ,p "1 is null" $ Right typeBool+>      ,p "1 is not null" $ Right typeBool++>      ,p "1+1" $ Right typeInt+>      ,p "1+1" $ Right typeInt+>      ,p "31*511" $ Right typeInt+>      ,p "5/2" $ Right typeInt+>      ,p "2^10" $ Right typeFloat8+>      ,p "17%5" $ Right typeInt++>      ,p "3 and 4" $ Left+>                   [NoMatchingOperator "!and" [typeInt,typeInt]]++>      ,p "True and False" $ Right typeBool+>      ,p "false or true" $ Right typeBool++>      ,p "lower('TEST')" $ Right (ScalarType "text")+>      ,p "lower(1)" $ Left [NoMatchingOperator "lower" [typeInt]]+>      ]]++>   ,Group "special functions" [ Expressions [+>       p "coalesce(null,1,2,null)" $ Right typeInt+>      ,p "coalesce('3',1,2,null)" $ Right typeInt+>      ,p "coalesce('3',1,true,null)"+>             $ Left [NoMatchingOperator "coalesce" [UnknownType+>                                                   ,ScalarType "int4"+>                                                   ,ScalarType "bool"+>                                                   ,UnknownType]]+>      ,p "nullif('hello','hello')" $ Right (ScalarType "text")+>      ,p "nullif(3,4)" $ Right typeInt+>      ,p "nullif(true,3)"+>             $ Left [NoMatchingOperator "nullif" [ScalarType "bool"+>                                           ,ScalarType "int4"]]+>      ,p "greatest(3,5,6,4,3)" $ Right typeInt+>      ,p "least(3,5,6,4,3)" $ Right typeInt+>      ,p "least(5,true)"+>             $ Left [NoMatchingOperator "least" [ScalarType "int4",ScalarType "bool"]]+++>      ]]++implicit casting and function/operator choice tests:+check when multiple implicit and one exact match on num args+check multiple matches with num args, only one with implicit conversions+check multiple implicit matches with one preferred+check multiple implicit matches with one preferred highest count+check casts from unknown string lits++>   ,Group "some expressions" [ Expressions [+>       p "3 + '4'" $ Right typeInt+>      ,p "3.0 + '4'" $ Right typeNumeric+>      ,p "'3' + '4'" $ Left [NoMatchingOperator "+" [UnknownType+>                                               ,UnknownType]]++>      ]]++>   ,Group "exists expressions" [ Expressions [+>       p "exists (select 1 from pg_type)" $ Right typeBool+>      ,p "exists (select testit from pg_type)"+>        $ Left [UnrecognisedIdentifier "testit"]+>      ]]++>   ,Group "row comparison expressions" [ Expressions [++rows different lengths+rows match types pairwise, same and different types+rows implicit cast from unknown+rows don't match types++>       p "row(1)" $ Right (AnonymousRecordType [typeInt])+>      ,p "row(1,2)" $ Right (AnonymousRecordType [typeInt,typeInt])+>      ,p "row('t1','t2')" $ Right (AnonymousRecordType [UnknownType,UnknownType])+>      ,p "row(true,1,'t3')" $ Right (AnonymousRecordType [typeBool, typeInt,UnknownType])+>      ,p "(true,1,'t3',75.3)" $ Right (AnonymousRecordType [typeBool,typeInt+>                                       ,UnknownType,typeNumeric])+>      ,p "row(1) = row(2)" $ Right typeBool+>      ,p "row(1,2) = row(2,1)" $ Right typeBool+>      ,p "(1,2) = (2,1)" $ Right typeBool+>      ,p "(1,2,3) = (2,1)" $ Left [NoMatchingOperator "="+>                                   [AnonymousRecordType [ScalarType "int4"+>                                                        ,ScalarType "int4"+>                                                        ,ScalarType "int4"]+>                                    ,AnonymousRecordType [ScalarType "int4"+>                                                         ,ScalarType "int4"]]]+>      ,p "('1',2) = (2,'1')" $ Right typeBool+>      ,p "(1,true) = (2,1)" $ Left [NoMatchingOperator "="+>                                    [AnonymousRecordType [ScalarType "int4"+>                                                         ,ScalarType "bool"]+>                                    ,AnonymousRecordType [ScalarType "int4"+>                                                         ,ScalarType "int4"]]]+>      ,p "(1,2) <> (2,1)" $ Right typeBool+>      ,p "(1,2) >= (2,1)" $ Right typeBool+>      ,p "(1,2) <= (2,1)" $ Right typeBool+>      ,p "(1,2) > (2,1)" $ Right typeBool+>      ,p "(1,2) < (2,1)" $ Right typeBool+>      ]]++>   ,Group "case expressions" [ Expressions [+>       p "case\n\+>         \ when true then 1\n\+>         \end" $ Right typeInt+>      ,p "case\n\+>         \ when 1=2 then 'stuff'\n\+>         \ when 2=3 then 'blah'\n\+>         \ else 'test'\n\+>         \end" $ Right (ScalarType "text")+>      ,p "case\n\+>         \ when 1=2 then 'stuff'\n\+>         \ when true=3 then 'blah'\n\+>         \ else 'test'\n\+>         \end" $ Left [NoMatchingOperator "=" [typeBool,typeInt]]+>      ,p "case\n\+>         \ when 1=2 then true\n\+>         \ when 2=3 then false\n\+>         \ else 1\n\+>         \end" $ Left [IncompatibleTypeSet [typeBool+>                                         ,typeBool+>                                         ,typeInt]]+>      ,p "case\n\+>         \ when 1=2 then false\n\+>         \ when 2=3 then 1\n\+>         \ else true\n\+>         \end" $ Left [IncompatibleTypeSet [typeBool+>                                           ,typeInt+>                                           ,typeBool]]++>      ,p "case 1 when 2 then 3 else 4 end" $ Right typeInt+>      ,p "case 1 when true then 3 else 4 end"+>             $ Left [IncompatibleTypeSet [ScalarType "int4"+>                                          ,ScalarType "bool"]]+>      ,p "case 1 when 2 then true else false end" $ Right typeBool+>      ,p "case 1 when 2 then 3 else false end"+>             $ Left [IncompatibleTypeSet [ScalarType "int4"+>                                          ,ScalarType "bool"]]+>      ]]++>   ,Group "polymorphic functions" [ Expressions [+>       p "array_append(ARRAY[1,2], 3)"+>         $ Right (ArrayType typeInt)+>      ,p "array_append(ARRAY['a','b'], 'c')"+>         $ Right (ArrayType $ ScalarType "text")+>      ,p "array_append(ARRAY['a'::int,'b'], 'c')"+>         $ Right (ArrayType typeInt)+>      ]]++>   ,Group "cast expressions" [ Expressions [+>       p "cast ('1' as integer)"+>         $ Right typeInt+>      ,p "cast ('1' as baz)"+>         $ Left [UnknownTypeName "baz"]+>      ,p "array[]" -- this isn't quite right but not sure how to do it atm+>                   -- no point fixing this case since need a load of other+>                   -- test cases where the behaviour is different+>         $ Right (Pseudo AnyArray) -- Left [TypelessEmptyArray]+>      ,p "array[] :: text[]"+>         $ Right (ArrayType (ScalarType "text"))+>      ]]++>   ,Group "simple selects" [ StatementTypes [+>       p "select 1;" $ Right [Just $ StatementType [] [("?column?", typeInt)]]+>      ,p "select 1 as a;" $+>         Right [Just $ StatementType [] [("a", typeInt)]]+>      ,p "select 1,2;" $+>         Right [Just $ StatementType [] [("?column?", typeInt)+>                                                 ,("?column?", typeInt)]]+>      ,p "select 1 as a, 2 as b;" $+>         Right [Just $ StatementType [] [("a", typeInt)+>                                                 ,("b", typeInt)]]+>      ,p "select 1+2 as a, 'a' || 'b';" $+>         Right [Just $ StatementType [] [("a", typeInt)+>                                        ,("?column?", ScalarType "text")]]+>      ,p "values (1,2);" $ Right [Just $ StatementType []+>                                           [("column1", typeInt)+>                                           ,("column2", typeInt)]]+>      ,p "values (1,2),('3', '4');" $ Right [Just $ StatementType []+>                                                      [("column1", typeInt)+>                                                      ,("column2", typeInt)]]+>      ,p "values (1,2),('a', true);" $ Left [IncompatibleTypeSet [typeInt+>                                                                 ,typeBool]]+>      ,p "values ('3', '4'),(1,2);" $ Right [Just $ StatementType []+>                                                      [("column1", typeInt)+>                                                      ,("column2", typeInt)]]+>      ,p "values ('a', true),(1,2);" $ Left [IncompatibleTypeSet [typeBool+>                                                                 ,typeInt]]+>      ,p "values ('a'::text, '2'::int2),('1','2');" $ Right [Just $ StatementType []+>                                      [("column1", ScalarType "text")+>                                      ,("column2", typeSmallInt)]]+>      ,p "values (1,2,3),(1,2);" $ Left [ValuesListsMustBeSameLength]++>      ]]++>   ,Group "simple combine selects" [ StatementTypes [+>      p "select 1,2  union select '3', '4';" $ Right [Just $ StatementType []+>                                      [("?column?", typeInt)+>                                      ,("?column?", typeInt)]]+>      ,p "select 1,2 intersect select 'a', true;" $ Left [IncompatibleTypeSet [typeInt+>                                                         ,typeBool]]+>      ,p "select '3', '4' except select 1,2;" $ Right [Just $ StatementType []+>                                      [("?column?", typeInt)+>                                      ,("?column?", typeInt)]]+>      ,p "select 'a', true union select 1,2;"+>                                      $ Left [IncompatibleTypeSet [typeBool+>                                                         ,typeInt]]+>      ,p "select 'a'::text, '2'::int2 intersect select '1','2';" $ Right [Just $ StatementType []+>                                      [("text", ScalarType "text")+>                                      ,("int2", typeSmallInt)]]+>      ,p "select 1,2,3 except select 1,2;" $ Left [ValuesListsMustBeSameLength]+>      ,p "select '3' as a, '4' as b except select 1,2;" $ Right [Just $ StatementType []+>                                      [("a", typeInt)+>                                      ,("b", typeInt)]]++>      ]]++>   ,Group "simple selects from" [ StatementTypes [+>       p "select a from (select 1 as a, 2 as b) x;"+>         $ Right [Just $ StatementType [] [("a", typeInt)]]+>      ,p "select b from (select 1 as a, 2 as b) x;"+>         $ Right [Just $ StatementType [] [("b", typeInt)]]+>      ,p "select c from (select 1 as a, 2 as b) x;"+>         $ Left [UnrecognisedIdentifier "c"]+>      ,p "select typlen from pg_type;"+>         $ Right [Just $ StatementType [] [("typlen", typeSmallInt)]]+>      ,p "select oid from pg_type;"+>         $ Right [Just $ StatementType [] [("oid", ScalarType "oid")]]+>      ,p "select p.oid from pg_type p;"+>         $ Right [Just $ StatementType [] [("oid", ScalarType "oid")]]+>      ,p "select typlen from nope;"+>         $ Left [UnrecognisedIdentifier "typlen",UnrecognisedRelation "nope"]+>      ,p "select generate_series from generate_series(1,7);"+>         $ Right [Just $ StatementType [] [("generate_series", typeInt)]]++check aliasing++>      ,p "select generate_series.generate_series from generate_series(1,7);"+>         $ Right [Just $ StatementType [] [("generate_series", typeInt)]]+>      ,p "select g from generate_series(1,7) g;"+>         $ Right [Just $ StatementType [] [("g", typeInt)]]+>      ,p "select g.g from generate_series(1,7) g;"+>         $ Right [Just $ StatementType [] [("g", typeInt)]]+>      ,p "select generate_series.g from generate_series(1,7) g;"+>         $ Left [UnrecognisedCorrelationName "generate_series"]+>      ,p "select g.generate_series from generate_series(1,7) g;"+>         $ Left [UnrecognisedIdentifier "g.generate_series"]+++>      ,p "select * from pg_attrdef;"+>         $ Right [Just $ StatementType []+>          [("adrelid",ScalarType "oid")+>          ,("adnum",ScalarType "int2")+>          ,("adbin",ScalarType "text")+>          ,("adsrc",ScalarType "text")]]+>      ,p "select abs from abs(3);"+>         $ Right [Just $ StatementType [] [("abs", typeInt)]]+>         --todo: these are both valid,+>         --the second one means select 3+generate_series from generate_series(1,7)+>         --  select generate_series(1,7);+>         -- select 3 + generate_series(1,7);++>      ]]++>   ,Group "simple selects from 2" [ EnvUpStatementTypes [+>       t "select a,b from testfunc();"+>         [EnvCreateComposite "testType" [("a", ScalarType "text")+>                                        ,("b", typeInt)+>                                        ,("c", typeInt)]+>         ,EnvCreateFunction FunName "testfunc" []+>          (SetOfType $ NamedCompositeType "testType") False]+>         $ Right [Just $ StatementType []+>                  [("a",ScalarType "text"),("b",ScalarType "int4")]]++>      ,t "select testfunc();"+>         [EnvCreateFunction FunName "testfunc" [] (Pseudo Void) False]+>         $ Right [Just $ StatementType [] []]++>      ]]++>   ,Group "simple join selects" [ StatementTypes [+>       p "select * from (select 1 as a, 2 as b) a\n\+>         \  cross join (select true as c, 4.5 as d) b;"+>         $ Right [Just $ StatementType [] [("a", typeInt)+>                                           ,("b", typeInt)+>                                           ,("c", typeBool)+>                                           ,("d", typeNumeric)]]+>      ,p "select * from (select 1 as a, 2 as b) a\n\+>         \  inner join (select true as c, 4.5 as d) b on true;"+>         $ Right [Just $ StatementType [] [("a", typeInt)+>                                           ,("b", typeInt)+>                                           ,("c", typeBool)+>                                           ,("d", typeNumeric)]]+>      ,p "select * from (select 1 as a, 2 as b) a\n\+>         \  inner join (select 1 as a, 4.5 as d) b using(a);"+>         $ Right [Just $ StatementType [] [("a", typeInt)+>                                           ,("b", typeInt)+>                                           ,("d", typeNumeric)]]+>      ,p "select * from (select 1 as a, 2 as b) a\n\+>         \ natural inner join (select 1 as a, 4.5 as d) b;"+>         $ Right [Just $ StatementType [] [("a", typeInt)+>                                           ,("b", typeInt)+>                                           ,("d", typeNumeric)]]+>         --check the attribute order+>      ,p "select * from (select 2 as b, 1 as a) a\n\+>         \ natural inner join (select 4.5 as d, 1 as a) b;"+>         $ Right [Just $ StatementType [] [("a", typeInt)+>                                           ,("b", typeInt)+>                                           ,("d", typeNumeric)]]+>      ,p "select * from (select 1 as a1, 2 as b) a\n\+>         \ natural inner join (select true as a1, 4.5 as d) b;"+>         $ Left [IncompatibleTypeSet [ScalarType "int4"+>                                      ,ScalarType "bool"]]+>      ,p "select * from (select 1 as a1, 2 as b) a\n\+>         \ natural inner join (select true as a1, 4.5 as d) b;"+>         $ Left [IncompatibleTypeSet [ScalarType "int4"+>                                      ,ScalarType "bool"]]++>      ,p "select * from (select 1 as a1) a, (select 2 as a2) b;"+>         $ Right [Just $ StatementType [] [("a1", typeInt)+>                                                                ,("a2", typeInt)]]++>      ,p "select * from (select 1 as a1) a, (select 2 as a1) b;"+>         $ Right [Just $ StatementType [] [("a1", typeInt)+>                                                                ,("a1", typeInt)]]++>      ,p "select a1 from (select 1 as a1) a,  (select 2 as a1) b;"+>         $ Left [AmbiguousIdentifier "a1"]+>      ]]++>   ,Group "simple scalar identifier qualification" [ StatementTypes [+>       p "select a.* from \n\+>         \(select 1 as a, 2 as b) a \n\+>         \cross join (select 3 as c, 4 as d) b;"+>         $ Right [Just $ StatementType [] [("a", typeInt)+>                                           ,("b", typeInt)]]+>      ,p "select nothere.* from \n\+>         \(select 1 as a, 2 as b) a \n\+>         \cross join (select 3 as c, 4 as d) b;"+>         $ Left [UnrecognisedCorrelationName "nothere"]+>      ,p "select a.b,b.c from \n\+>         \(select 1 as a, 2 as b) a \n\+>         \natural inner join (select 3 as a, 4 as c) b;"+>         $ Right [Just $ StatementType [] [("b", typeInt)+>                                           ,("c", typeInt)]]+>      ,p "select a.a,b.a from \n\+>         \(select 1 as a, 2 as b) a \n\+>         \natural inner join (select 3 as a, 4 as c) b;"+>         $ Right [Just $ StatementType [] [("a", typeInt)+>                                           ,("a", typeInt)]]++>      ,p "select pg_attrdef.adsrc from pg_attrdef;"+>         $ Right [Just $ StatementType [] [("adsrc", ScalarType "text")]]++>      ,p "select a.adsrc from pg_attrdef a;"+>         $ Right [Just $ StatementType [] [("adsrc", ScalarType "text")]]++>      ,p "select pg_attrdef.adsrc from pg_attrdef a;"+>         $ Left [UnrecognisedCorrelationName "pg_attrdef"]++>      ,p "select a from (select 2 as b, 1 as a) a\n\+>         \natural inner join (select 4.5 as d, 1 as a) b;"+>         $ Right [Just $ StatementType [] [("a", typeInt)]]++select g.fn from fn() g++>      ]]++>   ,Group "aggregates" [ StatementTypes [+>        p "select max(prorettype::int) from pg_proc;"+>         $ Right [Just $ StatementType [] [("max", typeInt)]]+>      ]]++>   ,Group "simple wheres" [ StatementTypes [+>       p "select 1 from pg_type where true;"+>         $ Right [Just $ StatementType [] [("?column?", typeInt)]]+>      ,p "select 1 from pg_type where 1;"+>         $ Left [ExpressionMustBeBool]+>      ,p "select typname from pg_type where typbyval;"+>         $ Right [Just $ StatementType [] [("typname", ScalarType "name")]]+>      ,p "select typname from pg_type where typtype = 'b';"+>         $ Right [Just $ StatementType [] [("typname", ScalarType "name")]]+>      ,p "select typname from pg_type where what = 'b';"+>         $ Left [UnrecognisedIdentifier "what"]+>      ]]++TODO: check identifier stacking working, then remove the pg_namespace+qualifier before oid and this should still work++>   ,Group "subqueries" [ StatementTypes [+>       p "select relname as relvar_name\n\+>         \    from pg_class\n\+>         \    where ((relnamespace =\n\+>         \           (select oid\n\+>         \              from pg_namespace\n\+>         \              where (nspname = 'public'))) and (relkind = 'r'));"+>         $ Right [Just $ StatementType [] [("relvar_name",ScalarType "name")]]+>      ,p "select relname from pg_class where relkind in ('r', 'v');"+>         $ Right [Just $ StatementType [] [("relname",ScalarType "name")]]+>      ,p "select * from generate_series(1,7) g\n\+>         \where g not in (select * from generate_series(3,5));"+>         $ Right [Just $ StatementType [] [("g",typeInt)]]+>      ,p "select 3 = any(array[1,2,3]);"+>         $ Right [Just $ StatementType [] [("?column?",typeBool)]]+>      ]]++identifiers in select parts++>{-    ,testGroup "select part identifiers"+>     (mapStatementTypes [+>       p "select relname,attname from pg_class\n\+>         \inner join pg_attribute\n\+>         \on pg_attribute.attrelid = pg_class.oid;"+>         $ Right [Just $ StatementType [] [("relvar_name",ScalarType "name")]]+>      ])-}++>   ,Group "insert" [ StatementTypes [+>       p "insert into nope (a,b) values (c,d);"+>         $ Left [UnrecognisedRelation "nope",UnrecognisedIdentifier "c",UnrecognisedIdentifier "d"]+>      ,p "insert into pg_attrdef (adrelid,adnum,adbin,adsrc)\n\+>         \values (1,2, 'a', 'b');"+>         $ Right [Just $ StatementType [] [] {-InsertInfo "pg_attrdef"+>                           [("adrelid",ScalarType "oid")+>                           ,("adnum",ScalarType "int2")+>                           ,("adbin",ScalarType "text")+>                           ,("adsrc",ScalarType "text")]-}]+>      ,p "insert into pg_attrdef\n\+>         \values (1,2, 'a', 'b');"+>         $ Right [Just $ StatementType [] [] {-InsertInfo "pg_attrdef"+>                           [("adrelid",ScalarType "oid")+>                           ,("adnum",ScalarType "int2")+>                           ,("adbin",ScalarType "text")+>                           ,("adsrc",ScalarType "text")]-}]+>      ,p "insert into pg_attrdef (hello,adnum,adbin,adsrc)\n\+>         \values (1,2, 'a', 'b');"+>         $ Left [UnrecognisedIdentifier "hello"]+>      ,p "insert into pg_attrdef (adrelid,adnum,adbin,adsrc)\n\+>         \values (1,true, 'a', 'b');"+>         $ Left [IncompatibleTypes (ScalarType "int2") (ScalarType "bool")]+>      ,p "insert into pg_attrdef (adrelid,adnum,adbin,adsrc)\n\+>         \values (1,true, 'a', 'b','c');"+>         $ Left [WrongNumberOfColumns]+>      ]]++>   ,Group "update" [ StatementTypes [+>       p "update nope set a = 1;"+>         $ Left [UnrecognisedRelation "nope"]+>      ,p "update pg_attrdef set adsrc = '' where 1;"+>         $ Left [ExpressionMustBeBool]+>      ,p "update pg_attrdef set (adbin,adsrc) = ('a','b','c');"+>         $ Left [WrongNumberOfColumns]+>      ,p "update pg_attrdef set (adrelid,adsrc) = (true,'b');"+>         $ Left [IncompatibleTypes (ScalarType "oid") typeBool]+>      ,p "update pg_attrdef set (shmadrelid,adsrc) = ('a','b');"+>         $ Left [UnrecognisedIdentifier "shmadrelid"]+>      ,p "update pg_attrdef set adsrc='';"+>         $ Right [Just $ StatementType [] [] {-UpdateInfo "pg_attrdef" [("adsrc",ScalarType "text")]-}]+>      ,p "update pg_attrdef set adsrc='' where 1=2;"+>         $ Right [Just $ StatementType [] [] {-UpdateInfo "pg_attrdef" [("adsrc",ScalarType "text")]-}]+>       -- TODO: actually, pg doesn't support this so need to generate error instead+>      ,p "update pg_attrdef set (adbin,adsrc) = ((select 'a','b'));"+>         $ Right [Just $ StatementType [] [] {-UpdateInfo "pg_attrdef" [("adbin",ScalarType "text"),("adsrc",ScalarType "text")]-}]+>      --check where ids+>      ,p "update pg_attrdef set adsrc='' where adsrc='';"+>         $ Right [Just $ StatementType [] [] {-UpdateInfo "pg_attrdef" [("adsrc",ScalarType "text")]-}]+>      ,p "update pg_attrdef set adnum = adnum + 1;"+>         $ Right [Just $ StatementType [] [] {-UpdateInfo "pg_attrdef" [("adnum",ScalarType "int2")]-}]+>      ]]++>   ,Group "delete" [ StatementTypes [+>       p "delete from nope;"+>         $ Left [UnrecognisedRelation "nope"]+>      ,p "delete from pg_attrdef where 1=2;"+>         $ Right [Just $ StatementType [] []]+>      ,p "delete from pg_attrdef where 1;"+>         $ Left [ExpressionMustBeBool]+>      ,p "delete from pg_attrdef where adsrc='';"+>         $ Right [Just $ StatementType [] []]+>      ]]++================================================================================++test the catalog updates from creates, etc.++>   ,Group "creates" [DdlStatements [+>       p "create table t1 (\n\+>         \   a int,\n\+>         \   b text\n\+>         \);"+>         [[EnvCreateTable "t1" [("a",ScalarType "int4")+>                               ,("b",ScalarType "text")]+>                               [("tableoid", ScalarType "oid")+>                               ,("cmax", ScalarType "cid")+>                               ,("xmax", ScalarType "xid")+>                               ,("cmin", ScalarType "cid")+>                               ,("xmin", ScalarType "xid")+>                               ,("ctid", ScalarType "tid")]]]+>      ,p "create type t1 as (\n\+>         \   a int,\n\+>         \   b text\n\+>         \);"+>         [[EnvCreateComposite "t1" [("a",ScalarType "int4")+>                                   ,("b",ScalarType "text")]]]++>      ,p "create domain t1 as text;"+>         [[EnvCreateDomain (DomainType "t1") (ScalarType "text")]]++>      ,p "create domain t1 as text check (value in ('a', 'b'));\n\+>         \select 'text'::t1;"+>         [[EnvCreateDomain (DomainType "t1") (ScalarType "text")]]+++>      ,p "create view v1 as select * from pg_attrdef;"+>         [[EnvCreateView "v1" [("adrelid",ScalarType "oid")+>                              ,("adnum",ScalarType "int2")+>                              ,("adbin",ScalarType "text")+>                              ,("adsrc",ScalarType "text")]]]++>      ,p "create function t1(text) returns text as $$\n\+>         \null;\n\+>         \$$ language sql stable;"+>         [[EnvCreateFunction FunName "t1" [ScalarType "text"]+>                             (ScalarType "text") False]]+>      ]]+++================================================================================++check the identifier resolution for functions:+parameters+variable declarations+select expressions inside these:+refer to param+refer to variable+override var with var+override var with select iden+todo: override var with param, override select iden with param++check var defs:+check type exists+check type of initial values++>   ,Group "create function identifier resolution" [ StatementTypes [+>       p "create function t1(stuff text) returns text as $$\n\+>         \begin\n\+>         \  return stuff || ' and stuff';\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         (Right [Nothing])+>      ,p "create function t1(stuff text) returns text as $$\n\+>         \begin\n\+>         \  return badstuff || ' and stuff';\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         (Left [UnrecognisedIdentifier "badstuff"])+>      ,p "create function t1() returns text as $$\n\+>         \declare\n\+>         \  stuff text;\n\+>         \begin\n\+>         \  return stuff || ' and stuff';\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         (Right [Nothing])+>      ]]++================================================================================++>   ,Group "plpgsqlbits" [ StatementTypes [+>       p "create function t1(stuff text) returns text as $$\n\+>         \begin\n\+>         \  return stuff || ' and stuff';\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         (Right [Nothing])+>      ,p "create function t1(stuff text) returns text as $$\n\+>         \begin\n\+>         \  return badstuff || ' and stuff';\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         (Left [UnrecognisedIdentifier "badstuff"])+>      ,p "create function t1() returns text as $$\n\+>         \declare\n\+>         \  stuff text;\n\+>         \begin\n\+>         \  return stuff || ' and stuff';\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         (Right [Nothing])+>      ]]++================================================================================++>   ,Group "plpgsqlbits" [ StatementTypes [+>       p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  a bool;\n\+>         \begin\n\+>         \  a := 3;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         (Left [IncompatibleTypes (ScalarType "bool") (ScalarType "int4")])+>      ,p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  a boolean;\n\+>         \begin\n\+>         \  a := true;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         (Right [Nothing])+>      ]]++================================================================================++>   ,Group "for loops" [ StatementTypes [+>       p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  r record;\n\+>         \  t int;\n\+>         \begin\n\+>         \  for r in select * from pg_attrdef loop\n\+>         \    t := r.adnum;\n\+>         \  end loop;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         (Right [Nothing])+++>      ,p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  r record;\n\+>         \  t int;\n\+>         \begin\n\+>         \  for r in select adnum from pg_attrdef loop\n\+>         \    t := r;\n\+>         \  end loop;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         (Right [Nothing])++loop var already declared++>      ,p "create function test() returns void as $$\n\+>         \declare\n\+>         \  i int;\n\+>         \  i1 int;\n\+>         \begin\n\+>         \  for i in 0 .. 10 loop\n\+>         \    i1 := i;\n\+>         \  end loop;\n\+>         \end;\n\+>         \$$ language plpgsql volatile;"+>        (Right [Nothing])++implicitly created loop var++>      ,p "create function test() returns void as $$\n\+>         \declare\n\+>         \  i1 int;\n\+>         \begin\n\+>         \  for i in 0 .. 10 loop\n\+>         \    i1 := i;\n\+>         \  end loop;\n\+>         \end;\n\+>         \$$ language plpgsql volatile;"+>        (Right [Nothing])++loop var already declared, wrong type++>      ,p "create function test() returns void as $$\n\+>         \declare\n\+>         \  i bool;\n\+>         \begin\n\+>         \  for i in 0 .. 10 loop\n\+>         \    null;\n\+>         \  end loop;\n\+>         \end;\n\+>         \$$ language plpgsql volatile;"+>        (Left [IncompatibleTypes (ScalarType "bool") (ScalarType "int4")])++loop var implicit check it's type++>      ,p "create function test() returns void as $$\n\+>         \declare\n\+>         \  t bool;\n\+>         \begin\n\+>         \  for i in 0 .. 10 loop\n\+>         \    t := i;\n\+>         \  end loop;\n\+>         \end;\n\+>         \       $$ language plpgsql volatile;"+>         (Left [IncompatibleTypes (ScalarType "bool") (ScalarType "int4")])+>      ]]++================================================================================++>   ,Group "check catalog chaining" [ StatementTypes [++create function then select+select then create function+then in two separate chained asts++>       p "create function t1() returns void as $$\n\+>         \begin\n\+>         \  null;\n\+>         \end;\n\+>         \$$ language plpgsql stable;\n\+>         \select t1();"+>         (Right [Nothing])+>      ,p "select t1();\n\+>         \create function t1() returns void as $$\n\+>         \begin\n\+>         \  null;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         (Left [NoMatchingOperator "t1" []])+>      ]]++>   {-,Group "check catalog chaining2" [ StatementTypes [+>       p ["create function t1() returns void as $$\n\+>          \begin\n\+>          \  null;\n\+>          \end;\n\+>          \$$ language plpgsql stable;"+>         ,"select t1();"]+>         (Right [Just (SelectInfo (Pseudo Void))])+>      ,p ["select t1();"+>         ,"create function t1() returns void as $$\n\+>          \begin\n\+>          \  null;\n\+>          \end;\n\+>          \$$ language plpgsql stable;"]+>         (Left [NoMatchingOperator "t1" []])+>      ]]-}++================================================================================++test some casts+assign composite to record+  then assign record to composite+assign row to composite+ : check wrong cols, wrong types+check read and write fields in composite->record+check read and write fields in composite+check domain <-> base assigns+check call function with compatible composite, compatible row ctor+assign comp to comp++todo for chaos sql+for loop var = scalar, select = setof composite with one scalar++select into+composite assignment and equality+autocast from rowctor to composite when calling function+assignment to composite fields+read fields of composite++array_contains -> match anyelement+createtable as env update+window functions+assign domain <-> base+sql function not working++================================================================================++check insert returning, update returning, delete returning, one check each+check select into: multiple vars, record (then access fields to check),+  composite var+check errors: select into wrong number of vars, wrong types, and into+  composite wrong number and wrong type++>   ,Group "select into" [ StatementTypes [+>       p "insert into pg_attrdef (adrelid,adnum,adbin,adsrc)\n\+>         \values (1,2, 'a', 'b') returning adnum,adbin;"+>         $ Right [Just $ StatementType [] [("adnum", ScalarType "int2")+>                                          ,("adbin", ScalarType "text")]]+>      ,p "update pg_attrdef set adnum = adnum + 1 returning adnum;"+>         $ Right [Just $ StatementType [] [("adnum", ScalarType "int2")]]+>      ,p "delete from pg_attrdef returning adnum,adbin;"+>         $ Right [Just $ StatementType [] [("adnum", ScalarType "int2")+>                                          ,("adbin", ScalarType "text")]]+>      ,p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  a int;\n\+>         \  b text;\n\+>         \begin\n\+>         \  select adnum,adbin into a,b from pg_attrdef;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         $ Right [Nothing]+>      ,p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  a int;\n\+>         \  b text;\n\+>         \begin\n\+>         \  select adnum,adbin into b,a from pg_attrdef;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         $ Left [IncompatibleTypes (ScalarType "text") (ScalarType "int2")+>                ,IncompatibleTypes (ScalarType "int4") (ScalarType "text")]+>      ,p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  a int;\n\+>         \  b text;\n\+>         \begin\n\+>         \  select adnum,adbin into a,c from pg_attrdef;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         $ Left [UnrecognisedIdentifier "c"]+>      ,p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  a int;\n\+>         \  b text;\n\+>         \begin\n\+>         \  select adnum,adbin into a from pg_attrdef;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         $ Left [WrongNumberOfColumns]+>      ,p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  r record;\n\+>         \  a int;\n\+>         \  b text;\n\+>         \begin\n\+>         \  select adnum,adbin into r from pg_attrdef;\n\+>         \  a := r.adnum;\n\+>         \  b := r.adbin;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         $ Right [Nothing]+>      ,p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  r record;\n\+>         \  a int;\n\+>         \  b text;\n\+>         \begin\n\+>         \  select adnum,adbin into r from pg_attrdef;\n\+>         \  a := r.adnum;\n\+>         \  b := r.adsrc;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         $ Left [UnrecognisedIdentifier "r.adsrc"]+>      ,p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  r pg_attrdef;\n\+>         \begin\n\+>         \  select * into r from pg_attrdef;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         $ Right [Nothing]+>      ,p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  r pg_class;\n\+>         \begin\n\+>         \  select adnum,adbin into r from pg_attrdef;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         $ Left [IncompatibleTypes (NamedCompositeType "pg_class") (AnonymousRecordType [ScalarType "int2",ScalarType "text"])]+>      ,p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  r record;\n\+>         \begin\n\+>         \  select adnum,adbin into r from pg_attrdef;\n\+>         \  select relname into r from pg_class;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         $ Right [Nothing]+>      ]]++>   ,Group "composite elements" [ StatementTypes [+>       p "create function t1() returns void as $$\n\+>         \declare\n\+>         \  r pg_attrdef;\n\+>         \  a int;\n\+>         \  b text;\n\+>         \begin\n\+>         \  b = r.adsrc;\n\+>         \  r.adnum := a;\n\+>         \  b = r.adsrc;\n\+>         \end;\n\+>         \$$ language plpgsql stable;"+>         $ Right [Nothing]+>      ]]++>   ,Group "positional args" [ StatementTypes [+>       p "create function distance(int, int, int, int) returns float(24) as $$\n\+>         \  select (point($1, $2) <-> point($3, $4))::float(24) as result;\n\+>         \$$ language sql immutable;"+>         $ Right [Nothing]+>      ,p "create function distance(int, int, int, int) returns float(24) as $$\n\+>         \  select (point($1, $2) <-> point($3, $5))::float(24) as result;\n\+>         \$$ language sql immutable;"+>         $ Left [UnrecognisedIdentifier "$5"]+>      ]]++>   ,Group "window fns" [ StatementTypes [+>       p "select *, row_number() over () from pg_attrdef;"+>         $ Right [Just $ StatementType []+>                   [("adrelid",ScalarType "oid")+>                   ,("adnum",ScalarType "int2")+>                   ,("adbin",ScalarType "text")+>                   ,("adsrc",ScalarType "text")+>                   ,("row_number",ScalarType "int8")]]+>      ]]++>   ,Group "drop stuff" [ DdlStatementsEnv [+>       p "create function test(a int) returns void as $$\n\+>         \begin\n\+>         \  null;\n\+>         \end\n\+>         \$$ language plpgsql;"+>         [EnvCreateFunction FunName "test" [typeInt] (Pseudo Void) False]+>      ,p "create function test(a int) returns void as $$\n\+>         \begin\n\+>         \  null;\n\+>         \end\n\+>         \$$ language plpgsql;\n\+>         \drop function test(int);"+>         []+>      ,p "drop function test(int);" -- this should fail but doesn't+>         []+>      ,p "drop function if exists test(int);"+>         []+>      ]]+>   ]++================================================================================++> p :: t -> t1 -> (t, t1)+> p a b = (a,b)++> t :: t -> u -> v -> (t,u,v)+> t a b c = (a,b,c)+++> testExpressionType :: String -> Either [TypeError] Type -> Test.Framework.Test+> testExpressionType src typ = testCase ("typecheck " ++ src) $+>   let ast = case parseExpression "" src of+>                                      Left e -> error $ show e+>                                      Right l -> l+>       aast = typeCheckExpression defaultTemplate1Environment ast+>       ty = getTopLevelTypes [aast]+>       er = concatMap snd $ getTypeErrors aast+>   in case (length er, length ty) of+>        (0,0) -> assertFailure "didn't get any types?"+>        (0,1) -> assertEqual ("typecheck " ++ src) typ $ Right $ head ty+>        (0,_) -> assertFailure "got too many types"+>        _ -> assertEqual ("typecheck " ++ src) typ $ Left er++> testStatementType :: String -> Either [TypeError] [Maybe StatementType] -> Test.Framework.Test+> testStatementType src sis = testCase ("typecheck " ++ src) $+>   let ast = case parseSql "" src of+>                               Left e -> error $ show e+>                               Right l -> l+>       aast = snd $ typeCheck defaultTemplate1Environment ast+>       is = getTopLevelInfos aast+>       er = concatMap snd $ getTypeErrors aast+>   in {-trace (show aast) $-} case (length er, length is) of+>        (0,0) -> assertFailure "didn't get any infos?"+>        (0,_) -> assertEqual ("typecheck " ++ src) sis $ Right is+>        _ -> assertEqual ("typecheck " ++ src) sis $ Left er+++> testEnvUpStatementType :: String+>                        -> [EnvironmentUpdate]+>                        -> Either [TypeError] [Maybe StatementType]+>                        -> Test.Framework.Test+> testEnvUpStatementType src eu sis = testCase ("typecheck " ++ src) $+>   let ast = case parseSql "" src of+>                               Left e -> error $ show e+>                               Right l -> l+>       aast = snd $ typeCheck makeEnv ast+>       is = getTopLevelInfos aast+>       er = concatMap snd $ getTypeErrors aast+>   in {-trace (show aast) $-} case (length er, length is) of+>        (0,0) -> assertFailure "didn't get any infos?"+>        (0,_) -> assertEqual ("typecheck " ++ src) sis $ Right is+>        _ -> assertEqual ("typecheck " ++ src) sis $ Left er+>   where+>     makeEnv = case updateEnvironment defaultTemplate1Environment eu of+>                         Left x -> error $ show x+>                         Right e -> e++> testEnvUp :: String -> [[EnvironmentUpdate]] -> Test.Framework.Test+> testEnvUp src eu = testCase ("typecheck " ++ src) $+>   let ast = case parseSql "" src of+>                               Left e -> error $ show e+>                               Right l -> l+>       aast = snd $ typeCheck defaultTemplate1Environment ast+>       er = concatMap snd $ getTypeErrors aast+>       eu' = getTopLevelEnvUpdates aast+>   in {-trace (show aast) $-} case (length er, length eu') of+>        (0,0) -> assertFailure "didn't get any infos or envupdates?"+>        (0,_) -> assertEqual ("eu " ++ src) eu eu'+>        (_,_) -> assertFailure $ show er+++> testEnv :: String -> [EnvironmentUpdate] -> Test.Framework.Test+> testEnv src eu = testCase ("check catalog: " ++ src) $+>   let ast = case parseSql "" src of+>                               Left e -> error $ show e+>                               Right l -> l+>       (nenv,aast) = typeCheck defaultTemplate1Environment ast+>       er = concatMap snd $ getTypeErrors aast+>       neu = deconstructEnvironment nenv \\ deconstructEnvironment defaultTemplate1Environment+>   in if not (null er)+>        then assertFailure $ show er+>        else assertEqual "check eus" eu neu+++> itemToTft :: Item -> [Test.Framework.Test]+> itemToTft (Expressions es) = map (uncurry testExpressionType) es+> itemToTft (StatementTypes es) = map (uncurry testStatementType) es+> itemToTft (EnvUpStatementTypes es) = map (\(s,eu,si) -> testEnvUpStatementType s eu si) es+> itemToTft (DdlStatements es) = map (uncurry testEnvUp) es+> itemToTft (DdlStatementsEnv es) = map (uncurry testEnv) es++> itemToTft (Group s is) = [testGroup s $ concatMap itemToTft is]
Database/HsSqlPpp/Utils.lhs view
@@ -13,10 +13,12 @@ > import Control.Monad.Error > import Control.Applicative -> errorWhen :: (Error a) =>->            Bool -> a -> Either a ()+> errorWhen :: (Error a) => Bool -> a -> Either a () > errorWhen cond = when cond . Left +> returnWhen :: (Monad m) => Bool -> a -> m a -> m a+> returnWhen c t t1 = if c then return t else t1+ > liftME :: a -> Maybe b -> Either a b > liftME d m = case m of >                Nothing -> Left d@@ -37,6 +39,27 @@ > fromRight b (Left _) = b > fromRight _ (Right r) = r +> fromLeft :: a -> Either a b -> a+> fromLeft _ (Left l) = l+> fromLeft a (Right _) = a++> mapEither :: (a->c) -> (b->d) -> Either a b -> Either c d+> mapEither l _ (Left a) = Left $ l a+> mapEither _ r (Right b) = Right $ r b++> mapRight :: (b -> c) -> Either a b -> Either a c+> mapRight = mapEither id++> mapLeft :: (a -> c) -> Either a b -> Either c b+> mapLeft l = mapEither l id++> isRight :: Either a b -> Bool+> isRight (Right _) = True+> isRight (Left _) = False++> leftToEmpty :: (r -> [a]) -> Either l r -> [a]+> leftToEmpty = either (const [])+ > replace :: (Eq a) => [a] -> [a] -> [a] -> [a] > replace _ _ [] = [] > replace old new xs@(y:ys) =@@ -51,3 +74,7 @@ >                            in  l : case s' of >                                            [] -> [] >                                            (_:s'') -> split c s''++> liftThrows :: (MonadError t m) => Either t a -> m a+> liftThrows (Left err) = throwError err+> liftThrows (Right val) = return val
+ Database/HsSqlPpp/Wrapper/WrapperTemplate.lhs view
@@ -0,0 +1,45 @@++> module Database.HsSqlPpp.Wrapper.WrapperTemplate where++> import Language.Haskell.TH+> import Language.Haskell.TH.Quote+> import Language.Haskell.TH.Lib+> --import Control.Exception++> --import qualified Database.HDBC.PostgreSQL as Pg+> --import Database.HDBC+> import Control.Monad.Error++> import Database.HsSqlPpp.Commands.CommandComponents+> import Database.HsSqlPpp.Ast.SqlTypes as HsSql+> import Database.HsSqlPpp.Ast.TypeChecker+> import Database.HsSqlPpp.Ast.Annotation+> import Database.HsSqlPpp.Parsing.Parser++++> select :: QuasiQuoter+> select = QuasiQuoter (litE . stringL) (litP . stringL)++> conv :: String -> String+> conv s = show $ parseSql "" s+++> getSelectResultType :: String -> String -> IO [(String,HsSql.Type)]+> getSelectResultType dbName sqlText = wrapET $ do+>   cat <- readCatalog dbName+>   ast <- parseSql1 "" sqlText >>= typeCheckC cat >>= lsnd+>   a <- case getTopLevelInfos ast of+>          [Just (SelectInfo (SetOfType (CompositeType atts)))] ->+>            return atts+>          _ -> throwError $ AEMisc "expected one info"+>   return a++ > select :: String -> IO (Q Exp)+ > select s = return $ stringE s++ > select :: String -> Q Exp+ > select s = stringE s+++ undefined
− HsSqlPppTests.lhs
@@ -1,20 +0,0 @@-#!/usr/bin/env runghc--Copyright 2009 Jake Wheat--Runner for automated tests, just pulls in the tests defs from the-other files.---> import Test.Framework-> import Database.HsSqlPpp.Tests.ParserTests-> --import Database.HsSqlPpp.Tests.DatabaseLoaderTests-> import Database.HsSqlPpp.Tests.AstCheckTests--> main :: IO ()-> main =->   defaultMain [->     parserTests->    ,astCheckTests->    --,databaseLoaderTests->    ]
HsSqlSystem.lhs view
@@ -1,320 +1,555 @@-#! /usr/bin/env runhaskell+#! /usr/bin/env runghc  Copyright 2009 Jake Wheat  Command line access to a bunch of utility functions. -command line is-./HsSqlSystem.lhs [commandName] [commandArgs ...]- run-./HsSqlSystem.lhs help+./HsSqlSystem.lhs -? to get a list of commands and purpose and usage info -TODO 1: add options to specify username and password (keep optional though)-TODO 2: think of a name for this command+> {-# LANGUAGE DeriveDataTypeable, ScopedTypeVariables #-} -> import System+> import System.Console.CmdArgs > import System.IO-> import Control.Monad > import System.Directory > import Data.List-> import Data.Either+> import Control.Monad.Error+> import Data.Char+> --import Control.Applicative -> import Database.HsSqlPpp.Parsing.Parser-> import Database.HsSqlPpp.Parsing.Lexer+> import Test.Framework (defaultMainWithArgs) -> import Database.HsSqlPpp.Ast.Annotator-> import Database.HsSqlPpp.Ast.Annotation+> import Database.HsSqlPpp.Tests.ParserTests+> import Database.HsSqlPpp.Tests.TypeCheckTests+> import Database.HsSqlPpp.Tests.ExtensionTests+> import Database.HsSqlPpp.Tests.ParameterizedStatementTests+ > import Database.HsSqlPpp.Ast.Environment+> import Database.HsSqlPpp.Ast.Ast+> import Database.HsSqlPpp.Commands.CommandComponents as C -> import Database.HsSqlPpp.PrettyPrinter.PrettyPrinter-> import Database.HsSqlPpp.PrettyPrinter.AnnotateSource+> data HsSqlSystem = Lex {files :: [String]}+>                  | Parse {files :: [String]}+>                  | ParseExpression {files :: [String]}+>                  | Pppp {files :: [String]}+>                  | Ppp {files :: [String]}+>                  | TypeCheck {database :: String+>                              ,files :: [String]}+>                  | TypeCheckExpression {database :: String+>                                        ,files :: [String]}+>                  | AllAnnotations {database :: String+>                                   ,files :: [String]}+>                  | AnnotateSource {database :: String+>                                   ,file :: String}+>                  | PPCatalog {database :: String+>                              ,files :: [String]}+>                  | Clear {database :: String}+>                  | Load {database :: String+>                         ,files :: [String]}+>                  | ClearLoad {database :: String+>                              ,files :: [String]}+>                  | DBCatalog {database :: String}+>                  | LoadPsql {database :: String+>                             ,files :: [String]}+>                  | PgDump {database :: String}+>                  | TestBattery {database :: String+>                                ,files :: [String]}+>                  | Test {extra :: [String]}+>                  | GenWrap {database :: String+>                            ,file :: String}+>                  | BuildDocs+>                    deriving (Show, Data, Typeable) -> import Database.HsSqlPpp.Dbms.DBAccess-> import Database.HsSqlPpp.Dbms.DatabaseLoader+> main :: IO ()+> main = do+>        cmd <- cmdArgs "HsSqlSystem, Copyright Jake Wheat 2009"+>                       [lexA, parseA, ppppA, pppA,+>                        parseExpressionA, typeCheckExpressionA,+>                        typeCheckA,allAnnotationsA,+>                        annotateSourceA, ppCatalogA,+>                        clearA, loadA, clearLoadA, catalogA, loadPsqlA,+>                        pgDumpA, testBatteryA,+>                        testA,buildDocsA, genWrapA] +>        case cmd of+>          Lex fns -> lexFiles fns+>          Parse fns -> showAst fns+>          Pppp fns -> testPppp fns+>          Ppp fns -> showAst fns+>          ParseExpression fns -> parseExpression fns+>          TypeCheck db fns -> typeCheck2 db fns+>          TypeCheckExpression db fns -> typeCheckExpression db fns+>          AllAnnotations db fns -> typeCheck2 db fns+>          AnnotateSource db fn -> annotateSourceF db fn+>          PPCatalog db fns -> ppCatalog db fns+>          Clear db -> cleardb db+>          Load db fns -> loadSql db fns+>          ClearLoad db fns -> clearAndLoadSql db fns+>          DBCatalog db -> readCat db+>          LoadPsql db fns -> loadSqlPsql db fns+>          PgDump db -> pgDump1 db+>          TestBattery db fns -> runTestBattery db fns+>          Test as -> runTests as+>          BuildDocs -> buildDocs+>          GenWrap db f -> genWrap db f++would like to have the database argument be a common arg, don't know+how to do this++> lexA, parseA, ppppA, pppA, annotateSourceA, clearA, loadA,+>   clearLoadA, catalogA, loadPsqlA, pgDumpA, testBatteryA,+>   typeCheckA, testA, parseExpressionA, typeCheckExpressionA,+>   buildDocsA, allAnnotationsA, ppCatalogA, genWrapA :: Mode HsSqlSystem++===============================================================================++> lexA = mode Lex {files = def &= typ "FILES" & args}+>        &= text "lex the files given and output the tokens on separate lines"++> lexFiles :: [FilePath] -> IO ()+> lexFiles fns = wrapET $+>                forM_ fns (\f ->+>                     message ("lexing " ++ f) >>+>                     readInput f >>= lexSql f >>= printList)+ ================================================================================ -= main+> parseA = mode $ Parse {files = def &= typ "FILES" & args}+>          &= text "Parse files and output the asts" -> main :: IO ()-> main = do->   args <- getArgs->   case () of->        _ | null args -> putStrLn "no command given" >> help []->          | otherwise -> case lookupCaller commands (head args) of->                           Nothing -> putStrLn "unrecognised command" >> help []->                           Just c -> call c $ tail args+> showAst :: [String] -> IO ()+> showAst = wrapET . mapM_ (\f ->+>                message ("-- ast of " ++ f) >>+>                readInput f >>= parseSql1 f >>= stripAnn >>= ppSh >>= message) -> commands :: [CallEntry]-> commands = [helpCommand->            ,clearDBCommand->            ,loadSqlCommand->            ,clearAndLoadSqlCommand->            ,lexFileCommand->            ,parseFileCommand->            ,roundTripCommand->            ,readEnvCommand->            ,annotateSourceCommand->            ,checkSourceCommand]+================================================================================ -> lookupCaller :: [CallEntry] -> String -> Maybe CallEntry-> lookupCaller ce name = find (\(CallEntry nm _ _) -> name == nm) ce+> ppppA = mode $ Pppp {files = def &= typ "FILES" & args}+>         &= text "Routine to parse sql from a file, pretty print it then parse it \+>                 \again and check the post pretty printing ast is the same as the \+>                 \initial ast" +> testPppp :: [String] -> IO ()+> testPppp = wrapET . mapM_ (\f -> do+>             ast1 <- readInput f >>= parseSql1 f >>= stripAnn+>             ast2 <- ppSql ast1 >>= parseSql1 "" >>= stripAnn+>             if ast1 /= ast2+>                then do+>                     message "asts are different\n-- original"+>                     ppSh ast1 >>= message+>                     message "-- ppp'd"+>                     ppSh ast2 >>= message+>                else message "success")+ ================================================================================ -> helpCommand :: CallEntry-> helpCommand = CallEntry->                  "help"->                  "use 'help' to see a list of commands\n\->                  \use 'help all' to see a list of commands with descriptions\n\->                  \use 'help [command]' to see the description for that command"->                   (Multiple help)+> pppA = mode $ Ppp {files = def &= typ "FILES" & args}+>        &= text "Parse then pretty print some sql so you can check the result \+>               \hasn't mangled the sql." +> ppp :: String -> IO()+> ppp f = wrapET $ message ("--ppp " ++ f) >>+>         readInput f >>= parseSql1 f >>= ppSql >>= message -> help :: [String] -> IO ()-> help args =->   case args of->             ["all"] -> showCommands True->             [x] -> helpForCommand x->             _ -> showCommands False->   where->     showCommands full = do->       putStrLn "commands available"->       mapM_ putStrLn $ flip map commands (\(CallEntry nm desc _)  ->->                                           if full->                                             then nm ++ "\n" ++ desc ++ "\n"->                                             else nm ++ "\n")+================================================================================ -> helpForCommand :: String -> IO ()-> helpForCommand c =->     case lookupCaller commands c of->       Nothing -> putStrLn "unrecognised command" >> help []->       Just (CallEntry nm desc _) -> putStrLn $ nm ++ "\n" ++ desc+> parseExpressionA = mode $ ParseExpression {files = def &= typ "FILES" & args}+>                    &= text "Parse files each containing one expression \+>                            \and output the asts" +> parseExpression :: [String] -> IO ()+> parseExpression = wrapET . mapM_ (\f ->+>                message ("-- ast of " ++ f) >>+>                readInput f >>= parseExpression1 f >>= stripAnn+>                >>= ppSh >>= message)+ ================================================================================ -= load sql file+> annotateSourceA = mode $ AnnotateSource {database = def+>                                         ,file = def &= typ "FILE"}+>                   &= text "reads a file, parses, type checks, then outputs info on \+>                           \each statement interspersed with the original source code" -> loadSqlCommand :: CallEntry-> loadSqlCommand = CallEntry->                  "loadsql"->                  "This takes one or more files with sql source text, \->                  \parses them then loads them into the database given."->                  (Multiple loadSql)+> annotateSourceF :: String -> FilePath -> IO ()+> annotateSourceF db f =+>   wrapET $ do+>     message ("--annotated source of " ++ f)+>     src <- readInput f+>     cat <- readCatalog db+>     parseSql1 f src >>= typeCheckC cat >>= lsnd >>=+>       ppAnnOrig False src >>= message -> loadSql :: [String] -> IO ()-> loadSql args = do->   -- do this to avoid having to put flushes everywhere when we->   -- provide "..." progress thingys, etc..->   hSetBuffering stdout NoBuffering->   let (db:fns) = args->   forM_ fns $ \fn -> do->   res <- parseSqlFile fn->   case res of->     Left er -> error $ show er->     Right ast -> putStrLn ("loading " ++ fn)->                  >> loadIntoDatabase db fn ast+================================================================================ +> ppCatalogA = mode $ PPCatalog {database = def+>                               ,files = def &= typ "FILES" & args}+>              &= text "reads each file, parses, type checks, then outputs the \+>                      \changes to the catalog that the sql makes"++> ppCatalog :: String -> [FilePath] -> IO ()+> ppCatalog db fns = wrapET $ do+>   scat <- readCatalog db+>   (ncat, _) <- mapM (\f -> readInput f >>=+>                            parseSql1 f) fns >>=+>                  lconcat >>= typeCheckC scat+>   compareCatalogs scat emptyEnvironment ncat >>=+>       ppCatDiff >>= message+ ================================================================================ +> typeCheckA = mode $ TypeCheck {database = def+>                               ,files = def &= typ "FILES" & args}+>              &= text "reads each file, parses, type checks, then outputs any type errors"+++> typeCheck2 :: String -> [FilePath] -> IO ()+> typeCheck2 db fns = wrapET $+>   readCatalog db >>= \cat ->+>   mapM (\f -> readInput f >>= parseSql1 f) fns >>= lconcat >>=+>   typeCheckC cat >>= lsnd >>= getTEs >>= ppTypeErrors >>= putStrLnList++================================================================================++> allAnnotationsA = mode $ AllAnnotations {database = def+>                                        ,files = def &= typ "FILES" & args}+>                   &= text "reads each file, parses, type checks, then pretty prints the \+>                           \ast with all annotations except the source positions"++> allAnnotations :: String -> [FilePath] -> IO ()+> allAnnotations db fns = wrapET $+>   readCatalog db >>= \cat ->+>   mapM (\f -> readInput f >>= parseSql1 f) fns >>= lconcat >>=+>   typeCheckC cat >>= lsnd >>= ppSh >>= message+++================================================================================++> typeCheckExpressionA = mode $ TypeCheckExpression {database = def+>                               ,files = def &= typ "FILES" & args}+>      &= text "reads each file, parses as expression, \+>              \ type checks, then outputs the type or any type errors"+++> typeCheckExpression :: String -> [FilePath] -> IO ()+> typeCheckExpression db fns = wrapET $ do+>   aasts <- readCatalog db >>= \cat ->+>               forM fns (\f -> readInput f >>= parseExpression1 f+>                                    >>= typeCheckExpressionC cat)+>   tes <- mapM getTEs aasts+>   mapM_ (\x -> ppTypeErrors x >>= putStrLnList) $ filter (not . null) tes+>   mapM_ (\a -> liftM (show . head) (getTopLevelTypes a) >>= message) aasts++================================================================================+ = small hack utility to help with testing  TODO: use the correct username in this command TODO: do something more correct -> clearDBCommand :: CallEntry-> clearDBCommand = CallEntry->                  "cleardb"->                  "hacky util to clear a database"->                  (Single cleardb)+> clearA = mode $ Clear {database = def}+>          &= text "hacky util to clear a database"  > cleardb :: String -> IO ()-> cleardb db = do->   withConn ("dbname=" ++ db) $ \conn ->->     runSqlCommand conn "drop owned by jake cascade;"->   putStrLn $ "database " ++ db ++ " cleared."+> cleardb = wrapET . clearDB  ================================================================================ -> clearAndLoadSqlCommand :: CallEntry-> clearAndLoadSqlCommand = CallEntry->                          "clearandloadsql"->                          "cleardb then loadsql"->                          (Multiple->                           (\args -> do->                              cleardb $ head args->                              loadSql args))+= load sql file +> loadA = mode $ Load {database = def+>                     ,files = def &= typ "FILES" & args}+>         &= text "This takes one or more files with sql source text, \+>            \parses them then loads them into the database given."++> loadSql :: String -> [String] -> IO ()+> loadSql db fns = wrapET $+>      liftIO (hSetBuffering stdout NoBuffering) >>+>      mapM (\f -> readInput f >>= parseSql1 f) fns >>= lconcat >>=+>      runExtensions >>= loadAst db ""+ ================================================================================ -> lexFileCommand :: CallEntry-> lexFileCommand = CallEntry->                  "lexfile"->                  "lex the file given and output the tokens on separate lines"->                  (Single lexFile)-> lexFile :: FilePath -> IO ()-> lexFile f = do->   putStrLn $ "lexing " ++ show f->   x <- lexSqlFile f->   return ()->   case x of->        Left er -> print er->        Right l -> mapM_ print l+> loadPsqlA = mode $ LoadPsql {database = def+>                             ,files = def &= typ "FILES" & args}+>             &= text "loads sql into a database using psql." +> loadSqlPsql :: String -> [String] -> IO ()+> loadSqlPsql db = wrapET .+>   --srcs <- mapM readInput fns+>   --mapM_ (\s -> loadSqlUsingPsql db s >>= message) (map snd srcs)+>   mapM_ (\s -> loadSqlUsingPsqlFromFile db s >>= message)+ ================================================================================ -> parseFileCommand :: CallEntry-> parseFileCommand = CallEntry->                    "parsefile"->                    "Routine to parse sql from a file, check that it appears to parse ok, \->                    \that pretty printing it and parsing that text gives the same ast, \->                    \and then displays the pretty printed version so you can see how well it's \->                    \done"->                    --(maybe it could interpolate each original statement with its->                    --parsed, pretty printed version so you can more easily check how->                    --authentic the sql is and how much has been silently dropped on the floor)->                    (Multiple parseFile)+> pgDumpA = mode $ PgDump {database = def}+>           &= text "run pg dump, used for testing." -> parseFile :: [String] -> IO ()-> parseFile = mapM_ pf->   where->     pf f = do->       putStrLn $ "parsing " ++ show f->       x <- parseSqlFile f->       case x of->            Left er -> print er->            Right st -> do->                --print l->                --putStrLn "END OF AST END OF AST END OF AST END OF AST END OF AST END OF AST"->                putStrLn "parse ok"->                print st->                let pp = printSql st->                --putStrLn pp->                --check roundtrip->                case parseSql pp of->                  Left er -> error $ "roundtrip failed: " ++ show er->                  Right st' -> if map stripAnnotations st == map stripAnnotations st'->                                then putStrLn "roundtrip ok"->                                else putStrLn "roundtrip failed: different ast"->       return ()+> pgDump1 :: String -> IO ()+> pgDump1 db = wrapET $ pgDump db >>= message + ================================================================================ -> annotateSourceCommand :: CallEntry-> annotateSourceCommand = CallEntry->                    "annotateSource"->                    "reads a file, parses, type checks, then outputs info on each statement \->                    \interspersed with the original source code"->                    (Single annotateSourceF)+might try to work out a way of running multiple commands in one invoc+of this exe, then this command will disappear -> annotateSourceF :: FilePath -> IO ()-> annotateSourceF f = do->   aste <- parseSqlFile f->   case aste of->     Left er -> error $ show er->     Right ast -> do->                  src <- readFile f->                  let aast = annotateAst ast->                      srcnew = annotateSource False src aast->                  putStr srcnew+> clearLoadA = mode $ ClearLoad {database = def+>                               ,files = def &= typ "FILES" & args}+>              &= text "cleardb then loadsql" +> clearAndLoadSql :: String -> [String] -> IO ()+> clearAndLoadSql db fns = cleardb db >> loadSql db fns+ ================================================================================ -> checkSourceCommand :: CallEntry-> checkSourceCommand = CallEntry->                    "checksource"->                    "reads each file, parses, type checks, then outputs any type errors"->                    (Multiple checkSource)+This reads an catalog from a database and writes it out using show. -> checkSource :: [FilePath] -> IO ()-> checkSource fns = mapM_ cs fns+> catalogA = mode $ DBCatalog {database = def}+>            &= text "read the catalog for the given db and dumps it in source \+>                    \format, used to create the catalog value for template1"++> readCat :: String -> IO ()+> readCat dbName = wrapET $ do+>   cat <- readCatalog dbName+>   message preamble+>   ppSh cat >>= prefixLines >>= message >   where->     cs f = do->            aste <- parseSqlFile f->            case aste of->                      Left er -> error $ show er->                      Right ast ->->                        do->                        let aast = annotateAst ast->                            tes = getTypeErrors aast->                        mapM_ (putStrLn.showSpTe) tes->     showSpTe (Just (SourcePos fn l c), e) =->         fn ++ ":" ++ show l ++ ":" ++ show c ++ ":\n" ++ show e->     showSpTe (_,e) = "unknown:0:0:\n" ++ show e+>     preamble = "\n\+>                \Copyright 2009 Jake Wheat\n\+>                \\n\+>                \This file contains\n\+>                \\n\+>                \> {-# OPTIONS_HADDOCK hide  #-}\n\+>                \\n\+>                \> module Database.HsSqlPpp.AstInternals.Environment.DefaultTemplate1Environment\n\+>                \>     (defaultTemplate1Environment\n\+>                \>      ) where\n\+>                \\n\+>                \> import Database.HsSqlPpp.AstInternals.Environment.EnvironmentInternal\n\+>                \> import Database.HsSqlPpp.AstInternals.TypeType\n\+>                \\n\+>                \> defaultTemplate1Environment :: Environment\n\+>                \> defaultTemplate1Environment =\n\+>                \>    (\\l -> case l of\n\+>                \>             Left x -> error $ show x\n\+>                \>             Right e -> e) $\n\+>                \>     updateEnvironment defaultEnvironment\n"+>     prefixLines :: (Monad m, Error e) => String -> ErrorT e m String+>     prefixLines = return . unlines . map (">        " ++) . lines  +================================================================================ +run test battery: run a bunch of tests including consistency on the+database and sql files given++The idea is to typecheck the sql, load it into pg and dump it via psql+and via database loader, can then compare asts, catalogs, etc. in a+lot of different ways++currently:+parse and type check sql, save the catalog+load the sql into the db using psql, compare the catalog read from pg+with the catalog from typechecking+dump the sql and typecheck the dump, compare the catalog from this+check with the catalog from the original typecheck++todo: compare asts from initial parse with parsed dump - this is going+to be a lot of work to get passing since the statements are+re-ordered, and sometimes changed/ split up by pg++also: load the sql using the extension system and database loader,+then compare pg catalog with initial catalog, and dump and compare ast+with original ast++want to run a similar set of tests starting with the dump sql:+get ast,cat from dump sql, load using psql and using databaseloader+and check cats and subsequent dump asts.++getting the dump ast comparing with the original ast:++step one: convert tests in parser test to also roundtrip through+database, see parsertests for details++step two: write an ast conversion routine: assume that the pgdump ast+is like the ast fed into pg but with a few statements split into+components (e.g. create table with serial is split into create+sequence and create table), and then the statements are reordered, so+write a routine to mirror this - will then have+(anyast -> rearrange and reorder) == (anyast -> pg->pgdump)++> testBatteryA = mode $ TestBattery {database = def+>                                   ,files = def &= typ "FILES" & args}+>                &= text "runs a load of consistency tests on the sql passed"++> runTestBattery :: String -> [FilePath] -> IO ()+> runTestBattery dbName fns = wrapET $ do+>     clearDB dbName+>     startingCat <- readCatalog dbName+>     (originalCat :: Environment,+>      originalAast :: StatementList) <-+>        mapM (\f -> readInput f >>= parseSql1 f) fns >>= lconcat >>=+>        runExtensions >>= typeCheckC startingCat++>     headerMessage "type errors from initial parse:\n"+>     getTEs originalAast >>= ppTypeErrors >>= putStrLnList++>     mapM_ (\s -> loadSqlUsingPsqlFromFile dbName s >>= message) fns+>     properCat <- readCatalog dbName+>     headerMessage "catalog differences from initial parse and vanilla load:\n"+>     compareCatalogs startingCat originalCat properCat >>=+>       ppCatDiff >>= message++>     (dumpCat,dumpAast) <-+>       pgDump dbName >>= parseSql1 "dump" >>= typeCheckC startingCat++>     headerMessage "type errors from dump:\n"+>     getTEs dumpAast >>= ppTypeErrors >>= putStrLnList++>     headerMessage "catalog differences from initial parse and rechecked pg dump:\n"+>     compareCatalogs startingCat originalCat dumpCat >>=+>       ppCatDiff >>= message++>     message "complete!"+>     where+>       headerMessage = message . ("-----------------------------\n" ++)+ ================================================================================ -> roundTripCommand :: CallEntry-> roundTripCommand = CallEntry->                        "roundtripfile"->                        "Used to test the parsing and pretty printing round trip. Takes two \->                        \arguments, a source filename and a target filename. If the target file \->                        \exists, it quits. Parses the source file then pretty prints it to the \->                        \target filename."->                        (Multiple roundTrip)+> testA = mode $ Test {extra = def &= typ "ANY" & args & unknownFlags}+>         &= text "run automated tests, uses test.framework can pass arguments \+>                 \to this e.g. HsSqlSystem test -t parserTests" -> roundTrip :: [FilePath] -> IO ()-> roundTrip args = do->   when (length args /= 2) $->          error "Please pass exactly two filenames, source and target."->   let (source:target:[]) = args->   targetExists <- doesFileExist target->   when targetExists $->          error "the target file name exists already, please delete it or choose a new filename"->   x <- parseSqlFile source->   case x of->        Left er -> print er->        Right l -> writeFile target $ printSql l+> runTests :: [String] -> IO ()+> runTests as =+>   flip defaultMainWithArgs as $+>     parserTests +++>     typeCheckTests +++>     --parameterizedStatementTests +++>     [extensionTests]  ================================================================================ -This reads an environment from a database and writes it out using show.+options: nothing -> create/overwrite folders and files+         clean -> delete generated files -> readEnvCommand :: CallEntry-> readEnvCommand = CallEntry->                   "readenv"->                   "read the catalogs for the given db and dump a Environment value source text to stdout"->                   (Single readEnv)-> readEnv :: String -> IO ()-> readEnv dbName = do->   s <- readEnvironmentFromDatabase dbName->   putStr "\n\->          \Copyright 2009 Jake Wheat\n\->          \\n\->          \This file contains\n\->          \\n\->          \> {-# OPTIONS_HADDOCK hide  #-}\n\->          \\n\->          \> module Database.HsSqlPpp.AstInternals.DefaultTemplate1Environment\n\->          \>     (defaultTemplate1Environment\n\->          \>      ) where\n\->          \\n\->          \> import Database.HsSqlPpp.AstInternals.EnvironmentInternal\n\->          \> import Database.HsSqlPpp.AstInternals.TypeType\n\->          \\n\->          \> defaultTemplate1Environment :: Environment\n\->          \> defaultTemplate1Environment = (\\l -> case l of\n\->          \>                                       Left x -> error $ show x\n\->          \>                                       Right e -> e)\n\->          \>                                 $ updateEnvironment defaultEnvironment "+create target folder if doesn't exist ->   print s+> buildDocsA = mode $ BuildDocs+>         &= text "build the documention in the docs/ folder" +> buildDocs :: IO ()+> buildDocs = wrapET $ do+>              liftIO $ createDirectoryIfMissing False "docs/build"+>              inputFiles <- sources+>              let sts = zip (map ("docs/" ++) inputFiles) $+>                        flip map inputFiles+>                             (\f -> "docs/build/" ++ f ++ ".html")+>              forM_ sts $ \(s,t) ->+>                      readInput s >>= pandoc >>= C.writeFile t+>             where+>               sources = liftM (filter (isSuffixOf ".txt"))+>                           (liftIO (getDirectoryContents "docs"))+ ================================================================================ -> data CallEntry = CallEntry String String CallType->                --          name   use+> genWrapA = mode $ GenWrap {database = def+>                           ,file = def &= typ "FILE"}+>            &= text "experimental code to generate typesafe haskell wrapper \+>                    \for db access"+> genWrap :: String -> String -> IO ()+> genWrap db f =+>   wrapET doit+>     where+>       doit :: (MonadIO m) => ErrorT AllErrors m ()+>       doit = wrapperGen1 db f >>= message -> data CallType = Single (String -> IO ())->               | Multiple ([String] -> IO ())+================================================================================ -> call :: CallEntry -> [String] -> IO ()-> call (CallEntry _ _ ct) args =->     case ct of->       Single f | length args /= 1 -> error "please call this command with one argument"->                | otherwise -> f (head args)->       Multiple f -> f args+TODOS++command to display all annotation inline in sql source+better catalog diff, e.g. if two tables differ in one column just show+that difference+see if can improve ppshow to use slightly less newlines+command to show which bits of preexisting catalog are used+command to list which views/functions/etc. aren't used anywhere+replace a bunch of commands with composible set:+parse(expression), ppp, typecheck(expression), allannots+->+parse (expression option)+type check+annotation filter + options+output: ast, sql, annotations + options+++++think of a better name for this command than hssqlsystem++want better options system:+first set of options get passed around in reader? monad:+  database name, username, password for pg+  useextensions+  annotation control? - when showing values, which annotations to also output?+these have defaults, can change defaults in ~/.config/hssqlsystem or something,+and can be overridden using --dbname=...,etc. command line args (make+these work like psql? then have environment variables also)+second set of options is for input and output:+read from file(s), stdin, or from string literal command line arg, e.g.+HsSqlSystem expressionType --src="3 + 5"+output to file(s) or stdout++review command names and arguments:+find a better naming convention: some commands produce haskell values as text,+some produce non haskell compatible text e.g. lexfile+some run tests and produce a success/fail result, maybe a list of issues++run multiple commands in one invocation?++check errors passed to user are understandable++command line commands to add:++showAast+ppCatalog - read from db and print in human readable rather+            than as haskell value+showexpressionast+showexpressionaast+typecheckexpression+pppexpression+showCatalogUpdates - run over some sql files, outputs the catalog changes+                     made by this sql+ppCatalogUpdates++graphviz stuff: dependency graph: pass a view name or function and it+draws a graph of all the views, tables and functions which are used by+that view or function++run an extension by name over some sql source to view differences: add+integration with external diff viewers, so can see before and after,+maybe option to either view pp'd sql, annotated pp'd sql, ast, aast,+etc.  - can also use this for pppsql and pppexpression to view how the+pretty printer mangles things, and for testing, etc.++logging/verbosity:++want a way to log to stderr/stdout/ files with different verbosity+settings++command line arguments:+options:+--database=xxx+?+--extensions+--username+--password+?other connection info+annotation control?++command name+other command arguments:+- on its own is read from stdin+--input='xxx' add literal input rather than from file/stdin+
README view
@@ -1,41 +1,45 @@-Summary: A parser, pretty printer, and type checker for PostGreSQL SQL+Summary: A parser, pretty printer, and type checker for PostgreSQL SQL and PL/pgSQL. BSD licensed. +** Some of the documentation here and in the other files is out of+   date, will be updated before the first alpha release. Please email+   me (address below) if you have any questions in the meantime **+ The current aims of the project is to provide a parser and type-checker for a substantial portion of PostGreSQL SQL and PL/pgSQL.+checker for a substantial portion of PostgreSQL SQL and PL/pgSQL, and+then hopefully to build on this to make tools and libraries to help+developing PL/pgSQL code.  Status: it successfully parses and accurately pretty prints the three moderate sized SQL files from another project of mine, but there are-lots of missing bits. Coverage of SQL is reasonable - it's possible-that your SQL files will parse ok, but it's also possible that they-won't parse at all - see below for more details on what is supported-and unsupported.+lots of missing bits. Coverage of SQL is sort of reasonable - it's+possible that your SQL files will parse ok, but it's also possible+that they won't parse at all. Please report any sql which doesn't+parse.  It also has the beginnings of a type checker, which currently can type-check a large subset of expressions and selects that the parser can-parse, and some aspects of all of the DDL statements that parse, but-is in an early state. You can run the type checker on your SQL in-various ways from the command line, see the 'usage' file for details.+check a fair bit of the three files mentioned above. You can run the+type checker on your SQL in various ways from the command line. Please+report any sql which doesn't type check correctly. Coming soon: a+command to produce a report on how well this code can parse and type+check your sql.  It comes with a small test suite. -It is Cabal-installable, run:+To install, use cabal update then cabal install hssqlppp-to install the libraries and HsSqlSystem executable (and the test-runner executable), if you want to try the utilities out, or run-cabal unpack hssqlppp-to download and view the source code easily. -I think it should work on all GHC 6.10.x and possibly also GHC 6.8.x.+I think it should work on all GHC 6.10.x and possibly also GHC 6.8.x,+YMMV. GHC 6.12.x untested so far. -See the file 'development' for some notes on how to work with the-source.+There are more doc files in the docs/ folder, and you can view the+haddock docs on hackage (see below for link). Better documentation is+coming soon.  The main dependencies of this project are: Parsec 3, HUnit, HDBC,-UUAGC and Data.Generics. The tests run without accessing PostGreSQL,-but some of the utility functions do need it.+UUAGC. You currently need PostgreSQL installed.  ================================================================================ @@ -57,6 +61,9 @@ To get a snapshot release, see the downloads on the Launchpad page, or use cabal install. ++================================================================================+ Contact  Let me know if you're using/ interesting in using the library, if you@@ -69,85 +76,7 @@  ================================================================================ -= Syntax supported/ not supported:--== Parsing--Partially supports:-select statements (selectlists (*, qualified, aliased/correlation names, expressions)-       distinct, basic window functions,-       from (with explicit joins - natural, inner, cross, left, right,-       full outer, on and using), aliases, from functions-       where, group by, having, order by, limit, offset-       except, intersect, union--expressions: subselects, in, row ctors, strings + dollar strings,-             integers, case, exists, boolean literals, null, arrays-             and subscripting (slightly limited), function calls,-             identifiers, cast(x as y), between (quite limited),-             substring(x from a for b)--also partially supports:-insert (with multiple values and select support), update, delete (all-three with returning)-create and drop table, type, view, domain-create function for sql and plpgsql functions-all constraint types-sort of skips copy statements instead of erroring--plpgsql statements:-        select into-        null-        continue-        perform-        execute-        assignment-        if-        return, return next, return query-        raise-        for (select and integer variants)-        while-        case statement--Many things are missing at the moment, in particular-  selects: cte, implicit joins-  joins in updates (delete from, update using)-  alter statements-  create and drop apart from table, view, domain, type, function-  transaction commands-  triggers and trigger functions-  loop statement, labels-  error trapping-  cursors-This is a non-exhaustive list.--Expression support is patchy, should work pretty well for a lot of-simple stuff though. There is a strong possibility that for some-complex selects and expressions, the implicit precedence (that is,-bits without enclosing parenthesis) may parse in the wrong-direction. Please let me know if you encounter such an error.--== Type checking--Type checking supports a good subset of expressions and select-statements that the parser parses, and has basic support for insert,-update, delete and the various create statements that the parser-supports. Development work is currently focused in this area.--= Other current downsides:--The design of the AST node types is pretty basic.--Not much work has been done on correctly rejecting invalid SQL-(although it does pretty well despite this) and not much thought has-been put into error messages and error reporting yet, this is slowly-improving, and at some point will become a major focus - I hope this-code will provide substantial benefits when developing in PL/pgSQL in-the future.--Only supports PostGreSQL SQL and PL/pgSQL.--Future plans (provisional):+= Some provisional future plans:  * use this system to develop a Lint-type checker for PL/pgSQL; @@ -160,3 +89,5 @@  * possibly a lightweight code generation/ simple macro support to help   with developing more robust PL/pgSQL code.++* documentation generation
− TODO
@@ -1,334 +0,0 @@-new features:-pretty printer for annotations for annotatesource and checksource--tidy up syb stuff-review use of annotations/attributes in type checker-run through error handling, fix spaghetti code and bizarre stuff-add either to remaining utils, convert error to either so we get-   internal errors in the aast instead of killing the program-check code ag <-> lhs-review the typechecking modules -> can get rid of astutils? probably-   not, but can rename it to errorhandling or similar-review ast/typechecking split, move ast to separate folder?,-  make sure don't have typechecking stuff in ast, and ast doesn't-  depend on type checking stuff (problem: annotations?)--lint stuff: ambiguous identifiers, null usage, duplicate definitions--error handling fixup-not just error handling, but most of the code in the type checking-files.-1. don't use error, use InternalError as part of a Either, these-   end up in the ast tree-2. add eithers to a bunch of env functions - make sure we check-   all the preconditions, e.g. check a view exists when trying-   to look up the attributes. Also add a bunch of precondition-   checks to the updateenvironment function, e.g. checking for-   duplicate types-3. make sure errors from updateenvironment aren't ignored, but-   end up in the ast tree-4. review the error handling utilities - probably could do with-   a rethink, also definitely need better names. The kind of things-   needed are: way to propagate typecheckfailed, dealing with-   conversions from lists of eithers to single eithers by-   concatenating the errors, if no errors take the last right,-   etc.-5. support variadic args to get rid of the current hacks to work-   around this not being supported-6. go through all the actual type checking code and work out some more-   consistent way of writing the code, and work on making the-   algorithms clearer, some are really obscure at the moment, mainly-   due to programmer incompetence and also many changes to the way-   various things are handled (particularly the error handling and-   typecheckfailed propagation), and just need pretty much rewriting-   from scratch.---= Additional TODO list towards alpha release--run through chaos sql and fix all type checking problems, make sure-roundtripping through annotate source doesn't mangle the code-start work on type checking inside functions - start with params,-   return types, non plpgsql statements, stuff with selects (e.g. for).-work on parsing and type checking pg_dump output, then do a util to-   dump and type check a live database (this will lead to being able-   to run the lint process on a live database rather than source)-work out api + do haddock-provide installation instructions for non haskell programmers--parse and/or type check todo list:-"identifier"-6.5e-5-type 'string' style type cast-[:] slice-missing keyword ops-default template1 operators should all parse-composite field selection-agg(all expr) agg(distinct expr), agg(*)-window frame clauses, named windows-parse inside string literals when cast, for common types-multidimensional arrays-implicit casting row values to composites-default values-serial-make sure can type check everything that parses-constraint names-provide list of keys in info for create/alter table: include unique-   not null and serials-type check fks, and other constraints-alter table: add/remove column-                        constraint-                        default value-                        column type-                        rename column-                        rename table-what other alters/creates-views, functions, operators, types, domains, triggers, rules-selects:-implicit joins-group by, having + group by with unaggregated and aggregated fields-distinct, on-order by - do properly-limit, offset-with queries-type modifiers-data type names with spaces in them-timestamps-schemas-alternative text for true and false-enums-geometric types weird syntax-composites: selector variants, rowctors, component get/update-do all keyword and template1 operators-any/some/all subqueries and arrays-check over rowwise comparisons-indexes: create/alter/drop--go over what more type checking could be done--stage 2:-instead of interspersing the annotation output with the pretty printed-   statements, insert or overwrite the annotation comments in the-   original source so we preserve formatting and other comments.-want to also output types of parts of statements, e.g. the select in a-   for statement or insert, etc.. Other things that could be useful-   include adding the resolved function prototype for each function-   used which has overloads so you can see which overload is being-   called, write out the canonicalized ast: so e.g. we have all the-   casts made explicit, etc. -> use the annotation system for this-With this in place, the code actually has some use for real code, in-   that we can use it to easily view the types of views, etc. inline-   in the real sql source code--stage 3:-review and choose from this list:-* do null inference-* some selective fixups here and there to the typing (e.g. type-   checking constraints in create tables)-* selectively add some missing syntax, to cover the most glaring holes-* schema qualification-* type check statements inside create function-* something else from the todo for milestone 0.1 below-* something else--================================================================================--rough milestones for first alpha-in addition to all the stage 3 items above,--add support for nearly all syntax for parsing and type checking,-   instead of doing piecemeal bits, so go through the pg manual part-   II, support almost everything, add comprehensive simple tests, go-   through the sql reference section also. This is the time to-   document more precisely what isn't supported so there is a clear-   reference for this-do ? placeholders, and do typesafe haskell wrapper generation using this-figure out what to do about tricky operator precedence parsing, etc.-ability to type check all of chaos sql-example for generating sql code from haskell using the ast-get database loader and typesafe access generators good enough to use-   in chaos-example usage of each of these-look at the error message formatting, particularly try to fix the-   parser errors so they make more sense-add annotation field to most ast nodes, store type and source-   positioning in this field, fix parser to add lots of accurate-   positioning information when parsing.-make sure the lint process works on text dumps of databases.-try checking the sample databases: http://pgfoundry.org/projects/dbsamples/---================================================================================--some syntax todo, not organised:---------------add support for following sql syntax (+ type checking)-alter table, common variations-create index-create rule-create trigger-+ drops for all creates-+ maybe alters?-ctes-loop, exit, labels-easy ones: transactions, savepoints, listen-prepare, execute + using-some more:-create or replace-alter table-transactions: begin, checkpoint, commit, end, rollback-cursors: declare, open, fetch, move, close, where current of-copy - parse properly-create database-create index-create rule-create trigger + plpgsql support-grant,revoke-listen, notify, unlisten-prepare, execute-savepoint, release savepoint, rollback to savepoint-set, reset-set constraints-set role-set transaction-correlated subquery attrs--plpgsql--blocks which aren't at the top level of a function-% types-strict on intos-not null for var defs-exception-execute using-get diagnostics-return query execute-raise missing bits-out params-elsif-loop-exit-labels-reverse, by in for-for in execute--expressions:-process string escapes, support dollar quoting and other quoting more-   robustly in the pretty printer-full user operator support (?)-fix expression parser properly to handle things like between - see-   grammar in pg source for info on how to do this-[:] array slices-aggregate: all and distinct-multi dimensional arrays: selectors and subscripting-missing keyword operators-datetime extract-time zone-subquery operators: any, some, all-in general, parsing operators is wrong, the lexer needs to be able to-   lex sequences of symbols into single/multiple operators correctly,-   what happens at the moment is a kludge, also, general operator-   parsing will change how operators are represented in the ast--================================================================================--some other random ideas:--null treatment-Basic motivation is to keep nulls carefully walled off, controlled,-   and be able to catch them when they sneak back into expressions,-   etc.. For each value, etc. we determine statically if it might be-   null. This can be done for return types of functions, fields in a-   select expression, etc.. (will do mappings e.g. if a functions-   inputs are all non null, then the output is non null, etc.). Once-   this is working ok, the second stage is to implement the anti null-   warnings/ errors.-Allow nulls in tables, outer joins, in coalesce, to be produced by-   selects (maybe add or remove from this allowed list, maybe make it-   configurable on a per project basis).-Never allow nulls to be an argument to a function call, (including-   ops, keyword ops, etc.). So every time you have a field being used-   in an expression and it cannot be statically verified to be non-   null, you have to insert a coalesce or fix it in some other way.-So nulls can still be used to represent optional values, n/a,-   etc.. and output to clients doing selects, but there is no need to-   grapple with:-* 3vl (or whatever it is that sql uses instead),-* what the result of a function call is if the some or all the-  arguments are null,-* what the result of a sum aggregate is if some of the values are null,-* etc.,-because none of these things are allowed.---parser, converter and pretty printer for explain output, want to view-   how a query is executed in human readable pseudocode. Add lint type-   checks, etc. to this, which can suggest ways to rewrite the query-   to get better performance. Another idea is to make the dependencies-   on the values in the tables more explicit, so you can see how much-   the data can change before another plan is chosen, or you can see a-   bad assumption about the kind of data the query will be run on.--write a replacement psql shell, which can expose parse trees, type-   checks, lint checks, and doesn't use a one line at a time style-   interface (i.e. works more like writing and executing lisp in-   emacs, not like bash).--chain scope lookups instead of unioning them since unioning is too-   slow - or maybe use maps/sets, but need to quickly scan whole lists-   e.g. for function lookup, which can't really use any sort of key-   based lookup, where the key the function lookup uses is the same as the-   key the map/set uses.--incorporate pg regression test sql into parsing and type checking-   tests--write a show for parsec errors which formats the lex tokens and-   expected lists properly (was broken when moved to the separate-   lexer)--add haddock docs to public api--write some example programs with plenty of comments - will this mainly-   be used as a library or as a utility though?--redo cabal file to add compile time options: exes, pg support, tests- or split into separate packages?--sort out modules/folder use--work on error reporting, add tests for malformed sql--add token location info to ast nodes, modify for type checking, etc-   support.--want to report multiple parse errors, perhaps can bodge this because-   of the property that ';' can only appear inside a string or-   comment, or otherwise at the end of a statement, so add some code-   to jump to the next end of statement looking ';' and continue to-   parse to end of file in an attempt to catch at least some further-   syntax errors--improve tests:-identify each bit of syntax and make sure there is a test for it-add some bigger tests: lots of sql statements, big functions-look for possible corner cases and add tests--get property checker working again - one problem is that the pretty-   printer will reject some asts (which the parser cannot-   produce), and the parser will probably reject some invalid sql that-   the pretty printer will happily produce from some asts.--ability to write new lint checks, and choose which lint checks to use-   on a per project basis.--plpgsql on 'roids:-write libraries in haskell, and then write syntax extensions for-   plpgsql using the extension mechanism to access these libs from-   extended plpgsql e.g. ui lib written in haskell, accessed by syntax-   extensions in plpgsql then can write the database and ui all in the-   same source code in the same language, with first class support for-   properly typed relation valued expressions, avoiding multiple-   languages and mapping/'impedance mismatch' between database types-   and types in the language you write the ui in.
− changelog
@@ -1,42 +0,0 @@-environment--New environment data type with abstracted implementation, can now-process ddl in a script and type check against it. Some work on-variable scoping, and annotations. New commands: annotateSource (adds-some annotations for statements into the original source code as-comments), and checksource, which outputs type errors in emacs-friendly format.--annotated tree--The API and type checking code has had a major overhaul, now uses-annotations inline in the ast, has rudimentary haddock documentation,-and the API is starting to take shape. No significant progress on-actual parsing or typechecking since last release.--secondtypechecking--typechecks a fair amount of select statements, and does some type-checking of insert, update, delete and create statements. It can also-take a sql file and parse, type check, and spit it back out with type-checking information interspersed with the statements (but with the-formatting mangled and the comments stripped).---earlytypechecking--hasn't fixed the error messages, but can now type check some select-statements, it includes a command to read a sql file in, type check it-against a database, then pretty print the ast interspersed with the-inferred types of each statement in comments.---lexing--parses with a separate lexer, unfortunately the error messages have-gone wrong.---prealpha1--parses without a separate lexer and gives ok error messages
− development
@@ -1,126 +0,0 @@-Some brief notes on developing with this code.--The project comes with a working cabal file.--UUAGC is used in the type checking, there are some links at the top of-AstInternal.ag for more information.--The code uses a few GHC extensions, I don't know if they are-conservative extensions or not.--Two of the files are generated:--DefaultTemplate1Environment.hs -> generated using- ./HsSqlSystem.lhs readenv template1 > something && cp something ...- You shouldn't need to regenerate this file unless you change the- Environment data type.--AstInternal.hs -> this is generated from AstInternal.ag and- Typechecking.ag using uuagc, see AstInternal.ag for the exact- arguments to use.--If you are editing either of these generated files directly you're-probably doing something wrong.--See the file 'usage' which documents a bunch of utility functions you-can run from the command line, you can look and HsSqlSystem.lhs source-for some example usage.--There are rudimentary test for a lot of the functionality, see-ParserTests.lhs and AstCheckTests.lhs (for type checking). These-contain some small examples of how the code can be used. The-HsSqlSystem.lhs file contains a few more examples.--Source file overview:--Executables:--HsSqlSystem.lhs--program to expose some functionality on the command line, mainly-utilities to help with developing the source. Run './HsSqlSystem.lhs-help' to list the commands.--HsSqlPppTests.lhs--small file to pull together the tests from other test suites, and make-them into an executable.--Main code files:--The main parsing code is in Database/HsSqlPpp/Parsing/Lexer.lhs and-Database/HsSqlPpp/Parsing/Parser.lhs--The main pretty printing code is in-Database/HsSqlPpp/PrettyPrinter/PrettyPrinter.lhs and there is also-some code to insert types, etc. into the original source in-Database/HsSqlPpp/PrettyPrinter/AnnotateSource.lhs--The main ast and typechecking code is in the following files:-attribute grammar files:-Database/HsSqlPpp/AstInternals/AstInternal.ag contains the ast nodes-Database/HsSqlPpp/AstInternals/TypeChecking.ag contains the ATTR and SEM code-for type checking-These are supplemented by a bunch of helper modules:--Database/HsSqlPpp/AstInternals/TypeConversion.lhs - contains the code-which handles the implicit type cast resolution (these are postgresql-algorithms used to lookup function calls, work out the types of result-sets and check assignments).--Database/HsSqlPpp/AstInternals/TypeCheckingH.lhs - contains some code-which has been moved out of TypeChecking.ag for ease of development--Database/HsSqlPpp/AstInternals/AstAnnotation.lhs - contains the data-types and a few helper functions for the annotation data types.--Database/HsSqlPpp/AstInternals/TypeType.lhs - contains the data types-and a few helper functions for postgresql types, and also type errors.--Database/HsSqlPpp/AstInternals/AstUtils.lhs - contains some error handling utils--Database/HsSqlPpp/AstInternals/AnnotationUtils.lhs - contains some-additional annotation functions which depend on the ast nodes--the code to track environment changes during type checking-(e.g. catalog changes, variables/bindings) is in the following two files:-Database/HsSqlPpp/AstInternals/EnvironmentInternal.lhs - the main code-to create, update and use environments.-Database/HsSqlPpp/AstInternals/EnvironmentReader.lhs - code to read a-catalog from a database and produce an environment value.-Database/HsSqlPpp/AstInternals/DefaultTemplate1Environment.lhs - this-is a copy of the default template1 database environment--The code under Database/HsSqlPpp/AstInternals/ is hidden behind the-public modules in Database/HsSqlPpp/Ast/:-Database/HsSqlPpp/Ast/Annotator.lhs-Database/HsSqlPpp/Ast/Ast.lhs-Database/HsSqlPpp/Ast/Environment.lhs-Database/HsSqlPpp/Ast/Annotation.lhs-These pretty much just forward exports, and add a bit of haddock-organisation.--The hunit tests are in:-Database/HsSqlPpp/Tests/AstCheckTests.lhs-Database/HsSqlPpp/Tests/ParserTests.lhs-and also this file which isn't really used yet:-Database/HsSqlPpp/Tests/DatabaseLoaderTests.lhs--There are a few utilities to access databases in-Database/HsSqlPpp/Dbms/, this code is very sketchy.--These files all have (hopefully) useful comments, although many of-these haven't been kept up to date.--The error handling in the type-checking code is in flux so quite a lot of the code there is a bit of-a mess unfortunately (I'm still not sure what the best way to do this is.).-- Also, some of the annotation functions use SYB which I'm a bit crap-with so that code is also a bit of a mess.--The test coverage isn't really great, but it's not bad (this will be-fixed at some point).--The bits which I hope aren't too bad are the ast node data types, the-parser code, and the environment code.
+ docs/Introduction.txt view
@@ -0,0 +1,154 @@+# Introduction++This is a short guide to what hssqlsystem can do.++## Expression types++<%Command HsSqlSystem typecheckexpression '"2+2"'%>++<%Command HsSqlSystem typecheckexpression '"2+'3'"'%>++<%Command HsSqlSystem typecheckexpression '"2||'3'"'%>++<%Command HsSqlSystem typecheckexpression '"2+a"'%>++<%Command HsSqlSystem typecheckexpression '"noexist(2)"'%>++<%Command HsSqlSystem typecheckexpression '"'dsf'||'sadfsdf'"'%>++<%Command File SelectExpression.sql+(select attname as attribute_name,+       typname as type_name,+       relname as relvar_name+  from pg_attribute inner join pg_class on (attrelid = pg_class.oid)+  inner join pg_type on (atttypid = pg_type.oid)+  inner join (select relname as relvar_name from pg_class where relnamespace =+    (select oid from pg_namespace where nspname = 'public')+    and relkind = 'r') base_relvars on (relname = base_relvars.relvar_name)+  where attnum >= 1)+%>++ ;++<%Command HsSqlSystem typecheckexpression SelectExpression.sql%>++this shouldn't be hint: this needs different command as wrapper+to say it's wrapped in wrapET++<%Command File Select1.sql+select attname as attribute_name,+       typname as type_name,+       relname as relvar_name+  from pg_attribute inner join pg_class on (attrelid = pg_class.oid)+  inner join pg_type on (atttypid = pg_type.oid)+  inner join (select relname as relvar_name from pg_class where relnamespace =+    (select oid from pg_namespace where nspname = 'public')+    and relkind = 'r') base_relvars on (relname = base_relvars.relvar_name)+  where attnum >= 1;+%>++<%Command HsSqlSystem annotatesource -f=Select1.sql%>+++: annotate source+aast+ppp++dig some big examples out of chaos++then with errors++## catalog info++<%Command File suppliers_and_parts_ddl.sql+create table s (+       s_no int primary key,+       sname text not null,+       status int not null,+       city text not null+);++create table p (+       p_po int primary key,+       pname text not null,+       color text not null,+       weight int not null,+       city text not null+);++create table sp (+       s_no int not null references s,+       p_no int not null references p,+       qty int not null,+       primary key (s_no,p_no)+);%>++<%Command HsSqlSystem ppcatalog -d=template1 suppliers_and_parts_ddl.sql%>++show catalog++compare catalogs++# extensions++demonstrate create_var extension+++ haskell source?++# stuff to write which will look good here:++function match resolution annotation++better pretty printer for type errors++better pretty printer for annotations++better pretty printer for catalog updates++typechecking ? strings+++reference for commands in hssqlppp with examples for each+++add sql files for suppliers and parts database?++----++more referency section with each command, a description, plus example+usage of each, and examples of all the options, and how to use a+config file++++# ??literatize this file some more:++embed these notes into HsSqlSystem.lhs then provide two documentation+processes, one to htmlize without the source as a command line users+guide, and to htmlize the entire file as a programmers guide: extend+this to commands.lhs as the start of a tutorial/ guide for someone+using this as a library.++-> then the system will allow conversion of HsSqlSystem.lhs to html+   for:+end user guide: how to use the program+library user guide: includes source as example code for haskell programmers+haddock generated documentation+and also to produce an executable.++-> need some way to mark which bits are excluded from the end user guide+   need to be able to pandoc-up the file with syntax highlighting also+   need to have some system to preprocess the file to run embedded+   commands and feed the output into the file before it is+   pandoc'd/syntax highlighted.+++~~~~~~~~{.sql}+(select attname as attribute_name,+       typname as type_name,+       relname as relvar_name+  from pg_attribute inner join pg_class on (attrelid = pg_class.oid)+  inner join pg_type on (atttypid = pg_type.oid)+  inner join base_relvars on (relname = base_relvars.relvar_name)+  where attnum >= 1)+~~~~~~~~
+ docs/TODO view
@@ -0,0 +1,670 @@+= new immediate todos:++get typing working for wrapper generator demo -> release+then in some order:+- docs and examples - some basics+- roundtrip + report+  start with users sql: either source files, a database or mixture+  say if parse ok, -> source files or pg_dumps+  list type errors from typechecking asts+  pretty print the catalog from sql source or dumps from typechecking+  check this catalog against pg catalog+  also, rename environment type at least+- nullability plus support in wrapper generator+then maybe:+  full api review, renames, error handling work, plus sqltypes review+++= milestones+not in any particular order++== type check for implicit join: need brain to work on++== use better database config+command line args and config file for db, username and password, and+   add prompt style so works like psql+== separate out documentation program to separate package+-> how to do plugins for extra commands?++== documentation work+reorganise doc files (changelog, development, questions, README, TODO,+   usage, introduction, etc.)+do test/example doc stuff for parsing and typechecking+parse transform pretty print example: basics of approach in chaos - do+   some notes on how this can be improved+hssqlsystem commands reference+== tidy files, comment work+particularly ag files, redo comments, review all code for crufty bits+check todos at top of files: move to bottom+== nullability+== example code gen for typesafe access+== api review+tidyups, renames - rename everything pending, review public api+   function names (particularly environment->catalog, and+   localidentifierbindings to localenvironment)+   get rid of inconsistent suffixes in hssqlsystem and command components+== error handling work+  remove all calls to error+  try to catch all places where errors are being ignored (mainly in+   the type checking: add these errors to the aast)+== roundtrip tests -> report+== get chaos stuff working again+get chaos sql loading via hssqlppp again so can run roundtrip tests on+== module system, show used catalog+== better pretty printers for annotation types+== extensions code tidy?+== annotation generics style+== non sql syntax extensions work+== catalog ish: triggers, sequences, constraints, index, defaults+== haddock work+== do makefile type thing for development and deployment of db projects++maybe these:+builddocs work+hssqlsystem commands+  better cat diff+  show used catalog+finish intro docs+haskell intro docs+other docs+haddock in command components+testbattery+extensions - tidy code+annotation generics: tidy code+pretty printer for annotation+ppshow less newlines+better syntax for extensions+modules extension + public/private+syntax extension with non sql syntax using preprocessor?+multiline strings with string type e.g. sql+some sort of report mode to parse, typecheck and roundtrip some sql,+   and report back what works and what doesn't+work on parse errors++long term todos+milestones for next release+todo for chaos (extensions, etc.)+divide todo categories+  investigation, end user docs, internal docs, hygiene/maintenance,+  testing, new functionality, bug fixes+docs: motivation/genesis, history?, high level criteria for 0.1+think about dependencies: make hdbc/pg dependency a flag?, split out+   exes and tests somehow?++++= documentation todo++write command processor thingy for builddocs+add extra commands to hssqlsystem for intro+finish intro+add haskell intro which uses the commandcomponents instead+other documentation files:+  reference for hssqlsystem+  hssqlsystem reference is generated from hssqlsystem.lhs:+    inside this file is the reference information for each+    command, plus example usage, so these appear next to the actual+    source. then when building docs, filter this file first to leave+    only the reference docs, then commandize and pandoc it+  installation guide++do haddock for commandcomponents so it has examples and stuff+++= New functionality++get checkbig mostly working: not trying to get no type errors or+   differences, but to get all the different aspects of the tests+   written and running so can see from the output what remains to be+   fixed+   main issues:+   databaseloader isn't working on the chaos sql files anymore, I+   think this is an issue with the pretty printer producing invalid+   sql+   finish extensions: for the tests to mostly work, need to flesh out+   the current extension implementations which are mainly stubs+   add missing items to catalog: triggers, sequences, constraints,+   indexes, defaults++= Amending existing functionality++add dbms database name, username and password support+review holes:+   round off parsing support for sql - make a list of what+     needs to be added+   should try to get as much typechecking working on what parses as+     possible+   work on organising the type checking tests, and make the tests much+     more comprehensive++= Housecleaning++rename Environment type to Catalog+change type annotation from Type to either typecheckfailed Type so can+   use monad style to propagate typecheckfaileds+work on error handling: try to add a lot better error reporting:+   a few errors are being ignored rather than added to the aast, also+   try to change all the calls to error into eithers to be added to+   the aast+review commands in hssqlppp: mainly review names and arguments for+   consistency (i.e. make sure every command accepts first a+   databasename and then a list of sql files where this makes sense),+   also redo annotate source so it can be run multiple times on the+   same source, and run to update the annotation comments when the+   source is changed. Maybe think about better error reporting?+tidy up code, refactor and add lots of comments, particularly in the+   ag files++= Documentation++work on haddock documentation+find way to do nice html example documentation: short+   intro/tour/tutorial to give people a flavour of what the+   hssqlsystem exe can do+want to be able to show what the code can do easily and debug+   annotations - so do a pretty printer which works the following way:+   output source code on left side of a table (with syntax+   highlighting, hyperlinks, etc? - use html?) and on the right output+   the interesting annotations pretty printed, draw lines from the+   pretty printed annotations to the sourcepositions in the source on+   the left. Looks like might be able to do this using gtk:+   http://www.bravegnu.org/gtktext/x498.html - maybe convert to png to+   allow viewing in a web browser+++= other issues to maybe fix:+check associativity of combine selects and join trefs without parens -+   write tests using pg_dump output+ids in joins issue+redo order by parsing/ast to add direction to each element+write some notes on hacking: source overview rewrite, file overview+   rewrites, and rough howto on adding new constructs: altering+   parser, altering ast and altering type checking process+typecheck old and new pseudo records in trigger functions+explore creating template syntax for simple expansions of function+   calls to make writing some extensions easier+makefile stuff?+plpgsql stuff: blocks, assignments in declarations, strict into,+   labels,loops,continue+look into running test suite from cabal+todo for checkbig:+get initial catalog tests passing:+  still some extra table triggers: think it may that foreign keys that+   pg supports directly and primary keys don't add a table trigger+  name/text result set resolution issue+  uniquify constraint names support+  trim constraint names support+  distance function return type issue+  plpgsql language functions+++support multiple files in annotate source and check source+match pgdump output for adding explicit parens e.g. in select unions+   and table refs, add tests for associativity in the absence of+   parens+tidy up code and docs as usual - lots of work needed on type checking+   code+redo catalog stuff (see below)+find some way to produce documentation: want motivation, examples,+   etc. in nice html+get chaos pgdump output parsing and partially type checking, todo:+  two parsing issues: not not, and count(distinct *)+  type checking issues exposed:+    old,new in trigger functions++old todoage:++================================================================================++== 2nd next release+fix catalog type, lots of work to make more robust:+  rename environment to catalog+  better pretty printer for catalog, and for bindings+  add annotations to catalog, so can see where bits came from+  do uniqueness testing e.g. disallow two tables with same name, two+   attributes with same name, etc.+fix tests using new catalog approach: don't want to have tests which+   use sql to alter catalog then use sql to test the catalog changes+   have been made - use separate tests (more unit-y tests)++=== types and internal errors handling++move type check failed to left of either, make node types an either+when there is a type error, add that as separate annotation, and add+type as left typecheckfailed. This way can use the haskell type system+to check we are chaining type check failed properly.+look at all the places where type lists are wrapped in+   unnamedcomposite and get rid of most of them - just use the type+   list directly.+Look at all the contexts where pg types can be used, and split into+   separate haskell types, and use sums to put them back together+   to use the haskell type system better e.g. different set of types+   can be used for an attribute in a table, for a function parameter,+   function return type, variable declaration, etc. - want to use the+   haskell type system to enforce this and get rid of a load of+   runtime checks (mainly the unwrap setof, etc. in typetype).++make sure errors aren't ignored, lots of places where this currently+   happens, e.g. updating environment - these errors need to end up in+   the ast. Get all the env functions to return eithers, and stick+   errors from these in the ast. Convert error calls to either return+   type and stick these errors in the ast.++=== parse/typecheck errors to user++pretty printers for type check failed, work on error messages from parsing+investigate alternative parser libs which can e.g. continue parsing+   after an error to provide more parse errors at once.+write a show for parsec errors which formats the lex tokens and+   expected lists properly (was broken when moved to the separate+   lexer)++================================================================================++== other soon todos++not sure which ones should be done before 0.1 release. rough guide is+   0.1 release should be something that regular sql programmers can+   try out/use without being overwhelmed with half finished/ missing+   bits, and actually see something useful.++=== schemas++think of a way to handle schemas, what about changes to schema search+   path mid code.++=== catalog and bindings annotation++want to add the catalog and current catalog to the annotations, so+   e.g. we can pretty print what exact updates are made to the catalog+   from a ddl statement+Add the current bindings as annotation everywhere, this can be used by+   the ambiguous identifier checks, etc., and to understand errors+also: add annotations to the catalog so we can see where an entity in+   the catalog has come from, what update and what source line+add similar to bindings, so each binding annotation contains a little+   explanation for where each binding has come from (e.g. identifier a+   with type b comes from this tref at source position x,y)++=== casting annotation++for each casting operation, add a log which explains what the relevant+   algorithm has done to either find the appropriate cast or what it's+   considered before failing. (e.g. can provide a list of steps taken+   with the candidate lists in the findcallmatch routine, might be+   useful for errors when it can't find a match, and if it is calling+   an unexpected function instead of the one you want).+add the prototype of the function actually matched at each funcall+   site++=== definition annotations+add sourcepos/reference to definition where each item is referenced+   (table, function, view, identifier binding, etc.)++=== documentation produce++=== null checking++null treatment+Basic motivation is to keep nulls carefully walled off, controlled,+   and be able to catch them when they sneak back into expressions,+   etc.. For each value, etc. we determine statically if it might be+   null. This can be done for return types of functions, fields in a+   select expression, etc.. (will do mappings e.g. if a functions+   inputs are all non null, then the output is non null, etc.). Once+   this is working ok, the second stage is to implement the anti null+   warnings/ errors.+Allow nulls in tables, outer joins, in coalesce, to be produced by+   selects (maybe add or remove from this allowed list, maybe make it+   configurable on a per project basis).+Never allow nulls to be an argument to a function call, (including+   ops, keyword ops, etc.). So every time you have a field being used+   in an expression and it cannot be statically verified to be non+   null, you have to insert a coalesce or fix it in some other way.+So nulls can still be used to represent optional values, n/a,+   etc.. and output to clients doing selects, but there is no need to+   grapple with:+* 3vl (or whatever it is that sql uses instead),+* what the result of a function call is if the some or all the+  arguments are null,+* what the result of a sum aggregate is if some of the values are null,+* etc.,+because none of these things are allowed.++=== do sql support todo++fill in the main gaps, some notes below+want to cover '90% of regularly used sql', no attempt for v0.1 to be+   comprehensive or nearly comprehensive++=== shadowed identifier test++use the bindings annotation to add warnings++=== modules extension++stage 1: set the current module with a function call+do creating the module and adding objects to the current module using+   extension instead of the sql functions used at the moment+find a way to annotate the source with modules stuff, want to use it+   for documentation+stage 2: add import/export stuff and check this++=== other extensions for chaos+mark generated code with annotation: make annotation types open with type+   class or something? - can get rid of typeerrora, statementinfoa+   wrappers this way+check for all ddl, etc. run in functions/executes and turn into+   extensions so the type checker can see these things+out of order definitions: want to write defs in any order and+   have the extension reorder them into something which can be loaded+   into postgres+finish create_var extension: add constraints+constraint system: make a bunch of stuff automatic, like using 'pg+   accelerators'+add notify triggers automatically, including for views+convert the sql tests (maybe some of the haskell tests) into static+   checks on the ast+find a better way to work with the tables with null fields:+  initial values - the copy statements are completely unreadable and+   uneditable+  what else?+crufty bits to try and simplify: turn sequence progression, action+   valid tables, ai+see if can make the multiple update hack more automatic+++=== development/deployment support:+build file for development, just lists sql files in order, and lists+   which extensions are used+deployment: use system to load all sql via extensions into pg, then+to a regular pg dump which can then be deployed.+++=== crufty bits to tidy+ag files constantly need fixing up for documentation and code clarity+syb stuff is a bit messy in astannotations (maybe use uniplate here to+   reduce dependencies?)+tidy the annotating functions in astinternals, implement then in terms+   of eachother+review local bindings use and decide how much logic to implement+   inside the local bindings module rather than eg. tablerefs.ag+want to stop having to write explicit backtrees everywhere. The key to+   fixing this is some way to read the existing annotation and supply+   an altered annotation within uuagc code+think about how doing multiple passes could help (e.g. star+   expansion).+think about where can use quickcheck+review when function bodies are typechecked - see if can do better+annotatesource function is a mess, also, make it overwrite it's own+   annotations instead of adding them so you can run it over a file+   multiple times.++=== testing+work on making the tests more comprehensive, want a test for each+   branch/option where feasible++=== write some automated tests for various roundtrips+add script to test chaos sql in various ways: parse roundtrip, load+   into database via psql and via hssqlppp comparison, and check+   catalog consistency++=== do way to produce aast from live database++use psql dump, and then can do type checks, lint checks, produce+   documentation++=== api+review/work on api and do haddock++=== prepare code for use by non haskell programmers + user docs+provide installation instructions+do usage documentation file, want to run code embedded in doc source+   and have results outputted to html output.++=== prepare code for use by haskell client programmers:+user docs as above for using the parser, the extension system, the+   annotator and annotations, examples for generating sql and writing+   extensions, etc.++=== ? place holder statements++=== precedence and operator parsing+add missing operators to parser+see if @ as prefix and infix just works in parsec+some a_expr and b_expr support properly by looking at pg grammar file+++---------+some new random notes++literal sql mode, with workspace idea: can write code/sql inline+in the source, and run it against a database and view the results+inline like in some text books where code is executed then the results+printed inline into the result - so this is a partial replacement for+   ghci, emacs haskell-mode ghci, psql, maybe bash, maybe ide, and+   also a runtime diagnosis tool which can be embedded into production+   exes. Pretty ambitious, need to focus on useful and easy features.++variant:+hssqlppp workspace: text view can type in commands and get results+   back, create multiple workspaces and they're persistent, maybe+   a wrapper round ghci but not conventional repl style, more like+   entering elisp and evaluating it in emacs? want to use+   as replacement for the ghci thing in emacs, and as a shell for working with+   the ast stuff and actual databases++use template haskell to simplify generics in extensions: cases and+   replacements are a bit verbose and difficult to write and read?+++= parse and/or type check todo list:+(rough/incomplete)+"identifier"+6.5e-5+type 'string' style type cast+[:] slice+missing keyword ops+default template1 operators should all parse+agg(all expr) agg(distinct expr), agg(*)+window frame clauses, named windows+parse inside string literals when cast, for common types+multidimensional arrays+default values+serial+make sure can type check everything that parses+constraint names+provide list of keys in info for create/alter table: include unique+   not null and serials+type check fks, and other constraints+alter table: add/remove column+                        constraint+                        default value+                        column type+                        rename column+                        rename table+what other alters/creates+views, functions, operators, types, domains, triggers, rules+selects:+implicit joins+group by, having + group by with unaggregated and aggregated fields+distinct, on+order by - do properly+limit, offset+with queries+type modifiers+data type names with spaces in them+timestamps+schemas+alternative text for true and false+enums+geometric types weird syntax+composites: selector variants, rowctors, component get/update+do all keyword and template1 operators+any/some/all subqueries and arrays+check over rowwise comparisons+indexes: create/alter/drop++another todo list:+catalog:+constraints, pg_constraint+triggers+rules+indexes+add drops for all creates+review which alters to add+default columns values + insert checking+support pks,fks better+support serial properly+type modifiers+sequences+enums+listen, notify, pg_listener+blocks in plpgsql, assignments in declarations, not null checking+strict in into+lables, loops, exit, continue+raise % counts+create schema++once all this is done, work on documenting precisely what is supported+   and what isn't.++================================================================================++example for generating sql code from haskell using the ast+get database loader and typesafe access generators good enough to use+   in chaos+example usage of each of these+look at the error message formatting, particularly try to fix the+   parser errors so they make more sense+add annotation field to most ast nodes, store type and source+   positioning in this field, fix parser to add lots of accurate+   positioning information when parsing.+make sure the lint process works on text dumps of databases.+try checking the sample databases: http://pgfoundry.org/projects/dbsamples/+++================================================================================++some syntax todo, not organised:++------------+add support for following sql syntax (+ type checking)+alter table, common variations+create index+create rule+create trigger++ drops for all creates++ maybe alters?+ctes+loop, exit, labels+easy ones: transactions, savepoints, listen+prepare, execute + using+some more:+create or replace+alter table+transactions: begin, checkpoint, commit, end, rollback+cursors: declare, open, fetch, move, close, where current of+copy - parse properly+create database+create index+create rule+create trigger + plpgsql support+grant,revoke+listen, notify, unlisten+prepare, execute+savepoint, release savepoint, rollback to savepoint+set, reset+set constraints+set role+set transaction+correlated subquery attrs++plpgsql++blocks which aren't at the top level of a function+% types+strict on intos+not null for var defs+exception+execute using+get diagnostics+return query execute+raise missing bits+out params+elsif+loop+exit+labels+reverse, by in for+for in execute++expressions:+process string escapes, support dollar quoting and other quoting more+   robustly in the pretty printer+full user operator support (?)+fix expression parser properly to handle things like between - see+   grammar in pg source for info on how to do this+[:] array slices+aggregate: all and distinct+multi dimensional arrays: selectors and subscripting+missing keyword operators+datetime extract+time zone+subquery operators: any, some, all+in general, parsing operators is wrong, the lexer needs to be able to+   lex sequences of symbols into single/multiple operators correctly,+   what happens at the moment is a kludge, also, general operator+   parsing will change how operators are represented in the ast++================================================================================++some other random ideas:++more tests:+   add parse and type check roundtrips automated tests for chaos sql+   add parse check which parses a single statement, then loads it into+   pg, pg_dumps it, then parses the output to see if it is the same:+   since pg sticks plenty of parens in, this should test the+   associativity and precedence. pg also rewrites some of the sql so+   will have to match that++parser, converter and pretty printer for explain output, want to view+   how a query is executed in human readable pseudocode. Add lint type+   checks, etc. to this, which can suggest ways to rewrite the query+   to get better performance. Another idea is to make the dependencies+   on the values in the tables more explicit, so you can see how much+   the data can change before another plan is chosen, or you can see a+   bad assumption about the kind of data the query will be run on.++incorporate pg regression test sql into parsing and type checking+   tests - can run the roundtrip tests on them, check the+   documentation generator, etc.++redo cabal file to add compile time options: exes, pg support, tests+ or split into separate packages?++work on error reporting, add tests for malformed sql, already some+   tests and plan for more for sql which fails type checks.++want to report multiple parse errors, perhaps can bodge this because+   of the property that ';' can only appear inside a string or+   comment, or otherwise at the end of a statement, so add some code+   to jump to the next end of statement looking ';' and continue to+   parse to end of file in an attempt to catch at least some further+   syntax errors++get property checker working again - one problem is that the pretty+   printer will reject some asts (which the parser cannot+   produce), and the parser will probably reject some invalid sql that+   the pretty printer will happily produce from some asts.++plpgsql on 'roids:+write libraries in haskell, and then write syntax extensions for+   plpgsql using the extension mechanism to access these libs from+   extended plpgsql e.g. ui lib written in haskell, accessed by syntax+   extensions in plpgsql then can write the database and ui all in the+   same source code in the same language, with first class support for+   properly typed relation valued expressions, avoiding multiple+   languages and mapping/'impedance mismatch' between database types+   and types in the language you write the ui in.
+ docs/changelog view
@@ -0,0 +1,60 @@+cleaning++typechecking support for a few more contexts for expressions (e.g. on+expressions in joins, check expressions, wheres in updates and+deletes, etc.)+type checking support for a few more statement types+work on implicit casts+improvements to checksource command+prototype idea for extension system+hack to improve typechecking of function bodies - they are now type+checked after the whole rest of the file+lots of work on catalog typechecking++main internal changes:+lots of refactoring+heavy rearrangement of ag code, it's not a complete mess anymore+split local binding code from catalog code++environment++New environment data type with abstracted implementation, can now+process ddl in a script and type check against it. Some work on+variable scoping, and annotations. New commands: annotateSource (adds+some annotations for statements into the original source code as+comments), and checksource, which outputs type errors in emacs+friendly format.++annotated tree++The API and type checking code has had a major overhaul, now uses+annotations inline in the ast, has rudimentary haddock documentation,+and the API is starting to take shape. No significant progress on+actual parsing or typechecking since last release.++secondtypechecking++typechecks a fair amount of select statements, and does some type+checking of insert, update, delete and create statements. It can also+take a sql file and parse, type check, and spit it back out with type+checking information interspersed with the statements (but with the+formatting mangled and the comments stripped).+++earlytypechecking++hasn't fixed the error messages, but can now type check some select+statements, it includes a command to read a sql file in, type check it+against a database, then pretty print the ast interspersed with the+inferred types of each statement in comments.+++lexing++parses with a separate lexer, unfortunately the error messages have+gone wrong.+++prealpha1++parses without a separate lexer and gives ok error messages
+ docs/development view
@@ -0,0 +1,150 @@+Some brief notes on developing with this code.++UUAGC is used in the type checking, there are some links at the top of+AstInternal.ag for more information.++The code uses a few GHC extensions, I don't know if they are+conservative extensions or not, see the cabal file and grep to find+out the current list.++Two of the files are generated:++DefaultTemplate1Environment.hs -> generated using+ ./HsSqlSystem.lhs readenv template1 > something && cp something ...+ You shouldn't need to regenerate this file unless you change the+ Environment data type.++AstInternal.hs -> this is generated from AstInternal.ag and+ Typechecking.ag using uuagc, see AstInternal.ag for the exact+ arguments to use.++If you are editing either of these generated files directly you're+probably doing something wrong.++See the file 'usage' which documents a bunch of utility functions you+can run from the command line, you can look and HsSqlSystem.lhs source+for some example usage.++There are rudimentary test for a lot of the functionality, see+ParserTests.lhs and AstCheckTests.lhs (for type checking). These+contain some small examples of how the code can be used. The+HsSqlSystem.lhs file contains a few more examples.++Source file overview:++HsSqlSystem.lhs++Main executable to provide command line access to library functions,+mainly utilities to help with developing the source. Run+'./HsSqlSystem.lhs help' to list the commands. You can run the+automated tests using './HsSqlSystem.lhs test'.++All the other source code is under Database/HsSqlSystem/++Database/HsSqlPpp/Utils.lhs contains some small utility functions.++The main folders under Database/HsSqlPpp are:++Ast: public modules which forward parts of the internal ast and+typechecking code++AstInternals: private modules for ast, annotations, typechecking, etc.+  also contains all the .ag files.++Commands: ErrorT wrappers for many library functions, used heavily in+HsSqlSystem.lhs++Dbms: Some rudimentary and half baked code to access databases.++Extensions: expermental code for a syntax extension system for plpgsql++HsText: code to help producing documentation: will process a text+file, extract commands, run them, and interpolate the output into the+text.++Parsing: the parsing code++PrettyPrinter: pretty printing code++Tests: hunit tests+++Main code files:++The main parsing code is in Database/HsSqlPpp/Parsing/Lexer.lhs and+Database/HsSqlPpp/Parsing/Parser.lhs++The main pretty printing code is in+Database/HsSqlPpp/PrettyPrinter/PrettyPrinter.lhs and there is also+some code to insert types, etc. into the original source in+Database/HsSqlPpp/PrettyPrinter/AnnotateSource.lhs++The main ast and typechecking code is in the following files:++attribute grammar files:+Database/HsSqlPpp/AstInternals/AstInternal.ag contains the ast nodes+Database/HsSqlPpp/AstInternals/Typechecking/ contains the ATTR and SEM code+for type checking+These are supplemented by a bunch of helper modules:++Database/HsSqlPpp/AstInternals/TypeConversion.lhs - contains the code+which handles the implicit type cast resolution (these are postgresql+algorithms used to lookup function calls, work out the types of result+sets and check assignments).++Database/HsSqlPpp/AstInternals/TypeCheckingH.lhs - contains some code+which has been moved out of TypeChecking.ag for ease of development++Database/HsSqlPpp/AstInternals/AstAnnotation.lhs - contains the data+types and a few helper functions for the annotation data types.++Database/HsSqlPpp/AstInternals/TypeType.lhs - contains the data types+and a few helper functions for postgresql types, and also type errors.++Database/HsSqlPpp/AstInternals/AstUtils.lhs - contains some error handling utils++Database/HsSqlPpp/AstInternals/AnnotationUtils.lhs - contains some+additional annotation functions which depend on the ast nodes++the code to track environment changes during type checking+(e.g. catalog changes, variables/bindings) is in the following two files:+Database/HsSqlPpp/AstInternals/EnvironmentInternal.lhs - the main code+to create, update and use environments.+Database/HsSqlPpp/AstInternals/EnvironmentReader.lhs - code to read a+catalog from a database and produce an environment value.+Database/HsSqlPpp/AstInternals/DefaultTemplate1Environment.lhs - this+is a copy of the default template1 database environment++The code under Database/HsSqlPpp/AstInternals/ is hidden behind the+public modules in Database/HsSqlPpp/Ast/:+Database/HsSqlPpp/Ast/Annotator.lhs+Database/HsSqlPpp/Ast/Ast.lhs+Database/HsSqlPpp/Ast/Environment.lhs+Database/HsSqlPpp/Ast/Annotation.lhs+These pretty much just forward exports, and add a bit of haddock+organisation.++The hunit tests are in:+Database/HsSqlPpp/Tests/AstCheckTests.lhs+Database/HsSqlPpp/Tests/ParserTests.lhs+and also this file which isn't really used yet:+Database/HsSqlPpp/Tests/DatabaseLoaderTests.lhs++There are a few utilities to access databases in+Database/HsSqlPpp/Dbms/, this code is very sketchy.++These files all have (hopefully) useful comments, although many of+these haven't been kept up to date.++The error handling in the type checking code is in flux so quite a lot+of the code there is a bit of a mess unfortunately (I'm still not sure+what the best way to do this is.).++Also, some of the annotation functions use SYB which I'm a bit crap+with so that code is also a bit of a mess.++The test coverage isn't really great, but it's not bad (this will be+fixed at some point).++The bits which I hope aren't too bad are the ast node data types, the+parser code, and the catalog code.
+ docs/recordtests.sql view
@@ -0,0 +1,370 @@+/*++record tests: try to find out exactly how records work+run a bunch of functions and check the results++run this file by loading psql then issuing \i recordtests.sql++the output from doing this has been manually pasted into this file in+comments++start with something to help understand the psql output++*/+create or replace function doingfn(fn text) returns void as $$+begin+  raise notice '\n===================================================\nFUNCTION: %\n-------------------------------------------',fn;+end;+$$ language plpgsql;++++select doingfn('t1');++create or replace function t1() returns void as $$+declare+  r record;+  t pg_attrdef;+begin+  select into r * from pg_attrdef;+  t := r;+  raise notice 'r: %',r;+  raise notice 't: %',t;+end;+$$ language plpgsql;++select t1();++/*+result from this select is:+*************************+psql:recordtests.sql:20: NOTICE:  r: (258241,3,"{FUNCEXPR :funcid 480 :funcresulttype 23 :funcretset false :funcformat 2 :args ({FUNCEXPR :funcid 1574 :funcresulttype 20 :funcretset false :funcformat 0 :args ({CONST :consttype 2205 :consttypmod -1 :constlen 4 :constbyval true :constisnull false :location -1 :constvalue 4 [ -65 -16 3 0 ]}) :location -1}) :location -1}","nextval('modules_module_order_seq'::regclass)")+psql:recordtests.sql:20: NOTICE:  t: (258241,3,"{FUNCEXPR :funcid 480 :funcresulttype 23 :funcretset false :funcformat 2 :args ({FUNCEXPR :funcid 1574 :funcresulttype 20 :funcretset false :funcformat 0 :args ({CONST :consttype 2205 :consttypmod -1 :constlen 4 :constbyval true :constisnull false :location -1 :constvalue 4 [ -65 -16 3 0 ]}) :location -1}) :location -1}","nextval('modules_module_order_seq'::regclass)")+ t1 +----+ +(1 row)+*************************++the output is a list of values, looks like each has a type but we+don't get any field names, will investigate the field name aspects+below++The output from t and r are exactly the same - looks like the record+is pointing to exactly the same type of value that the composite variable is.++*/++-- test two: build a record out of bits and then try to assign to a composite+select doingfn('t2');++create or replace function t2() returns void as $$+declare+  r record;+  t pg_attrdef;+begin+  r.adrelid := 1;+  --r.adnum := 2;+  --r.adbin = 'adbinval';+  --r.adsrc = 'adsrcval';+  --raise notice 'r: %',t;+  --t := r;+  --raise notice 't: %',t;+end;+$$ language plpgsql;++select t2();+/*+psql:recordtests.sql:37: ERROR:  record "r" is not assigned yet+DETAIL:  The tuple structure of a not-yet-assigned record is indeterminate.+CONTEXT:  PL/pgSQL function "t1" line 5 at assignment++didn't know whether this would work or not, but this is only because I+didn't read the postgresql manual properly, it's noted in+38.3.4. Record Types++*/++-- test three - assign to record from row ctor+select doingfn('t3');++create or replace function t3() returns void as $$+declare+  r record;+  t pg_attrdef;+begin+  r := row(1,2,'adbinval','adsrcval');+  raise notice 'r: %',r;+  t := r;+  raise notice 't: %',t;+end;+$$ language plpgsql;++select t3();+/*+output is:+psql:recordtests.sql:105: NOTICE:  r: (,,,)+psql:recordtests.sql:105: NOTICE:  t: (1,2,adbinval,adsrcval)++so:+the assignment worked, but we can't see the fields with the row+constructor value in the record for some reason. This suggests the row+isn't the same type as the composite or even the same kind of type,+but it is compatible. Next check: see what happens when the row ctor+value types are in the wrong order.+*/++select doingfn('t4');++create or replace function t4() returns void as $$+declare+  r record;+  t pg_attrdef;+begin+  r := row('adbinval',1,2,'adsrcval');+  raise notice 'r: %',t;+  t := r;+  raise notice 't: %',t;+end;+$$ language plpgsql;++select t4();++/*+psql:recordtests.sql:143: NOTICE:  r: (,,,)+psql:recordtests.sql:143: ERROR:  invalid input syntax for type oid: "adbinval"+CONTEXT:  PL/pgSQL function "t4" line 7 at assignment++so this fails. So the the order of values counts. I think this would+mean our row ctor which assign succeeds above produces an anonymous+composite type with the structure:++(a:number,b:number,c:unknownstringlit,d:unknownstringlit)++where a,b,c,d are anonymous name placeholders, so we can't use them to+access the individual parts.++then we use the check assignment cast value one by one over the values to work out if the assign from the record to the composite type works.++next: check the number of fields behaviour+*/+++select doingfn('t5');++create or replace function t5() returns void as $$+declare+  r record;+  t pg_attrdef;+  b bool;+begin+  r := row(1,2,'adbinval','adsrcval', 3,null,true,'is this ignored?');+  raise notice 'r: %',t;+  t := r;+  raise notice 't: %',t;+  --todo: investigate equalities in same way as assignments+  b := row(1,2,'adbinval','adsrcval') = row(1,2,'adbinval','a1dsrcval');+  raise notice 'b: %',b;+end;+$$ language plpgsql;++select t5();++/*+psql:recordtests.sql:173: NOTICE:  r: (,,,)+psql:recordtests.sql:173: NOTICE:  t: (1,2,adbinval,adsrcval)++slightly disappointing - it works instead of giving an error, with the+extra fields ignored.++test composite variations on this - see if extra fields are ignored there too++Want to check if the field names are significant for named composite+types with non anonymous field names.+- check composite to composite assignment with+  same names and types+  different names same types+  same names and types but different order+  check if extra fields get ignored or cause error as with row values++*/++select doingfn('t6');+drop type if exists fake_pg_attrdef;+create type fake_pg_attrdef as (+  adrelid oid,+  adnum int2,+  adbin text,+  adsrc text+);++--just test a bunch of stuff which should definitely work as sanity check+create or replace function t6() returns void as $$+declare+  t pg_attrdef;+  u fake_pg_attrdef;+  r record;+begin+  u := (1,2,'adbinval','adsrcval');+  t := u;+  raise notice 'u: %',u;+  raise notice 't: %',t;+  r := u;+  t := r;+  raise notice 'u: %',r;+  raise notice 'r: %',r;+  raise notice 't: %',t;+end;+$$ language plpgsql;++select t6();++/*+works fine:+psql:recordtests.sql:220: NOTICE:  u: (1,2,adbinval,adsrcval)+psql:recordtests.sql:220: NOTICE:  t: (1,2,adbinval,adsrcval)+psql:recordtests.sql:220: NOTICE:  u: (1,2,adbinval,adsrcval)+psql:recordtests.sql:220: NOTICE:  r: (1,2,adbinval,adsrcval)+psql:recordtests.sql:220: NOTICE:  t: (1,2,adbinval,adsrcval)++check if field names are significant:+*/++select doingfn('t7');+drop type if exists fake_renamed_pg_attrdef;+create type fake_renamed_pg_attrdef as (+  a oid,+  b int2,+  c text,+  d text+);++create or replace function t7() returns void as $$+declare+  t pg_attrdef;+  u fake_renamed_pg_attrdef;+  r record;+begin+  u := (1,2,'adbinval','adsrcval');+  t := u;+  raise notice 'u: %',u;+  raise notice 't: %',t;+  r := u;+  t := r;+  raise notice 'u: %',r;+  raise notice 'r: %',r;+  raise notice 't: %',t;+end;+$$ language plpgsql;++select t7();++/*+works fine also:+psql:recordtests.sql:261: NOTICE:  u: (1,2,adbinval,adsrcval)+psql:recordtests.sql:261: NOTICE:  t: (1,2,adbinval,adsrcval)+psql:recordtests.sql:261: NOTICE:  u: (1,2,adbinval,adsrcval)+psql:recordtests.sql:261: NOTICE:  r: (1,2,adbinval,adsrcval)+psql:recordtests.sql:261: NOTICE:  t: (1,2,adbinval,adsrcval)++check field order is important:+*/++select doingfn('t8');+drop type if exists fake_renamed2_pg_attrdef;+create type fake_renamed2_pg_attrdef as (+  adnum int2,+  adbin text,+  adsrc text,+  adrelid oid+);++create or replace function t8() returns void as $$+declare+  t pg_attrdef;+  u fake_renamed2_pg_attrdef;+  r record;+begin+  u := (2,'adbinval','adsrcval',1);+  --t := u;+  raise notice 'u: %',u;+  raise notice 't: %',t;+  r := u;+  t := r;+  raise notice 'u: %',r;+  raise notice 'r: %',r;+  raise notice 't: %',t;+end;+$$ language plpgsql;++select t8();++/*+fails:+psql:recordtests.sql:300: ERROR:  invalid input syntax for integer: "adbinval"+also fails with same error earlier if you uncomment the commented out line+confirmation: pg is just looking at the types in order and ignoring+the names. This seems consistent with the rest of sql (e.g. unions)...++check extra fields+*/++select doingfn('t9');+drop type if exists fake_renamed3_pg_attrdef;+create type fake_renamed3_pg_attrdef as (+  adrelid oid,+  adnum int2,+  adbin text,+  adsrc text,+  hello text+);++create or replace function t9() returns void as $$+declare+  t pg_attrdef;+  u fake_renamed3_pg_attrdef;+  r record;+begin+  u := (1,2,'adbinval','adsrcval','test');+  r := u;+  t := r;+  raise notice 'u: %',r;+  raise notice 'r: %',r;+  raise notice 't: %',t;+end;+$$ language plpgsql;++select t9();+/*+yes, it works just like the row ctor. ignores the extra field+psql:recordtests.sql:340: NOTICE:  u: (1,2,adbinval,adsrcval,test)+psql:recordtests.sql:340: NOTICE:  r: (1,2,adbinval,adsrcval,test)+psql:recordtests.sql:340: NOTICE:  t: (1,2,adbinval,adsrcval)++check with missing fields:+*/++select doingfn('t10');+create or replace function t10() returns void as $$+declare+  t pg_attrdef;+  u fake_renamed3_pg_attrdef;+  r record;+begin+  u := (1,2,'adbinval');+  r := u;+  t := r;+  raise notice 'u: %',r;+  raise notice 'r: %',r;+  raise notice 't: %',t;+end;+$$ language plpgsql;++select t10();+/*+yep, works+psql:recordtests.sql:363: NOTICE:  u: (1,2,adbinval,,)+psql:recordtests.sql:363: NOTICE:  r: (1,2,adbinval,,)+psql:recordtests.sql:363: NOTICE:  t: (1,2,adbinval,)++*/
+ docs/status view
@@ -0,0 +1,87 @@+Rough notes on status, probably a bit out of date. You can also see the test files:++http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head%3A/Database/HsSqlPpp/Tests/ParserTests.lhs++and++http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head%3A/Database/HsSqlPpp/Tests/AstCheckTests.lhs++to see a load of examples of what type checks.++= Syntax supported/ not supported:++== Parsing++Partially supports:+select statements (selectlists (*, qualified, aliased/correlation names, expressions)+       distinct, basic window functions,+       from (with explicit joins - natural, inner, cross, left, right,+       full outer, on and using), aliases, from functions+       where, group by, having, order by, limit, offset+       except, intersect, union++expressions: subselects, in, row ctors, strings + dollar strings,+             integers, case, exists, boolean literals, null, arrays+             and subscripting (slightly limited), function calls,+             identifiers, cast(x as y), between (quite limited),+             substring(x from a for b)++also partially supports:+insert (with multiple values and select support), update, delete (all+three with returning)+create and drop table, type, view, domain+create function for sql and plpgsql functions+all constraint types+sort of skips copy statements instead of erroring++plpgsql statements:+        select into+        null+        continue+        perform+        execute+        assignment+        if+        return, return next, return query+        raise+        for (select and integer variants)+        while+        case statement++Many things are missing at the moment, in particular+  selects: cte, implicit joins+  joins in updates (delete from, update using)+  alter statements+  create and drop apart from table, view, domain, type, function+  transaction commands+  triggers and trigger functions+  loop statement, labels+  error trapping+  cursors+This is a non-exhaustive list.++Expression support is patchy, should work pretty well for a lot of+simple stuff though. There is a strong possibility that for some+complex selects and expressions, the implicit precedence (that is,+bits without enclosing parenthesis) may parse in the wrong+direction. Please let me know if you encounter such an error.++== Type checking++Type checking supports a good subset of expressions and select+statements that the parser parses, and has basic support for insert,+update, delete and the various create statements that the parser+supports. Development work is currently focused in this area.++= Other current downsides:++The design of the AST node types is pretty basic.++Not much work has been done on correctly rejecting invalid SQL+(although it does pretty well despite this) and not much thought has+been put into error messages and error reporting yet, this is slowly+improving, and at some point will become a major focus - I hope this+code will provide substantial benefits when developing in PL/pgSQL in+the future.++Only supports PostgreSQL SQL and PL/pgSQL.
+ docs/usage view
@@ -0,0 +1,145 @@+Here are some notes on what you can currently do with the code:++** This file is a bit out of date, you can run 'HsSqlSystem -?'  to+   get started **++= HsSqlSystem++Command line access to a number of functions is provided by+HsSqlSystem.lhs. You can list the commands using 'HsSqlSystem help',+and you can get the descriptions of what these commands do using+'HsSqlSystem help all'. (Assuming you have cabal installed the+software and have the cabal binary folder in your path.)++The commands which access postgresql probably won't work right on your+system, they are in a very early alpha state.++The most interesting commands are:+* parsefile+* roundtripfile, loadsql+* annotateSource+* checksource+++== parsefile++Pass in one or more filenames for files containing sql source, and the+program will attempt to parse, then pretty print and reparse to see if+the two asts are the same. This can be used to check the program can+successfully parse your sql, and if pretty printing then parsing the+result mangles it - lack of such mangling might give you slightly more+confidence that it has parsed ok.++== roundtripfile, loadsql++Similar to parse file, pass in a source filename and a target+filename, and the code with parse then pretty print the text. You can+then load the pretty printed code into a database and run your test+suite to see if the code made it through the parsing and pretty+printing process ok, or you can just eyeball the resultant+sql.++The related command is loadsql, which will attempt to parse one or+more files then pretty print them line by line, loading each line+straight into a database to help with testing. This may be a bit more+fragile than using roundtripfile.++Loading the roundtripped sql into a database then running tests on it+will hopefully can give a bit more confidence that the sql has been+parsed accurately.++== annotateSource++This command takes a filename, parses and type checks the file, and+then outputs a copy of the source with the main annotations attached+to the statements interspersed into the source in comments. This can+be used e.g. to view the attribute names and types of a view. After+some more work has been done on this command, it is intended that this+is expanded to provide lots of useful comments which are maintained in+your actual source and checked in to source control, etc..++== checksource++This command takes a set of files and type checks each one in turn+(later files can depend on definitions appearing in files earlier in+the file list). It outputs all the type errors found in Emacs friendly+format. This mostly just shows you all the bits that haven't been+implemented in the type checker yet. This is the early precursor to+the lint checking process.++Pretty printers and other work for the Annotation types are planned,+to make the annotateSource comments and error messages more readable.++== reasonably up to date output of './HsSqlSystem.lhs help all'++commands available+help+use 'help' to see a list of commands+use 'help all' to see a list of commands with descriptions+use 'help [command]' to see the description for that command++cleardb+hacky util to clear a database++loadsql+This takes one or more files with sql source text, parses them then+loads them into the database given.++clearandloadsql+cleardb then loadsql++lexfile+lex the file given and output the tokens on separate lines++parsefile+Routine to parse sql from a file, check that it appears to parse ok,+that pretty printing it and parsing that text gives the same ast, and+then displays the pretty printed version so you can see how well it's+done++roundtripfile+Used to test the parsing and pretty printing round trip. Takes two+arguments, a source filename and a target filename. If the target file+exists, it quits. Parses the source file then pretty prints it to the+target filename.++readenv+read the catalogs for the given db and dump a Environment value source+text to stdout++annotateSource+reads a file, parses, type checks, then outputs info on each statement+interspersed with the original source code++checksource+reads each file, parses, type checks, then outputs any type errors++================================================================================++= library usage++See the haddock docs to get a basic idea of using the libraries. The+source for HsSqlSystem.lhs might also be worth a look for some+examples. You should be able to view the haddock docs online on the+hackagedb page here:+http://hackage.haskell.org/package/hssqlppp++Quick notes:++to parse some sql use the parse functions in+Database.HsSqlPpp.Parsing.Parser: 'parseSql' to parse from a string,+'parseSqlFile' to parse from a file. This will give you an ast with+source position annotations. If you want to get rid of these+annotations, use 'Database.HsSqlPpp.Ast.Annotation.stripAnnotations'.+To typecheck and add other information to the ast, use+'Database.HsSqlPpp.Ast.TypeChecker.typeCheck'. You can read the+environment value from a database to check against that database, or+parse the ddl source along with your dml and concatenate them both to+pass to the typeCheck function.++================================================================================++= run the automated tests++To run the test suite run ./HsSqlSystem.lhs test. This will run the tests+for parsing and pretty printing, and for type checking.
hssqlppp.cabal view
@@ -1,8 +1,8 @@ Name:                hssqlppp-Version:             0.0.10+Version:             0.1.0 Synopsis:            Sql parser and type checker Description:-    Sql parser, pretty printer and type checker, targets PostGreSQL SQL+    Sql parser, pretty printer and type checker, targets PostgreSQL SQL     and PL/pgSQL, uses Parsec and UUAGC.     .     Overview:@@ -15,14 +15,13 @@     .     'AnnotateSource' for pretty printing annotations inline with original source;     .-    'Annotator' for annotating asts (this does the type checking);-    and working with annotated trees;+    'TypeChecker' for type checking and annotating asts and working+    with annotated trees;     .     'SqlTypes' for the data types which represent SQL types, the data     type for type errors, and some support functions;     .-    'Annotation' for the annotation data types and utilities, this-    also contains the data types for SQL types;+    'Annotation' for the annotation data types and utilities;     .     'Environment' to read a catalog from a database to type check against,     or to generate catalog information;@@ -32,12 +31,30 @@     without loading it via psql). The loader just about does the job     but error handling is a bit crap at the moment.     .-    Comes with a HUnit test suite which you can run using the-    HsSqlPppTests executable, and command line access to some+    'CommandComponents' for the component functions used in the HsSqlSystem+    exe.+    .+    'ChaosExtensions' for the experimental plpgsql syntax extensions.+    .+    Comes with command line access to some     functions via a exe called HsSqlSystem, run this file with no-    arguments to get some help. See the project page+    arguments to get some help. Has a HUnit test suite which you can+    run using the HsSqlSystem executable. for the time being you can+    look at the source of this command to see what it can do:+    .+    <http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head:/HsSqlSystem.lhs>+    .+    See the project page     <https://launchpad.net/hssqlppp> for more information and     documentation links.+    .+    The test files for parsing and for type checking contain examples+    of what parses/ typechecks and what the asts and annotations look+    like:+    .+    <http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head:/Database/HsSqlPpp/Tests/ParserTests.lhs>+    .+    <http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head:/Database/HsSqlPpp/Tests/TypeCheckTests.lhs>  License:             BSD3 License-file:        LICENSE@@ -52,44 +69,69 @@ category:            Database  extra-source-files:  README-                     TODO-                     development-                     questions-                     usage                      LICENSE-                     changelog+                     docs/changelog+                     docs/development+                     docs/Introduction.txt+                     docs/recordtests.sql+                     docs/status+                     docs/TODO+                     docs/usage                      sqltestfiles/system.sql                      sqltestfiles/server.sql                      sqltestfiles/client.sql                      --find Database/ -type f -a ! -iname '*.o' -a ! -iname '*.hi'                      Database/HsSqlPpp/Utils.lhs+                     Database/HsSqlPpp/Commands/CommandComponents.lhs                      Database/HsSqlPpp/Dbms/DBAccess.lhs                      Database/HsSqlPpp/Dbms/DatabaseLoader.lhs-                     Database/HsSqlPpp/AstInternals/DefaultTemplate1Environment.lhs-                     Database/HsSqlPpp/AstInternals/TypeCheckingH.lhs+                     Database/HsSqlPpp/Dbms/WrapLib.lhs+                     Database/HsSqlPpp/Dbms/WrapperGen.lhs+                     Database/HsSqlPpp/Extensions/ChaosExtensions.lhs                      Database/HsSqlPpp/AstInternals/AnnotationUtils.lhs-                     Database/HsSqlPpp/AstInternals/TypeConversion.lhs-                     Database/HsSqlPpp/AstInternals/TypeChecking.ag-                     Database/HsSqlPpp/AstInternals/EnvironmentReader.lhs-                     Database/HsSqlPpp/AstInternals/EnvironmentInternal.lhs                      Database/HsSqlPpp/AstInternals/AstAnnotation.lhs                      Database/HsSqlPpp/AstInternals/AstInternal.hs+                     Database/HsSqlPpp/AstInternals/Environment/DefaultTemplate1Environment.lhs+                     Database/HsSqlPpp/AstInternals/Environment/EnvironmentReader.lhs+                     Database/HsSqlPpp/AstInternals/Environment/EnvironmentInternal.lhs+                     Database/HsSqlPpp/AstInternals/Environment/LocalIdentifierBindings.lhs                      Database/HsSqlPpp/AstInternals/AstInternal.ag                      Database/HsSqlPpp/AstInternals/TypeType.lhs-                     Database/HsSqlPpp/AstInternals/AstUtils.lhs-                     Database/HsSqlPpp/Tests/AstCheckTests.lhs+                     Database/HsSqlPpp/AstInternals/TypeChecking/Dml.ag+                     Database/HsSqlPpp/AstInternals/TypeChecking/SelectStatement.ag+                     Database/HsSqlPpp/AstInternals/TypeChecking/TypeConversion.lhs+                     Database/HsSqlPpp/AstInternals/TypeChecking/TableRefs.ag+                     Database/HsSqlPpp/AstInternals/TypeChecking/Plpgsql.ag+                     Database/HsSqlPpp/AstInternals/TypeChecking/TypeChecking.ag+                     Database/HsSqlPpp/AstInternals/TypeChecking/Misc.ag+                     Database/HsSqlPpp/AstInternals/TypeChecking/ErrorUtils.lhs+                     Database/HsSqlPpp/AstInternals/TypeChecking/CreateTable.ag+                     Database/HsSqlPpp/AstInternals/TypeChecking/CreateFunction.ag+                     Database/HsSqlPpp/AstInternals/TypeChecking/Statements.ag+                     Database/HsSqlPpp/AstInternals/TypeChecking/SelectLists.ag+                     Database/HsSqlPpp/AstInternals/TypeChecking/Expressions.ag+                     Database/HsSqlPpp/AstInternals/TypeChecking/Drops.ag+                     Database/HsSqlPpp/AstInternals/TypeChecking/MiscCreates.ag+                     Database/HsSqlPpp/Wrapper/WrapperTemplate.lhs+                     Database/HsSqlPpp/Tests/ExtensionTests.lhs                      Database/HsSqlPpp/Tests/ParserTests.lhs                      Database/HsSqlPpp/Tests/DatabaseLoaderTests.lhs+                     Database/HsSqlPpp/Tests/RoundtripTests.lhs+                     Database/HsSqlPpp/Tests/TypeCheckTests.lhs+                     Database/HsSqlPpp/Tests/ParameterizedStatementTests.lhs+                     Database/HsSqlPpp/Here.lhs                      Database/HsSqlPpp/PrettyPrinter/AnnotateSource.lhs                      Database/HsSqlPpp/PrettyPrinter/PrettyPrinter.lhs+                     Database/HsSqlPpp/HsText/Commands.lhs+                     Database/HsSqlPpp/HsText/HsText.lhs                      Database/HsSqlPpp/Parsing/Lexer.lhs                      Database/HsSqlPpp/Parsing/Parser.lhs                      Database/HsSqlPpp/Parsing/ParseErrors.lhs-                     Database/HsSqlPpp/Ast/Annotator.lhs                      Database/HsSqlPpp/Ast/Ast.lhs                      Database/HsSqlPpp/Ast/Environment.lhs                      Database/HsSqlPpp/Ast/Annotation.lhs                      Database/HsSqlPpp/Ast/SqlTypes.lhs+                     Database/HsSqlPpp/Ast/TypeChecker.lhs  Library   Build-Depends:     base >= 4 && < 5,@@ -101,108 +143,100 @@                      HDBC,                      HDBC-postgresql,                      directory,-                     syb-  Exposed-modules:   Database.HsSqlPpp.Ast.Ast,-                     Database.HsSqlPpp.Parsing.Parser,-                     Database.HsSqlPpp.PrettyPrinter.PrettyPrinter,-                     Database.HsSqlPpp.PrettyPrinter.AnnotateSource,-                     Database.HsSqlPpp.Ast.Annotator,-                     Database.HsSqlPpp.Ast.Environment,-                     Database.HsSqlPpp.Ast.Annotation,-                     Database.HsSqlPpp.Ast.SqlTypes,+                     syb,+                     uniplate,+                     pretty-show,+                     Pipe,+                     process,+                     --pandoc == 1.2.1,+                     filepath,+                     template-haskell,+                     haskell-src-exts++  Exposed-modules:   Database.HsSqlPpp.Ast.Ast+                     Database.HsSqlPpp.Ast.TypeChecker+                     Database.HsSqlPpp.Ast.Environment+                     Database.HsSqlPpp.Ast.Annotation+                     Database.HsSqlPpp.Ast.SqlTypes+                     Database.HsSqlPpp.Parsing.Parser+                     Database.HsSqlPpp.PrettyPrinter.PrettyPrinter+                     Database.HsSqlPpp.PrettyPrinter.AnnotateSource                      Database.HsSqlPpp.Dbms.DatabaseLoader-  other-modules:     Database.HsSqlPpp.Utils+                     Database.HsSqlPpp.Commands.CommandComponents+                     Database.HsSqlPpp.Extensions.ChaosExtensions++  Other-Modules:     Database.HsSqlPpp.Utils+                     --Database.HsSqlPpp.Here                      Database.HsSqlPpp.Dbms.DBAccess-                     Database.HsSqlPpp.AstInternals.DefaultTemplate1Environment-                     Database.HsSqlPpp.AstInternals.TypeCheckingH+                     Database.HsSqlPpp.Dbms.WrapperGen+                     Database.HsSqlPpp.Dbms.WrapLib                      Database.HsSqlPpp.AstInternals.AnnotationUtils-                     Database.HsSqlPpp.AstInternals.TypeConversion-                     Database.HsSqlPpp.AstInternals.EnvironmentReader-                     Database.HsSqlPpp.AstInternals.EnvironmentInternal                      Database.HsSqlPpp.AstInternals.AstAnnotation                      Database.HsSqlPpp.AstInternals.AstInternal+                     Database.HsSqlPpp.AstInternals.Environment.DefaultTemplate1Environment+                     Database.HsSqlPpp.AstInternals.Environment.EnvironmentReader+                     Database.HsSqlPpp.AstInternals.Environment.EnvironmentInternal+                     Database.HsSqlPpp.AstInternals.Environment.LocalIdentifierBindings                      Database.HsSqlPpp.AstInternals.TypeType-                     Database.HsSqlPpp.AstInternals.AstUtils-                     Database.HsSqlPpp.Tests.AstCheckTests+                     Database.HsSqlPpp.AstInternals.TypeChecking.TypeConversion+                     Database.HsSqlPpp.AstInternals.TypeChecking.ErrorUtils+                     Database.HsSqlPpp.Tests.ExtensionTests+                     Database.HsSqlPpp.Tests.TypeCheckTests                      Database.HsSqlPpp.Tests.ParserTests+                     Database.HsSqlPpp.Tests.DatabaseLoaderTests+                     Database.HsSqlPpp.Tests.ParameterizedStatementTests+                     Database.HsSqlPpp.HsText.Commands+                     Database.HsSqlPpp.HsText.HsText                      Database.HsSqlPpp.Parsing.Lexer                      Database.HsSqlPpp.Parsing.ParseErrors-                     Database.HsSqlPpp.Utils+   extensions:        DeriveDataTypeable,RankNTypes,ScopedTypeVariables  Executable HsSqlSystem   Main-is:           HsSqlSystem.lhs+   Build-Depends:     base,                      haskell98,                      regex-posix,                      HDBC,                      HDBC-postgresql,-                     directory-  extensions:        DeriveDataTypeable,RankNTypes,ScopedTypeVariables-  other-modules:     Database.HsSqlPpp.Utils-                     Database.HsSqlPpp.Dbms.DBAccess-                     Database.HsSqlPpp.Dbms.DatabaseLoader-                     Database.HsSqlPpp.AstInternals.DefaultTemplate1Environment-                     Database.HsSqlPpp.AstInternals.TypeCheckingH-                     Database.HsSqlPpp.AstInternals.AnnotationUtils-                     Database.HsSqlPpp.AstInternals.TypeConversion-                     Database.HsSqlPpp.AstInternals.EnvironmentReader-                     Database.HsSqlPpp.AstInternals.EnvironmentInternal-                     Database.HsSqlPpp.AstInternals.AstAnnotation-                     Database.HsSqlPpp.AstInternals.AstInternal-                     Database.HsSqlPpp.AstInternals.TypeType-                     Database.HsSqlPpp.AstInternals.AstUtils-                     Database.HsSqlPpp.Tests.AstCheckTests-                     Database.HsSqlPpp.Tests.ParserTests-                     Database.HsSqlPpp.Tests.DatabaseLoaderTests-                     Database.HsSqlPpp.PrettyPrinter.AnnotateSource-                     Database.HsSqlPpp.PrettyPrinter.PrettyPrinter-                     Database.HsSqlPpp.Parsing.Lexer-                     Database.HsSqlPpp.Parsing.Parser-                     Database.HsSqlPpp.Parsing.ParseErrors-                     Database.HsSqlPpp.Ast.Annotator-                     Database.HsSqlPpp.Ast.Ast-                     Database.HsSqlPpp.Ast.Environment-                     Database.HsSqlPpp.Ast.Annotation-                     Database.HsSqlPpp.Ast.SqlTypes-                     Database.HsSqlPpp.Utils--Executable HsSqlPppTests-  Main-is:           HsSqlPppTests.lhs-  Build-Depends:     base,-                     HUnit,+                     directory,                      test-framework,                      test-framework-hunit,-                     regex-posix,-                     HDBC,-                     HDBC-postgresql,-                     directory-  other-modules:     Database.HsSqlPpp.Utils+                     HUnit,+                     cmdargs++  Other-Modules:     Database.HsSqlPpp.Utils+                     --Database.HsSqlPpp.Here+                     Database.HsSqlPpp.Commands.CommandComponents                      Database.HsSqlPpp.Dbms.DBAccess                      Database.HsSqlPpp.Dbms.DatabaseLoader-                     Database.HsSqlPpp.AstInternals.DefaultTemplate1Environment-                     Database.HsSqlPpp.AstInternals.TypeCheckingH+                     Database.HsSqlPpp.Extensions.ChaosExtensions                      Database.HsSqlPpp.AstInternals.AnnotationUtils-                     Database.HsSqlPpp.AstInternals.TypeConversion-                     Database.HsSqlPpp.AstInternals.EnvironmentReader-                     Database.HsSqlPpp.AstInternals.EnvironmentInternal                      Database.HsSqlPpp.AstInternals.AstAnnotation                      Database.HsSqlPpp.AstInternals.AstInternal+                     Database.HsSqlPpp.AstInternals.Environment.DefaultTemplate1Environment+                     Database.HsSqlPpp.AstInternals.Environment.EnvironmentReader+                     Database.HsSqlPpp.AstInternals.Environment.EnvironmentInternal+                     Database.HsSqlPpp.AstInternals.Environment.LocalIdentifierBindings                      Database.HsSqlPpp.AstInternals.TypeType-                     Database.HsSqlPpp.AstInternals.AstUtils-                     Database.HsSqlPpp.Tests.AstCheckTests+                     Database.HsSqlPpp.AstInternals.TypeChecking.TypeConversion+                     Database.HsSqlPpp.AstInternals.TypeChecking.ErrorUtils+                     Database.HsSqlPpp.Tests.ExtensionTests+                     Database.HsSqlPpp.Tests.TypeCheckTests                      Database.HsSqlPpp.Tests.ParserTests                      Database.HsSqlPpp.Tests.DatabaseLoaderTests                      Database.HsSqlPpp.PrettyPrinter.AnnotateSource                      Database.HsSqlPpp.PrettyPrinter.PrettyPrinter+                     Database.HsSqlPpp.HsText.Commands+                     Database.HsSqlPpp.HsText.HsText                      Database.HsSqlPpp.Parsing.Lexer                      Database.HsSqlPpp.Parsing.Parser                      Database.HsSqlPpp.Parsing.ParseErrors-                     Database.HsSqlPpp.Ast.Annotator+                     Database.HsSqlPpp.Ast.TypeChecker                      Database.HsSqlPpp.Ast.Ast                      Database.HsSqlPpp.Ast.Environment                      Database.HsSqlPpp.Ast.Annotation                      Database.HsSqlPpp.Ast.SqlTypes-                     Database.HsSqlPpp.Utils    extensions:        DeriveDataTypeable,RankNTypes,ScopedTypeVariables
− questions
@@ -1,90 +0,0 @@-here are some queries that need investigating, and possibly posted to-the appropriate mailing list.--= haskell questions--generating the default scope, the layout is awful when saved to a-file. Is there an easy way to Show this value, with nice formatting?-Is there a better way to serialize this value rather than as a haskell-source file? Todo - try Data.Binary--= ghc questions--getting-ghc: panic! (the 'impossible' happened)-  (GHC version 6.10.4 for i386-unknown-linux):-	linkBCO: >= 64k insns in BCO--Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug--when compiling defaultscope with -Wall, put together a bug report or-something.--------getting segmentation fault when trying to run code with profiling on-- ghc --make -prof -auto-all  HsSqlSystem.lhs +RTS -K64M-then run ./HsSqlSystem--= cabal--when tried to install profiling, is there a short cut to reinstall all-the dependent libs with the profiling option on? had to do this one or-two libs at a time and it took ages.--after cabal stop complaining about libs without profiling on, tried to-build the code and got errors like HSHunit_p library not found, this-was fixed by re-cabal installing some libraries with profiling on that-cabal had missed - it picked up on some libs, and not others?--cabal haddock - top level documentation from cabal file appears to-have whitespace stripping, destroying paragraphs and lists--= uuagc--compare with aspectag - what are the upsides/downsides?-update - looks like the syntax still needs a lot of work for aspectag--= postgresql questions--is a null literal treated as a unknown string for the purposes of-function resolution, resultset resolution, etc.?--how does the function resolution work for polymorphic functions--what situations can an empty array type check successfully, and when-is it rejected.--is it possible to create a full view of all the casts that are used in-implicit, etc., resolution, i.e. including the ones that aren't in pg_cast--is it correct to use the resolve result set type algo when determining-the type of common fields in a natural or using join?--looking at postgresql-doc-8.4/html/query-path.html, it is unclear-where type checking occurs - is it mainly in a separate stage, or-intermingled in with the other stages--is the way the keyword operators are typed correct (using the function-call match algo to sort the implicit casts)?--how does the parser handle parsing operators without knowing whether-they are prefix, postfix or binary until later--when is the b_expr parser used (should just need a grep over the-grammar file)--is the handling of between, coalesce, greatest, and least correct-(delegating the checks to <= operators or whatever, coalesce uses-resultsetresolution)--why doesn't this work:-select-    att.oid,-    cls.oid,-    cls.relkind,-    cls.relname,-    att.typname-  from pg_type att-  inner join pg_class cls using(oid);---- column "oid" specified in USING clause does not exist in left table
sqltestfiles/client.sql view
@@ -1718,3 +1718,4 @@  select protect_readonly_relvars(); select set_all_attributes_to_not_null();+select set_notifies_on_all_data_tables();
sqltestfiles/server.sql view
@@ -79,7 +79,7 @@  After we've loaded the sql, we can protect all the readonly relvars from being updated again using transition constraints (see below for-how they are implemented). This might catch some programming error.+how they are implemented). This might catch some programming errors.   */ @@ -2617,7 +2617,7 @@     perform action_cast_failed();     return false;   end if;-  select into r ptype, allegiance, tag, imaginary+  select into r ptype, allegiance, tag     from pieces_on_top_view where (x,y) = (px,py);    perform add_history_spell_succeeded();@@ -4301,7 +4301,7 @@   else     raise exception     'argument must be one of all_pieces, upgraded_wizards, overlapping, got %',-    flavours;+    flavour;   end if; end $$ language plpgsql volatile;
sqltestfiles/system.sql view
@@ -17,7 +17,9 @@  Probably the only interesting bit is the constraint system. -+*/+create language plpgsql;+/* ================================================================================  = Catalog
− usage
@@ -1,130 +0,0 @@-Here are some notes on what you can currently do with the code:--= HsSqlSystem--Command line access to a number of functions is provided by-HsSqlSystem.lhs. You can list the commands using 'HsSqlSystem help',-and you can get the descriptions of what these commands do using-'HsSqlSystem help all'. (Assuming you have cabal installed the-software and have the cabal binary folder in your path.)--The commands which access postgresql probably won't work right on your-system, they are in a very early alpha state.--The most interesting commands are:-* parsefile-* roundtripfile, loadsql-* annotateSource-* checksource---== parsefile--Pass in one or more filenames for files containing sql source, and the-program will attempt to parse, then pretty print and reparse to see if-the two asts are the same. This can be used to check the program can-successfully parse your sql, and if pretty printing then parsing the-result mangles it - lack of such mangling might give you slightly more-confidence that it has parsed ok.--== roundtripfile, loadsql--Similar to parse file, pass in a source filename and a target-filename, and the code with parse then pretty print the text. You can-then load the pretty printed code into a database and run your test-suite to see if the code made it through the parsing and pretty-printing process ok, or you can just eyeball the resultant-sql.--The related command is loadsql, which will attempt to parse one or-more files then pretty print them line by line, loading each line-straight into a database to help with testing. This may be a bit more-fragile than using roundtripfile.--Loading the roundtripped sql into a database then running tests on it-will hopefully can give a bit more confidence that the sql has been-parsed accurately.--== annotateSource--This command takes a filename, parses and type checks the file, and-then outputs a copy of the source with the main annotations attached-to the statements interspersed into the source in comments. This can-be used e.g. to view the attribute names and types of a view. After-some more work has been done on this command, it is intended that this-is expanded to provide lots of useful comments which are maintained in-your actual source and checked in to source control, etc..--== checksource--This command takes a set of files and type checks each one in turn-(later files can depend on definitions appearing in files earlier in-the file list). It outputs all the type errors found in Emacs friendly-format. This mostly just shows you all the bits that haven't been-implemented in the type checker yet. This is the early precursor to-the lint checking process.--Pretty printers and other work for the Annotation types are planned,-to make the annotateSource comments and error messages more readable.--== reasonably up to date output of './HsSqlSystem.lhs help all'--commands available-help-use 'help' to see a list of commands-use 'help all' to see a list of commands with descriptions-use 'help [command]' to see the description for that command--cleardb-hacky util to clear a database--loadsql-This takes one or more files with sql source text, parses them then-loads them into the database given.--clearandloadsql-cleardb then loadsql--lexfile-lex the file given and output the tokens on separate lines--parsefile-Routine to parse sql from a file, check that it appears to parse ok,-that pretty printing it and parsing that text gives the same ast, and-then displays the pretty printed version so you can see how well it's-done--roundtripfile-Used to test the parsing and pretty printing round trip. Takes two-arguments, a source filename and a target filename. If the target file-exists, it quits. Parses the source file then pretty prints it to the-target filename.--readenv-read the catalogs for the given db and dump a Environment value source-text to stdout--annotateSource-reads a file, parses, type checks, then outputs info on each statement-interspersed with the original source code--checksource-reads each file, parses, type checks, then outputs any type errors--================================================================================--= library usage--See the haddock docs to get a basic idea of using the libraries. The-source for HsSqlSystem.lhs might also be worth a look for some-examples. You should be able to view the haddock docs online on the-hackagedb page here:-http://hackage.haskell.org/package/hssqlppp---================================================================================--= run the automated tests--To run the test suite run ./HsSqlPppTests.lhs. This will run the tests-for parsing and pretty printing, and for type checking.