Re: [GENERAL] ECPG and Curors.

2006-06-13 Thread Michael Meskes
On Mon, Jun 12, 2006 at 11:14:24PM -0400, Peter L. Berghold wrote: what I don't see is how to detect that I've fetched the last row from a query. Is there more complete doco on this process somewhere? Just look for exec sql whenever not found ... Michael -- Michael Meskes Email: Michael at

[GENERAL] Help speeding up this query - maybe need another index?

2006-06-13 Thread Pat Maddox
Here's my SQL query. I don't think it's too gigantic, but it is kind of beastly: SELECT COUNT(r) FROM trainer_hand_results r, trainer_scenarios s, trainer_scenario_stats stats WHERE r.user_id=1 AND r.trainer_scenario_id=s.id AND s.id=stats.trainer_scenario_id AND r.action=stats.correct_action;

Re: [GENERAL] Help speeding up this query - maybe need another index?

2006-06-13 Thread Chris
Pat Maddox wrote: Here's my SQL query. I don't think it's too gigantic, but it is kind of beastly: SELECT COUNT(r) FROM trainer_hand_results r, trainer_scenarios s, trainer_scenario_stats stats WHERE r.user_id=1 AND r.trainer_scenario_id=s.id AND s.id=stats.trainer_scenario_id AND

Re: [GENERAL] Help speeding up this query - maybe need another index?

2006-06-13 Thread Pat Maddox
On 6/13/06, Chris [EMAIL PROTECTED] wrote: Pat Maddox wrote: Here's my SQL query. I don't think it's too gigantic, but it is kind of beastly: SELECT COUNT(r) FROM trainer_hand_results r, trainer_scenarios s, trainer_scenario_stats stats WHERE r.user_id=1 AND r.trainer_scenario_id=s.id AND

Re: [GENERAL] ECPG and Curors.

2006-06-13 Thread John Smith
On Mon, Jun 12, 2006 at 11:14:24PM -0400, Peter L. Berghold wrote: what I don't see is how to detect that I've fetched the last row from a query. Is there more complete doco on this process somewhere? You could either handle a NOT FOUND exception, or make use of SQLCODE or SQLSTATE like

[GENERAL] BLOB Searching

2006-06-13 Thread jdwatson1
Hi, I am not 100% sure what the best solution would be, so I was hoping someone could point me in the right direction. I usually develop in MS tools, such as .net, ASP, SQL Server etc..., but I really want to expand my skillset and learn as much about Postgres as possible. What I need to do, is

[GENERAL] pg_dump: missing pg_database entry

2006-06-13 Thread gl
Hello, I'm experiencing a strange problem with PostgreSQL 7.4.9. One of my database production servers has 2 large databases, it's still possible to connect to them and pass queries, but the pg_database system table is empty, which prohibits such actions as dumping the databases. For instance:

[GENERAL] Searching BLOB

2006-06-13 Thread James Watson
Hi,I am not 100% sure what the best solution would be, so I was hopingsomeone could point me in the right direction.I usually develop in MS tools, such as .net, ASP, SQL Server etc...,but I really want to expand my skillset and learn as much about Postgresqlas possible. What I need to do, is

[GENERAL] Error: Server doesn't listen

2006-06-13 Thread Fernando Sánchez Cervera
Every two days, Postgres 8.1 Server is unconfigured without apparent changes done. The service under windows XP is always stoped. I work under XP SP2. has somebody any idea? Do the list accept messages in spanish? ---(end of broadcast)--- TIP

Re: [GENERAL] Help with storing spatial (map coordinates) data?

2006-06-13 Thread Brent Wood
On Mon, 12 Jun 2006, John Tregea wrote: Hi, I have recently switched to PostgreSQL and had no problem bringing our existing (my)SQL databases and data into the environment. I am now extending the functionality of our databases and want to start storing spatial information. The

Re: [GENERAL] Help with storing spatial (map coordinates) data?

