Transcription of PostgreSQL Functions By Example - joeconway.com
{{id}} {{{paragraph}}}
OverviewFunction BasicsBy ExamplePostgreSQL Functions By ExampleJoe GroupJanuary 20, 2012 Joe ConwaySCALE10X-PGDayOverviewFunction BasicsBy ExampleIntroductionUsesVarietiesLanguage sWhat are Functions ?Full fledged SQL objectsMany other database objects are implemented with themFundamental part of PostgreSQL s system architectureCreated withCREATE FUNCTIONE xecuted through normal SQLtarget-list:SELECT myfunc(f1) FROM foo;FROM clause:SELECT * FROM myfunc();WHERE clause:SELECT * FROM foo WHERE myfunc(f1) = 42;Joe ConwaySCALE10X-PGDayOverviewFunction BasicsBy ExampleIntroductionUsesVarietiesLanguage sHow are they Used?FunctionsOperatorsData typesIndex methodsCastsTriggersAggregatesJoe ConwaySCALE10X-PGDayOverviewFunction BasicsBy ExampleIntroductionUsesVarietiesLanguage sWhat Forms Can They Take? PostgreSQL provides four kinds of Functions :SQLP rocedural LanguagesInternalC-languageArgumentsBase , composite, or combinationsScalar or arrayPseudo or polymorphicVARIADICIN/OUT/INOUTR eturnSingleton or set (SETOF)Base or composite typePseudo or ConwaySCALE10X-PGDayOverviewFunction BasicsBy ExampleIntroductionUsesVarietiesLanguage sSQL FunctionsBehaviorExecutes an arbitrary list of SQL statements separated bysemicolonsLast statement may be INSERT, UPDATE, or DELETE withRETURNING clauseArgumentsReferenced by function body using $n: $1 is first arg, etc.
Overview Function Basics By Example Introduction Uses Varieties Languages What are Functions? Full edged SQL objects Many other database objects are implemented with them
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}
ArcSDE Administration for PostgreSQL, PostgreSQL, Introduction, Hacking PostgreSQL, Converting from SAS® Table Server to a PostgreSQL Database, Server to a PostgreSQL Database, Internals Of PostgreSQL, Security Best Practices for Postgres, Using the NoSQL Capabilities in Postgres, PostgreSQL Installation Guide, PostgreSQL: Introduction and Concepts, PostgreSQL Introduction and Concepts