Jump toUpdate content
Database-icon

Database

Let us address the most common questions you have about Database.

What is Scaleway Database?

Scaleway Database provides fully-managed relational database Instances, supporting the database engines PostgreSQL and MySQL.

The product lets you focus on development, rather than administration or configuration. It comes with high-availability mode, data replication, and automatic backups.

In comparison to traditional database management, which requires customers to provision their infrastructure and resources to manage their databases, Scaleway Database offers the user access to a database instance without the need for setting up the hardware or configuring the software. Scaleway handles the provisioning, manages the configuration, and provides useful features as high availability, Automated Backup, User management, and more.

How can I access my database once it is provisioned?

On the details page of your Instance, the IP address and your Instance’s port are shown:

It is possible to connect to your Instance from any application using the IP address and port shown in the Endpoint section and the login/password of any valid database user. This can be managed from the “users” tab.

PostgreSQL

To access your Scaleway Database for PostgreSQL Instance, use the psql command-line tool with the following command: psql -h $IP -p $PORT -U $YOUR_USER -d $DATABASE_NAME You will have to enter your password to establish the connection. The default $DATABASE_NAME to be used is rdb.

MySQL

You can access your Scaleway Database for MySQL Instance with the following command:

mysql -h $IP --port $PORT -p -u $USERNAME You will be prompted to enter your password to log in.

How do I import data into a Scaleway Database?

PostgreSQL

To import data into your Scaleway Database for PostgreSQL, export your data using the pg_dump command in a first step:

pg_dump -h OLD_DB_IP -p OLD_DB_PORT -U OLD_DB_USERNAME -F c -b -v -f "/usr/local/backup/database.backup" DATABASE_NAME

Once the data is exported, import the database using the pg_restore command:

pg_restore -h INSTANCE_IP -p INSTANCE_PORT -U USERNAME -d DATABASE_NAME -v "/usr/local/backup/database.backup"

The different parameters used in the commands represent the following values:

-h (—host): IP address of the host -p (—port): Port number of the host -U (—username): PostgreSQL user -F (—format): Format c: c just after a -F means that the format is the binary format specific to postgreSQL -b (—blobs): Specifies the binary string type -v (—verbose) -f (—file): Specifies the file name

MySQL

If you want to import your existing database into a Scaleway Database for MySQL, start by exporting your data using the command mysqldump:

mysqldump -u username -p old_database > backup.sql Then import the backup into your Scaleway Database for MySQL:

mysql -u username -p new_database < backup.sql

Which postgreSQL extensions are available?

The following pg_extensions are available for Scaleway Database:

Extension nameComment
chkpassdata type for auto-encrypted passwords
pgrowlocksshow row-level locking information
sslinfoinformation about SSL certificates
citextdata type for case-insensitive character strings
tablefuncfunctions that manipulate whole tables, including crosstab
uuid-osspgenerate universally unique identifiers (UUIDs)
pg_buffercacheexamine the shared buffer cache
intarrayfunctions, operators, and index support for 1-D arrays of integers
bloombloom access method – signature file based index
hstoredata type for storing sets of (key, value) pairs
isndata types for international product numbering standards
dict_inttext search dictionary template for integers
tsm_system_rowsTABLESAMPLE method which accepts number of rows as a limit
btree_ginsupport for indexing common datatypes in GIN
plpgsqlPL/pgSQL procedural language
tsm_system_timeTABLESAMPLE method which accepts time in milliseconds as a limit
unaccenttext search dictionary that removes accents
pgcryptocryptographic functions
intagginteger aggregator and enumerator (obsolete)
pg_freespacemapexamine the free space map (FSM)
pgstattupleshow tuple-level statistics
pg_trgmtext similarity measurement and index searching based on trigrams
cubedata type for multidimensional cubes
dblinkconnect to other PostgreSQL databases from within a database
fuzzystrmatchdetermine similarities and distance between strings
earthdistancecalculate great-circle distances on the surface of the Earth
dict_xsyntext search dictionary template for extended synonym processing
btree_gistsupport for indexing common datatypes in GiST
pg_visibilityexamine the visibility map (VM) and page-level visibility info
ltreedata type for hierarchical tree-like structures
pg_prewarmprewarm relation data
postgisPostGIS geometry, geography, and raster spatial types and functions
address_standardizer_data_usAddress Standardizer US dataset example
address_standardizerUsed to parse an address into constituent elements. Generally used to support geocoding address normalization step.
postgis_sfcgalPostGIS SFCGAL functions
postgis_topologyPostGIS topology spatial types and functions
postgis_tiger_geocoderPostGIS tiger geocoder and reverse geocoder
postgres_fdwThe postgres_fdw module provides the foreign-data wrapper postgres_fdw, which can be used to access data stored in external PostgreSQL servers.
postgis_rasterPostGIS Raster implements the RASTER type like the GEOMETRY type support in PostGIS
pgroutingpgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality
ogr_fdwOGR is the vector half of the GDAL spatial data access library
timescaledbenable handling of time-series data

How do I backup my database?

If the automatic backup feature is enabled, new backups will be created according to your backup schedule, which can be set on the “Instance overview” tab. Your instance is available during backup, but there might be a performance impact and some actions may not be available. Automatic backups are enabled by default. It is possible to disable them at any time in the backup settings of your Instance. It is also possible to launch manual backups by clicking on the Create a backup button from the backups tab.