Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ GaussDB(DWS)/ SQL Syntax Reference/ SQL Syntax Reference (8.1.3.x)/ Differences Between GaussDB(DWS) and PostgreSQL

Differences Between GaussDB(DWS) and PostgreSQL

Updated on 2024-09-03 GMT+08:00

The differences between GaussDB(DWS) and PostgreSQL are sorted based on PostgreSQL 9.X. The differences are as follows:

Client Differences

GaussDB(DWS) gsql differs from PostgreSQL psql in that the former has made the following changes to enhance security:

  • User passwords cannot be set by running the \password meta-command.
  • The \i+, \ir+, and \include_relative+ meta-commands and the input and output parameter -k are added to encrypt imported and exported files.
  • Historical command lines cannot be printed to files using the \s meta-command.
  • SQL statements related to sensitive operations, such as those containing passwords, are not recorded. Users cannot see such records when they turn pages or press up or down arrow keys to view the SQL history.
  • After a connection is set up, a message is displayed to inform users of password expiration and to show version information.

gsql provides the following additional functions based on psql:

  • The output format parameter -r is added to allow you to adjust the focus by pressing the Tab key or arrow keys when entering commands.
  • The \parallel meta-command is added to improve execution performance.
  • The \set RETRY meta-command is added to support retry upon statement errors.
  • Slashes (/) are used as the default terminator at the end of PL/SQL statements CREATE OR REPLACE FUNCTION/PROCEDURE.

libpq:

During the development of certain GaussDB(DWS) functions such as the gsql client connection tool, PostgreSQL libpq is greatly modified. However, the libpq interface is not verified in application development. You are not advised to use this set of APIs for application development, because underlying risks probably exist. You can use the ODBC or JDBC APIs instead.

SQL Statement Differences

Table 1 PostgreSQL syntaxes not supported by GaussDB(DWS)

Type

Syntaxes Not Supported by GaussDB(DWS)

Description

Data

Geometric lines

For details about the data types supported by GaussDB(DWS), see Data Types.

pg_node_tree

Functions

Enumeration functions:

  • enum_first(anyenum)
  • enum_last(anyenum)
  • enum_range(anyenum)
  • enum_range(anyenum, anyenum)

For details about the functions supported by GaussDB(DWS), see Functions and Operators.

Access permission query functions:

  • has_sequence_privilege(user, sequence, privilege)
  • has_sequence_privilege(sequence, privilege)
System directory information functions:
  • pg_get_triggerdef(trigger_oid)
  • pg_get_triggerdef(trigger_oid, pretty_bool)

Geometric type conversion function:

line(point, point)

pg_node_tree

SQL syntax

CREATE TABLE clause:

INHERITS ( parent_table [, ... ] )

Inherits tables.

CREATE TABLE column constraints:

REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE action ] [ ON UPDATE action ]

Use REFERENCES reftable [ (refcolumn) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE action ] [ ON UPDATE action ] to create a foreign key constraint for a table.

CREATE TABLE table constraints:

EXCLUDE [ USING index_method ] ( exclude_element WITH operator [, ... ] )

Use EXCLUDE [ USING index_method ] ( exclude_element WITH operator [, ... ] ) to create exclusion constraints for a table.

CREATE/ALTER/DROP EXTENSION

Loads, modifies, and deletes extensions.

CREATE/ALTER/DROP AGGREGATE

Defines, modifies, and deletes aggregate functions.

CREATE/ALTER/DROP OPERATOR

Creates, modifies, and deletes operators.

CREATE/ALTER/DROP OPERATOR CLASS

Creates, modifies, and deletes operator classes.

CREATE/ALTER/DROP OPERATOR FAMILY

Creates, modifies, and deletes operator families.

CREATE/ALTER/DROP TEXT SEARCH PARSER

Creates, modifies, and deletes text search parsers.

CREATE/ALTER/DROP TEXT SEARCH TEMPLATE

Create, modify, and delete text search templates.

CREATE/ALTER/DROP COLLATION

Creates, modifies, and deletes collation rules.

CREATE/ALTER/DROP CONVERSION

Defines, modifies, and deletes the conversion of character set encoding.

CREATE/ALTER/DROP RULE

Creates, modifies, and deletes rules.

CREATE/ALTER/DROP LANGUAGE

Registers, modifies, and deletes procedural languages (LANGUAGE).

CREATE/ALTER/DROP DOMAIN

Creates, modifies, and deletes domains.

CREATE/DROP CAST

Defines and deletes casts.

CREATE/ALTER/DROP USER MAPPING

Defines, modifies, and deletes user mapping.

SECURITY LABEL

Defines or changes the security tag of an object.

NOTIFY

Generates a notification.

LISTEN

Listens to a notification.

UNLISTEN

Stops listening to a notification.

LOAD

Loads or reloads a shared library file.

DISCARD

Releases session resources of a database. (Clusters of 8.2.0 and later versions support DISCARD.)

MOVE BACKWARD

Moves a cursor backward.

COPY FROM FILE and COPY TO FILE

To isolate permissions, COPY FROM FILE and COPY TO FILE is disabled in GaussDB(DWS).

Other

User-defined C functions

For details about user-defined functions supported by GaussDB(DWS), see User-Defined Functions.

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback