adapter la syntaxe pour pgSQL

Bernard Schoenacker <[email protected]> Thu, 11 Jan 2018 16:37:24 +0100 (CET)
Newsgroups gmane.comp.db.postgresql.french
Message-ID <149081809.757155829.1515685044200.JavaMail.root@zimbra19-e3.priv.proxad.net>
bonjour,

pour passer à mailman3 je suis obligé de revoir la structure de ma messagerie
et de basculer courier vers dovecot et PgSQL


étant un débutant je recherche à refaire les tables pour pgSQL, voici
les éléments qui sont prévus pour mariadb:


cat instructions-postfix-SQL.txt
..........................................................................................

// créer une base portant son nom et donner à cet utilisateurs tous les privilèges, ou :
..........................................................................................
mysql -u root -p
mysql> CREATE USER 'postfix'@'localhost' IDENTIFIED BY 'mot_de_passe';
mysql> GRANT USAGE ON * . * TO 'postfix'@'localhost' IDENTIFIED BY 'mot_de_passe';
mysql> CREATE DATABASE `postfix` ;
mysql> GRANT ALL PRIVILEGES ON `postfix` . * TO 'postfix'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> quit

//
CREATE USER 'postfix'@'localhost' IDENTIFIED BY  '***';

GRANT USAGE ON * . * TO  'postfix'@'localhost' IDENTIFIED BY  '***' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

GRANT ALL PRIVILEGES ON  `postfix` . * TO  'postfix'@'localhost';
..........................................................................................
// importer les tables postfix ou :
USE postfix;
CREATE TABLE `domaines` (
  `domaine` varchar(255) NOT NULL default '',
  `etat` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`domaine`)
) ENGINE=InnoDB;
CREATE TABLE `comptes` (
  `email` varchar(255) NOT NULL default '',
  `password` varchar(255) NOT NULL default '',
  `quota` int(10) NOT NULL default '0',
  `etat` tinyint(1) NOT NULL default '1',
  `imap` tinyint(1) NOT NULL default '1',
  `pop3` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`email`)
) ENGINE=InnoDB;
CREATE TABLE `alias` (
  `source` varchar(255) NOT NULL default '',
  `destination` text NOT NULL,
  `etat` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`source`)
) ENGINE=InnoDB;
..........................................................................................
INSERT INTO `postfix`.`comptes` ( `email` , `password` , `quota` , `etat` , `imap` , `pop3` ) VALUES ('[email protected]', ENCRYPT( 'mon_beau-mot-de-passe' ) , '0', '1', '1', '1');
..........................................................................................
service mysql reload

..........................................................................................
INSERT INTO `postfix`.`alias` ( `source`, `destination`  , `etat` ) VALUES ('[email protected]', '[email protected]', '1');
..........................................................................................


slt
bernard