pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Creating schema for multiple tables/fields/indices.
4+ messages / 3 participants
[nested] [flat]

* Creating schema for multiple tables/fields/indices.
@ 2003-04-24 15:34 dlangschied <dlangschied@ameritech.net>
  2003-04-24 15:40 ` Re: Creating schema for multiple tables/fields/indices. Adam Witney <awitney@sghms.ac.uk>
  2003-04-24 15:46 ` Re: Creating schema for multiple tables/fields/indices. Victor Yegorov <viy@pirmabanka.lv>
  0 siblings, 2 replies; 4+ messages in thread

From: dlangschied @ 2003-04-24 15:34 UTC (permalink / raw)
  To: pgsql-admin

I just downloaded postgreSQL.  I have finished the install and everything
looks okay.  I am now ready to create a db and add tables/fields/indices.  I
have approx. 100 tables 2,000 fields and 500 indices.  Before I spend an
ungodly amount of time doing these individually, can I load an entire schema
via some scripting method?

Sincerely,

David Langschied
Langschied Consulting Services
25644 Mackinac
Roseville, MI 48066

Phone:  (586)777-7542
Cell:      (248)789-8493
e-mail:  dlangschied@ameritech.net




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Creating schema for multiple tables/fields/indices.
  2003-04-24 15:34 Creating schema for multiple tables/fields/indices. dlangschied <dlangschied@ameritech.net>
@ 2003-04-24 15:40 ` Adam Witney <awitney@sghms.ac.uk>
  2003-04-24 15:49   ` Re: Creating schema for multiple tables/fields/indices. dlangschied <dlangschied@ameritech.net>
  1 sibling, 1 reply; 4+ messages in thread

From: Adam Witney @ 2003-04-24 15:40 UTC (permalink / raw)
  To: dlangschied <dlangschied@ameritech.net>; pgsql-admin


If you have the CREATE statements all written out in one file (eg
create_stuff.sql)

psql <dbname> <username> < create_stuff.sql

Or you could connect with psql and type

\i create_stuff.sql





> I just downloaded postgreSQL.  I have finished the install and everything
> looks okay.  I am now ready to create a db and add tables/fields/indices.  I
> have approx. 100 tables 2,000 fields and 500 indices.  Before I spend an
> ungodly amount of time doing these individually, can I load an entire schema
> via some scripting method?
> 
> Sincerely,
> 
> David Langschied
> Langschied Consulting Services
> 25644 Mackinac
> Roseville, MI 48066
> 
> Phone:  (586)777-7542
> Cell:      (248)789-8493
> e-mail:  dlangschied@ameritech.net
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>   (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Creating schema for multiple tables/fields/indices.
  2003-04-24 15:34 Creating schema for multiple tables/fields/indices. dlangschied <dlangschied@ameritech.net>
  2003-04-24 15:40 ` Re: Creating schema for multiple tables/fields/indices. Adam Witney <awitney@sghms.ac.uk>
@ 2003-04-24 15:49   ` dlangschied <dlangschied@ameritech.net>
  0 siblings, 0 replies; 4+ messages in thread

From: dlangschied @ 2003-04-24 15:49 UTC (permalink / raw)
  To: Adam Witney <awitney@sghms.ac.uk>; +Cc: pgsql-admin

Thanks!  This looks doable.

Sincerely,

David Langschied
Langschied Consulting Services
25644 Mackinac
Roseville, MI 48066

Phone:  (586)777-7542
Cell:      (248)789-8493
e-mail:  dlangschied@ameritech.net
----- Original Message ----- 
From: "Adam Witney" <awitney@sghms.ac.uk>
To: "dlangschied" <dlangschied@Ameritech.Net>; "pgsql-admin"
<pgsql-admin@postgresql.org>
Sent: Thursday, April 24, 2003 11:40 AM
Subject: Re: [ADMIN] Creating schema for multiple tables/fields/indices.


>
> If you have the CREATE statements all written out in one file (eg
> create_stuff.sql)
>
> psql <dbname> <username> < create_stuff.sql
>
> Or you could connect with psql and type
>
> \i create_stuff.sql
>
>
>
>
>
> > I just downloaded postgreSQL.  I have finished the install and
everything
> > looks okay.  I am now ready to create a db and add
tables/fields/indices.  I
> > have approx. 100 tables 2,000 fields and 500 indices.  Before I spend an
> > ungodly amount of time doing these individually, can I load an entire
schema
> > via some scripting method?
> >
> > Sincerely,
> >
> > David Langschied
> > Langschied Consulting Services
> > 25644 Mackinac
> > Roseville, MI 48066
> >
> > Phone:  (586)777-7542
> > Cell:      (248)789-8493
> > e-mail:  dlangschied@ameritech.net
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> >   (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Creating schema for multiple tables/fields/indices.
  2003-04-24 15:34 Creating schema for multiple tables/fields/indices. dlangschied <dlangschied@ameritech.net>
@ 2003-04-24 15:46 ` Victor Yegorov <viy@pirmabanka.lv>
  1 sibling, 0 replies; 4+ messages in thread

From: Victor Yegorov @ 2003-04-24 15:46 UTC (permalink / raw)
  To: dlangschied <dlangschied@ameritech.net>; +Cc: pgsql-admin

* dlangschied <dlangschied@ameritech.net> [24.04.2003 18:39]:
> I just downloaded postgreSQL.  I have finished the install and everything
> looks okay.  I am now ready to create a db and add tables/fields/indices.  I
> have approx. 100 tables 2,000 fields and 500 indices.  Before I spend an
> ungodly amount of time doing these individually, can I load an entire schema
> via some scripting method?

Do you have structure of your stuff (DDL) as SQL statements somewhere?

If yes, then find how to feed all that stuff to psql (I suggest using `-c'
flag or simply pipe to psql) - see docs.

If no, then you'll have to spent some time on creation of your DB structure.

-- 

Victor Yegorov

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2003-04-24 15:49 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-04-24 15:34 Creating schema for multiple tables/fields/indices. dlangschied <dlangschied@ameritech.net>
2003-04-24 15:40 ` Adam Witney <awitney@sghms.ac.uk>
2003-04-24 15:49   ` dlangschied <dlangschied@ameritech.net>
2003-04-24 15:46 ` Victor Yegorov <viy@pirmabanka.lv>

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