Re: [GENERAL] Constraint Problem

2003-11-05 Thread Csaba Nagy
You probably didn't quite understand the suggestion. You should create a unique index like: create unique index your_index_name on your_table (companyID, associationID) where ysnDefault; This will restrict the uniqueness checks to the records where ysnDefault is true (and not null, of course). H

Re: [GENERAL] Database design question: ugliness or referential integrity?

2003-11-05 Thread Jaime Casanova
One solution is to create partial index: create unique index indice on emails(direccion) where estado = 'A' _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -

[GENERAL] Changes in Rel. 7.4

2003-11-05 Thread Alex
Hi, is there a document available describing the changes / additions in 7.4 ? Thanks Alex ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] Help on update that subselects other records in table, uses joins

2003-11-05 Thread Manfred Koizar
On Wed, 5 Nov 2003 02:58:28 +0900, Michael Glaesemann <[EMAIL PROTECTED]> wrote: >> UPDATE ordercharges >>SET orderchargeasbilled = 0.065 * sale.orderchargeasbilled >> FROM orders AS o, ordercharges AS sale >> WHERE ordercharges.orderchargecode = 'S&H' >>AND ordercharges.orderid = o.orde

Re: [GENERAL] select/update performance?

2003-11-05 Thread Rob Fielding
Bjørn T Johansen wrote: I need to maintain a manually counter for an id-field, but I can do this two ways. Either make a counter table (which means one select and one update) or just selecting the largest id from existing table and increment by one (just one select + one table lock). Which one is f

Re: [GENERAL] select/update performance?

2003-11-05 Thread Richard Huxton
On Wednesday 05 November 2003 09:49, Bjørn T Johansen wrote: > Yes, but the table in question have 3 PK and only one that needs this > "sequence" so I just thought instead of getting holes in the IDs I just > manually handle this counter somehow.. Not a big deal but... :) Do you mean a 3-column pr

Re: [GENERAL] question

2003-11-05 Thread Richard Huxton
On Tuesday 04 November 2003 16:50, Alexandr S wrote: > Hi > There is question. I have column name_my varchar (not array) in table1, > and column name_my_ref varchar[] (array) in other table2. I want set > Foreign Key on name_my_ref and every element in the same row of array > must match any

Re: [GENERAL] select/update performance?

2003-11-05 Thread Rob Fielding
Bjørn T Johansen wrote: Yes, but the table in question have 3 PK and only one that needs this "sequence" so I just thought instead of getting holes in the IDs I just manually handle this counter somehow.. Not a big deal but... :) You'd only get holes if you keep making nextval requests without usin

Re: [GENERAL] select/update performance?

2003-11-05 Thread Bjørn T Johansen
Ok you all, I cave... I will use sequences :) BTJ On Wed, 2003-11-05 at 11:46, Rob Fielding wrote: > Bjørn T Johansen wrote: > > Yes, but the table in question have 3 PK and only one that needs this > > "sequence" so I just thought instead of getting holes in the IDs I just > > manually handl

[GENERAL] SET AUTOCOMMIT OFF

2003-11-05 Thread Thierry Missimilly
Hi, I have got an error with PostgreSQL-7.4Beta4 : ERROR SET AUTOCOMMIT TO OFF is no longer supported I used these option to load huge Database as i can save time with it. Is there an other option in PG 7.4 to do the same ? Regards Thierry Missimilly begin:vcard n:Missimilly;Thierry tel;fax:+33

Re: [GENERAL] Changes in Rel. 7.4

2003-11-05 Thread Bruno Wolff III
On Wed, Nov 05, 2003 at 13:27:15 +0900, Alex <[EMAIL PROTECTED]> wrote: > Hi, > is there a document available describing the changes / additions in 7.4 ? > > Thanks > Alex The release notes in the 7.4 documentation cover what has changed. ---(end of broadcast)--

[GENERAL] select/update performance?

