Re: [GENERAL] General Ledger db design

2007-02-26 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/26/07 01:39, Karl O. Pinc wrote: On 02/25/2007 06:21:45 PM, Kenneth Downs wrote: Martin Winsler wrote: [snip] The above proposal takes care of the data structure/referential integrity issues, but does not solve the data integrity

Re: [GENERAL] complex referential integrity constraints

2007-02-26 Thread Alban Hertroys
Robert Haas wrote: I don't understand what a weighted constraint would mean. Either the attacker_id can be a wolf, or it can't. Knowing that it is only 1% likely over the long haul is insufficient to disallow any particular transaction. Basically I suggested to combine the constraint with a

Re: [GENERAL] PostgreSQL on Windows Paper

2007-02-26 Thread Dave Page
Scott Marlowe wrote: On Fri, 2007-02-23 at 12:22, Chris Travers wrote: Hi all; Microsoft has seen it fit to publish a paper I have written as an introduction to PostgreSQL on Windows. This paper covers the basics of installing and configuring the software. I thought it might be of

Re: [GENERAL] SQL Question - Using Group By

2007-02-26 Thread Alban Hertroys
[EMAIL PROTECTED] wrote: You could use COUNT() in conjunction with NULLIF: select Type, count(nullif(Active, false)) as Active Count, count(nullif(Active, true)) as Inactive Count, 100 * count(nullif(Active, false)) / count(*) as Active Percent from table_name group by Type Tom Lane

Re: [GENERAL] problem installing NPGSQL and pgOLEDB with .NET

2007-02-26 Thread RPK
I am using NPGSQL but noticed degraded performance when only 5 to 10 records are there. ODBC was very fast. -- View this message in context: http://www.nabble.com/problem-installing-NPGSQL-and-pgOLEDB-with-.NET-tf3282768.html#a9156510 Sent from the PostgreSQL - general mailing list archive at

Re: [GENERAL] General Ledger db design

2007-02-26 Thread Raymond O'Donnell
Kenneth Downs wrote: So far so good. Now we have AR invoices, and AP vouchers. Let's My apologies if this is a stupid question, but what do AR and AP stand for? I'm following this thread with interest. Ray. --- Raymond

Re: [GENERAL] General Ledger db design

2007-02-26 Thread Michael Glaesemann
On Feb 26, 2007, at 19:32 , Raymond O'Donnell wrote: Kenneth Downs wrote: So far so good. Now we have AR invoices, and AP vouchers. Let's My apologies if this is a stupid question, but what do AR and AP stand for? I'm following this thread with interest. Accounts Receivable and

[GENERAL] PostgreSQL 8.2.x and JDBC driver

2007-02-26 Thread DANTE Alexandra
Hello List, I am not sure that this is the appropriated list but I try... I try to used BenchmarkSQL (release 2.3.2, built on February 12, 2006) with PostgreSQL 8.2.2 and then 8.2.3. By default, the JDBC driver included with this release of BenchmarkSQL is postgresql-8.0.309.jdbc3.jar. So I

[GENERAL] Strange Problem. Please Help.

2007-02-26 Thread hengky liwandouw
Dear all, I have a very strange problem with Access 2003 as frontend and PqSql 8.1 as backend. In my access application, i have order form with orderdetail subform. Subform recordsource, based on a saved Access query that has very simple calculated field AMOUNT that calculate

Re: [GENERAL] [HACKERS] urgent: upgraded to 8.2, getting kernel panics

2007-02-26 Thread Merlin Moncure
On 2/23/07, Tom Lane [EMAIL PROTECTED] wrote: Merlin Moncure [EMAIL PROTECTED] writes: On friday we upgraded a critical backend server to postgresql 8.2 running on fedora core 4. Umm ... why that particular choice of OS? Red Hat dropped update support for FC4 some time ago, and AFAIK the

Re: [GENERAL] General Ledger db design