2006-06-13 Thread Brent Wood
On Tue, 13 Jun 2006, John Tregea wrote: Hi Brent, I will look at postGIS today. I will try and keep the whole GIS functionality as a separate schema to avoid confusing myself, so a postGIS may be exactly what I am looking for. Ummm... one caution: The lovely side effect, apart from all

Re: [GENERAL] Help with storing spatial (map coordinates) data?

2006-06-13 Thread Brent Wood
On Tue, 13 Jun 2006, John Tregea wrote: Thanks Brent, I will be cautious in my approach. The public schema is the place that I wanted to use to store the geometry attributes, so from your points, that sounds like the best place. The other schemas contain controlled (security) information

Re: [GENERAL] Searching BLOB

2006-06-13 Thread Florian G. Pflug
James Watson wrote: What I was hoping someone could help me out with was identifying the best possible solution to use. 1. How can I store the word doc's in the DB, would it be best to use a BLOB data type? You can use the column type bytea, which can store (nearly) arbitrary amounts of binary

Re: [GENERAL] pg_dump: missing pg_database entry

2006-06-13 Thread Florian G. Pflug
[EMAIL PROTECTED] wrote: Hello, I'm experiencing a strange problem with PostgreSQL 7.4.9. One of my database production servers has 2 large databases, it's still possible to connect to them and pass queries, but the pg_database system table is empty, which prohibits such actions as dumping the

Re: [GENERAL] Help speeding up this query - maybe need another index?

2006-06-13 Thread Florian G. Pflug
Pat Maddox wrote: Here's my SQL query. I don't think it's too gigantic, but it is kind of beastly: SELECT COUNT(r) FROM trainer_hand_results r, trainer_scenarios s, trainer_scenario_stats stats WHERE r.user_id=1 AND r.trainer_scenario_id=s.id AND s.id=stats.trainer_scenario_id AND

Re: [GENERAL] Searching BLOB

2006-06-13 Thread John Sidney-Woollett
Save yourself some effort and use Lucene to index a directory of your 300 word documents. I'm pretty sure that Lucene includes an extension to read Word documents, and you can use PDFBox to read/write PDF files. Marrying the searching and displaying of results to your web application should be

Re: [GENERAL] Error: Server doesn't listen

2006-06-13 Thread Richard Huxton
Fernando Sánchez Cervera wrote: Every two days, Postgres 8.1 Server is unconfigured without apparent changes done. The service under windows XP is always stoped. I work under XP SP2. has somebody any idea? What do the logs show? Either PostgreSQL's or Window's logs should show something

[GENERAL] A slow query

2006-06-13 Thread Alban Hertroys
Hi all, We're using some 3rd party product that uses inheritence, and the following query is rather slow on PostgreSQL 7.4.7 (debian stable). Any suggestions how to speed it up? explain analyze SELECT otype,owner,rnumber,dir,number,dnumber,pos,snumber FROM mm_posrel posrel ORDER BY number

Re: [GENERAL] delete seems to be getting blocked

2006-06-13 Thread surabhi.ahuja
Title: Re: [GENERAL] delete seems to be getting blocked however if the for every occuerence of the foreign key there are some 2000 rows inthe table, is it ok to still have an index on that foreign key. also will index scan still take place or postgres will itself choose to do sequential

Re: [GENERAL] A slow query

2006-06-13 Thread Alban Hertroys
Alban Hertroys wrote: Hi all, We're using some 3rd party product that uses inheritence, and the following query is rather slow on PostgreSQL 7.4.7 (debian stable). Any suggestions how to speed it up? A few more datapoints: - Database was vacuum full analyzed just before the query. - The

Re: [GENERAL] Password for postgresql superuser?

2006-06-13 Thread jqpx37
- Original Message - From: Chris Browne [EMAIL PROTECTED] To: pgsql-general@postgresql.org Sent: Thursday, June 08, 2006 01:30 PM Subject: [GENERAL] Password for postgresql superuser? [EMAIL PROTECTED] (jqpx37) writes: Is there any security risk in the postgresql superuser having a

