[ADMIN] How this query!

2005-08-25 Thread Richard Susanto
Folks, would you like help me how to query this case. I have tbl_a, the fields are : item_record item_product_name item_qty if the data are : item_record = 1,2,3,4,5,6 item_product_name = a,b,a,c,d,c,... item_qty = 10,5,15,10,20,5,... How the query to sum item_qty_total if i want the result :

Re: [ADMIN] How this query!

2005-08-25 Thread Lars Haugseth
* [EMAIL PROTECTED] (Richard Susanto) wrote: | | Folks, | would you like help me how to query this case. | | I have tbl_a, the fields are : | item_record | item_product_name | item_qty | | | if the data are : | | item_record = 1,2,3,4,5,6 | item_product_name = a,b,a,c,d,c,... | item_qty =

[ADMIN] size of indexes and tables (more than 1GB)

2005-08-25 Thread jose fuenmayor
I read and have seen that when a table has more than 1GB it is divided in several files with the names of inode,inode.1,inode.2,inode.3, etc. I have a table of 1.3 GB (9.618.118 rows,13 fields) it is divided in that way as i see on /PGDATA/base but each file has the same size i mean table inode

Re: [ADMIN] size of indexes and tables (more than 1GB)

2005-08-25 Thread Bruno Wolff III
On Thu, Aug 25, 2005 at 08:52:35 -0400, jose fuenmayor [EMAIL PROTECTED] wrote: The size of the table is 3 times bigger than, for instance Visual Fox Pro dbf's? since is there fisically three times. Have you been vacuuming properly? It is possible you have a lot of dead tuples in the

[ADMIN] Question regarding blocking locks

2005-08-25 Thread Kevin Keith
I have a question regarding blocking locks in the pg database. I ran into a process which terminated abnormally, and to fully clear the locks it left behind I had to reboot the system (probably restarting postmaster would have had the same effect). This was a personal development system so this

Re: [ADMIN] How this query!

