{"id":4487,"date":"2022-03-09T11:08:41","date_gmt":"2022-03-09T10:08:41","guid":{"rendered":"https:\/\/www.dlvsystem.it\/dlvsite\/?page_id=4487"},"modified":"2022-03-09T11:11:41","modified_gmt":"2022-03-09T10:11:41","slug":"dlvdb-user-manual","status":"publish","type":"page","link":"https:\/\/www.dlvsystem.it\/dlvsite\/dlvdb-user-manual\/","title":{"rendered":"DLVDB User Manual"},"content":{"rendered":"<div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-background-position:left top;--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-top:100px;--awb-padding-bottom:60px;--awb-border-sizes-top:0px;--awb-border-sizes-bottom:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height\" style=\"--awb-bg-size:cover;--awb-margin-bottom:0px;\"><div class=\"fusion-column-wrapper fusion-flex-column-wrapper-legacy\"><div class=\"fusion-title title fusion-title-1 fusion-title-center fusion-title-text fusion-title-size-two\"><div class=\"title-sep-container title-sep-container-left\"><div class=\"title-sep sep- sep-solid\" style=\"border-color:#e2e2e2;\"><\/div><\/div><span class=\"awb-title-spacer\"><\/span><h2 class=\"fusion-title-heading title-heading-center fusion-responsive-typography-calculated\" style=\"margin:0;--fontSize:48;line-height:1.2;\">DLV<sup>DB<\/sup> User Manual<\/h2><span class=\"awb-title-spacer\"><\/span><div class=\"title-sep-container title-sep-container-right\"><div class=\"title-sep sep- sep-solid\" style=\"border-color:#e2e2e2;\"><\/div><\/div><\/div><div class=\"fusion-text fusion-text-1\"><h4 class=\"AUTHOR\" style=\"text-align: center;\">DLVSystem&#8217;s Development Team<\/h4>\n<\/div><div class=\"accordian fusion-accordian\" style=\"--awb-border-size:1px;--awb-icon-size:13px;--awb-content-font-size:21px;--awb-icon-alignment:left;--awb-hover-color:#f9f9f9;--awb-border-color:#cccccc;--awb-background-color:#ffffff;--awb-divider-color:#e0dede;--awb-divider-hover-color:#e0dede;--awb-icon-color:#ffffff;--awb-title-color:#333333;--awb-content-color:#646464;--awb-icon-box-color:#007aa6;--awb-toggle-hover-accent-color:#007aa6;--awb-title-font-family:&quot;PT Sans&quot;;--awb-title-font-weight:400;--awb-title-font-style:normal;--awb-title-font-size:20px;--awb-content-font-family:&quot;PT Sans&quot;;--awb-content-font-style:normal;--awb-content-font-weight:regular;\"><div class=\"panel-group fusion-toggle-icon-boxed\" id=\"accordion-4487-1\"><div class=\"fusion-panel panel-default panel-a8b8545db474a0ac0 fusion-toggle-no-divider fusion-toggle-boxed-mode\"><div class=\"panel-heading\"><h4 class=\"panel-title toggle\" id=\"toggle_a8b8545db474a0ac0\"><a aria-expanded=\"false\" aria-controls=\"a8b8545db474a0ac0\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion-4487-1\" data-target=\"#a8b8545db474a0ac0\" href=\"#a8b8545db474a0ac0\"><span class=\"fusion-toggle-icon-wrapper\" aria-hidden=\"true\"><i class=\"fa-fusion-box active-icon awb-icon-minus\" aria-hidden=\"true\"><\/i><i class=\"fa-fusion-box inactive-icon awb-icon-plus\" aria-hidden=\"true\"><\/i><\/span><span class=\"fusion-toggle-heading\">Main Memory Execution<\/span><\/a><\/h4><\/div><div id=\"a8b8545db474a0ac0\" class=\"panel-collapse collapse \" aria-labelledby=\"toggle_a8b8545db474a0ac0\"><div class=\"panel-body toggle-content fusion-clearfix\">\n<p>In the following we describe the <code>#import<\/code> and <code>#export<\/code> built-ins of the DLV<sup>DB<\/sup> system. We will then also give a short introduction of the ODBC library and show how to configure a database system (PostgreSQL) to interface with DLV.<\/p>\n<h3>Syntax<\/h3>\n<p>We extend DLV with an ODBC interface by adding two new built-in commands to import and export relations (predicates) from\/to a DBMS. These commands take a number of arguments providing the information needed for DBMS authentication, the relational predicate to import\/export from\/to the DBMS, and the name of the table in the DBMS.<\/p>\n<h3>The #import command<\/h3>\n<p>The <code>#import<\/code> command reads tuples from a specified table of a relational database and stores them as facts (EDB program) with a predicate name p provided by the user. The name of the imported atoms is set to p, and defines a part of the EDB program. Further EDB predicates can be added by providing input via text files. Since DLV supports only supports unsigned integer and constant data types the #import command takes a parameter which specifies a type conversion for every column of the table.<\/p>\n<p>The <code>#import<\/code> command is of the form:<\/p>\n<p><code>#import(databasename,\"username\",\"password\",\"query\", predname, typeConv).<\/code><\/p>\n<p>where:<\/p>\n<ol>\n<li><em>databasename<\/em> is the name of the database server;<\/li>\n<li><em>username<\/em> defines the name of the user who connects to the database (the string must be enclosed by \u201d \u201c);<\/li>\n<li><em>password<\/em> defines the password of that user (the string must be enclosed by \u201d \u201c);<\/li>\n<li><em>query<\/em> as an SQL statement that constructs the table that will be imported (and must be quoted by \u201d \u201c);<\/li>\n<li><em>predname<\/em> defines the name of the predicate that will be used;<\/li>\n<li><em>typeConv<\/em> specifies the conversion for mapping DBMS data types to DLV data type; it provides a conversion for each column imported by the database.<\/li>\n<\/ol>\n<p>The <em>typeConv<\/em> parameter is a string with the following syntax: <code>type: Conv [, Conv]<\/code>, where type: is a string constant and Conv is one of several conversion types:<\/p>\n<ul>\n<li><em>U_INT<\/em>: the column is converted to an unsigned integer;<\/li>\n<li><em>UT_INT<\/em>: the column is truncated to an unsigned integer;<\/li>\n<li><em>UR_INT<\/em>: the column is rounded to an unsigned integer;<\/li>\n<li><em>CONST<\/em>: the column is converted to a string without quotes;<\/li>\n<li><em>Q_COST<\/em>: the column is converted to a string with quotes.<\/li>\n<\/ul>\n<p>The number of the entries in the conversion list has to match the number of columns in the selected table. Strings converted as CONST should be valid DLV constants (e.g. they must not contain spaces).<\/p>\n<h3>The <code>#export<\/code> command<\/h3>\n<p>The <code>#export<\/code> built-in allows exporting the extension of a predicate in an answer set to a database. Every atom (for that predicate) which is true in the answer set will lead to the insertion of a corresponding tuple into the database.<\/p>\n<p>The #export command comes in two variants. The first is of the form:<\/p>\n<p><code>#export(databasename, \"username\", \"password\", predname, tablename).<\/code><\/p>\n<p>The second variant adds another parameter, <em> \u201cREPLACE where SQL-Condition\u201d <\/em>, which replaces the tuples in the table tablename for which SQL-Condition holds. It allows adding tuples to the table without creating conflicts whenever such tuples would violate some integrity constraint of the database (e.g. duplicate values for a key attribute):<\/p>\n<p><code>#export(databasename, \"username\", \"password\", predname, tablename, \"REPLACE where SQL-Condition\").<\/code><\/p>\n<p>where<\/p>\n<ol>\n<li><em>databasename<\/em> is the name of the database server;<\/li>\n<li><em>username<\/em> is the name of the user who connects to the database (the string must be enclosed by \u201d \u201c);<\/li>\n<li><em>password<\/em> provides the password of that user (the string must be enclosed by \u201d \u201c);<\/li>\n<li><em>predname<\/em> defines the name of the predicate that will be exported;<\/li>\n<li><em>tablename<\/em> defines the name of the target table; it must be already present in the database, with the correct number of attributes;<\/li>\n<li><em> \u201cREPLACE where SQL-Condition\u201d <\/em> contains the keywords REPLACE and where followed by an SQL-Condition which indicates the tuples which shall be deleted from the relational table before the export takes place.<\/li>\n<\/ol>\n<p><em>Remark<\/em>: Export must be used with the option <code>-n=1<\/code>.<\/p>\n<p>The command line to evaluate the logic program (whit <code>#import<\/code> and <code>#export<\/code> command) in main-memory is:<\/p>\n<p><code>dl program_ie.dlv<\/code><\/p>\n<p>where, <code>dl<\/code> is an executable version of DLV<sup>DB<\/sup> and <em>program_ie.dlv<\/em> is a text file containing the logic program and the necessary <code>#import<\/code>\/<code>#export<\/code> commands.<\/p>\n<p>Note that, if the program query has some constants, you should prefer to activate the automatic magic-sets optimization, as:<\/p>\n<p><code>dl -ODMS program_ie.dlv<\/code><\/p>\n<\/div><\/div><\/div><div class=\"fusion-panel panel-default panel-7227c6375ad186089 fusion-toggle-no-divider fusion-toggle-boxed-mode\"><div class=\"panel-heading\"><h4 class=\"panel-title toggle\" id=\"toggle_7227c6375ad186089\"><a aria-expanded=\"false\" aria-controls=\"7227c6375ad186089\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion-4487-1\" data-target=\"#7227c6375ad186089\" href=\"#7227c6375ad186089\"><span class=\"fusion-toggle-icon-wrapper\" aria-hidden=\"true\"><i class=\"fa-fusion-box active-icon awb-icon-minus\" aria-hidden=\"true\"><\/i><i class=\"fa-fusion-box inactive-icon awb-icon-plus\" aria-hidden=\"true\"><\/i><\/span><span class=\"fusion-toggle-heading\">Direct DB Execution<\/span><\/a><\/h4><\/div><div id=\"7227c6375ad186089\" class=\"panel-collapse collapse \" aria-labelledby=\"toggle_7227c6375ad186089\"><div class=\"panel-body toggle-content fusion-clearfix\">\n<p>In the following we describe the direct database evaluation functionality of the DLV<sup>DB<\/sup> system. We will also give a necessary introduction of the database mapping directives and show how to prepare and configure dlv to be interfaced with a database system (e.g PostgreSQL or Oracle) in order to evaluate logic programs directly on the db. The present version of this functionality supports normal stratified logic programs plus aggregate functions, with input data (the facts) stored in possibly distributed databases.<\/p>\n<h3>Auxiliary Directives<\/h3>\n<p>The <em>Auxiliary Directives<\/em> are a set of dlv system directives. They must be written in a separate file that must have a \u201ctyp\u201d extension. The <em>Auxiliary Directives<\/em> are composed by three sections. In the first section (<em>Init-Section<\/em>), we define the database connection to the working database. The working database is the DBMS on which the logic program must be evaluated. In the second section (<em>Table-Definition<\/em>), we define the \u201cdatabase table\u201d\/\u201dlogic atom\u201d mappings. This mapping is needed in order to define the correspondences between atoms of the logic programs and tables of the distributed databases. In the last section (<em>Final-Section<\/em>), we define the output directive for storing some (or all) of the results of the program execution.<\/p>\n<h4>BNF Syntax of Auxiliary Directives<\/h4>\n<p><code>Init-Section\u00a0::=<\/code><\/p>\n<p>1.<code>USEDB databaseName:username:password [System-Like]?.<\/code><\/p>\n<p><code>System-Like\u00a0::=<\/code><\/p>\n<p><code>LIKE [POSTGRES | ORACLE | DB2 | SQLSERVER | MYSQL]<\/code><\/p>\n<p><code>Table-Definition (EDB definition)::=<\/code><\/p>\n<p>2. <code>USE tableName [( attribute [, attribute]*)]?<\/code><\/p>\n<p>3.<code> [AS (\"SQL-Statement\")]?<\/code><\/p>\n<p>4.<code> [FROM DatabaseName:UserName:Password]?<\/code><\/p>\n<p>5. <code>MAPTO predName [( type [, type] )]? [ALLOW_APPEND<sup>(1)<\/sup>]?.<\/code><\/p>\n<p><code>Table-Definition (IDB definition)::=<\/code><\/p>\n<p>6. <code>CREATE tableName [(attribute [, attribute]*)]?<\/code><\/p>\n<p>7. <code>MAPTO predName [( type [, type] )]?<\/code><\/p>\n<p>8. <code>[KEEP_AFTER_EXECUTION]?.<\/code><\/p>\n<p><code>Table-Definition (Query definition)::=<\/code><\/p>\n<p>9. <code>QUERY tableName.<\/code><\/p>\n<p><code>Final-Section\u00a0::=<\/code><\/p>\n<p>10. <code>DBOUTPUT DatabaseName:UserName:Password.<\/code><\/p>\n<p>|<\/p>\n<p>11. <code>OUTPUT [Write-Option]? predName<\/code><\/p>\n<p>12.<code> [AS AliasTableName]?<\/code><\/p>\n<p>13.<code> IN DatabaseName:UserName:Password.<\/code><\/p>\n<p><code>Write-Option\u00a0:: =<\/code><\/p>\n<p>14. <code>APPEND<\/code><\/p>\n<p>|<\/p>\n<p>15. <code>OVERWRITE<\/code><\/p>\n<p><sup>(1)<\/sup> ALLOW_APPEND clause is allowed only if the table is on the working database.<br \/>\nIn the following, we describe how to compose <em>Auxiliary Directives<\/em>. The <code>USEDB<\/code> command (line 1.) is needed to define the connection properties with the working database. A possible use of this directive, when the database name is <em>MyDatabase<\/em> (e.g. on Postgres DBMS) and the access is granted to the user scott with password tiger, is:<\/p>\n<p><code>USEDB MyDatabase:scott:tiger LIKE POSTGRES.<\/code><\/p>\n<p>The <code>USEDB<\/code> is the only non optional directive.<\/p>\n<p>The <code>LIKE<\/code> directive is optional, but it is highly recommended if the working database is among the listed one. Indeed, this directive allows our system both to use SQL dialect of the specified system (guaranteeing full compatibility with DLV<sup>DB<\/sup>) and to optimize the interaction of the system with the working database (to possibly enhance performances). If the LIKE directive is not used, standard SQL and ODBC functionalities are exploited (in particular, full compatibility with POSTGRES is guaranteed).<\/p>\n<p>Note that, currently, the list of DBMS fully compatible as working database for DLV<sup>DB<\/sup> is:<\/p>\n<ul>\n<li>POSTGRESQL 8.0 and higher<\/li>\n<li>MySQL 5.0<\/li>\n<li>ORACLE 10g<\/li>\n<li>SQL Server 2005<\/li>\n<li>DB2 UDB Version 8.2<\/li>\n<\/ul>\n<p>For instance, suppose we have a table such as <code>my_table(lname varchar(20), fname char(20))<\/code> on <code>remote_database<\/code> and our logic program defines the atom <code>my_atom<\/code> as <code>my_atom(X, Y)<\/code>. If we need to specify a mapping between my_table and my_atom, we have to define the following Auxiliary Directive:<\/p>\n<p><code>USE my_table (lname, fname) FROM remote_database:dlv:db MAPTO my_atom (varchar(20), char(20)).<\/code><br \/>\nOn the other hand, when a <code>[AS (\"SQL-Statement\")]<\/code> (3.) clause is specified, the <code>tablename<\/code> is expected to be updated by means of the tuples resulting from execution of the <code>\"SQL-Statement\"<\/code>. That is, the arity of the table <code>tablename<\/code> and the predicate <code>predName<\/code> must be compliant with both arity and types of the result set obtained.<br \/>\nThe IDB definition is similar to the EDB definition. With the <code>CREATE<\/code> directive, the system creates an IDB table <em>tableName<\/em> and defines the mapping with the logic atom <em>predName<\/em>. This table will be created into the working database. The directive at line 8., if present, defines that the table is not deleted at the end of the evaluation. For example, if we need to map a logic IDB <em>my_idb_predicate<\/em> with a database table, we must define the following Auxiliary Directive:<\/p>\n<p><code>CREATE my_idb_table (preferred_attribute_name_1, preferred_attribute_name_1) MAPTO my_idb_predicate (varchar(20), char(20)).<\/code><\/p>\n<p>Noted that the just created table will be deleted after the execution end (this could be useful for intermediate or support tables). However, if we need this table to be persistent (e.g., because it store useful information we want to further analyze), than the correct definition is:<\/p>\n<p><code>CREATE my_idb_table<br \/>\n(preferred_attribute_name_1, preferred_attribute_name_1) MAPTO<br \/>\nmy_idb_predicate (varchar(20), char(20)) KEEP_AFTER_EXECUTION.<\/code><br \/>\nIntuitively, an <code>Use<\/code> directive is intended to map a predicate whose extension cannot change during processing. That is, the associated table is read-only. On the other hand, a <code>Create<\/code> directive is conceived to create a new table on the working database in order to store new data inferred for the related predicate. In case we need both accessing tuples within a table and adding new tuples derived during the computation, we have to explicitly allow for \u201cappend\u201d operations. In particular, we have to specify an <code>USE ... ALLOW_APPEND<\/code> directive. For instance\u00a0:<\/p>\n<p><code>USE my_table (lname, fname) FROM working_database:dlv:db MAPTO my_atom (varchar(20), char(20)) ALLOW_APPEND.<\/code><br \/>\nThe <code>QUERY<\/code> option, allows to define the name of the query table (i.e the table storing the results of the query possibly present in the logic program). In the <em>Final-Section<\/em> we introduce the <code>OUTPUT<\/code> directive. This directive is necessary in order to redirect the output of the program computation. With line 10., the working database in which the program stores the computation, is specified into the database <em>DatabaseName<\/em>. If we need to store only a specified <em>predName<\/em> (noted that <em>predName<\/em> is mapped to a table) then, we must use the directive 11. Specifically, if we need to store the content of the predicate <em>my_predicate<\/em> after the execution to the database <em>remote_database<\/em> (grant access to user <em>pippo<\/em> with password <em>pluto<\/em>), and I need to rename the table to <em>my_new_table<\/em> and I need to APPEND the new data to the data possibly already present in that table, I must use the following Mapping Directive:<\/p>\n<p><code>OUTPUT APPEND my_predicate AS my_new_table IN remote_database:pippo:pluto.<\/code><\/p>\n<p>The command line needed to evaluate the logic program in mass-memory (on a DBMS) is:<\/p>\n<p><code>dl -DBSupport -ORdr- program.dlv directives.typ<\/code><\/p>\n<p>where, <em>dl<\/em> is an executable version of DLV<sup>DB<\/sup>, <em>program.dlv<\/em> is a text file containing the logic program and <em>directives.typ<\/em> is a text file containing the auxialry directives.<\/p>\n<p>Note that, if the program query has some constants, you should prefer to activate the automatic magic-sets optimization, as:<\/p>\n<p><code>dl -DBSupport -ORdr- -ODMS program.dlv directives.typ<\/code><\/p>\n<\/div><\/div><\/div><div class=\"fusion-panel panel-default panel-29933396fe5645aeb fusion-toggle-no-divider fusion-toggle-boxed-mode\"><div class=\"panel-heading\"><h4 class=\"panel-title toggle\" id=\"toggle_29933396fe5645aeb\"><a aria-expanded=\"false\" aria-controls=\"29933396fe5645aeb\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion-4487-1\" data-target=\"#29933396fe5645aeb\" href=\"#29933396fe5645aeb\"><span class=\"fusion-toggle-icon-wrapper\" aria-hidden=\"true\"><i class=\"fa-fusion-box active-icon awb-icon-minus\" aria-hidden=\"true\"><\/i><i class=\"fa-fusion-box inactive-icon awb-icon-plus\" aria-hidden=\"true\"><\/i><\/span><span class=\"fusion-toggle-heading\">ODBC Set Up<\/span><\/a><\/h4><\/div><div id=\"29933396fe5645aeb\" class=\"panel-collapse collapse \" aria-labelledby=\"toggle_29933396fe5645aeb\"><div class=\"panel-body toggle-content fusion-clearfix\">\n<p>DLV<sup>DB<\/sup> provides an interface to database systems via ODBC (Open Database Connectivity). For Unix-like systems, this is achieved by using unixODBC, while for Windows systems Microsoft ODBC is used.<\/p>\n<h3>Set up unixODBC<\/h3>\n<p>Now let\u2019s set up unixODBC (we again assume that it has already been installed correctly). The relevant configuration files are \/etc\/odbcinst.ini and \/etc\/odbc.ini. For further information or finding out what to do for configuring unixODBC refer to <a title=\"http:\/\/www.unixodbc.org\/\" href=\"http:\/\/web.archive.org\/web\/20170414152435\/http:\/\/www.unixodbc.org\/\" rel=\"nofollow\">http:\/\/www.unixodbc.org<\/a>.<\/p>\n<p>We will give a brief example in which we set up unixODBC with a PostgreSQL database system. Note that this is not at all related to DLV. It is not important, which database is \u201cbehind\u201d the ODBC interface, PostgreSQL is just an example. You should in any case consult the respective manuals for your database, unixODBC or the Windows ODBC subsystem when creating your ODBC setup.<\/p>\n<p>\/etc\/odbcinst.ini defines the drivers. This might have been configured already by your system upon installation; on our test system it looks as follows:<\/p>\n<p><code>[PostgreSQLa]<\/code><\/p>\n<p><code>Description = PostgreSQL ODBC ANSI driver<\/code><\/p>\n<p><code>Driver = \/usr\/lib\/odbc\/psqlodbca.so<\/code><\/p>\n<p><code>Setup = \/usr\/lib\/odbc\/libodbcpsqlS.so<\/code><\/p>\n<p><code>UsageCount = 1<\/code><\/p>\n<p><code>CPTimeout =<\/code><\/p>\n<p><code>CPReuse =<\/code><\/p>\n<p>\/etc\/odbc.ini defines the database access. For the database we have just created, this looks as follows:<\/p>\n<p><code>[test-ansi]<\/code><\/p>\n<p><code>Description = ODBC DSN test-ansi<\/code><\/p>\n<p><code>Driver = PostgreSQLav<\/code><\/p>\n<p><code>Trace = No<\/code><\/p>\n<p><code>TraceFile =<\/code><\/p>\n<p><code>Database = test<\/code><\/p>\n<p><code>Servername = localhost<\/code><\/p>\n<p><code>Username = dlvodbc<\/code><\/p>\n<p><code>Password = dlvodbc<\/code><\/p>\n<p><code>Port = 5432<\/code><\/p>\n<p><code>Protocol = 6.4<\/code><\/p>\n<p><code>ReadOnly = No<\/code><\/p>\n<p><code>RowVersioning = No<\/code><\/p>\n<p><code>ShowSystemTables = No<\/code><\/p>\n<p><code>ShowOidColumn = No<\/code><\/p>\n<p><code>FakeOidIndex = No<\/code><\/p>\n<p><code>ConnSettings =<\/code><\/p>\n<p>The name in square brackets is the ODBC DSN (Data Source Name). The driver must match the ID defined in \/etc\/odbcinst.ini; <em>User<\/em>, <em>Password<\/em>, and <em>Databas<\/em>e are those of our PostgreSQL setup. The Server is our own machine (localhost), using the standard PostgreSQL port 5432.<\/p>\n<h3>Set up ODBC on Windows system<\/h3>\n<p>The ODBC Data Source Administrator within Windows enables you to create DSNs, check driver installation and configure ODBC systems such as tracing (used for debugging) and connection pooling.<\/p>\n<p>Different editions and versions of Windows store the ODBC Data Source Administrator in different locations depending on the version of Windows that you are using.<\/p>\n<p>To open the ODBC Data Source Administrator on <strong>Windows XP<\/strong>:<\/p>\n<ol>\n<li>On the Start menu, click Control Panel.<\/li>\n<li>In the Control Panel when in Category View click Performance and Maintenance and then click Administrative Tools.. If you are viewing the Control Panel in Classic View, click Administrative Tools.<\/li>\n<li>In Administrative Tools, click Data Sources (ODBC).<\/li>\n<\/ol>\n<p>To add and configure a new data source (i.e., for PostgreSQL database) on Windows, use the ODBC Data Source Administrator:<\/p>\n<ol>\n<li>Open the ODBC Data Source Administrator;<\/li>\n<li>To create a System DSN (which will be available to all users) , select the System DSN tab. To create a User DSN, which will be unique only to the current user, select the User DSN tab; click the <strong>Add<\/strong>.. button;<\/li>\n<li>You will need to select the ODBC driver for this DSN (i.e.,select PostgreSQL ANSI driver), then click Finish. Note that the ODBC driver must already installed on your system.<\/li>\n<li>You now need to configure the specific fields for the DSN you are creating through the Add Data Source Namedialog:\n<ul>\n<li>In the Data Source Name box, enter the name of the data source you want to access. It can be any valid name that you choose;<\/li>\n<li>In the Description box, enter some text to help identify the connection;<\/li>\n<li>In the Server field, enter the name of the server host that you want to access. By default, it is localhost;<\/li>\n<li>In the User field, enter the user name to use for this connection;<\/li>\n<li>In the Password field, enter the corresponding password for this connection;<\/li>\n<li>In the Database field, enter the database name;<\/li>\n<\/ul>\n<\/li>\n<li>Click <strong>OK<\/strong> to save the DSN.<\/li>\n<\/ol>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-4487","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.dlvsystem.it\/dlvsite\/wp-json\/wp\/v2\/pages\/4487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dlvsystem.it\/dlvsite\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.dlvsystem.it\/dlvsite\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.dlvsystem.it\/dlvsite\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dlvsystem.it\/dlvsite\/wp-json\/wp\/v2\/comments?post=4487"}],"version-history":[{"count":2,"href":"https:\/\/www.dlvsystem.it\/dlvsite\/wp-json\/wp\/v2\/pages\/4487\/revisions"}],"predecessor-version":[{"id":4489,"href":"https:\/\/www.dlvsystem.it\/dlvsite\/wp-json\/wp\/v2\/pages\/4487\/revisions\/4489"}],"wp:attachment":[{"href":"https:\/\/www.dlvsystem.it\/dlvsite\/wp-json\/wp\/v2\/media?parent=4487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}