Commit a984270b authored by Stephane Crozat's avatar Stephane Crozat

Mise en forme README

parent 4b95a1ec
......@@ -4,6 +4,7 @@
su postgres
psql
```
\c postgres
DROP DATABASE apisub;
CREATE DATABASE apisub WITH OWNER apisub;
......@@ -12,6 +13,7 @@ BEGIN;
\i /home/stc/Bureau/apisub20181213.sql
SELECT pg_catalog.set_config('search_path', 'public', false);
COMMIT;
```
## Sync des inscriptions arbitrées sur tableur
......@@ -19,6 +21,7 @@ COMMIT;
2. Enregistrer sous ; format CSV ; paramètres du filtre (UTF-8 et séparateur ;)
3. Importer dans une table finalsub
```
BEGIN;
CREATE TABLE finalsub (
api INTEGER NOT NULL,
......@@ -26,9 +29,11 @@ CREATE TABLE finalsub (
PRIMARY KEY (api,utclogin));
COPY finalsub FROM '/home/stc/Bureau/api_sub_final.csv' WITH CSV HEADER DELIMITER ';';
COMMIT;
```
### Inscriptions
```
SELECT
'echo ''Bonjour ' ||
firstname || ' ' || surname ||
......@@ -42,9 +47,11 @@ ON vapi.code=finalsub.api
JOIN localuser
ON localuser.utclogin=finalsub.utclogin
ORDER BY surname;
```
### Non-inscrit
```
CREATE VIEW vnosub AS
SELECT utclogin FROM subscribe
EXCEPT
......@@ -59,3 +66,4 @@ FROM vnosub
JOIN localuser
ON localuser.utclogin=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