2005-08-25 Thread Bruno Wolff III
On Thu, Aug 25, 2005 at 18:44:00 +0700, Richard Susanto [EMAIL PROTECTED] wrote: Folks, would you like help me how to query this case. This question is off topic for the pgsql-admin list, it should have been asked on the pgsql-sql list because it was a question about SQL. (I probably wouldn't

Re: [ADMIN] size of indexes and tables (more than 1GB)

2005-08-25 Thread Aldor
Hi Chris, If you're running VACUUM often enough, then there's nothing wrong, and nothing to be done. You're simply observing how PostgreSQL handles large tables. Wrong. I have a big table - running VACUUM the first time needs as long as I run it after the VACUUM has finished. There are

[ADMIN] What is syslog:duration reporting ... ?

2005-08-25 Thread Marc G. Fournier
'k, I've been wracking my brains over this today, and I'm either mis-understanding what is being reported *or* its reporting wrong ... According to syslog: LOG: duration: 4107.987 ms statement: UPDATE session SET hit_time=now() WHERE md5='8b8e7b7ff9b1b2ed5fc60218ced28d00'; But, if I do

Re: [ADMIN] What is syslog:duration reporting ... ?

2005-08-25 Thread Aldor
As I know EXPLAIN ANALYZE runs the query. I think you are just running the query two times. The first time you run the query it will take a long time to be processed - after the first run the query planner will remember the best way to run the query so your second run runs much faster. I can

Re: [ADMIN] What is syslog:duration reporting ... ?

2005-08-25 Thread Marc G. Fournier
On Thu, 25 Aug 2005, Aldor wrote: As I know EXPLAIN ANALYZE runs the query. I think you are just running the query two times. The first time you run the query it will take a long time to be processed - after the first run the query planner will remember the best way to run the query so your

Re: [ADMIN] What is syslog:duration reporting ... ?

2005-08-25 Thread Michael Fuhr
On Thu, Aug 25, 2005 at 03:56:36PM -0300, Marc G. Fournier wrote: On Thu, 25 Aug 2005, Aldor wrote: I'm still wondering why you first query takes about 4107.987 ms - this kind of query has usually have to run much much faster. That would work if I were to get really occasional high values

Re: [ADMIN] What is syslog:duration reporting ... ?

2005-08-25 Thread Michael Fuhr
On Thu, Aug 25, 2005 at 01:55:08PM -0600, Michael Fuhr wrote: Are the updates happening inside a transaction? Is it possible that they're being blocked by other transactions that update the same record around the same time and don't commit immediately? I can duplicate the results you're

[ADMIN] Problem with rules

2005-08-25 Thread Chris Hoover
I am having a problem with the rule system in 7.3.4. I have a view with an on insert do instead rule that is calling a function and passing new.*. When try to insert a row into the view, I get ERROR: ResolveNew: can't handle whole-tuple reference. I was working with this in 8.0 on an RD

[ADMIN] dumping query results to a csv

2005-08-25 Thread David Durham
This is kind of a pg-admin newbie question, so apologies in advance. Anyway, I'd like to issue a command that dumps the results of a query to a txt file in comma delimited format. Does PostgreSQL ship with something to do this? I searched the web, but found what appeared to be non-free

Re: [ADMIN] dumping query results to a csv

2005-08-25 Thread Jeff Frost
David, You're probably looking for something like this from the psql man page: -F separator --field-separator separator Use separator as the field separator. This is equivalent to \pset fieldsep or \f. I would guess -F , would do the trick. On

Re: [ADMIN] dumping query results to a csv

2005-08-25 Thread Adi Alurkar
Greetings, There is no direct way to achieve what you want, the easiest hack is to create a temp table with you query i.e. create table tmp_foo as select col1, col4, col7 from table1, table2 where ; copy table tmp_foo to [stdout|file_name] HTH Adi Alurkar [EMAIL PROTECTED] On Aug

Re: [ADMIN] dumping query results to a csv

2005-08-25 Thread Jeff Frost
Whoops, should have also mentioned that you want -P format=unaligned like so: psql -P format=unaligned -F ',' snort EOF select * from iphdr; EOF On Thu, 25 Aug 2005, Jeff Frost wrote: David, You're probably looking for something like this from the psql man page: -F separator

Re: [ADMIN] dumping query results to a csv

2005-08-25 Thread Jim C. Nasby
On Thu, Aug 25, 2005 at 03:48:54PM -0700, Adi Alurkar wrote: Greetings, There is no direct way to achieve what you want, the easiest hack is to create a temp table with you query i.e. create table tmp_foo as select col1, col4, col7 from table1, table2 where ; copy table tmp_foo

[ADMIN] pgcrypto 'cryptsrc' in Makefile: what is that?

2005-08-25 Thread Colin E. Freas
In the Makefile for pgcrypto there's a cryptsrc variable you can set to 'builtin' or 'system'. Makefile only references the variable when it's set to 'builtin'... I can't figure out what it's supposed to do when set to 'system'. Anyone happen to know? Thanks, Colin

Re: [ADMIN] What is syslog:duration reporting ... ?

2005-08-25 Thread Aldor
Aug 25 14:53:32 forgehouse-s1 postgres[23721]: [2-1] LOG: duration: 567.559 ms statement: UPDATE session SET hit_time=now() WHERE md5='7537b74eab488de54d6e0167d1919207'; Aug 25 14:53:32 forgehouse-s1 postgres[23722]: [2-1] LOG: duration: 565.966 ms statement: UPDATE session SET

Re: [ADMIN] dumping query results to a csv

2005-08-25 Thread Steve Crawford
On Thursday 25 August 2005 3:24 pm, David Durham wrote: This is kind of a pg-admin newbie question, so apologies in advance. Anyway, I'd like to issue a command that dumps the results of a query to a txt file in comma delimited format. Does PostgreSQL ship with something to do this? I

[ADMIN] pgcrypto regression test: how can I change the port?

2005-08-25 Thread Colin E. Freas
I can't figure out how to change the port of the pgcrypto regression tests... I see how to change it in the regress.sh file, but, I can't figure out how to invoke it with that option... make has never been a forte of mine. I mean... couldn't you just use ant? :) Colin

Re: [ADMIN] pgcrypto regression test: how can I change the port?

2005-08-25 Thread Colin E. Freas
Found the PGPORT variable. But is there a way to invoke the tests with a different port from the command line? Colin E. Freas wrote: I can't figure out how to change the port of the pgcrypto regression tests... I see how to change it in the regress.sh file, but, I can't figure out how

Re: [ADMIN] What is syslog:duration reporting ... ?

2005-08-25 Thread Michael Fuhr
On Fri, Aug 26, 2005 at 12:50:29AM +0100, Aldor wrote: Aug 25 14:53:32 forgehouse-s1 postgres[23721]: [2-1] LOG: duration: 567.559 ms statement: UPDATE session SET hit_time=now() WHERE md5='7537b74eab488de54d6e0167d1919207'; Aug 25 14:53:32 forgehouse-s1 postgres[23722]: [2-1] LOG:

Re: [ADMIN] What is syslog:duration reporting ... ?

2005-08-25 Thread Marc G. Fournier
On Thu, 25 Aug 2005, Michael Fuhr wrote: On Fri, Aug 26, 2005 at 12:50:29AM +0100, Aldor wrote: Aug 25 14:53:32 forgehouse-s1 postgres[23721]: [2-1] LOG: duration: 567.559 ms statement: UPDATE session SET hit_time=now() WHERE md5='7537b74eab488de54d6e0167d1919207'; Aug 25 14:53:32

Re: [ADMIN] pgcrypto regression test: how can I change the port?

2005-08-25 Thread Michael Fuhr
On Thu, Aug 25, 2005 at 08:21:11PM -0400, Colin E. Freas wrote: Found the PGPORT variable. But is there a way to invoke the tests with a different port from the command line? You should be able to set variables like PGPORT, PGUSER, PGHOST, etc., on make's command line: make PGPORT=12345

[ADMIN] dumping query results to a csv

2005-08-25 Thread David Durham
This is kind of a pg-admin newbie question, so apologies in advance. Anyway, I'd like to issue a command that dumps the results of a query to a txt file in comma delimited format. Does PostgreSQL ship with something to do this? I searched the web, but found what appeared to be non-free

[ADMIN] pg_dumpall problem - duplicated users

2005-08-25 Thread Przemysław Nogaj
Hi, few days ago we made vacuum of all databases on our server. After that we canot dump databases: # pg_dumpall -i -U postgres test.sql pg_dump: query to obtain list of schemas failed: ERROR: More than one tuple returned by a subselect used as an expression. pg_dumpall: pg_dump failed on

[ADMIN] Postgres using SSL connections

2005-08-25 Thread Simon de Hartog
Hi, I want to have Postgres use an SSL certificate for secure access by clients over the internet. I have a server that runs PostgreSQL and I have created my own Certificate Authority. I now have a certificate and corresponding private key in /etc/ssl. This pair is used without problems by: -

Re: [ADMIN] connect to postgres from shell scripts

2005-08-25 Thread Chris Travers
Hemapriya wrote: Hi, I would like to know how to connect to postgres from shell scripts using a password protected user. psql is the simple way. Is there a way to embed the password in psql login. It keeps prompting for the passwords. Use the .pgpass file to store the password.

[ADMIN] installation on postgresql on different port

2005-08-25 Thread Ramesh PVK
Hi, Anyone pls. help me. I have a postgres installation package for Mac OS X. After installation, Can i use my own user for configuring postgres, instead of creating a postgres user. Also how can I run it on different port, instead of the default port (5432). And lastly how can I

[ADMIN] DB restore fails W2k.

2005-08-25 Thread Dan
Hello, We have upgraded our PostgreSQL database version from 7.3.1 (Cygwin) under Windows 2000 server to v8.03 for windows. Now we dumped our database (app. size 6 GB) with PgAdmin III with success. The problem now is that we cant completely restore our database with the dump file.

[ADMIN] RPM 8.0.3 for RH7.3, RH7.2 and AS2.1

2005-08-25 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I'm trying to create the rpm for these distributions, I'm using the one available for RH9.0 but I got: On RH7.3, RH7.2 and AS2.1 I get: # rpmbuild --rebuild postgresql-8.0.3-1PGDG.src.rpm [...] checking for perl... /usr/bin/perl checking for