Commit a984270b authored by Stephane Crozat's avatar Stephane Crozat

Mise en forme README

parent 4b95a1ec
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
su postgres su postgres
psql psql
```
\c postgres \c postgres
DROP DATABASE apisub; DROP DATABASE apisub;
CREATE DATABASE apisub WITH OWNER apisub; CREATE DATABASE apisub WITH OWNER apisub;
...@@ -12,6 +13,7 @@ BEGIN; ...@@ -12,6 +13,7 @@ BEGIN;
\i /home/stc/Bureau/apisub20181213.sql \i /home/stc/Bureau/apisub20181213.sql
SELECT pg_catalog.set_config('search_path', 'public', false); SELECT pg_catalog.set_config('search_path', 'public', false);
COMMIT; COMMIT;
```
## Sync des inscriptions arbitrées sur tableur ## Sync des inscriptions arbitrées sur tableur
...@@ -19,6 +21,7 @@ COMMIT; ...@@ -19,6 +21,7 @@ COMMIT;
2. Enregistrer sous ; format CSV ; paramètres du filtre (UTF-8 et séparateur ;) 2. Enregistrer sous ; format CSV ; paramètres du filtre (UTF-8 et séparateur ;)
3. Importer dans une table finalsub 3. Importer dans une table finalsub
```
BEGIN; BEGIN;
CREATE TABLE finalsub ( CREATE TABLE finalsub (
api INTEGER NOT NULL, api INTEGER NOT NULL,
...@@ -26,9 +29,11 @@ CREATE TABLE finalsub ( ...@@ -26,9 +29,11 @@ CREATE TABLE finalsub (
PRIMARY KEY (api,utclogin)); PRIMARY KEY (api,utclogin));
COPY finalsub FROM '/home/stc/Bureau/api_sub_final.csv' WITH CSV HEADER DELIMITER ';'; COPY finalsub FROM '/home/stc/Bureau/api_sub_final.csv' WITH CSV HEADER DELIMITER ';';
COMMIT; COMMIT;
```
### Inscriptions ### Inscriptions
```
SELECT SELECT
'echo ''Bonjour ' || 'echo ''Bonjour ' ||
firstname || ' ' || surname || firstname || ' ' || surname ||
...@@ -42,9 +47,11 @@ ON vapi.code=finalsub.api ...@@ -42,9 +47,11 @@ ON vapi.code=finalsub.api
JOIN localuser JOIN localuser
ON localuser.utclogin=finalsub.utclogin ON localuser.utclogin=finalsub.utclogin
ORDER BY surname; ORDER BY surname;
```
### Non-inscrit ### Non-inscrit
```
CREATE VIEW vnosub AS CREATE VIEW vnosub AS
SELECT utclogin FROM subscribe SELECT utclogin FROM subscribe
EXCEPT EXCEPT
...@@ -59,3 +66,4 @@ FROM vnosub ...@@ -59,3 +66,4 @@ FROM vnosub
JOIN localuser JOIN localuser
ON localuser.utclogin=vnosub.utclogin ON localuser.utclogin=vnosub.utclogin
ORDER BY vnosub.utclogin; ORDER BY vnosub.utclogin;
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment