1878
PRODUCT DOCUMENTATION Pivotal Greenplum Database ® Version 5.21 Pivotal Greenplum Database Documentation Rev: A06 © 2019 Pivotal Software, Inc.

Pivotal Greenplum Database · 2020. 7. 1. · Contents OpenTopic 9 Configuring gphdfs for Kerberos..... 849 Testing Greenplum Database Access to HDFS.....850 Troubleshooting HDFS

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

  • PRODUCT DOCUMENTATION

    Pivotal™ GreenplumDatabase®Version 5.21

    Pivotal Greenplum DatabaseDocumentationRev: A06

    © 2019 Pivotal Software, Inc.

  • Copyright OpenTopic

    2

    Notice

    Copyright

    Privacy Policy | Terms of Use

    Copyright © 2019 Pivotal Software, Inc. All rights reserved.

    Pivotal Software, Inc. believes the information in this publication is accurate as of its publication date. Theinformation is subject to change without notice. THE INFORMATION IN THIS PUBLICATION IS PROVIDED"AS IS." PIVOTAL SOFTWARE, INC. ("Pivotal") MAKES NO REPRESENTATIONS OR WARRANTIES OF ANYKIND WITH RESPECT TO THE INFORMATION IN THIS PUBLICATION, AND SPECIFICALLY DISCLAIMSIMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

    Use, copying, and distribution of any Pivotal software described in this publication requires an applicablesoftware license.

    All trademarks used herein are the property of Pivotal or their respective owners.

    Revised September 2019 (5.21.5)

    http://pivotal.io/privacy-policyhttp://pivotal.io/terms-of-use

  • Contents OpenTopic

    3

    Contents

    Chapter 1: Pivotal Greenplum 5.21.5 Release Notes............................. 17Welcome to Pivotal Greenplum 5.21.5............................................................................................. 18Resolved Issues................................................................................................................................ 19Beta Features.................................................................................................................................... 21Deprecated Features.........................................................................................................................22Known Issues and Limitations.......................................................................................................... 23Differences Compared to Open Source Greenplum Database.........................................................43Supported Platforms..........................................................................................................................44

    Veritas NetBackup.................................................................................................................. 46Supported Platform Notes...................................................................................................... 47

    Pivotal Greenplum Tools and Extensions Compatibility................................................................... 49Client Tools.............................................................................................................................49Extensions...............................................................................................................................50Pivotal Greenplum Data Connectors......................................................................................51Pivotal GPText Compatibility.................................................................................................. 51Pivotal Greenplum Command Center.................................................................................... 51

    Hadoop Distribution Compatibility..................................................................................................... 52Upgrading to Greenplum Database 5.21.5....................................................................................... 53

    Upgrading from 5.x to 5.21.5................................................................................................. 54Troubleshooting a Failed Upgrade.........................................................................................56

    Migrating Data to Pivotal Greenplum 5.x..........................................................................................57Pivotal Greenplum on DCA Systems................................................................................................59

    Installing the Pivotal Greenplum 5.21.5 Software Binaries on DCA Systems........................ 59Upgrading from 5.x to 5.21.5 on DCA Systems.....................................................................59

    Update for gp_toolkit.gp_bloat_expected_pages Issue.................................................................... 62Update for gp_toolkit.gp_bloat_diag Issue........................................................................................64

    Chapter 2: Pivotal Greenplum 5.21.4 Release Notes............................. 66Welcome to Pivotal Greenplum 5.21.4............................................................................................. 67Changed Feature...............................................................................................................................68Resolved Issues................................................................................................................................ 69Beta Features.................................................................................................................................... 70Deprecated Features.........................................................................................................................71Known Issues and Limitations.......................................................................................................... 72Differences Compared to Open Source Greenplum Database.........................................................92Supported Platforms..........................................................................................................................93

    Veritas NetBackup.................................................................................................................. 95Supported Platform Notes...................................................................................................... 96

    Pivotal Greenplum Tools and Extensions Compatibility................................................................... 98Client Tools.............................................................................................................................98Extensions...............................................................................................................................99Pivotal Greenplum Data Connectors....................................................................................100Pivotal GPText Compatibility................................................................................................ 100Pivotal Greenplum Command Center.................................................................................. 100

    Hadoop Distribution Compatibility................................................................................................... 101Upgrading to Greenplum Database 5.21.4..................................................................................... 102

    Upgrading from 5.x to 5.21.4............................................................................................... 103Troubleshooting a Failed Upgrade....................................................................................... 105

  • Contents OpenTopic

    4

    Migrating Data to Pivotal Greenplum 5.x........................................................................................106Pivotal Greenplum on DCA Systems..............................................................................................108

    Installing the Pivotal Greenplum 5.21.4 Software Binaries on DCA Systems...................... 108Upgrading from 5.x to 5.21.4 on DCA Systems...................................................................108

    Update for gp_toolkit.gp_bloat_expected_pages Issue.................................................................. 111Update for gp_toolkit.gp_bloat_diag Issue......................................................................................113

    Chapter 3: Pivotal Greenplum 5.21.3 Release Notes........................... 115Welcome to Pivotal Greenplum 5.21.3........................................................................................... 116Changed Feature.............................................................................................................................117Resolved Issues.............................................................................................................................. 118Beta Features.................................................................................................................................. 120Deprecated Features.......................................................................................................................121Known Issues and Limitations........................................................................................................ 122Differences Compared to Open Source Greenplum Database.......................................................142Supported Platforms........................................................................................................................143

    Veritas NetBackup................................................................................................................ 145Supported Platform Notes.................................................................................................... 146

    Pivotal Greenplum Tools and Extensions Compatibility................................................................. 148Client Tools...........................................................................................................................148Extensions.............................................................................................................................149Pivotal Greenplum Data Connectors....................................................................................150Pivotal GPText Compatibility................................................................................................ 150Pivotal Greenplum Command Center.................................................................................. 150

    Hadoop Distribution Compatibility................................................................................................... 151Upgrading to Greenplum Database 5.21.3..................................................................................... 152

    Upgrading from 5.x to 5.21.3............................................................................................... 153Troubleshooting a Failed Upgrade....................................................................................... 155

    Migrating Data to Pivotal Greenplum 5.x........................................................................................156Pivotal Greenplum on DCA Systems..............................................................................................158

    Installing the Pivotal Greenplum 5.21.3 Software Binaries on DCA Systems...................... 158Upgrading from 5.x to 5.21.3 on DCA Systems...................................................................158

    Update for gp_toolkit.gp_bloat_expected_pages Issue.................................................................. 161Update for gp_toolkit.gp_bloat_diag Issue......................................................................................163

    Chapter 4: Pivotal Greenplum 5.21.2 Release Notes........................... 165Welcome to Pivotal Greenplum 5.21.2........................................................................................... 166Resolved Issues.............................................................................................................................. 167Beta Features.................................................................................................................................. 169Deprecated Features.......................................................................................................................170Known Issues and Limitations........................................................................................................ 171Differences Compared to Open Source Greenplum Database.......................................................191Supported Platforms........................................................................................................................192

    Veritas NetBackup................................................................................................................ 194Supported Platform Notes.................................................................................................... 195

    Pivotal Greenplum Tools and Extensions Compatibility................................................................. 197Client Tools...........................................................................................................................197Extensions.............................................................................................................................198Pivotal Greenplum Data Connectors....................................................................................199Pivotal GPText Compatibility................................................................................................ 199Pivotal Greenplum Command Center.................................................................................. 199

    Hadoop Distribution Compatibility................................................................................................... 200Upgrading to Greenplum Database 5.21.2..................................................................................... 201

    Upgrading from 5.x to 5.21.2............................................................................................... 202

  • Contents OpenTopic

    5

    Troubleshooting a Failed Upgrade....................................................................................... 204Migrating Data to Pivotal Greenplum 5.x........................................................................................205Pivotal Greenplum on DCA Systems..............................................................................................207

    Installing the Pivotal Greenplum 5.21.2 Software Binaries on DCA Systems...................... 207Upgrading from 5.x to 5.21.2 on DCA Systems...................................................................207

    Update for gp_toolkit.gp_bloat_expected_pages Issue.................................................................. 210Update for gp_toolkit.gp_bloat_diag Issue......................................................................................212

    Chapter 5: Pivotal Greenplum 5.21.1 Release Notes........................... 214Welcome to Pivotal Greenplum 5.21.1........................................................................................... 215Resolved Issues.............................................................................................................................. 216Beta Features.................................................................................................................................. 217Deprecated Features.......................................................................................................................218Known Issues and Limitations........................................................................................................ 219Differences Compared to Open Source Greenplum Database.......................................................239Supported Platforms........................................................................................................................240

    Veritas NetBackup................................................................................................................ 242Supported Platform Notes.................................................................................................... 243

    Pivotal Greenplum Tools and Extensions Compatibility................................................................. 245Client Tools...........................................................................................................................245Extensions.............................................................................................................................246Pivotal Greenplum Data Connectors....................................................................................247Pivotal GPText Compatibility................................................................................................ 247Pivotal Greenplum Command Center.................................................................................. 247

    Hadoop Distribution Compatibility................................................................................................... 248Upgrading to Greenplum Database 5.21.1..................................................................................... 249

    Upgrading from 5.x to 5.21.1............................................................................................... 250Troubleshooting a Failed Upgrade....................................................................................... 252

    Migrating Data to Pivotal Greenplum 5.x........................................................................................253Pivotal Greenplum on DCA Systems..............................................................................................255

    Installing the Pivotal Greenplum 5.21.1 Software Binaries on DCA Systems...................... 255Upgrading from 5.x to 5.21.1 on DCA Systems...................................................................255

    Update for gp_toolkit.gp_bloat_expected_pages Issue.................................................................. 258Update for gp_toolkit.gp_bloat_diag Issue......................................................................................260

    Chapter 6: Pivotal Greenplum 5.21.0 Release Notes........................... 262Welcome to Pivotal Greenplum 5.21.0........................................................................................... 263New Features.................................................................................................................................. 264

    PXF Version 5.7.0................................................................................................................ 264Resolved Issues.............................................................................................................................. 266Beta Features.................................................................................................................................. 267Deprecated Features.......................................................................................................................268Known Issues and Limitations........................................................................................................ 269Differences Compared to Open Source Greenplum Database.......................................................290Supported Platforms........................................................................................................................291

    Veritas NetBackup................................................................................................................ 293Supported Platform Notes.................................................................................................... 294

    Pivotal Greenplum Tools and Extensions Compatibility................................................................. 296Client Tools...........................................................................................................................296Extensions.............................................................................................................................297Pivotal Greenplum Data Connectors....................................................................................298Pivotal GPText Compatibility................................................................................................ 298Pivotal Greenplum Command Center.................................................................................. 298

    Hadoop Distribution Compatibility................................................................................................... 299

  • Contents OpenTopic

    6

    Upgrading to Greenplum Database 5.21.0..................................................................................... 300Upgrading from 5.x to 5.21.0............................................................................................... 301Troubleshooting a Failed Upgrade....................................................................................... 303

    Migrating Data to Pivotal Greenplum 5.x........................................................................................304Pivotal Greenplum on DCA Systems..............................................................................................306

    Installing the Pivotal Greenplum 5.21.0 Software Binaries on DCA Systems...................... 306Upgrading from 5.x to 5.21.0 on DCA Systems...................................................................306

    Update for gp_toolkit.gp_bloat_expected_pages Issue.................................................................. 309Update for gp_toolkit.gp_bloat_diag Issue......................................................................................311

    Chapter 7: Greenplum Database Installation Guide.............................313Introduction to Greenplum...............................................................................................................314

    The Greenplum Master.........................................................................................................314The Segments...................................................................................................................... 315The Interconnect...................................................................................................................316ETL Hosts for Data Loading................................................................................................ 317Greenplum Performance Monitoring.................................................................................... 318

    Estimating Storage Capacity........................................................................................................... 319Calculating Usable Disk Capacity........................................................................................ 319Calculating User Data Size.................................................................................................. 319Calculating Space Requirements for Metadata and Logs....................................................320

    Configuring Your Systems and Installing Greenplum..................................................................... 321System Requirements...........................................................................................................321Disabling SELinux and Firewall Software............................................................................ 322Setting the Greenplum Recommended OS Parameters...................................................... 323Creating the Greenplum Database Administrative User Account........................................ 329Installing the Greenplum Database Software.......................................................................329Installing and Configuring Greenplum on all Hosts..............................................................332

    Validating Your Systems................................................................................................................. 339Validating OS Settings..........................................................................................................339Validating Hardware Performance........................................................................................339Validating Disk I/O and Memory Bandwidth.........................................................................340

    Initializing a Greenplum Database System..................................................................................... 342Overview............................................................................................................................... 342Initializing Greenplum Database...........................................................................................342Setting Greenplum Environment Variables.......................................................................... 345Next Steps............................................................................................................................ 346

    Installing Optional Extensions......................................................................................................... 348Procedural Language, Machine Learning, and Geospatial Extensions................................348Python Data Science Module Package................................................................................348R Data Science Library Package......................................................................................... 350Greenplum Platform Extension Framework (PXF)............................................................... 352Oracle Compatibility Functions.............................................................................................352dblink Connectivity Functions............................................................................................... 353pgcrypto Cryptographic Functions........................................................................................353

    Configuring Timezone and Localization Settings............................................................................354Configuring the Timezone.................................................................................................... 354About Locale Support in Greenplum Database................................................................... 354Character Set Support..........................................................................................................356Setting the Character Set.....................................................................................................358Character Set Conversion Between Server and Client........................................................359

    About Implicit Text Casting in Greenplum Database......................................................................362Workaround: Manually Creating Missing Operators.............................................................363

    Installation Management Utilities.....................................................................................................366Greenplum Environment Variables................................................................................................. 367

  • Contents OpenTopic

    7

    Required Environment Variables..........................................................................................367Optional Environment Variables........................................................................................... 367

    Chapter 9: Greenplum Database Administrator Guide........................ 369Greenplum Database Concepts...................................................................................................... 370

    About the Greenplum Architecture....................................................................................... 370About Management and Monitoring Utilities........................................................................ 372About Concurrency Control in Greenplum Database...........................................................373About Parallel Data Loading................................................................................................ 381About Redundancy and Failover in Greenplum Database...................................................382About Database Statistics in Greenplum Database............................................................. 384

    Managing a Greenplum System..................................................................................................... 391About the Greenplum Database Release Version Number................................................. 391Starting and Stopping Greenplum Database....................................................................... 391Accessing the Database.......................................................................................................394Configuring the Greenplum Database System.....................................................................402Enabling High Availability and Data Consistency Features................................................. 413Backing Up and Restoring Databases................................................................................. 431Expanding a Greenplum System..........................................................................................490Migrating Data...................................................................................................................... 505Monitoring a Greenplum System..........................................................................................511Routine System Maintenance Tasks....................................................................................531Recommended Monitoring and Maintenance Tasks............................................................ 535

    Managing Greenplum Database Access.........................................................................................543Configuring Client Authentication......................................................................................... 543Managing Roles and Privileges............................................................................................571

    Defining Database Objects..............................................................................................................578Creating and Managing Databases......................................................................................578Creating and Managing Tablespaces...................................................................................580Creating and Managing Schemas........................................................................................583Creating and Managing Tables............................................................................................ 584Choosing the Table Storage Model..................................................................................... 587Partitioning Large Tables......................................................................................................598Creating and Using Sequences........................................................................................... 611Using Indexes in Greenplum Database............................................................................... 613Creating and Managing Views............................................................................................. 616

    Distribution and Skew..................................................................................................................... 618Local (Co-located) Joins.......................................................................................................618Data Skew............................................................................................................................ 618Processing Skew.................................................................................................................. 619

    Inserting, Updating, and Deleting Data...........................................................................................622About Concurrency Control in Greenplum Database...........................................................622Inserting Rows...................................................................................................................... 623Updating Existing Rows........................................................................................................624Deleting Rows.......................................................................................................................624Working With Transactions...................................................................................................624Vacuuming the Database..................................................................................................... 626

    Querying Data................................................................................................................................. 627About Greenplum Query Processing....................................................................................627About GPORCA....................................................................................................................630Defining Queries................................................................................................................... 643WITH Queries (Common Table Expressions)......................................................................653Using Functions and Operators............................................................................................655Working with JSON Data..................................................................................................... 665Working with XML Data........................................................................................................669

  • Contents OpenTopic

    8

    Query Performance.............................................................................................................. 681Managing Spill Files Generated by Queries........................................................................ 681Query Profiling...................................................................................................................... 682

    Working with External Data.............................................................................................................687Defining External Tables...................................................................................................... 687Accessing External Data with PXF...................................................................................... 706Accessing HDFS Data with gphdfs (Deprecated)................................................................ 706Using the Greenplum Parallel File Server (gpfdist)..............................................................729

    Loading and Unloading Data.......................................................................................................... 734Loading Data Using an External Table................................................................................ 735Loading and Writing Non-HDFS Custom Data.................................................................... 735Handling Load Errors............................................................................................................738Loading Data with gpload.....................................................................................................740Accessing External Data with PXF...................................................................................... 741Transforming External Data with gpfdist and gpload........................................................... 742Loading Data with COPY..................................................................................................... 752Running COPY in Single Row Error Isolation Mode............................................................752Optimizing Data Load and Query Performance................................................................... 752Unloading Data from Greenplum Database......................................................................... 753Formatting Data Files........................................................................................................... 755Example Custom Data Access Protocol.............................................................................. 758

    Managing Performance................................................................................................................... 765Defining Database Performance.......................................................................................... 765Common Causes of Performance Issues............................................................................ 766Greenplum Database Memory Overview............................................................................. 769Managing Resources............................................................................................................773Investigating a Performance Problem.................................................................................. 803

    Chapter 11: Greenplum Database Security Configuration Guide....... 806Securing the Database....................................................................................................................807Greenplum Database Ports and Protocols..................................................................................... 808Configuring Client Authentication.................................................................................................... 813

    Allowing Connections to Greenplum Database....................................................................813Editing the pg_hba.conf File.................................................................................................815Authentication Methods........................................................................................................ 815SSL Client Authentication.....................................................................................................818PAM Based Authentication...................................................................................................820Radius Authentication...........................................................................................................820Limiting Concurrent Connections......................................................................................... 821Encrypting Client/Server Connections..................................................................................822

    Configuring Database Authorization................................................................................................823Access Permissions and Roles............................................................................................823Managing Object Privileges..................................................................................................823Using SSH-256 Encryption...................................................................................................824Restricting Access by Time..................................................................................................826Dropping a Time-based Restriction.................................................................................... 828

    Greenplum Command Center Security........................................................................................... 829Auditing............................................................................................................................................ 832Encrypting Data and Database Connections.................................................................................. 837

    Encrypting gpfdist Connections............................................................................................ 837Encrypting Data at Rest with pgcrypto.................................................................................838

    Enabling gphdfs Authentication with a Kerberos-secured Hadoop Cluster (Deprecated)............... 846Prerequisites......................................................................................................................... 846Configuring the Greenplum Cluster......................................................................................846Creating and Installing Keytab Files.................................................................................... 847

  • Contents OpenTopic

    9

    Configuring gphdfs for Kerberos.......................................................................................... 849Testing Greenplum Database Access to HDFS...................................................................850Troubleshooting HDFS with Kerberos..................................................................................851

    Security Best Practices................................................................................................................... 853

    Chapter 13: Greenplum Database Best Practices................................ 857Best Practices Summary.................................................................................................................858System Configuration...................................................................................................................... 864Schema Design............................................................................................................................... 869

    Data Types........................................................................................................................... 869Storage Model...................................................................................................................... 869Compression......................................................................................................................... 870Distributions.......................................................................................................................... 871Partitioning............................................................................................................................ 874Indexes..................................................................................................................................876Column Sequence and Byte Alignment............................................................................... 876

    Memory and Resource Management with Resource Groups......................................................... 878Memory and Resource Management with Resource Queues........................................................ 881System Monitoring and Maintenance..............................................................................................885

    Monitoring............................................................................................................................. 885Updating Statistics with ANALYZE.......................................................................................886Managing Bloat in the Database..........................................................................................887Monitoring Greenplum Database Log Files..........................................................................891

    Loading Data................................................................................................................................... 893INSERT Statement with Column Values..............................................................................893COPY Statement.................................................................................................................. 893External Tables.....................................................................................................................893External Tables with Gpfdist................................................................................................ 893Gpload...................................................................................................................................894Best Practices.......................................................................................................................895

    Migrating Data with gptransfer........................................................................................................ 896Security............................................................................................................................................ 902Encrypting Data and Database Connections.................................................................................. 905Tuning SQL Queries....................................................................................................................... 914

    How to Generate Explain Plans........................................................................................... 914How to Read Explain Plans................................................................................................. 914Optimizing Greenplum Queries............................................................................................ 916

    High Availability............................................................................................................................... 918Disk Storage......................................................................................................................... 918Master Mirroring....................................................................................................................918Segment Mirroring................................................................................................................ 919Dual Clusters........................................................................................................................ 920Backup and Restore.............................................................................................................920Detecting Failed Master and Segment Instances................................................................ 921Segment Mirroring Configuration..........................................................................................922

    Chapter 15: Greenplum Database Utility Guide................................... 928Management Utility Reference........................................................................................................ 929

    Backend Server Programs................................................................................................... 930analyzedb..............................................................................................................................931gpactivatestandby................................................................................................................. 935gpaddmirrors......................................................................................................................... 937gpbackup...............................................................................................................................940gpcheck.................................................................................................................................946

  • Contents OpenTopic

    10

    gpcheckcat............................................................................................................................ 948gpcheckperf...........................................................................................................................951gpconfig.................................................................................................................................954gpcrondump.......................................................................................................................... 957gpdbrestore........................................................................................................................... 971gpcopy...................................................................................................................................978gpdeletesystem..................................................................................................................... 978gpexpand.............................................................................................................................. 979gpfdist....................................................................................................................................982gpfilespace............................................................................................................................ 986gpinitstandby......................................................................................................................... 989gpinitsystem.......................................................................................................................... 991gpload................................................................................................................................... 998gplogfilter.............................................................................................................................1009gpmapreduce...................................................................................................................... 1011gpmfr................................................................................................................................... 1013gpmovemirrors.................................................................................................................... 1016gpperfmon_install................................................................................................................1017gppkg.................................................................................................................................. 1022gprecoverseg...................................................................................................................... 1023gpreload.............................................................................................................................. 1028gprestore............................................................................................................................. 1030gpscp...................................................................................................................................1035gpseginstall......................................................................................................................... 1037gpssh...................................................................................................................................1039gpssh-exkeys...................................................................................................................... 1042gpstart................................................................................................................................. 1044gpstate................................................................................................................................ 1046gpstop................................................................................................................................. 1050gpsys1.................................................................................................................................1052gptransfer............................................................................................................................ 1053pgbouncer........................................................................................................................... 1065pgbouncer.ini.......................................................................................................................1067pgbouncer-admin................................................................................................................ 1079

    Client Utility Reference..................................................................................................................1088clusterdb..............................................................................................................................1088createdb.............................................................................................................................. 1089createlang........................................................................................................................... 1091createuser........................................................................................................................... 1092dropdb................................................................................................................................. 1094droplang.............................................................................................................................. 1096dropuser.............................................................................................................................. 1097pg_config.............................................................................................................................1098pg_dump............................................................................................................................. 1100pg_dumpall..........................................................................................................................1105pg_restore........................................................................................................................... 1109psql......................................................................................................................................1113reindexdb............................................................................................................................ 1131vacuumdb............................................................................................................................1132

    Additional Supplied Modules......................................................................................................... 1135citext Data Type................................................................................................................. 1135dblink Functions..................................................................................................................1137hstore Functions................................................................................................................. 1139Oracle Compatibility Functions...........................................................................................1142passwordcheck................................................................................................................... 1163

  • Contents OpenTopic

    11

    Chapter 17: Greenplum Database Reference Guide.......................... 1165SQL Command Reference............................................................................................................ 1166

    SQL Syntax Summary........................................................................................................1168ABORT................................................................................................................................1196ALTER AGGREGATE.........................................................................................................1196ALTER CONVERSION....................................................................................................... 1197ALTER DATABASE............................................................................................................ 1198ALTER DOMAIN.................................................................................................................1200ALTER EXTENSION...........................................................................................................1201ALTER EXTERNAL TABLE................................................................................................1204ALTER FILESPACE............................................................................................................1206ALTER FUNCTION.............................................................................................................1206ALTER GROUP.................................................................................................................. 1209ALTER INDEX.................................................................................................................... 1210ALTER LANGUAGE........................................................................................................... 1211ALTER OPERATOR........................................................................................................... 1212ALTER OPERATOR CLASS.............................................................................................. 1212ALTER OPERATOR FAMILY.............................................................................................1213ALTER PROTOCOL........................................................................................................... 1216ALTER RESOURCE GROUP............................................................................................ 1217ALTER RESOURCE QUEUE.............................................................................................1219ALTER ROLE..................................................................................................................... 1221ALTER SCHEMA................................................................................................................1225ALTER SEQUENCE........................................................................................................... 1226ALTER TABLE....................................................................................................................1228ALTER TABLESPACE........................................................................................................1238ALTER TYPE......................................................................................................................1239ALTER USER..................................................................................................................... 1240ALTER VIEW...................................................................................................................... 1241ANALYZE............................................................................................................................1241BEGIN................................................................................................................................. 1245CHECKPOINT.....................................................................................................................1247CLOSE................................................................................................................................ 1247CLUSTER........................................................................................................................... 1248COMMENT..........................................................................................................................1249COMMIT..............................................................................................................................1251COPY.................................................................................................................................. 1252CREATE AGGREGATE......................................................................................................1262CREATE CAST...................................................................................................................1266CREATE CONVERSION.................................................................................................... 1269CREATE DATABASE......................................................................................................... 1270CREATE DOMAIN..............................................................................................................1271CREATE EXTENSION........................................................................................................1273CREATE EXTERNAL TABLE.............................................................................................1274CREATE FUNCTION..........................................................................................................1283CREATE GROUP............................................................................................................... 1289CREATE INDEX................................................................................................................. 1290CREATE LANGUAGE........................................................................................................ 1293CREATE OPERATOR........................................................................................................ 1295CREATE OPERATOR CLASS........................................................................................... 1299CREATE OPERATOR FAMILY..........................................................................................1303CREATE PROTOCOL........................................................................................................ 1304CREATE RESOURCE GROUP......................................................................................... 1305CREATE RESOURCE QUEUE..........................................................................................1308

  • Contents OpenTopic

    12

    CREATE ROLE.................................................................................................................. 1311CREATE RULE...................................................................................................................1315CREATE SCHEMA.............................................................................................................1317CREATE SEQUENCE........................................................................................................ 1318CREATE TABLE.................................................................................................................1321CREATE TABLE AS...........................................................................................................1333CREATE TABLESPACE.....................................................................................................1336CREATE TYPE...................................................................................................................1337CREATE USER.................................................................................................................. 1342CREATE VIEW................................................................................................................... 1343DEALLOCATE.................................................................................................................... 1345DECLARE........................................................................................................................... 1345DELETE.............................................................................................................................. 1348DISCARD............................................................................................................................ 1350DO.......................................................................................................................................1351DROP AGGREGATE..........................................................................................................1352DROP CAST.......................................................................................................................1353DROP CONVERSION........................................................................................................ 1354DROP DATABASE............................................................................................................. 1354DROP DOMAIN.................................................................................................................. 1355DROP EXTENSION............................................................................................................1356DROP EXTERNAL TABLE.................................................................................................1357DROP FILESPACE.............................................................................................................1358DROP FUNCTION..............................................................................................................1358DROP GROUP................................................................................................................... 1359DROP INDEX..................................................................................................................... 1360DROP LANGUAGE.............................................................................................................1360DROP OPERATOR............................................................................................................ 1361DROP OPERATOR CLASS............................................................................................... 1362DROP OPERATOR FAMILY.............................................................................................. 1363DROP OWNED...................................................................................................................1364DROP PROTOCOL............................................................................................................ 1365DROP RESOURCE GROUP..............................................................................................1365DROP RESOURCE QUEUE.............................................................................................. 1366DROP ROLE.......................................................................................................................1367DROP RULE.......................................................................................................................1368DROP SCHEMA................................................................................................................. 1369DROP SEQUENCE............................................................................................................ 1370DROP TABLE..................................................................................................................... 1370DROP TABLESPACE.........................................................................................................1371DROP TYPE....................................................................................................................... 1372DROP USER...................................................................................................................... 1373DROP VIEW....................................................................................................................... 1373END.....................................................................................................................................1374EXECUTE........................................................................................................................... 1374EXPLAIN............................................................................................................................. 1375FETCH................................................................................................................................ 1378GRANT................................................................................................................................1380INSERT............................................................................................................................... 1385LOAD.................................................................................................................................. 1387LOCK.................................................................................................................................. 1387MOVE..................................................................................................................................1390PREPARE........................................................................................................................... 1392REASSIGN OWNED...........................................................................................................1393REINDEX............................................................................................................................ 1394RELEASE SAVEPOINT......................................................................................................1395

  • Contents OpenTopic

    13

    RESET................................................................................................................................ 1396REVOKE............................................................................................................................. 1397ROLLBACK......................................................................................................................... 1399ROLLBACK TO SAVEPOINT.............................................................................................1399SAVEPOINT........................................................................................................................1401SELECT.............................................................................................................................. 1402SELECT INTO.................................................................................................................... 1416SET..................................................................................................................................... 1417SET ROLE.......................................................................................................................... 1419SET SESSION AUTHORIZATION..................................................................................... 1420SET TRANSACTION.......................................................................................................... 1422SHOW................................................................................................................................. 1424START TRANSACTION..................................................................................................... 1424TRUNCATE.........................................................................................................................1425UPDATE..............................................................................................................................1426VACUUM.............................................................................................................................1429VALUES.............................................................................................................................. 1432

    SQL 2008 Optional Feature Compliance......................................................................................1435Greenplum Environment Variables............................................................................................... 1464

    Required Environment Variables........................................................................................1464Optional Environment Variables......................................................................................... 1464

    System Catalog Reference........................................................................................................... 1466System Tables.................................................................................................................... 1466System Views..................................................................................................................... 1467System Catalogs Definitions...............................................................................................1468

    The gp_toolkit Administrative Schema..........................................................................................1554Checking for Tables that Need Routine Maintenance........................................................1554Checking for Locks.............................................................................................................1555Checking Append-Optimized Tables.................................................................................. 1557Viewing Greenplum Database Server Log Files................................................................ 1561Checking Server Configuration Files..................................................................................1564Checking for Failed Segments........................................................................................... 1565Checking Resource Group Activity and Status.................................................................. 1566Checking Resource Queue Activity and Status................................................................. 1568Checking Query Disk Spill Space Usage...........................................................................1570Viewing Users and Groups (Roles)....................................................................................1572Checking Database Object Sizes and Disk Space............................................................ 1573Checking for Uneven Data Distribution.............................................................................. 1577

    The gpperfmon Database..............................................................................................................1579database_*.........................................................................................................................1581diskspace_*....................................................................................................................... 1582interface_stats_*................................................................................................................ 1582log_alert_*..........................................................................................................................1584queries_*............................................................................................................................. 1585segment_*..........................................................................................................................1587socket_stats_*.....................................................................................................................1588system_*............................................................................................................................. 1589dynamic_memory_info........................................................................................................ 1591memory_info...................................................................................................................... 1591

    Greenplum Database Data Types.................................................................................................1593Character Set Support...................................................................................................................1598

    Setting the Character Set...................................................................................................1600Character Set Conversion Between Server and Client...................................................... 1600

    Server Configuration Parameters..................................................................................................1603Parameter Types and Values.............................................................................................1603Setting Parameters............................................................................................................. 1603

  • Contents OpenTopic

    14

    Parameter Categories.........................................................................................................1604Configuration Parameters...................................................................................................1614

    Summary of Built-in Functions...................................................................................................... 1697Greenplum Database Function Types................................................................................1697Built-in Functions and Operators........................................................................................1698JSON Functions and Operators......................................................................................... 1701Window Functions.............................................................................................................. 1704Advanced Aggregate Functions......................................................................................... 1706

    Greenplum MapReduce Specification...........................................................................................1708Greenplum MapReduce Document Format........................................................................1708Greenplum MapReduce Document Schema......................................................................1709Example Greenplum MapReduce Document..................................................................... 1716

    Greenplum PL/pgSQL Procedural Language............................................................................... 1722About Greenplum Database PL/pgSQL............................................................................. 1722PL/pgSQL Plan Caching.....................................................................................................1724PL/pgSQL Examples...........................................................................................................1724References..........................................................................................................................1728

    Greenplum PostGIS Extension..................................................................................................... 1729About PostGIS.................................................................................................................... 1729Enabling and Removing PostGIS Support......................................................................... 1730Usage..................................................................................................................................1731PostGIS Extension Support and Limitations...................................................................... 1732PostGIS Support Scripts.....................................................................................................1733

    Greenplum PL/R Language Extension..........................................................................................1736About Greenplum Database PL/R......................................................................................1736

    Greenplum PL/Python Language Extension................................................................................. 1742About Greenplum PL/Python..............................................................................................1742Enabling and Removing PL/Python support...................................................................... 1742Developing Functions with PL/Python................................................................................1743Installing Python Modules...................................................................................................1746Examples............................................................................................................................ 1749References..........................................................................................................................1751

    Greenplum PL/Container Language Extension.............................................................................1752About the PL/Container Language Extension.................................................................... 1752About PL/Container Resource Management......................................................................1753PL/Container Docker Images............................................................................................. 1755Prerequisites....................................................................................................................... 1755Installing the PL/Container Language Extension............................................................... 1756Installing PL/Container Docker Images.............................................................................. 1759Uninstalling PL/Container................................................................................................... 1759Using PL/Container Functions............................................................................................1761About PL/Container Running PL/Python............................................................................ 1763About PL/Container Running PL/R.....................................................................................1764Configuring PL/Container....................................................................................................1764Installing Docker................................................................................................................. 1774References..........................................................................................................................1776

    Greenplum PL/Java Language Extension.....................................................................................1777About PL/Java.................................................................................................................... 1777About Greenplum Database PL/Java.................................................................................1778Installing PL/Java................................................................................................................1779Enabling PL/Java and Installing JAR Files........................................................................ 1780Uninstalling PL/Java........................................................................................................... 1781Writing PL/Java functions................................................................................................... 1781Using JDBC........................................................................................................................ 1787Exception Handling.............................................................................................................1787Savepoints.......................................................................................................................... 1788

  • Contents OpenTopic

    15

    Logging............................................................................................................................... 1788Security............................................................................................................................... 1788Some PL/Java Issues and Solutions..................................................................................1789Example.............................................................................................................................. 1790References..........................................................................................................................1791

    Greenplum PL/Perl Language Extension......................................................................................1792About Greenplum PL/Perl...................................................................................................1792Greenplum Database PL/Perl Limitations.......................................................................... 1792Trusted/Untrusted Language.............................................................................................. 1792Enabling and Removing PL/Perl Support...........................................................................1793Developing Functions with PL/Perl.....................................................................................1793

    Greenplum MADlib Extension for Analytics.................................................................................. 1797About MADlib......................................................................................................................1797About Deep Learning..........................................................................................................1797Installing MADlib................................................................................................................. 1797Upgrading MADlib...............................................................................................................1798Uninstalling MADlib.............................................................................................................1799Examples............................................................................................................................ 1800References..........................................................................................................................1806

    Greenplum Partner Connector API............................................................................................... 1807Using the GPPC API..........................................................................................................1807Building a GPPC Shared Library with PGXS.....................................................................1819Registering a GPPC Function with Greenplum Database................................................. 1819Packaging and Deployment Considerations.......................................................................1820GPPC Text Function Example........................................................................................... 1821GPPC Set-Returning Function Example............................................................................ 1823

    Greenplum Fuzzy String Match Extension....................................................................................1827Soundex Functions............................................................................................................. 1827Levenshtein Functions........................................................................................................1828Metaphone Functions......................................................................................................... 1828Double Metaphone Functions.............................................................................................1829Installing and Uninstalling the Fuzzy String Match Functions............................................ 1829

    Summary of Greenplum Features.................................................................................................1830Greenplum SQL Standard Conformance........................................................................... 1830Greenplum and PostgreSQL Compatibility.........................................................................1832

    Chapter 18: Greenplum Database UNIX Client Documentation........ 1841Greenplum Database Client Tools for UNIX.................................................................................1842

    Installing the Greenplum Client Tools................................................................................ 1842Client Tools Reference.......................................................................................................1845

    Greenplum Database Load Tools for UNIX..................................................................................1846Installing the Greenplum Load Tools................................................................................. 1846Load Tools Reference........................................................................................................ 1847

    Chapter 19: Greenplum Database Windows Client Documentation..1849Greenplum Database Client Tools for Windows...........................................................................1850

    Installing the Greenplum Client Tools....................................................................