Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E2BE4200BEF for ; Wed, 4 Jan 2017 16:48:41 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E140B160B3A; Wed, 4 Jan 2017 15:48:41 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 34960160B39 for ; Wed, 4 Jan 2017 16:48:41 +0100 (CET) Received: (qmail 93016 invoked by uid 500); 4 Jan 2017 15:48:40 -0000 Mailing-List: contact dev-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list dev@hawq.incubator.apache.org Received: (qmail 93000 invoked by uid 99); 4 Jan 2017 15:48:40 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jan 2017 15:48:40 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 5AA81C2432 for ; Wed, 4 Jan 2017 15:48:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -7.019 X-Spam-Level: X-Spam-Status: No, score=-7.019 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id LM16BlOWGoqC for ; Wed, 4 Jan 2017 15:48:38 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 767765F24E for ; Wed, 4 Jan 2017 15:48:37 +0000 (UTC) Received: (qmail 92936 invoked by uid 99); 4 Jan 2017 15:48:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jan 2017 15:48:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8930ADF9E6; Wed, 4 Jan 2017 15:48:36 +0000 (UTC) From: lisakowen To: dev@hawq.incubator.apache.org Reply-To: dev@hawq.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-hawq-docs pull request #77: HAWQ-1216 - clean up plpython docs Content-Type: text/plain Message-Id: <20170104154836.8930ADF9E6@git1-us-west.apache.org> Date: Wed, 4 Jan 2017 15:48:36 +0000 (UTC) archived-at: Wed, 04 Jan 2017 15:48:42 -0000 Github user lisakowen commented on a diff in the pull request: https://github.com/apache/incubator-hawq-docs/pull/77#discussion_r94606714 --- Diff: plext/using_plpython.html.md.erb --- @@ -2,374 +2,608 @@ title: Using PL/Python in HAWQ --- -This section contains an overview of the HAWQ PL/Python language extension. +This section provides an overview of the HAWQ PL/Python procedural language extension. ## About HAWQ PL/Python -PL/Python is a loadable procedural language. With the HAWQ PL/Python extension, you can write HAWQ user-defined functions in Python that take advantage of Python features and modules to quickly build robust database applications. +PL/Python is embedded in your HAWQ product distribution or within your HAWQ build if you chose to enable it as a build option. + +With the HAWQ PL/Python extension, you can write user-defined functions in Python that take advantage of Python features and modules, enabling you to quickly build robust HAWQ database applications. HAWQ uses the system Python installation. ### HAWQ PL/Python Limitations -- HAWQ does not support PL/Python triggers. +- HAWQ does not support PL/Python trigger functions. - PL/Python is available only as a HAWQ untrusted language. ## Enabling and Removing PL/Python Support -To use PL/Python in HAWQ, you must either use a pre-compiled version of HAWQ that includes PL/Python or specify PL/Python as a build option when compiling HAWQ. +To use PL/Python in HAWQ, you must either install a binary version of HAWQ that includes PL/Python or specify PL/Python as a build option when compiling HAWQ from source. + +PL/Python user-defined functions (UDFs) are registered at the database level. To create and run a PL/Python UDF on a database, you must register the PL/Python language with the database. + +On every database to which you want to install and enable PL/Python: + +1. Connect to the database using the `psql` client: + + ``` shell + $ psql -d + ``` + + Replace \ with the name of the target database. + +2. Run the following SQL command to register the PL/Python procedural language; you must be a database superuser to register new languages: + + ``` sql + dbname=# CREATE LANGUAGE plpythonu; + ``` -To create and run a PL/Python user-defined function (UDF) in a database, you must register the PL/Python language with the database. On every database where you want to install and enable PL/Python, connect to the database using the `psql` client. + **Note**: `plpythonu` is installed as an *untrusted* language; it offers no way of restricting what you can program in UDFs created with the language. --- End diff -- yes, it is kind of confusing. the operations one can perform with trusted languages are restricted; unprivileged database users can be permitted to create and run UDFs created in these languages. untrusted languages are the opposite - you can do pretty much anything, and i think are restricted to superusers. (will verify.) --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---