[GENERAL] PostgreSQL and Apache

2006-06-13 Thread jqpx37
I'm working on a project involving PostgreSQL and Apache. Anyone know of any good books or online how-to's on getting PostgreSQL and Apache to work together? (I'm also using PHP.) TIA ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] Cant' create language - could not load library

2006-06-13 Thread andrey dmitrenko
Hello All.I have installed version 8.1.4(located in D:/PostgreSQL/8.1 ) on Windows XP and try to create language with command CREATE LANGUAGE or createlang command line tool but in any way got an error:postgres=# create language plperl; ERROR: could not load library

Re: [GENERAL] Aggregate functions not allowed in WHERE clause

2006-06-13 Thread Michael Fuhr
On Mon, Jun 12, 2006 at 08:40:29PM -0700, pradeep singh wrote: i think this query can be rewritten as SELECT claim_id,sum(invoices),sum(payments) FROM logs GROUP BY claim_id HAVING sum(invoices) 0 OR sum(payments) 0; having clause can be used with aggregate functions but those

Re: [GENERAL] PostgreSQL and Apache

2006-06-13 Thread Leif B. Kristensen
On Tuesday 13. June 2006 15:39, jqpx37 wrote: I'm working on a project involving PostgreSQL and Apache. Anyone know of any good books or online how-to's on getting PostgreSQL and Apache to work together? (I'm also using PHP.) AFAIK, there are no dependencies beween Apache and PostgreSQL. PHP

Re: [GENERAL] PostgreSQL and Apache

2006-06-13 Thread louis gonzales
PHP is one alternative, another is PERL with CGI to write web based programs that can GET/POST with input/output from the browser, and to interface with *SQL - i.e. postgresql - you can use PERL's DBI interface Leif B. Kristensen wrote: On Tuesday 13. June 2006 15:39, jqpx37 wrote: I'm

Re: [GENERAL] PostgreSQL and Apache

2006-06-13 Thread Peter Wilson
louis gonzales wrote: PHP is one alternative, another is PERL with CGI to write web based programs that can GET/POST with input/output from the browser, and to interface with *SQL - i.e. postgresql - you can use PERL's DBI interface Leif B. Kristensen wrote: On Tuesday 13. June 2006 15:39,

Re: [GENERAL] pg_dump: missing pg_database entry

2006-06-13 Thread Tom Lane
[EMAIL PROTECTED] writes: I'm experiencing a strange problem with PostgreSQL 7.4.9. One of my database production servers has 2 large databases, it's still possible to connect to them and pass queries, but the pg_database system table is empty, which prohibits such actions as dumping the

[GENERAL] XID comparations

2006-06-13 Thread Carlos H. Reimer
Hi, I would like to understand better the logic to determine when a xid is older than another one. As I could understand, the XID is always incremented, never reset. If it is true, then we can have rows with cmin ranging from 1 to 4.294.967.295 (2^32-1). When xid overflows (32 bits) the next

Re: [GENERAL] Fabian Pascal and RDBMS deficiencies in fully

2006-06-13 Thread Scott Ribe
What say we just stop right there and call Date's Relational Model what it is: a silly edifice built atop wrong premises. SQL was a quick and dirty hack (Systems R and R* needed some way to interface with data) with multiple deficiencies recognized and documented right within the very first

Re: [GENERAL] XID comparations

2006-06-13 Thread Tom Lane
Carlos H. Reimer [EMAIL PROTECTED] writes: I would like to understand better the logic to determine when a xid is older than another one. It's circular mod 2^32, with a special case for FrozenXID. It's a mistake to imagine that XIDs are unsigned ints, really --- the comparison doesn't work

Re: [GENERAL] XID comparations

2006-06-13 Thread Martijn van Oosterhout
On Tue, Jun 13, 2006 at 12:10:26PM -0300, Carlos H. Reimer wrote: When xid overflows (32 bits) the next one will be 3 (1 and 2 are reserved). In this case, we could have have lines with cmin 4.294.967.295 and lines with cmin 3. How are they compared to determine that rows with cmin 3 are

[GENERAL] PostgreSQL and Apache: authentication and authorization

2006-06-13 Thread jqpx37
Thanks to everyone who replied to my previous post, PostgreSQL and Apache, where I asked about references describing how to get PostgreSQL and Apache working together. Here, I'll ask the specific questions which motivated that post. The setup: I'm working on a database project. We chose

Re: [GENERAL] Fabian Pascal and RDBMS deficiencies in fully implementing

2006-06-13 Thread David Fetter
On Tue, Jun 13, 2006 at 09:18:17AM -0600, Scott Ribe wrote: What say we just stop right there and call Date's Relational Model what it is: a silly edifice built atop wrong premises. SQL was a quick and dirty hack (Systems R and R* needed some way to interface with data) with multiple

Re: [GENERAL] Fabian Pascal and RDBMS deficiencies in fully

2006-06-13 Thread A.M.
Now, there's another thing that makes it amazingly hard to displace: imagining what would be better *enough* to justify the many millions of people-years and even more billions of dollars needed to move away from it. Despite Date's many whines over the decades, his still-vaporware Relational

Re: [GENERAL] Fabian Pascal and RDBMS deficiencies in fully implementing

2006-06-13 Thread Merlin Moncure
On 6/13/06, David Fetter [EMAIL PROTECTED] wrote: SQL was a quick and dirty hack (Systems R and R* needed some way to interface with data) with multiple deficiencies recognized and documented right within the very first paper by its own authors. Perfection isn't a human attribute. There

Re: [GENERAL] PostgreSQL and Apache: authentication and authorization

2006-06-13 Thread Kenneth Downs
jqpx37 wrote: I can envision, broadly, two authentication schemes: (1) Users authenticate to Apache. (2) Users authenticate to PG. This is a little too complicated. The most accurate and precise security is obtained by having the user log in with a real postgres account, and to grant

Re: [GENERAL] Fabian Pascal and RDBMS deficiencies in fully implementing

2006-06-13 Thread David Fetter
On Tue, Jun 13, 2006 at 12:51:57PM -0400, Merlin Moncure wrote: On 6/13/06, David Fetter [EMAIL PROTECTED] wrote: SQL was a quick and dirty hack (Systems R and R* needed some way to interface with data) with multiple deficiencies recognized and documented right within the very first paper

[GENERAL] More on state variables

2006-06-13 Thread Kenneth Downs
Yesterday on this list I found out about the nifty setting custom_variable_classes='global' which allows the setting and retrieving of arbitrary values that persist across statements. I wonder if there is a way to do the same thing within the scope of a transaction? Is there a magic value

Re: [GENERAL] Fabian Pascal and RDBMS deficiencies in fully

2006-06-13 Thread brian ally
2) Re: still-vaporware Relational Model- the relational model is a mathematical model for data representation. Your comment makes as much sense as claiming that Newtonian physics is vaporware. If we're discussing the luminiferous aether, then, yes, vaporware seems /somewhat/ appropriate.

[GENERAL] plpgsql Result Sets

2006-06-13 Thread Brandon E Hofmann
When using a temp table in plpgsql functions that has columns comprised from many tables populated by joins, how do you specify a temp table return type when its generated by select into and dropped dynamically? I get an error when I specify returns setof temp_table. Also when I specify a

RES: [GENERAL] XID comparations

2006-06-13 Thread Carlos H. Reimer
Thanks, In my first question I would like to use xmin instead of cmin, even so I could understand the logic. Then for each XID you have 2 bilions XIDs that are considered lower than and the other 2 bi higher than. About row visibility: are all the rows with xmin higher than my XID be considered

Re: [GENERAL] How can I retrieve a function result?

2006-06-13 Thread Luis Alberto Pérez Paz
Hi, Thanks a lot for your answer, Let me give you a simple examplewith more detail: In my postgres database I have a function called myFunction. // CREATE OR REPLACE FUNCTION myFunction(INT) RETURN INT AS ' DECLARE indice

[GENERAL] Short circuit evaluation of expressions in query

2006-06-13 Thread Jimmy Choi
Say I have the following parameterized query in a function: select * from foo where ($1 = -1 or foo.status = $1) and () where the () part consists of more parameterized conditions similar to the first one. Suppose that at runtime, $1 is supplied a value of -1, does the foo.status

[GENERAL] MAX() across partition tables

2006-06-13 Thread Qiao Yang
Hi, In Postgres 8.1, MAX() was rewritten to use index backward search without doing seq_scan. This achieves a huge performance gain. But I found that when I use MAX() on a partitioned table, it reverses back to the old seq_scan plan. Wouldn't it be more efficient to get MAX() from each partition

Re: [GENERAL] Fabian Pascal and RDBMS deficiencies in fully implementing

2006-06-13 Thread Ron Mayer
David Fetter wrote: On Tue, Jun 13, 2006 at 12:51:57PM -0400, Merlin Moncure wrote: On 6/13/06, David Fetter [EMAIL PROTECTED] wrote: SQL was a quick and dirty hack... If there are better alternatives, they will need to show some real-world attributes, not mathematically-inspired fantasies,

Re: [GENERAL] Short circuit evaluation of expressions in query

2006-06-13 Thread Martijn van Oosterhout
On Tue, Jun 13, 2006 at 02:34:36PM -0400, Jimmy Choi wrote: Suppose that at runtime, $1 is supplied a value of -1, does the foo.status = $1 condition still have to be evaluated? SQL doesn't offer any kind of guarentees about order of evaluations, and neither does postgres. It may occasionally

Re: [GENERAL] State of Postgresql Replication?

2006-06-13 Thread Shane Ambler
On 10/6/2006 4:37, Jim C. Nasby [EMAIL PROTECTED] wrote: On Fri, Jun 09, 2006 at 01:51:23PM -0500, Scott Marlowe wrote: On Fri, 2006-06-09 at 12:51, Jim C. Nasby wrote: On Fri, Jun 09, 2006 at 01:35:44PM -0400, Wei Weng wrote: Is there any OSS solutions (stable) for postgresql replication for

Re: [GENERAL] Fabian Pascal and RDBMS deficiencies in fully implementing

2006-06-13 Thread Christopher Browne
Ron Mayer [EMAIL PROTECTED] wrote: David Fetter wrote: the terse mathematical notation commonly used... Again, if you have a piece of software you can point to that does this thing, please do so. I seriously doubt it follows Date or Pascal religiously, but it does have a convenient and

Re: [GENERAL] BLOB Searching

2006-06-13 Thread Jim C. Nasby
On Mon, Jun 12, 2006 at 02:44:34PM -0700, [EMAIL PROTECTED] wrote: 1. How can I store the word doc's in the DB, would it be best to use a BLOB data type? Use a bytea field. 2. Does Postgres support full text searching of a word document once it Nope. is loaded into the BLOB column how

Re: [GENERAL] Partitioning...

2006-06-13 Thread Jim C. Nasby
On Mon, Jun 12, 2006 at 06:58:06PM -0400, Tom Lane wrote: Milen Kulev [EMAIL PROTECTED] writes: What is wrong with random() ? Not guaranteed to be stable across the multiple evaluations that the rule will perform ... remember a rule is a macro and has the usual multiple-evaluation gotchas

Re: [GENERAL] plpgsql Result Sets

2006-06-13 Thread Jim C. Nasby
If you're trying to do what I think you're trying to do, you might need to create the temp table before you create the function (in the same session). Posting a test case people could look at somewhere would be easier than reading a bunch of description about the problem. On Tue, Jun 13, 2006 at

Re: [GENERAL] How can I retrieve a function result?

2006-06-13 Thread Joachim Wieland
Luis, On Tue, Jun 13, 2006 at 01:19:32PM -0500, Luis Alberto Pérez Paz wrote: The program works fine, actually I can verify that it executes the FUNCTION 'myFunction', however I dont know how can I get the return value of the FUNCTION 'myFunction' (as you can see in the little example the

Re: [GENERAL] postgres vs. oracle for very large tables

2006-06-13 Thread Jim C. Nasby
On Mon, May 15, 2006 at 12:24:51PM -0700, TJ O'Donnell wrote: I've written some extensions to postgres to implement chemical structure searching. I get inquiries about the performance of postgres vs. oracle. This is a huge topic, with lots of opinions and lots of facts. But, today I got

Re: [GENERAL] How can I retrieve a function result?

2006-06-13 Thread Luis Alberto Pérez Paz
Thank you Joachim, it woks! Regards, Luis A Perez Paz On 6/13/06, Joachim Wieland [EMAIL PROTECTED] wrote: Luis,On Tue, Jun 13, 2006 at 01:19:32PM -0500, Luis Alberto Pérez Paz wrote: The program works fine, actually I can verify that it executes the FUNCTION 'myFunction', however I dont

Re: [GENERAL] Fabian Pascal and RDBMS deficiencies in fully implementing

2006-06-13 Thread Trent Shipley
On Tuesday 2006-06-13 09:26, David Fetter wrote: On Tue, Jun 13, 2006 at 09:18:17AM -0600, Scott Ribe wrote: What say we just stop right there and call Date's Relational Model what it is: a silly edifice built atop wrong premises. SQL was a quick and dirty hack (Systems R and R* needed

Re: [GENERAL] postgres vs. oracle for very large tables

2006-06-13 Thread Trent Shipley
On Tuesday 2006-06-13 16:19, Jim C. Nasby wrote: On Mon, May 15, 2006 at 12:24:51PM -0700, TJ O'Donnell wrote: I've written some extensions to postgres to implement chemical structure searching. I get inquiries about the performance of postgres vs. oracle. This is a huge topic, with

Re: [GENERAL] BLOB Searching

2006-06-13 Thread Joshua D. Drake
Jim C. Nasby wrote: On Mon, Jun 12, 2006 at 02:44:34PM -0700, [EMAIL PROTECTED] wrote: 1. How can I store the word doc's in the DB, would it be best to use a BLOB data type? Use a bytea field. 2. Does Postgres support full text searching of a word document once it Nope. Not natively.

Re: [GENERAL] postgres vs. oracle for very large tables

2006-06-13 Thread Joshua D. Drake
Jim C. Nasby wrote: On Mon, May 15, 2006 at 12:24:51PM -0700, TJ O'Donnell wrote: I've written some extensions to postgres to implement chemical structure searching. I get inquiries about the performance of postgres vs. oracle. This is a huge topic, with lots of opinions and lots of facts.

Re: [GENERAL] Short circuit evaluation of expressions in query

2006-06-13 Thread Tom Lane
Jimmy Choi [EMAIL PROTECTED] writes: Say I have the following parameterized query in a function: select * from foo where ($1 = -1 or foo.status = $1) and (...) Suppose that at runtime, $1 is supplied a value of -1, does the foo.status = $1 condition still have to be evaluated? The PG manual

[GENERAL] Problem Connecting to 5432

2006-06-13 Thread Casey, J Bart
All, I have read message after message and searched the internet for hours, yet I still cant get a remote computer to connect to port 5432 on my Fedora Core 3 system running Postgresql 7.4.7. What I have done: 1) Stopped the iptables service 2) Modified postgresql.conf and