Main Content

PostgreSQL Native Interface

Interact with a PostgreSQL database using the PostgreSQL native interface

Create a data source and connect to a PostgreSQL database. Explore data and import data from the database into MATLAB®. Export data from MATLAB into the database. Explore and import data using the Database Explorer app or the command line.

Objects

connectionPostgreSQL native interface database connection (Since R2020b)
SQLConnectionOptionsDefine PostgreSQL native interface database connection options (Since R2020b)

Functions

expand all

databaseConnectionOptionsCreate database connection options (Since R2020b)
rmoptionsRemove PostgreSQL native interface connection options (Since R2020b)
saveAsDataSourceSave PostgreSQL native interface data source (Since R2020b)
setoptionsSet PostgreSQL native interface connection options (Since R2020b)
resetReset PostgreSQL native interface connection options to defaults (Since R2020b)
testConnectionTest PostgreSQL native interface database connection (Since R2020b)
postgresqlCreate PostgreSQL native interface database connection (Since R2020b)
closeClose PostgreSQL native interface database connection (Since R2020b)
isopenDetermine if PostgreSQL native interface database connection is open (Since R2020b)
sqlfindFind information about all table types in PostgreSQL database (Since R2020b)
fetchImport results of SQL statement in PostgreSQL database into MATLAB (Since R2020b)
sqlreadImport data into MATLAB from PostgreSQL database table (Since R2020b)
sqlinnerjoinInner join between two PostgreSQL database tables (Since R2020b)
sqlouterjoinOuter join between two PostgreSQL database tables (Since R2020b)
executeSQLScriptExecute SQL script on PostgreSQL database (Since R2020b)
databaseImportOptionsDefine import options for database data
getoptionsRetrieve import options for database data
previewPreview eight rows from database using import options
setoptionsCustomize import options for database data
resetReset to default import options for database data
databaseDatastoreDatastore for data in database
hasdataDetermine if data in DatabaseDatastore is available to read
previewReturn subset of data from DatabaseDatastore
readRead data in DatabaseDatastore
readallRead all data in DatabaseDatastore
resetReset DatabaseDatastore to initial state
splitsqlquerySplit SQL query using paging
createConnectionForPoolInitialize parallel pool using database connection
sqlwriteInsert MATLAB data into PostgreSQL database table (Since R2020b)
executeExecute SQL statement using PostgreSQL native interface database connection (Since R2020b)
commitMake changes to PostgreSQL database permanent (Since R2020b)
rollbackUndo changes to PostgreSQL database (Since R2020b)
sqlupdateUpdate rows in PostgreSQL database table (Since R2023a)

Topics

Configure PostgreSQL Native Interface

Import Data into MATLAB

Export Data from MATLAB

Execute Database Operations

Deploy Standalone Database Application