2007-02-26 Thread Kenneth Downs
Karl O. Pinc wrote: On 02/25/2007 06:21:45 PM, Kenneth Downs wrote: Martin Winsler wrote: This is a real world situation where referential integrity needs to be broken in theory, I believe. Does anybody have any experience or knowledge of building financial accounting databases? Am I

Re: [GENERAL] perfromance world records

2007-02-26 Thread Merlin Moncure
On 2/24/07, Tomi N/A [EMAIL PROTECTED] wrote: That's the kind of leverage I'd like to have when talking about using pgsql with my colleagues. Anyone care to comment? The name brand test are basically paid pr for the big databases. Basically, the tests are in environments controlled completely

Re: [GENERAL] [HACKERS] urgent: upgraded to 8.2, getting kernel panics

2007-02-26 Thread Devrim GUNDUZ
Hi, On Mon, 2007-02-26 at 08:24 -0500, Merlin Moncure wrote: we tried update to the latest via yum update with no help. As Tom stated, FC4 is no more supported; therefore you won't be able to get newer kernel via yum. as promised, here is the best photo of the panic we could get:

[GENERAL] proper export table to csv? multilineproblem.

2007-02-26 Thread peter pilsl
I need to export several tables as csv. I use the \f-command to set the seperator and pipe the output of my select directly to a file. Unfortunately thats all the control I have over the created csv-file. I cannot set the field-delimiter and - which is critical to me - I cannot set an

[GENERAL] how to sort an array and remove duplicate in plpgsql

2007-02-26 Thread David Gagnon
Hi all, I'm messing up with this problem for a while and I searched the web without success. I have an array of timestamp and I needed sorted and I need to remove duplicate value. The Select statement offers the SORT BY and UNIQUE that may help me but so far I didn't find the way to plug my

Re: [GENERAL] how to sort an array and remove duplicate in plpgsql

2007-02-26 Thread A. Kretschmer
am Mon, dem 26.02.2007, um 9:15:52 -0500 mailte David Gagnon folgendes: Hi all, I?m messing up with this problem for a while and I searched the web without success. I have an array of timestamp and I needed sorted and I need to remove duplicate value. The Select statement offers the

[GENERAL] Querying all months even if don't exist

2007-02-26 Thread Robert Fitzpatrick
I have a query that pulls totals for the month and from there I am building a crosstab to show all months. My dilemma is that sometimes there is no data for a month and the crosstab becomes skewed. I made a table with all the 12 months in it and joined to the query in my view to get all the months

Re: [GENERAL] how to sort an array and remove duplicate in plpgsql

2007-02-26 Thread Chris Coleman
Hi, I'm no postgres guru and am not sure if this is the accepted way or not, but: CREATE OR REPLACE FUNCTION explode_array(in_array anyarray) RETURNS SETOF anyelement AS $BODY$ SELECT ($1)[s] FROM generate_series(1, array_upper($1, 1)) AS s; $BODY$ LANGUAGE 'sql' IMMUTABLE; ALTER FUNCTION

Re: [GENERAL] Querying all months even if don't exist

2007-02-26 Thread A. Kretschmer
am Mon, dem 26.02.2007, um 10:10:45 -0500 mailte Robert Fitzpatrick folgendes: I have a query that pulls totals for the month and from there I am building a crosstab to show all months. My dilemma is that sometimes there is no data for a month and the crosstab becomes skewed. I made a table

Re: [GENERAL] Writing oracle/postgress generic SQL

2007-02-26 Thread Richard Troy
On Fri, 23 Feb 2007, David Fetter wrote: On Fri, Feb 23, 2007 at 08:28:06AM -0800, Richard Troy wrote: On Fri, 23 Feb 2007, David Fetter wrote: On Fri, Feb 23, 2007 at 10:23:56AM +0100, Ben Edwards wrote: Anyone know of any guidelines for writing SQL which works under Oracle witch

Re: [GENERAL] complex referential integrity constraints

