[GENERAL] asynchronour queries and result testing

2001-05-15 Thread Matus \fantomas\ Uhlar
Hello, I have this query in my .c program: if (PQsendQuery(srcmain, select userid,uid,clear_passwd,www_home,date_part('epoch',dt_block),date_part('epoch',dt_cancel) from www where uid=parent_uid and dt_modify dt_export)) { while ((srcmres = PQgetResult(srcmain)) != NULL) { well

Re: [GENERAL] Re: naming convention/mixed case

2001-05-15 Thread Tom Lane
Alejandro Fernandez [EMAIL PROTECTED] writes: I suspected that the access guidelines broke the SQL standard! Thanks for the information. Is there a standards compliant naming convention I can use as an alternative in future? You can use mixed case if you want --- you just have to be

Re: [GENERAL] psql always ends with a SEGV:

2001-05-15 Thread Tom Lane
Renaud Thonnart [EMAIL PROTECTED] writes: We are starting to run PGSQL V7.1 on Solaris 7. It seems to work but psql binary always ends with a SEGV. Paul McGarry just reported in pgsql-bugs that updating to gcc 2.95.3 made a similar problem go away for him. regards,

[GENERAL] Not a PG question: SCSI question

2001-05-15 Thread Jean-Arthur Silve
Hi ! I have 2 servers running apache, php and PG 7.0.3 running under Linux The first one uses IDE disks, and everything run fine and fast. (uses linux 2.0.36) The second one uses SCSI drives with a Adaptec adapter. (uses Linux 2.2.14) My problem is that acces to the DB on this server are

Re: [GENERAL] Performance aggregates

2001-05-15 Thread Stephan Szabo
On Tue, 15 May 2001, snpe wrote: Table e_kalkn have 4668 rows and e_kalkns 101170 rows. Query : select roba,sum(izn) from e_kalkn k,e_kalkns ks where k.id=ks.id group by roba order by roba is 2.5 times faster on one commercial database (there are tests on Internet that say

Re: [GENERAL] locking a dropped table

2001-05-15 Thread Tom Lane
Thomas F. O'Connell [EMAIL PROTECTED] writes: is there any way to preserve a lock on a table that gets dropped? i have a situation where it would be nice to have a select wait on a lock on a table that gets dropped but almost immediately recreated, but, at the moment, the select generates

Re: [GENERAL] Re: What's the best front end/client under MS Windows?

2001-05-15 Thread Justin Clift
Hi Greg, Instead of using psql to get the NOTICES, when I program in PL/pgSQL, I start the database with -d 2 (debug level of 2) and this forces the NOTICES into the PostgreSQL log file. Then, I just have a telnet/ssh/etc session on the server running : tail -f postgresql.log So I constantly

[GENERAL] Re: Re: What's the best front end/client under MS Windows?

2001-05-15 Thread Gregory Wood
Then, I just have a telnet/ssh/etc session on the server running : Would this be useful to you? Seem just as easy to run psql to me. In fact a bit easier as I don't have to switch back and forth between windows. I guess it goes back to the days when I was first learning SQL on a MySQL web

Re: [GENERAL] Re: Re: What's the best front end/client under MS Windows?

2001-05-15 Thread Tom Lane
Gregory Wood [EMAIL PROTECTED] writes: ... So anytime I see something that requires some sort of shell access I don't like it. EXPLAIN is one of those things. Huh? EXPLAIN doesn't require shell access ... it merely requires a client that doesn't drop NOTICE messages into the bit bucket.

[GENERAL] Re: Re: Re: What's the best front end/client under MS Windows?

2001-05-15 Thread Gregory Wood
... So anytime I see something that requires some sort of shell access I don't like it. EXPLAIN is one of those things. Huh? EXPLAIN doesn't require shell access ... it merely requires a client that doesn't drop NOTICE messages into the bit bucket. Clients that drop NOTICEs are broken

Re: [GENERAL] Performance aggregates

2001-05-15 Thread snpe
On Tuesday 15 May 2001 17:28, Stephan Szabo wrote: On Tue, 15 May 2001, snpe wrote: Table e_kalkn have 4668 rows and e_kalkns 101170 rows. Query : select roba,sum(izn) from e_kalkn k,e_kalkns ks where k.id=ks.id group by roba order by roba is 2.5 times faster on one

Re: [GENERAL] Performance aggregates

2001-05-15 Thread snpe
On Tuesday 15 May 2001 17:28, Stephan Szabo wrote: On Tue, 15 May 2001, snpe wrote: Table e_kalkn have 4668 rows and e_kalkns 101170 rows. Query : select roba,sum(izn) from e_kalkn k,e_kalkns ks where k.id=ks.id group by roba order by roba is 2.5 times faster on one

Re: [GENERAL] Performance aggregates

2001-05-15 Thread Tom Lane
snpe [EMAIL PROTECTED] writes: select roba,sum(izn) from e_kalkn k,e_kalkns ks where k.id=ks.id group by roba order by roba is 2.5 times faster on one commercial database That other DBMS is probably implementing the GROUP BY + aggregate using a hash table to compute all the aggregates in

Re: [GENERAL] Re: Re: Re: What's the best front end/client under MS Windows?

2001-05-15 Thread Tom Lane
Gregory Wood [EMAIL PROTECTED] writes: How are clients that drop NOTICEs broken though? Because you want to be able to see NOTICEs ... at least if you are doing SQL development. (I don't object to optionally dropping them, but I think the default should be to show 'em, at least in interactive

Re: [GENERAL] Performance aggregates

2001-05-15 Thread Ryan Mahoney
If your query is not using the correct index files, you're query will run slowly. Please post the output from EXPLAIN. -r At 09:00 PM 5/15/01 +0200, snpe wrote: On Tuesday 15 May 2001 17:28, Stephan Szabo wrote: On Tue, 15 May 2001, snpe wrote: Table e_kalkn have 4668 rows and e_kalkns

[GENERAL] index doesn't work for null?

2001-05-15 Thread Alex Pilosov
I have a bit of a problem: 'select from xx where field=null' will always result in seq scan even when there's a [btree] index on the field. Is this a known issue? -alex ---(end of broadcast)--- TIP 6: Have you searched our list archives?

[GENERAL] trouble with the automatic indexes on CREATE TABLE

2001-05-15 Thread Bill McGonigle
When doing CREATE TABLE (piped in from a file with my table definitions) I' m getting errors that I think are related to the automatic index creation on my UNIQUE columns: ERROR: Relation 'phone_number_types' does not exist ERROR: Cannot create index: 'phone_number__phone_number__key' already

Re: [GENERAL] trouble with the automatic indexes on CREATE TABLE

2001-05-15 Thread Tom Lane
Bill McGonigle [EMAIL PROTECTED] writes: CREATE TABLE Delivery_Methods ( delivery_method_id INTEGER NOT NULL UNIQUE, delivery_method VARCHAR(50) NOT NULL UNIQUE ); If you want to use names like that, you'd be well advised to increase NAMEDATALEN. See the archives.

RE: [GENERAL] Performance aggregates

2001-05-15 Thread Albertson, Chris
I found this same problem. It's the group by that is the killer. PostgreSQL's implementation of group by requires a sort of the entire table on the group by criteria, even if there is an index on the group by column. It's to bad this caused us not to be able to use Postgresql for a project.

[GENERAL] Re: index doesn't work for null?

2001-05-15 Thread Per-Olof Pettersson
Hi Alex I have no idea if it is a known issue. Though field=null is not allowed in standard SQL. The correct statement should be select from xx where field IS NULL;. Perhaps it will be handled better (or not). Best regards Per-Olof Pettersson Original Message On 2001-05-16, 00:21:34,

Re: [GENERAL] Re: index doesn't work for null?

2001-05-15 Thread Alex Pilosov
Sorry bout that. Actually query does 'is null', I made a mistake in my post. -alex On Tue, 15 May 2001, Per-Olof Pettersson wrote: Hi Alex I have no idea if it is a known issue. Though field=null is not allowed in standard SQL. The correct statement should be select from xx where field

Re: [GENERAL] Not a PG question: SCSI question

2001-05-15 Thread John Clark L. Naldoza
Hi, Let me get this straight...;-) The IDE server is running Linux 2.0.36 with PHP and Apache. The SCSI server is running with PostgreSQL 7.0.3 ?? And you're talking about speed in inserts? Try to use a kernel after 2.2.16 or the current 2.4.4 series, they handle memory management rather

[GENERAL] Re: Which Front End for Postgresql

2001-05-15 Thread Per-Olof Pettersson
Hi As you might have figured out Postgresql is merely a server. (And some client code too). You have to find programs that do the input-forms, reports I tend to use Apache and PHP for these tasks. It works like ASP for Windows (but better in my opinion). PostgreSQL is not like eg Access

[GENERAL] Re: What's the best front end/client under MS Windows?

2001-05-15 Thread Per-Olof Pettersson
Hi I like WinSQL LITE. There you get all messages. You can get it from: http://www.indus-soft.com/ It uses ODBC to connect. Best regards Per-Olof Pettersson Original Message On 2001-05-14, 16:33:08, [EMAIL PROTECTED] (Gregory Wood) wrote regarding Re: What's the best front end/client

[GENERAL] I need a jump start

2001-05-15 Thread Scott Holmes
I need to write a C program that will require libpq and ecpg. I'm hoping someone can point me to an example. I'm not a C programmer, so I need a crash course or jump start. The original program has existed as an Informix 4GL program for many years. We have lately been converting our

[GENERAL] Re: Not a PG question: SCSI question

2001-05-15 Thread Per-Olof Pettersson
Hi Just a little miss I think John did. With PHP you dont have to start a new connection everytime. You can use the good ole pg_pconnect. It is a persistant connection to the server. The server keeps a pool of connections open for fast access. There has been some problems with this so I

[GENERAL] SQL help...

2001-05-15 Thread Alex Hochberger
To any SQL wizards out there, I have finally exhausted my SQL knowledge. I have 3 tables that I need to do a fancy join on... 1 stores the users 1 stores the questions 1 stores the user's answers to the questions (based on foreign keys to the answers table) I would like to create a result

Re: [GENERAL] SQL help...

2001-05-15 Thread Ryan Mahoney
Please post the sql statement that creates these tables. -r At 12:15 AM 5/16/01 -0400, Alex Hochberger wrote: To any SQL wizards out there, I have finally exhausted my SQL knowledge. I have 3 tables that I need to do a fancy join on... 1 stores the users 1 stores the questions 1 stores the

RE: [GENERAL] SQL help...

2001-05-15 Thread Alex Hochberger
Users: -- CREATE TABLE users ( user_id int8 DEFAULT nextval('user_id_seq'::text) NOT NULL, group_id int4 NOT NULL, user_agent varchar(200) NOT NULL, ip_address varchar(20) NOT NULL, CONSTRAINT users_pkey PRIMARY KEY (user_id) ); CREATE UNIQUE INDEX

[GENERAL] Performance in searchig data using like

2001-05-15 Thread Jorge Sarmiento
Hello everybody! I have postgreslq 7.1 running on a 1 Ghz Intel Box, with 2 H.D. SCSI 1 RPM connected in a DPT SCSI card with 40 MB cache RAM, 256 Mb RAM and a Intel Mainboard. I have a 2.5 million rows database, and when I do a search using like it tooks about a minute to give me a

[GENERAL] timestamp changed on 7.1.1 ?

2001-05-15 Thread Alex
Hello there! I've just install PostgreSQL 7.1.1 and noticed that timestamp have changed in this release. for example: CREATE TABLE foo ( test timestamp ); if you \d foo you will notice the column test is not a timestamp, it's a timestamp with time zone In all the docs I've read (7.2 and 7.1)

RE: [GENERAL] SQL help...

2001-05-15 Thread Ryan Mahoney
I don't know of a single query that will satisfy your needs (not saying that there isn't one...) - you might try in whatever language you are using: select users for each user select questions for each question select answers end loop end loop This