Changes between Version 79 and Version 80 of members/GRIP-UQAM


Ignore:
Timestamp:
Apr 2, 2016, 10:42:33 AM (3 years ago)
Author:
https://id.mayfirst.org/gripuqam
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • members/GRIP-UQAM

    v79 v80  
    5959    * #!js
    6060    * #!text/javascript ...
    61     * #!sql
     61    * **#!sql**
    6262    * #!text/x-sql
    6363    * #!text/x-sqlite3-console
     
    8282=== Reported by us ===
    8383[[TicketQuery(reporter=https://id.mayfirst.org/gripuqam|https://id.mayfirst.org/gripuqamweb|https://id.mayfirst.org/essais)]]
    84 === Drupal requirements ===
    85 * Drupal 8.0.5 needs Postgresql >= 9.1.2 instead of 8.4.20 #11587, #11522
    8684=== Taged with GRIP-UQAM with description ===
    8785[[TicketQuery(max=1,keywords~=GRIP-UQAM,format=table,col=changetime|resolution|owner|summary,rows=description)]]
     
    9694* [wiki:support-team]
    9795== Some PostgreSQL commands ==
    98 * $ psql postgres --command="\l" # do see DB on server and parameters
    99 * postgres:~$ createuser -D -R -S <UNIX user>
    100 * postgres:~$ createdb -O <postgres user> <database name>
    101 * $ pg_dump -Fc --verbose --file=<file name (.data)> <database name>
    102 * $ pg_restore --verbose --no-owner --no-privileges --dbname=<database name> <file name (.data)> # restore the data base as a different user eg. to clone a Drupal website
     96* List of DB with parameters
     97{{{#!sh
     98$ psql postgres --command="\l"
     99}}}
     100* Create user
     101{{{#!sh
     102postgres:~$ createuser -D -R -S <UNIX user>
     103}}}
     104* Create DB
     105{{{#!sh
     106postgres:~$ createdb -O <postgres user> <database name>
     107}}}
     108* Backup
     109{{{#!sh
     110$ pg_dump -Fc --verbose --file=<file name (.data)> <database name>
     111}}}
     112* Restore the data base as a different user eg. to clone a Drupal website (bad idea to clone a drupal website)
     113{{{#!sh
     114$ pg_restore --verbose --no-owner --no-privileges --dbname=<database name> <file name (.data)>
     115}}}
     116* Drop all tables in a database
     117 * keywords: drop all tables from postgres database
     118 * This can be copyed into psql
     119{{{#!sql
     120DROP FUNCTION IF EXISTS remove_all();
     121
     122CREATE FUNCTION remove_all() RETURNS void AS $$
     123DECLARE
     124    rec RECORD;
     125    cmd text;
     126BEGIN
     127    cmd := '';
     128
     129    FOR rec IN SELECT
     130            'DROP SEQUENCE ' || quote_ident(n.nspname) || '.'
     131                || quote_ident(c.relname) || ' CASCADE;' AS name
     132        FROM
     133            pg_catalog.pg_class AS c
     134        LEFT JOIN
     135            pg_catalog.pg_namespace AS n
     136        ON
     137            n.oid = c.relnamespace
     138        WHERE
     139            relkind = 'S' AND
     140            n.nspname NOT IN ('pg_catalog', 'pg_toast') AND
     141            pg_catalog.pg_table_is_visible(c.oid)
     142    LOOP
     143        cmd := cmd || rec.name;
     144    END LOOP;
     145
     146    FOR rec IN SELECT
     147            'DROP TABLE ' || quote_ident(n.nspname) || '.'
     148                || quote_ident(c.relname) || ' CASCADE;' AS name
     149        FROM
     150            pg_catalog.pg_class AS c
     151        LEFT JOIN
     152            pg_catalog.pg_namespace AS n
     153        ON
     154            n.oid = c.relnamespace WHERE relkind = 'r' AND
     155            n.nspname NOT IN ('pg_catalog', 'pg_toast') AND
     156            pg_catalog.pg_table_is_visible(c.oid)
     157    LOOP
     158        cmd := cmd || rec.name;
     159    END LOOP;
     160
     161    FOR rec IN SELECT
     162            'DROP FUNCTION ' || quote_ident(ns.nspname) || '.'
     163                || quote_ident(proname) || '(' || oidvectortypes(proargtypes)
     164                || ');' AS name
     165        FROM
     166            pg_proc
     167        INNER JOIN
     168            pg_namespace ns
     169        ON
     170            (pg_proc.pronamespace = ns.oid)
     171        WHERE
     172            ns.nspname =
     173            'public'
     174        ORDER BY
     175            proname
     176    LOOP
     177        cmd := cmd || rec.name;
     178    END LOOP;
     179
     180    EXECUTE cmd;
     181    RETURN;
     182END;
     183$$ LANGUAGE plpgsql;
     184
     185SELECT remove_all();
     186}}}
     187http://stackoverflow.com/questions/3327312/drop-all-tables-in-postgresql
     188 * http://stackoverflow.com/questions/20017552/delete-all-table-without-droping-database-in-postgres-in-django-dbshell-in-one-c
    103189== Javascript: from npm to bower ==
    104190* $ nice -n 127 ionice --class=idle npm install bower --save
     
    283369 * [https://www.drupal.org/node/1314752 Versioned dependencies and Git]
    284370* [https://git-scm.com/book/tr/v2/Git-Internals-Git-References 10.3 Git Internals - Git References]
     371== Drupal 8 requirements and particularities ==
     372* Drupal 8.0.5 needs Postgresql >= 9.1.2 instead of 8.4.20 #11587, #11522
     373* Drupal 8.0.4-or-5 does not work with Postgres
     374 * keywords: drupal 8 postgresql
     375 * [https://www.drupal.org/node/2157455 Make Drupal 8 work with PostgreSQL or remove support from core before release]
     376 * [https://www.drupal.org/node/1060476 Multiple issues when PostgreSQL is used with non-public schema]
    285377== CKEditor for Drupal 7 ==
    286378Lets'use wysiwyg module