[SQL] backup of a specific schema

2004-08-27 Thread Kenneth Gonsalves
hi, is there anyway to backup/restore a specfic schema in a database? -- regards kg http://www.onlineindianhotels.net - fastest hotel search website in the world http://www.ootygolfclub.org ---(end of broadcast)--- TIP 8: explain analyze is your fr

Re: [SQL] backup of a specific schema

2004-08-27 Thread Riccardo G. Facchini
check pg_dump options, is there --- Kenneth Gonsalves <__> wrote: > hi, > is there anyway to backup/restore a specfic schema in a database? > -- > regards > kg > > http://www.onlineindianhotels.net - fastest hotel search website in > the world > http://www.ootygolfclub.org > > ---

Re: [SQL] Aggregate query for multiple records

2004-08-27 Thread Troy
shouldn't take that long, I would think. You have indexes on wid and date? Troy > > Hello, I am new to the list, my apology if this question is beyond the > scope or charter of this list. > > My questions is: > What is the best method to perform an aggregate query to calculate > sum() values

Re: [SQL] backup of a specific schema

2004-08-27 Thread Kenneth Gonsalves
On Friday 27 August 2004 01:17 pm, Michalis Kabrianis wrote: > Kenneth Gonsalves wrote: > > hi, > > is there anyway to backup/restore a specfic schema in a database? > > Hi, > isn't this what pg_dump --schema=SCHEMA does? thanx - was looking in the wrong place in the manual -- regards kg http:/

Re: [SQL] from PG_DUMP to CVS

2004-08-27 Thread Philip Warner
At 02:38 PM 27/08/2004, Josh Berkus wrote: If it's Perl, I'd be interested in contributing. I've long needed something like this myself. My thinking at this stage is to try to get pg_dump/restore to produce the output directly. Something like: some-dbname/create.sql some-dbname/drop.sql

[SQL] GRANT ON all tables

2004-08-27 Thread Nosyman
Hi there, I need to know how can I give privileges to all the tables in a database. For example, I have one database named "test" .This database contains about 30 tables. I want to grant SELECT and DELETE privileges to the 'test_user' by typing GRANT just once (something like GRANT SELECT, DE

Re: [SQL] from PG_DUMP to CVS

2004-08-27 Thread Riccardo G. Facchini
That depends on the use you plan to... as a backup, useless, as a documentary tool, very (at least, for what I need). Our way of developing things is to set up a development box, and set up the tables, functions, etc etc etc using a set of tools... the only problem is that these do not provide an

Re: [SQL] Aggregate query for multiple records

2004-08-27 Thread Josh Berkus
Scott, > > SELECT wid, > > (SELECT SUM(oil) FROM prd_data pd2 > > WHERE pd2.wid = prd_data.wid ORDER BY "date" LIMIT 6) as tot_oil, > > (SELECT SUM(hours) FROM prd_data pd2 > > WHERE pd2.wid = prd_data.wid ORDER BY "date" LIMIT 6) as tot_hours > > FROM prd_data > > ORDER BY wid;

Re: [SQL] from PG_DUMP to CVS

2004-08-27 Thread Josh Berkus
Philip, > My thinking at this stage is to try to get pg_dump/restore to produce the > output directly. Something like: Hey, you do what you want, of course. However, it seems to me that hacking AutoDoc would be a *lot* less effort than hacking pg_dump. Interestingly, though, I was talking t

Re: [SQL] Aggregate query for multiple records

2004-08-27 Thread Josh Berkus
Scott, > >> I tried your query but it doesn't seem to work. The interpreter > >> expects prd2.date to be grouped but this doesn't make sence, see > >> below: > > > > Oh, yeah, darn it. > > > > Hmmm ... maybe you could explain the purpose of selecting just 6? > > This query > > is going to get a *

Re: [SQL] GRANT ON all tables

2004-08-27 Thread Bruno Wolff III
On Fri, Aug 27, 2004 at 15:30:32 -, Nosyman <[EMAIL PROTECTED]> wrote: > Hi there, > > I need to know how can I give privileges to all the tables in a database. > For example, I have one database named "test" .This database contains about > 30 tables. I want to grant SELECT and DELETE privil

Re: [SQL] help with trigger

2004-08-27 Thread Dino Vliet
Maybe I've missed it but can someone plese help me with this? Brgds and thanks in advance, --- Dino Vliet <[EMAIL PROTECTED]> wrote: > Hi folks, > I'm new to PostgreSQL and am busy tring to work with > it. Of pl/pgsql I know even less and that's the part > I > have a question on right now. I hav

[SQL] Copy command freezes but INSERT works fine with trigger on insert.

2004-08-27 Thread Artimenko Igor
I tried to add up records 2 different ways: 1. using command [copy messageinfo (user_id, receivedtime, filename, sendersstring, subject, hasattachments, groupmsg, msgsize, version ) FROM '/meridtemp/messageinfo.dat';] from psql 2. using simple INSERT INTO messageinfo ( user_id ) V

Re: [SQL] Copy command freezes but INSERT works fine with trigger oninsert.

2004-08-27 Thread Gregory S. Williamson
The copy command will run as a single transaction -- all succeed or all fail, I think, so if you interrupt it no rows will be loaded. The inserts -- unless wrapped into a transaction with a "begin; ... commit;" block will each be a single transaction. Check you postgres log file for the time wh

Re: [SQL] Copy command freezes but INSERT works fine with trigger on insert.

2004-08-27 Thread Artimenko Igor
Copy from .. works fine for 1000 records to load. For data set of 6 records I could never get it finish. And I'm planing to reload 1000,000 records. So there is a limit somewhere between 1,000 & 60,000 since it starts working slower. The only question for me left is. What config parameter(s)

Re: [SQL] [PERFORM] Why those queries do not utilize indexes?

2004-08-27 Thread Artimenko Igor
Thanks a lot but none of those queries was effecient. 1. This query is longest. explain analyze SELECT * FROM messageinfo WHERE user_id::bigint = 2 and msgstatus::smallint = 0; 2. This one is the same as my original in performance and bad index usage. explain analyze SELECT * FROM messagein

Re: [SQL] backup of a specific schema

2004-08-27 Thread Gaetano Mendola
Kenneth Gonsalves wrote: On Friday 27 August 2004 01:17 pm, Michalis Kabrianis wrote: Kenneth Gonsalves wrote: hi, is there anyway to backup/restore a specfic schema in a database? Hi, isn't this what pg_dump --schema=SCHEMA does? thanx - was looking in the wrong place in the manual Which one ? Re