Thread: Running a file
I'm runnin postgres 7.?? (Last RPM package available from the site). I want to create a few DB creation scripts so I can "publish" that afterwards. On Oracle there's a such possibility but I haven't seen anything comaprable in the docs ... I however think I'm missing one of the very first possibility of "pgsql". Could someone point me were I could find some more infos on that matter ? Tx, Thomas, p.s. : Merry Xmas for some / Enjoy Ead / Merry Solstice for the others :-) -- Sun Dec 24 13:32:35 CET 2000 Thomas SMETS e-mail : tsmets@altern.org Av. de la Brabançonne 133 / 3 Tel. : +32 (0)2 742. 05. 94. 1030 Bruxelles ======= Quote of the Day ========= The FALAFEL SANDWICH lands on my HEAD and I become a VEGETARIAN ... ========= End of Quote ===========
On Sun, 24 Dec 2000, Thomas SMETS wrote: > I'm runnin postgres 7.?? (Last RPM package available from the site). > > I want to create a few DB creation scripts so I can "publish" that > afterwards. > On Oracle there's a such possibility but I haven't seen anything > comaprable in the docs ... > I however think I'm missing one of the very first possibility of > "pgsql". > Could someone point me were I could find some more infos on that matter > ? Are you talking about writing external scripts and importing them into Postgres in a manner similar to the @ function in SQL*Plus? In psql, you can use \i to import scripts to do that. -- Brett http://www.chapelperilous.net/~bmccoy/ --------------------------------------------------------------------------- Reading is to the mind what exercise is to the body.
> Are you talking about writing external scripts and importing them into > Postgres in a manner similar to the @ function in SQL*Plus? In psql, you > can use \i to import scripts to do that. If it's to be used in shell scripts, it's just as easy to pipe: psql dbname<create_table.sql -- Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582 Kaki Data tshirts, merchandize Fax: 3816 2501 Howitzvej 75 �ben 14.00-18.00 Email: kar@webline.dk 2000 Frederiksberg L�rdag 11.00-17.00 Web: www.suse.dk
Hi Thomas, Is it possible you're looking for: psql -f script.sql <database> ? Regards, -- Raju >>>>> "Thomas" == Thomas SMETS <tsmets@altern.org> writes: Thomas> I'm runnin postgres 7.?? (Last RPM package available from Thomas> the site). Thomas> I want to create a few DB creation scripts so I can Thomas> "publish" that afterwards. On Oracle there's a such Thomas> possibility but I haven't seen anything comaprable in the Thomas> docs ... I however think I'm missing one of the very Thomas> first possibility of "pgsql". Could someone point me were Thomas> I could find some more infos on that matter ? Thomas> Tx, Thomas> Thomas, Thomas> p.s. : Merry Xmas for some / Enjoy Ead / Merry Solstice Thomas> for the others :-) -- Raju Mathur raju@kandalaya.org http://kandalaya.org/
Tx, Thomas, "Brett W. McCoy" wrote: > > On Sun, 24 Dec 2000, Thomas SMETS wrote: > > > I'm runnin postgres 7.?? (Last RPM package available from the site). > > > > I want to create a few DB creation scripts so I can "publish" that > > afterwards. > > On Oracle there's a such possibility but I haven't seen anything > > comaprable in the docs ... > > I however think I'm missing one of the very first possibility of > > "pgsql". > > Could someone point me were I could find some more infos on that matter > > ? > > Are you talking about writing external scripts and importing them into > Postgres in a manner similar to the @ function in SQL*Plus? In psql, you > can use \i to import scripts to do that. > > -- Brett > http://www.chapelperilous.net/~bmccoy/ > --------------------------------------------------------------------------- > Reading is to the mind what exercise is to the body. -- Sat Dec 30 00:39:50 CET 2000 Thomas SMETS e-mail : tsmets@altern.org Av. de la Brabançonne 133 / 3 Tel. : +32 (0)2 742. 05. 94. 1030 Bruxelles ======= Quote of the Day ========= Ye've also got to remember that ... respectable people do the most astonishin' things to preserve their respectability. Thank God I'm not respectable. -- Ruthven Campbell Todd ========= End of Quote ===========
Yep, Tx, Thomas, p.s. Sorry for the stupid question Raju Mathur wrote: > > Hi Thomas, > > Is it possible you're looking for: > > psql -f script.sql <database> > > ? > > Regards, > > -- Raju > > >>>>> "Thomas" == Thomas SMETS <tsmets@altern.org> writes: > > Thomas> I'm runnin postgres 7.?? (Last RPM package available from > Thomas> the site). > > Thomas> I want to create a few DB creation scripts so I can > Thomas> "publish" that afterwards. On Oracle there's a such > Thomas> possibility but I haven't seen anything comaprable in the > Thomas> docs ... I however think I'm missing one of the very > Thomas> first possibility of "pgsql". Could someone point me were > Thomas> I could find some more infos on that matter ? > > Thomas> Tx, > > Thomas> Thomas, > > Thomas> p.s. : Merry Xmas for some / Enjoy Ead / Merry Solstice > Thomas> for the others :-) > -- > Raju Mathur raju@kandalaya.org http://kandalaya.org/ -- Sat Dec 30 00:39:50 CET 2000 Thomas SMETS e-mail : tsmets@altern.org Av. de la Brabançonne 133 / 3 Tel. : +32 (0)2 742. 05. 94. 1030 Bruxelles ======= Quote of the Day ========= Ye've also got to remember that ... respectable people do the most astonishin' things to preserve their respectability. Thank God I'm not respectable. -- Ruthven Campbell Todd ========= End of Quote ===========