2003-11-05 Thread Bjørn T Johansen
I need to maintain a manually counter for an id-field, but I can do this two ways. Either make a counter table (which means one select and one update) or just selecting the largest id from existing table and increment by one (just one select + one table lock). Which one is fastest? Regards, BTJ

Re: [GENERAL] select/update performance?

2003-11-05 Thread Bjørn T Johansen
Yes, but the table in question have 3 PK and only one that needs this "sequence" so I just thought instead of getting holes in the IDs I just manually handle this counter somehow.. Not a big deal but... :) BTJ On Wed, 2003-11-05 at 10:42, Rob Fielding wrote: > Bjørn T Johansen wrote: > > I need

Re: [GENERAL] select/update performance?

2003-11-05 Thread Csaba Nagy
You are buying yourself trouble. The holes in the IDs are the least problem, and a generated sequence should not have any business meaning anyway. BTW, what happens when you delete a record ? That would surely leave you a hole in the IDs... Just a quick thought: if you are going to handle manually

Re: [GENERAL] PostgreSQL v7.4 Release Candidate 1

2003-11-05 Thread Tom Lane
ljb <[EMAIL PROTECTED]> writes: > I sent in a revised patch which removes the loss of Tcl8.0.x compatibility. When? I don't recall having seen any such patch. regards, tom lane ---(end of broadcast)--- TIP 3: if posting/rea

[GENERAL] System crash and trying to run vacuum getting errors

2003-11-05 Thread Dave Smith
After a abnormal system shutdown I am trying to run a vacuum full verbose ANALYZE and getting the following error. NOTICE: Analyzing classification NOTICE: RelationBuildDesc: can't open pg_temp_5821_0: No such file or directory NOTICE: --Relation pg_temp_5821_0-- ERROR: _mdfd_getrelnfd: canno

Re: [GENERAL] Help on update that subselects other records in table, uses joins