2007-02-26 Thread Alban Hertroys
Robert Haas wrote: I sort of think that this kind of stuff belongs in a separate table somehow. For example in this case I would want to: I wasn't suggesting otherwise. A constraint is a constraint; whether it involves an extra table or not wasn't really relevant until now (apparently).

Re: [GENERAL] Best way to store and retrieve photo from PostGreSQL

2007-02-26 Thread Brent Wood
We are storing images as files with names/paths, metadata, etc. in PostGIS (as our images are often associated with a location, being things like field specimen images, or seabed pictures we use PostGIS to store query the location info, and UMN Mapserver as the engine driving a map based

Re: [GENERAL] complex referential integrity constraints

2007-02-26 Thread Robert Haas
I sort of think that this kind of stuff belongs in a separate table somehow. For example in this case I would want to: CREATE TABLE attack_probability ( attacker_type_id integer not null references animal_type (id), victim_type_id integer not null references animal_type (id),

Re: [GENERAL] General Ledger db design

2007-02-26 Thread Filipe Fernandes
[snip] Martin Winsler wrote: Does anybody have any experience or knowledge of building financial accounting databases? [snip] I too was thinking about building a double entry accounting system and I've been following this thread closely, learning a few tricks on the way :) I've been gathering

Re: [GENERAL] General Ledger db design

2007-02-26 Thread Karl O. Pinc
On 02/26/2007 07:40:17 AM, Kenneth Downs wrote: Karl O. Pinc wrote: On 02/25/2007 06:21:45 PM, Kenneth Downs wrote: Martin Winsler wrote: This is a real world situation where referential integrity needs to be broken in theory, I believe. The problem is that with double entry accounting

Re: [GENERAL] General Ledger db design

2007-02-26 Thread Kenneth Downs
Karl O. Pinc wrote: You can put triggers into the financial transaction detail table that says that the batch id has to be valid if it exists to get your referential integrity right. Right. You can also not allow new rows to be inserted if there is already a batch row, thus the insertion of

Re: [GENERAL] General Ledger db design

2007-02-26 Thread Karl O. Pinc
On 02/26/2007 11:41:18 AM, Kenneth Downs wrote: You can also not allow new rows to be inserted if there is already a batch row, thus the insertion of a batch row closes the batch. Not sure what you mean, but you can in fact have any number of open batches, on the assumption that it is a

Re: [pgsql-advocacy] [GENERAL] PostgreSQL on Windows Paper

2007-02-26 Thread Magnus Hagander
Dave Page wrote: Scott Marlowe wrote: On Fri, 2007-02-23 at 12:22, Chris Travers wrote: Hi all; Microsoft has seen it fit to publish a paper I have written as an introduction to PostgreSQL on Windows. This paper covers the basics of installing and configuring the software. I thought it

Re: [GENERAL] proper export table to csv? multilineproblem.

2007-02-26 Thread Reid Thompson
On Mon, 2007-02-26 at 14:54 +0100, peter pilsl wrote: I need to export several tables as csv. I use the \f-command to set the seperator and pipe the output of my select directly to a file. Unfortunately thats all the control I have over the created csv-file. I cannot set the

Re: [GENERAL] General Ledger db design

2007-02-26 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/26/07 10:35, Filipe Fernandes wrote: [snip] Martin Winsler wrote: Does anybody have any experience or knowledge of building financial accounting databases? [snip] I too was thinking about building a double entry accounting system and

Re: [GENERAL] proper export table to csv? multilineproblem.

2007-02-26 Thread Reid Thompson
On Mon, 2007-02-26 at 13:20 -0500, Reid Thompson wrote: On Mon, 2007-02-26 at 14:54 +0100, peter pilsl wrote: I need to export several tables as csv. I use the \f-command to set the seperator and pipe the output of my select directly to a file. Unfortunately thats all the control I have

Re: [GENERAL] Composite Keys

2007-02-26 Thread RPK
Jorge, For other tables I have ID field which is incremented by sequence. But for this table, there is not ID field. Receipt No will be incremented by finding the max value from the existing Receipt Nos. corresponding to that Book No. This case has a drawback as compared to the sequences in

[GENERAL] stored procedure optimisation...

2007-02-26 Thread Anton Melser
Hi, I need to analyse some html to get some links out, and with only 25 lines in exports_tmp_links (and text_to_parse no more than around 10KB) this function has taken 10 minutes and counting. Something horribly wrong is going on here! Can someone give me any pointers? Cheers Anton delete from

Re: [GENERAL] Composite Keys

2007-02-26 Thread Alvaro Herrera
RPK wrote: Jorge, For other tables I have ID field which is incremented by sequence. But for this table, there is not ID field. Receipt No will be incremented by finding the max value from the existing Receipt Nos. corresponding to that Book No. This case has a drawback as compared to the

Re: [GENERAL] help required regarding queryin postgis database from google maps

2007-02-26 Thread Andrew Hammond
On Feb 25, 9:34 am, [EMAIL PROTECTED] (Andrew Dunstan) wrote: Phani Kishore wrote: hi ! i think u people could probably help me i how to query the pgsql/postgis from google maps api to display the markers on the google maps which are stored in the postgis database. Phani Kishore

Re: [GENERAL] Composite Keys

2007-02-26 Thread RPK
Alvaro, I am using VB.NET. How to enable locking from within VB.NET for PostgreSQL? Which command need to be executed? Alvaro Herrera-7 wrote: Lock the table beforehand. Only one user can be getting the max(ReceiptNo) that way. Alternatively, you could use userlocks, so that you can

[GENERAL] psql : password on Win32

2007-02-26 Thread Fabio D'Ovidio
Hi folks ! I am new of the list even if I use PostgreSQL\PostGIS since I was in Planetek to work. I have a problem with psql command line on Windows XP. I want to set password for the user postgres in order to execute an sql script directly from a batch file without entering password from

Re: [pgsql-advocacy] [GENERAL] PostgreSQL on Windows Paper

2007-02-26 Thread Dave Page
Magnus Hagander wrote: - It says that 'one should expect performance on Windows to be lower [because of the per-process architecture], especially where large numbers of small queries are made.' That's not really accurate - it will be slower when there are large numbers of short lived

Re: [GENERAL] psql : password on Win32

2007-02-26 Thread A. Kretschmer
am Mon, dem 26.02.2007, um 19:34:25 +0100 mailte Fabio D'Ovidio folgendes: I have used pgpass.conf file with the syntax : localhost:5432:mydb:postgres:password and it doesn't work. Wrong syntax. Change ':' to '\t' or other whitespace. Andreas -- Andreas Kretschmer Kontakt: Heynitz:

Re: [GENERAL] General Ledger db design

2007-02-26 Thread Filipe Fernandes
Look at SQL-Ledger and LedgerSMB [snip] Ledger SMB (http://www.ledgersmb.org/about/) might be a place to start. Thanks Ron and Brent for the suggestion... very much appreciated. filipe ---(end of broadcast)--- TIP 3: Have you checked our

Re: [GENERAL] Writing oracle/postgress generic SQL

2007-02-26 Thread Joshua D. Drake
Unless, as with rare beasties like Science Tools, the major purpose of the application is to support multiple DBMS back-ends, it's just too expensive. Even in those rare cases, it's expensive. I guess anything you have to pay for is too expensive. (Sounds like dogma to me. And you know

Re: [GENERAL] Writing oracle/postgress generic SQL

2007-02-26 Thread David Fetter
On Mon, Feb 26, 2007 at 08:01:52AM -0800, Richard Troy wrote: On Fri, 23 Feb 2007, David Fetter wrote: On Fri, Feb 23, 2007 at 08:28:06AM -0800, Richard Troy wrote: On Fri, 23 Feb 2007, David Fetter wrote: On Fri, Feb 23, 2007 at 10:23:56AM +0100, Ben Edwards wrote: Anyone know of

[GENERAL] grant on sequence and pg_restore/pg_dump problem

2007-02-26 Thread Tony Caduto
Hi, I did a quick search and didn't see anything on this, if I missed it sorry in advance. Anyway, I was doing a restore of a 8.1 database(on a 8.1 server) using the 8.2 pg_restore and it was throwing errors when it was trying to restore the permissions on the sequences. basically the

[GENERAL] Most efficient report of number of records in all tables?

2007-02-26 Thread D. Dante Lorenso
All, I can find the names of all tables in the database with this query: SELECT table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') ORDER BY table_name ASC; Then, in code, I can loop through all

[GENERAL] preventing ALTER TABLE RENAME from changing view definitions?

2007-02-26 Thread George Pavlov
Currently ALTER TABLE ... RENAME TO ... results in all views that refer to the table to be rewritten with the new table name. This is a good thing in the general case, but there are also situations where it is not (e.g. temporarily renaming tables for data reorg reasons). I can't seem to find a

Re: [GENERAL] Most efficient report of number of records in all tables?

2007-02-26 Thread Dann Corbit
If you only need a cardinality estimate, then pg_class.reltuples may be of help (it will be accurate to when the last vacuum was performed). If you need exact counts then there are a couple of problems: 1. An MVCC database cannot store an exact count, because it can differ by user. Hence, to

Re: [GENERAL] Most efficient report of number of records in all tables?

2007-02-26 Thread D. Dante Lorenso
Dann Corbit wrote: If you only need a cardinality estimate, then pg_class.reltuples may be of help (it will be accurate to when the last vacuum was performed). Last vacuum ... how does that work with autovacuum? If you need exact counts then there are a couple of problems: 1. An MVCC

Re: [GENERAL] preventing ALTER TABLE RENAME from changing view definitions?

2007-02-26 Thread Richard Huxton
George Pavlov wrote: Currently ALTER TABLE ... RENAME TO ... results in all views that refer to the table to be rewritten with the new table name. This is a good thing in the general case, but there are also situations where it is not (e.g. temporarily renaming tables for data reorg reasons). I

Re: [GENERAL] Most efficient report of number of records in all tables?

2007-02-26 Thread Alvaro Herrera
D. Dante Lorenso wrote: Dann Corbit wrote: If you only need a cardinality estimate, then pg_class.reltuples may be of help (it will be accurate to when the last vacuum was performed). Last vacuum ... how does that work with autovacuum? The same, only that you'd have to monitor autovac

[GENERAL] dropping a master table and all of its partitions?

2007-02-26 Thread George Nychis
Hey everyone, I created a master table, and created ~2000 partitions for it. *no* data is in any of these partitions. I am trying to drop the master and all of the partitions with a cascade: DROP TABLE master CASCADE; Except after about 30 seconds my memory usage (4GB) jumps to 99%, and

Re: [GENERAL] dropping a master table and all of its partitions?

2007-02-26 Thread Erik Jones
Did you use some kind of sensical naming convention for the child tables? If so, couldn't you write a script to loop through and drop them one at a time? On Feb 26, 2007, at 6:42 PM, George Nychis wrote: Hey everyone, I created a master table, and created ~2000 partitions for it. *no*

Re: [GENERAL] dropping a master table and all of its partitions?

2007-02-26 Thread George Nychis
Sure I can do that, but why is this happening? Is this normal behavior? - George Erik Jones wrote: Did you use some kind of sensical naming convention for the child tables? If so, couldn't you write a script to loop through and drop them one at a time? On Feb 26, 2007, at 6:42 PM, George

Re: [GENERAL] dropping a master table and all of its partitions?

2007-02-26 Thread Joshua D. Drake
George Nychis wrote: Sure I can do that, but why is this happening? Is this normal behavior? Well that is the better question. If it is indeed doing what you say it is doing, I would say it is a bug. However you have not mentioned several important items, like what postgresql version you are

Re: [GENERAL] dropping a master table and all of its partitions?

2007-02-26 Thread George Nychis
I tend to forget the important details ;) [EMAIL PROTECTED]:~$ psql --version psql (PostgreSQL) 8.1.8 contains support for command-line editing [EMAIL PROTECTED]:~$ uname -a Linux sn001 2.6.17-10-server #2 SMP Tue Dec 5 21:17:26 UTC 2006 x86_64 GNU/Linux - George Joshua D. Drake wrote:

Re: [GENERAL] Most efficient report of number of records in all tables?

2007-02-26 Thread Merlin Moncure
On 2/27/07, D. Dante Lorenso [EMAIL PROTECTED] wrote: Dann Corbit wrote: If you only need a cardinality estimate, then pg_class.reltuples may be of help (it will be accurate to when the last vacuum was performed). Last vacuum ... how does that work with autovacuum? 'analyze' updates

Re: [GENERAL] preventing ALTER TABLE RENAME from changing view definitions?

2007-02-26 Thread Tom Lane
George Pavlov [EMAIL PROTECTED] writes: Currently ALTER TABLE ... RENAME TO ... results in all views that refer to the table to be rewritten with the new table name. They are not rewritten. Views refer to tables by OID, and are therefore entirely insensitive to RENAME operations. This is not

Re: [GENERAL] dropping a master table and all of its partitions?

2007-02-26 Thread Alvaro Herrera
George Nychis wrote: I tend to forget the important details ;) [EMAIL PROTECTED]:~$ psql --version psql (PostgreSQL) 8.1.8 contains support for command-line editing [EMAIL PROTECTED]:~$ uname -a Linux sn001 2.6.17-10-server #2 SMP Tue Dec 5 21:17:26 UTC 2006 x86_64 GNU/Linux Just tried

Re: [GENERAL] dropping a master table and all of its partitions?

2007-02-26 Thread Tom Lane
Joshua D. Drake [EMAIL PROTECTED] writes: George Nychis wrote: Sure I can do that, but why is this happening? Is this normal behavior? Well that is the better question. If it is indeed doing what you say it is doing, I would say it is a bug. However you have not mentioned several important

[GENERAL] Connecting to a remote server, pg_hba.conf error?

2007-02-26 Thread novnov
I am trying to connect to a postgres 8.1 installation on a ubuntu box from windows xp. I get this error: FATAL: missing or erroneous pg_hba.conf file HINT see server log for details. The server ip address is 192.168.1.10. The workstation ip address is 192.168.2.100. The server firewall allows

Re: [GENERAL] Connecting to a remote server, pg_hba.conf error?

2007-02-26 Thread Douglas McNaught
novnov [EMAIL PROTECTED] writes: I am trying to connect to a postgres 8.1 installation on a ubuntu box from windows xp. I get this error: FATAL: missing or erroneous pg_hba.conf file HINT see server log for details. The server ip address is 192.168.1.10. The workstation ip address is

Re: [GENERAL] Connecting to a remote server, pg_hba.conf error?

2007-02-26 Thread novnov
Wonderful, that solved it...THANK YOU! Douglas McNaught wrote: novnov [EMAIL PROTECTED] writes: I am trying to connect to a postgres 8.1 installation on a ubuntu box from windows xp. I get this error: FATAL: missing or erroneous pg_hba.conf file HINT see server log for details. The

Re: [GENERAL] PostgreSQL 8.2.x and JDBC driver

2007-02-26 Thread Kris Jurka
On Mon, 26 Feb 2007, DANTE Alexandra wrote: I am not sure that this is the appropriated list but I try... I try to used BenchmarkSQL (release 2.3.2, built on February 12, 2006) with PostgreSQL 8.2.2 and then 8.2.3. By default, the JDBC driver included with this release of BenchmarkSQL is