Vous n'êtes pas identifié(e).
- Contributions : Récentes | Sans réponse
Pages : 1
#1 Installation » importer une BDD juste apres installation » 08/10/2010 16:55:58
- astala7
- Réponses : 1
bonjour,
J'ai une question simple: peut on apres l'installation de postgreSQL, importer une script de type : mabase.psql SANS avoir au préalable fait un createdb?
si oui quel serait la commande ?
#2 Re : Installation » import apres installation » 08/10/2010 16:54:31
merci ! ton 2e lien m'a bien aidé.
#3 Re : Installation » import apres installation » 07/10/2010 17:32:07
Bonsoir, je suis complètement perdu avec PostgresSQL, même en lisant les docs je n'ai pas trouvé ce que je cherche :
Configuration : OS : FreeBSD 8.1 - PostgreSQL 845
Step1 : installation de posgresql
cd /usr/ports/databases
make make install clean
Step2 : adduser
adduser pgsql
Step 3 : modifier /etc/rc.conf
postgresql_enable="YES"
postgresql_data="/usr/local/pgsql"
Step 4 : démarrer postgresql
# /usr/local/etc/rc.d/postgresql start
Step 5 :
su – pgsql
initdb –D /usr/local/pgsql/test
==> Un dossier test avec tous les fichiers vient d'etre créer.
Que dois-je faire ensuite ?
Vous avez dit : Ensuite, vous pouvez faire exécuter «psql -U postgres -f mon_script ma_base»
une fois qu'on a fait su - pgsql ?
$ psql -U pgsql -f MaBDD.psql test
?? Je suis un peu perdu, merci de votre aide!
#4 Re : Installation » import apres installation » 07/10/2010 15:04:16
Merci Marc, je vais tester cela.
#5 Re : Installation » import apres installation » 07/10/2010 14:53:38
et concernant l'installation de postgresql : j'ai simplement fait :
/usr/port/databases/postgresql84-server
make
make install clean
+ création d'un user
#6 Re : Installation » import apres installation » 07/10/2010 14:51:35
Je n'ai aucune script spécifique. Il a été dumpé à partir d'un autre postgresql de la meme version que j'ai installé. Je n'ai que un fichier nommé baseimport.psql dont voici le début du contenu :
--
-- PostgreSQL database dump
--
SET client_encoding = 'LATIN1';
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON SCHEMA public IS 'Standard public schema';
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: acronyms; Type: TABLE; Schema: public; Owner: vtsdb; Tablespace:
--
CREATE TABLE acronyms (
intref serial NOT NULL,
acronym character varying(32) NOT NULL,
text text NOT NULL
);
ALTER TABLE public.acronyms OWNER TO vtsdb;
--
-- Name: acronyms_intref_seq; Type: SEQUENCE SET; Schema: public; Owner: vtsdb
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('acronyms', 'intref'), 81, true);
--
-- Name: articles; Type: TABLE; Schema: public; Owner: vtsdb; Tablespace:
--
CREATE TABLE articles (
intref serial NOT NULL,
letter smallint,
date date,
author character(4),
chapter smallint,
"type" smallint,
rating smallint,
title character varying(128),
text text,
"link-1" character varying(256),
"url-1a" character varying(256),
"url-1b" character varying(256),
"url-1c" character varying(256),
"link-2" character varying(256),
"url-2a" character varying(256),
"url-2b" character varying(256),
"url-2c" character varying(256),
"link-3" character varying(256),
"url-3a" character varying(256),
"url-3b" character varying(256),
"url-3c" character varying(256),
"link-4" character varying(256),
"url-4a" character varying(256),
"url-4b" character varying(256),
"url-4c" character varying(256),
"link-5" character varying(256),
"url-5a" character varying(256),
"url-5b" character varying(256),
"url-5c" character varying(256),
"link-6" character varying(256),
"url-6a" character varying(256),
"url-6b" character varying(256),
"url-6c" character varying(256),
"link-7" character varying(256),
"url-7a" character varying(256),
"url-7b" character varying(256),
"url-7c" character varying(256),
"link-8" character varying(256),
"url-8a" character varying(256),
"url-8b" character varying(256),
"url-8c" character varying(256),
status character varying(10) DEFAULT 'N_'::character varying,
title_text character varying(20)
);
ALTER TABLE public.articles OWNER TO vtsdb;
--
-- Name: articles_intref_seq; Type: SEQUENCE SET; Schema: public; Owner: vtsdb
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('articles', 'intref'), 1981, true);
--
-- Name: chapters; Type: TABLE; Schema: public; Owner: vtsdb; Tablespace:
--
CREATE TABLE chapters (
chapter_num smallint NOT NULL,
chapter_name character varying(40) NOT NULL,
chapter_longname character varying(72) NOT NULL
);
ALTER TABLE public.chapters OWNER TO vtsdb;
--
-- Name: extensions; Type: TABLE; Schema: public; Owner: vtsdb; Tablespace:
--
CREATE TABLE extensions (
extension character varying(5) NOT NULL,
"type" character varying(5) NOT NULL,
warn boolean DEFAULT false NOT NULL,
content character varying(64)
);
ALTER TABLE public.extensions OWNER TO vtsdb;
--
-- Name: letters; Type: TABLE; Schema: public; Owner: vtsdb; Tablespace:
--
CREATE TABLE letters (
intref serial NOT NULL,
week smallint,
date date,
state character varying(10)
);
ALTER TABLE public.letters OWNER TO vtsdb;
--
-- Name: letters_intref_seq; Type: SEQUENCE SET; Schema: public; Owner: vtsdb
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('letters', 'intref'), 245, true);
--
-- Name: subscribers; Type: TABLE; Schema: public; Owner: vtsdb; Tablespace:
--
CREATE TABLE subscribers (
intref serial NOT NULL,
name character varying(64) NOT NULL,
format character varying(4) DEFAULT 'HTML'::character varying NOT NULL,
contact_name character varying(32) NOT NULL,
contact_mail character varying(256) NOT NULL,
"template" character varying(32) NOT NULL
);
ALTER TABLE public.subscribers OWNER TO vtsdb;
--
-- Name: subscribers_intref_seq; Type: SEQUENCE SET; Schema: public; Owner: vtsdb
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('subscribers', 'intref'), 57, true);
--
-- Name: types; Type: TABLE; Schema: public; Owner: vtsdb; Tablespace:
--
CREATE TABLE types (
type_id serial NOT NULL,
type_name character varying(24) NOT NULL,
type_name_fr character varying(24)
);
ALTER TABLE public.types OWNER TO vtsdb;
--
-- Name: types_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: vtsdb
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('types', 'type_id'), 99, true);
--
-- Name: url_types; Type: TABLE; Schema: public; Owner: vtsdb; Tablespace:
--
CREATE TABLE url_types (
url character varying(256) NOT NULL,
content_type character varying(64)
);
ALTER TABLE public.url_types OWNER TO vtsdb;
--
-- Data for Name: acronyms; Type: TABLE DATA; Schema: public; Owner: vtsdb
--
.................... etc sur 800pages....
#7 Re : Installation » import apres installation » 07/10/2010 14:22:10
Il s'agirait d'un PostgreSQL database dump
COMMENT ON SCHEMA public IS 'Standard public schema';
#8 Installation » import apres installation » 07/10/2010 14:09:28
- astala7
- Réponses : 10
Bonjour,
Dans le cadre d'un projet, j'ai récupéré un fichier .psql
On m'a demandé d'installer postgresql (8.4.5) sous FreeBsd 8.1
Après installation de postgresql, comment puis-je faire pour ouvrir ou importer la base de donnée que l'on ma demandé d'implanter ?
Pages : 1