2003-11-05 Thread Michael Glaesemann
Manfred, Thanks for taking the time to walk me through this. You've pointed out things I've noticed when writing queries and wondered about. (More specific comments—and commentary—below. What I came up with was deleting and reinserting the relevant ordercharges rows This might have unwanted sid

Re: [GENERAL] System crash and trying to run vacuum getting errors

2003-11-05 Thread Dave Smith
Yup that's what happened. Dropped them and all is good. I really should get a list of all of the underling files for each index and table and see if any others are missing. On Wed, 2003-11-05 at 11:30, Tom Lane wrote: > Dave Smith <[EMAIL PROTECTED]> writes: > > After a abnormal system shutdown I

Re: [GENERAL] Using SUBSELECT in CHECK expressions

2003-11-05 Thread Michael Glaesemann
On Wednesday, November 5, 2003, at 06:26 AM, Tom Lane wrote: If you are satisfied with only a one-directional constraint (apply the check just when the constrained table is modified), you can have it today. Just put the SELECT into a function that's called by the CHECK expression. Tom, you've just

Re: [GENERAL] Using SUBSELECT in CHECK expressions

2003-11-05 Thread Tom Lane
Michael Glaesemann <[EMAIL PROTECTED]> writes: > On Wednesday, November 5, 2003, at 06:26 AM, Tom Lane wrote: >> Just put the SELECT into a function that's called by the CHECK >> expression. > Tom, you've just provided the solution to something I've been thinking > about a lot. I really have to s

[GENERAL] invalid command \

2003-11-05 Thread Jan Poslusny
Hallo, we runs PostgreSQL 7.3.4 on RedHat 9. I initialized dbcluster with --locale=cs_CZ.UTF-8 and created database with --encoding=unicode. But following script generates error: -- -*- coding: iso-8859-2 -*- set client_encoding to LATIN2; create table t (txt text); begin; --inserted character is

Re: [GENERAL] Using SUBSELECT in CHECK expressions

2003-11-05 Thread Michael Glaesemann
On Thursday, November 6, 2003, at 02:38 AM, Tom Lane wrote: Michael Glaesemann <[EMAIL PROTECTED]> writes: On Wednesday, November 5, 2003, at 06:26 AM, Tom Lane wrote: Just put the SELECT into a function that's called by the CHECK expression. Tom, you've just provided the solution to something I'

Re: [GENERAL] Using SUBSELECT in CHECK expressions

2003-11-05 Thread Michael Glaesemann
On Thursday, November 6, 2003, at 03:12 AM, Tom Lane wrote: Michael Glaesemann <[EMAIL PROTECTED]> writes: On Thursday, November 6, 2003, at 02:38 AM, Tom Lane wrote: IIRC we check that it is labeled IMMUTABLE. Thanks for the clarification. Is this in the documentation somewhere? [digs...] No, be

Re: [GENERAL] Using SUBSELECT in CHECK expressions

2003-11-05 Thread Tom Lane
Michael Glaesemann <[EMAIL PROTECTED]> writes: > On Thursday, November 6, 2003, at 02:38 AM, Tom Lane wrote: >> IIRC we check that it is labeled IMMUTABLE. > Thanks for the clarification. Is this in the documentation somewhere? [digs...] No, because my recollection is wrong: there's no such chec

Re: [GENERAL] System crash and trying to run vacuum getting errors

2003-11-05 Thread Tom Lane
Dave Smith <[EMAIL PROTECTED]> writes: > After a abnormal system shutdown I am trying to run a > vacuum full verbose ANALYZE and getting the following error. > NOTICE: Analyzing classification > NOTICE: RelationBuildDesc: can't open pg_temp_5821_0: No such file or > directory > NOTICE: --Relat

Re: [GENERAL] System crash and trying to run vacuum getting errors

2003-11-05 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > You should be able to DROP that table even though it doesn't have an > underlying file. My guess is that you are running atop a non-crash-safe > filesystem and it lost the directory entry for the just-created file. > You might want to think about switching

Re: [GENERAL] SET AUTOCOMMIT OFF

2003-11-05 Thread Tom Lane
Thierry Missimilly <[EMAIL PROTECTED]> writes: > I have got an error with PostgreSQL-7.4Beta4 : > ERROR SET AUTOCOMMIT TO OFF is no longer supported > I used these option to load huge Database as i can save time with it. Is > there an other option in PG 7.4 to do the same ? psql has a \set command

Re: [GENERAL] System crash and trying to run vacuum getting errors

2003-11-05 Thread Tom Lane
Dave Smith <[EMAIL PROTECTED]> writes: > Yup that's what happened. Dropped them and all is good. I really should > get a list of all of the underling files for each index and table and > see if any others are missing. If VACUUM ran to completion without complaints then there aren't any other miss

[GENERAL] Database Design & Application Server Design

2003-11-05 Thread Lane Beneke
All, New to the list and a relative newbie to PostgreSQL. Please forgive stupid questions. Designing an application server for a work order processing (et al) database. I have a good handle on sequences, referencial integrity, views, & the basics. What books/documentation would you recommend t

Re: [GENERAL] Multi-master asynchronous replication

2003-11-05 Thread Marc G. Fournier
On Wed, 5 Nov 2003, Chris M. Gamble wrote: > My company has just finished a simple replication system in java. We are > now interested in sharing our work under the GPL license so that we can > hopefully work with others in improving this product. > > Would such a thing be useful, or simply over

Re: [GENERAL] SET AUTOCOMMIT OFF

2003-11-05 Thread Kathy Zhu
Do you mean that, this doesn't work any more ?? from jdbc connextion.setAutoCommit(false) Tom Lane wrote: > Thierry Missimilly <[EMAIL PROTECTED]> writes: > > I have got an error with PostgreSQL-7.4Beta4 : > > ERROR SET AUTOCOMMIT TO OFF is no longer supported > > I used these option to load hu