pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedNeed Help in creating script
4+ messages / 4 participants
[nested] [flat]
* Need Help in creating script
@ 2001-05-16 21:16 Prashant Sinha <prashant@envivio.com>
2001-05-16 22:03 ` Re: Need Help in creating script Alexander Dederer <dederer@spb.cityline.ru>
2001-05-17 22:05 ` Re: Need Help in creating script Oliver Elphick <olly@lfix.co.uk>
0 siblings, 2 replies; 4+ messages in thread
From: Prashant Sinha @ 2001-05-16 21:16 UTC (permalink / raw)
To: pgsql-admin
Hi,
I am a new postgre user. I had used sql commands to create database and tables. Is it possible to create a script or installable version on existing database which I could run on any machine and it would crearte the database with all the tables and everything. Can anyone please help me with this?
Thanks in advance,
-Prashant.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Need Help in creating script
2001-05-16 21:16 Need Help in creating script Prashant Sinha <prashant@envivio.com>
@ 2001-05-16 22:03 ` Alexander Dederer <dederer@spb.cityline.ru>
2001-05-17 11:42 ` Re: Need Help in creating script manuel@des01.sanyres.es
1 sibling, 1 reply; 4+ messages in thread
From: Alexander Dederer @ 2001-05-16 22:03 UTC (permalink / raw)
To: pgsql-admin
Prashant Sinha wrote:
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_0021_01C0DE12.BB861C80
> Content-Type: text/plain; charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> Hi,
> I am a new postgre user. I had used sql commands to create database and
> tab= les. Is it possible to create a script or installable version on
> existing d= atabase which I could run on any machine and it would crearte
> the database = with all the tables and everything. Can anyone please help
> me with this? Thanks in advance,
Look programm:
pg_dump
pg_dumpall
psql
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Need Help in creating script
2001-05-16 21:16 Need Help in creating script Prashant Sinha <prashant@envivio.com>
2001-05-16 22:03 ` Re: Need Help in creating script Alexander Dederer <dederer@spb.cityline.ru>
@ 2001-05-17 11:42 ` manuel@des01.sanyres.es
0 siblings, 0 replies; 4+ messages in thread
From: manuel@des01.sanyres.es @ 2001-05-17 11:42 UTC (permalink / raw)
To: pgsql-admin
In article <9dutbv$2hdu$2@news.tht.net>, Alexander Dederer wrote:
> Prashant Sinha wrote:
>
>> This is a multi-part message in MIME format.
>>
>> ------=_NextPart_000_0021_01C0DE12.BB861C80
>> Content-Type: text/plain; charset="iso-8859-1"
>> Content-Transfer-Encoding: quoted-printable
>>
>> Hi,
>> I am a new postgre user. I had used sql commands to create database and
>> tab= les. Is it possible to create a script or installable version on
>> existing d= atabase which I could run on any machine and it would crearte
>> the database = with all the tables and everything. Can anyone please help
>> me with this? Thanks in advance,
>
> Look programm:
> pg_dump
> pg_dumpall
> psql
>
>
Use pg_dump.
pg_dump <database> > <file>
createdb <newdatabase>
cat <file> | psql <newdatabase>
--
Manuel Cano Muñoz
------------------------------
SANYRES, S.A.
Director Dpto. Sistemas
manuel@sanyres.com
manuel@sanyres.es
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Need Help in creating script
2001-05-16 21:16 Need Help in creating script Prashant Sinha <prashant@envivio.com>
@ 2001-05-17 22:05 ` Oliver Elphick <olly@lfix.co.uk>
1 sibling, 0 replies; 4+ messages in thread
From: Oliver Elphick @ 2001-05-17 22:05 UTC (permalink / raw)
To: Prashant Sinha <prashant@envivio.com>; +Cc: pgsql-admin
"Prashant Sinha" wrote:
>I am a new postgre user. I had used sql commands to create database and tab=
>les. Is it possible to create a script or installable version on existing d=
>atabase which I could run on any machine and it would crearte the database =
>with all the tables and everything. Can anyone please help me with this?
>Thanks in advance,
A simple example:
Put the database commands in a text file (precede comments with --):
CREATE DATABASE junk;
\connect junk
-- Table "a" is adgaga axdfaxdfga hgfadsh
CREATE TABLE a (f1 INT PRIMARY KEY,
f2 TEXT);
...and so on...
Then run the script:
$ psql <sql.script
(Obviously you need to be a database user with the privilege to let you
do everything that is in the script.)
(I see you are using Microsoft mail software. The above commands are for
Unix; I don't know whether they need any modification for Windows.)
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Jesus said unto her, I am the resurrection, and the
life. He that believeth in me, though he were dead,
yet shall he live." John 11:25
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2001-05-17 22:05 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-16 21:16 Need Help in creating script Prashant Sinha <prashant@envivio.com>
2001-05-16 22:03 ` Alexander Dederer <dederer@spb.cityline.ru>
2001-05-17 11:42 ` manuel@des01.sanyres.es
2001-05-17 22:05 ` Oliver Elphick <olly@lfix.co.uk>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox