Re: [GENERAL] 8.0 questions

2004-10-08 Thread Thomas Madsen
Hi! A quite impressive list of changes in version 8.0.0. ... But the question from me is: When is it done? We have a lot of 7.2.5 versions running which badly needs an update, but if version 8.0.0 comes in the near future, we could surely hold out a while longer and go for the top of the line.

Re: [GENERAL] Question about timezones

2004-10-08 Thread Martijn van Oosterhout
On Thu, Oct 07, 2004 at 01:43:49PM -0700, Steven Klassen wrote: > * Martijn van Oosterhout <[EMAIL PROTECTED]> [2004-10-07 22:22:24 +0200]: > > > Is there any way I can use these from within postgresql? Those files > > contains details about daylight saving changes and other useful > > details lik

[GENERAL] query gone haywire :)

2004-10-08 Thread Robin Ericsson
The query have been running ok for some time now, but this morning I decided to run vacuum analyze (vacuumdb -a -z) on the cluster, and suddenly the query isn't running very well at all. This query has only one value in the "IN", if I add another id the query becomes really really slow. Query: SEL

[GENERAL] interesting! a sequence clashes with data already in that table

2004-10-08 Thread Miles Keaton
Here's an interesting problem! When a sequence clashes with data already in that table: CREATE TABLE clients ( id serial NOT NULL PRIMARY KEY UNIQUE, name varchar(64)); -- import OLD clients, with their original ID#... INSERT INTO clients VALUES (3, 'Dave'); INSERT INTO clients VALUES (4, 'Sally

Re: [GENERAL] 8.0 questions

2004-10-08 Thread David Garamond
Thomas Madsen wrote: A quite impressive list of changes in version 8.0.0. ... But the question from me is: When is it done? Two words: Nobody knows. Beta cycle is usually at least 2-3 months. First beta is in Aug. So a release is probably Nov at the earliest. We have a lot of 7.2.5 versions runn

Re: [GENERAL] when to use NULL and when to NOT NULL DEFAULT ''

2004-10-08 Thread Peter Eisentraut
Am Freitag, 8. Oktober 2004 07:22 schrieb Miles Keaton: > What's the prevailing wisdom & best-practice advice about when to let > a varchar (or any) column be NULL, and when to make it NOT NULL > DEFAULT '' (or '-00-00' or whatever) - in PostgreSQL? Briefly, you always do the first and never d

Re: [GENERAL] when to use NULL and when to NOT NULL DEFAULT ''

2004-10-08 Thread Terry Lee Tucker
Why would you never define a column as NOT NULL, or am I misunderstanding what you are saying? On Friday 08 October 2004 06:07 am, Peter Eisentraut saith: > > Briefly, you always do the first and never do the second. > > -- > Peter Eisentraut > http://developer.postgresql.org/~petere/ > > ---

[GENERAL] text + text

2004-10-08 Thread David Garamond
What is "text + text" supposed to do right now? It doesn't seem very useful to me. What about making "text + text" as an equivalent for "text || text"? Most strongly-typed programming languages do this. And MS SQL Server too, I think (CMIIW). -- dave ---(end of broadcast

Re: [GENERAL] when to use NULL and when to NOT NULL DEFAULT ''

2004-10-08 Thread David Garamond
Btw, MySQL manual used to recommend (or still does?) defining all columns as NOT NULL as much as possible, "because NULL is slow"... :-) For me it's pretty obvious, if you are never going to allow the column to have an "unknown value", then define it NOT NULL to let the database guarantee that.

Re: [GENERAL] when to use NULL and when to NOT NULL DEFAULT ''

2004-10-08 Thread David Garamond
Peter Eisentraut wrote: Am Freitag, 8. Oktober 2004 07:22 schrieb Miles Keaton: What's the prevailing wisdom & best-practice advice about when to let a varchar (or any) column be NULL, and when to make it NOT NULL DEFAULT '' (or '-00-00' or whatever) - in PostgreSQL? Briefly, you always do the

Re: [GENERAL] when to use NULL and when to NOT NULL DEFAULT ''

2004-10-08 Thread Terry Lee Tucker
Understood. We use NOT NULL as you have stated below. I just wanted to make sure we weren't doing something stupid. Thanks for the reply... On Friday 08 October 2004 07:09 am, David Garamond saith: > Btw, MySQL manual used to recommend (or still does?) defining all > columns as NOT NULL as much a

Re: [GENERAL] 8.0 questions

2004-10-08 Thread Gaetano Mendola
David Garamond wrote: Thomas Madsen wrote: A quite impressive list of changes in version 8.0.0. ... But the question from me is: When is it done? Two words: Nobody knows. Beta cycle is usually at least 2-3 months. First beta is in Aug. So a release is probably Nov at the earliest. We have a lot

Re: [GENERAL] Activestate Perl and DBD-Pg?

2004-10-08 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > Anyone using Activestate Perl and DBD-Pg? > I am using perl 5.8.3 ppm does not seem to work. I downloaded the DBD-Pg > .zip file I found through google but ppm could not seem to install that. > Any suggestions? There has been little Win support

Re: [GENERAL] when to use NULL and when to NOT NULL DEFAULT ''

2004-10-08 Thread Michael Glaesemann
On Oct 8, 2004, at 8:12 PM, David Garamond wrote: Speaking of NULLs, what does the relational model ideal suggest for missing information? a) no NULL at all; b) NULL and N/A; I've read both of those as well. Date has a pretty good section regarding NULLs in his Introduction to Database Systems.

Re: [GENERAL] European dates with Win32 version

2004-10-08 Thread Raymond O'Donnell
On 7 Oct 2004 at 14:48, Bruce Momjian wrote: > OK, we just tested this on Win32 and it now works fine. Seems we must > have fixed it somehow between your report and now. Good on ye! Someone else also pointed out to me the following in postgresql.conf - datestyle = 'iso, dmy' - which I ha

Re: [GENERAL] when to use NULL and when to NOT NULL DEFAULT ''

2004-10-08 Thread Peter Eisentraut
Am Freitag, 8. Oktober 2004 12:20 schrieb Terry Lee Tucker: > Why would you never define a column as NOT NULL, or am I misunderstanding > what you are saying? His question was, should one use null values or should one use artificially reserved real data values to indicate missing values, as MySQL

Re: [GENERAL] text + text

2004-10-08 Thread Peter Eisentraut
Am Freitag, 8. Oktober 2004 12:57 schrieb David Garamond: > What is "text + text" supposed to do right now? Nothing. > What about making "text + text" as an equivalent for "text > || text"? Most strongly-typed programming languages do this. And MS SQL > Server too, I think (CMIIW). What would t

Re: [GENERAL] text + text

2004-10-08 Thread David Garamond
Peter Eisentraut wrote: What is "text + text" supposed to do right now? Nothing. Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly, the current behaviour is quite strange to me. -- =# select coalesce('1'+'0','NULL'); a =# select coalesce('1'+'1','NULL'); b =

Re: [GENERAL] interesting! a sequence clashes with data already in that table

2004-10-08 Thread Bruno Wolff III
On Fri, Oct 08, 2004 at 03:00:07 -0700, Miles Keaton <[EMAIL PROTECTED]> wrote: > I thought Postgres would be smart enough to make the clients_id_seq > skip existing numbers, but I guess not! It wouldn't be very efficient to do that. > Do I, instead, have to be smart enough to set the sequence

Re: [GENERAL] when to use NULL and when to NOT NULL DEFAULT ''

2004-10-08 Thread David Garamond
Michael Glaesemann wrote: For employees you don't have birthdates for, you could use NULL in SQL. However, as relationally one shouldn't use NULL, you would do the following: CREATE TABLE employees ( emp_id SERIAL NOT NULL UNIQUE , emp_name TEXT NOT NULL ); CREATE TABLE employees_birthda

Re: [GENERAL] text + text

2004-10-08 Thread Stephan Szabo
On Fri, 8 Oct 2004, David Garamond wrote: > Peter Eisentraut wrote: > >>What is "text + text" supposed to do right now? > > > > Nothing. > > Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly, > the current behaviour is quite strange to me. > > -- > =# select co

Re: [GENERAL] when to use NULL and when to NOT NULL DEFAULT ''

2004-10-08 Thread Michael Glaesemann
On Oct 8, 2004, at 10:19 PM, David Garamond wrote: Michael Glaesemann wrote: In any case, one would never use NULL. Either the domain includes a value for all possible values (including N/A) or you set up the db schema appropriately. Hm, that can be painful. What if I have ten optional attributes

Re: [GENERAL] Question about timezones

2004-10-08 Thread Tom Lane
Martijn van Oosterhout <[EMAIL PROTECTED]> writes: > But it doesn't seem to work to actually work out times across the > world w.r.t. daylight savings. > ... > For example, this script works out, given a time in one timezone, what > it was in another timezone: What we need for that is the ability

[GENERAL] pg_restore -l and schema name

2004-10-08 Thread Phil Endecott
Dear Postgresql people, For the first time I'm trying to use pg_restore to do a partial restore. It looks as if it should be easy: pg_restore -l, filter out the required tables, then pg_restore -L. But unfortunately the listing generated by pg_resotre doesn't include the schema name! Since m

Re: [GENERAL] query gone haywire :)

2004-10-08 Thread Tom Lane
Robin Ericsson <[EMAIL PROTECTED]> writes: > The query have been running ok for some time now, but this morning I > decided to run vacuum analyze (vacuumdb -a -z) on the cluster, and > suddenly the query isn't running very well at all. > -> Index Scan using idx_d_entered on data (cost=0

Re: [GENERAL] when to use NULL and when to NOT NULL DEFAULT ''

2004-10-08 Thread David Garamond
Michael Glaesemann wrote: In any case, one would never use NULL. Either the domain includes a value for all possible values (including N/A) or you set up the db schema appropriately. Hm, that can be painful. What if I have ten optional attributes; separate them to ten different tables? Strictly?

Re: [GENERAL] text + text

2004-10-08 Thread Tom Lane
David Garamond <[EMAIL PROTECTED]> writes: > Peter Eisentraut wrote: >>> What is "text + text" supposed to do right now? >> >> Nothing. > Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly, > the current behaviour is quite strange to me. CVS tip gives regression=# select co

Re: [GENERAL] when to use NULL and when to NOT NULL DEFAULT ''

2004-10-08 Thread Michael Glaesemann
On Oct 8, 2004, at 11:11 PM, David Garamond wrote: The relationists' SQL replacement had better have more convenient JOIN syntax then. :-) Personally I find the JOIN ... USING syntax quite convenient. More robust domain support is another side to this issue. Cheers, Michael Glaesemann grzm myrea

Re: [GENERAL] pg_restore -l and schema name

2004-10-08 Thread Tom Lane
Phil Endecott <[EMAIL PROTECTED]> writes: > So this message is really a feature request for "please include the > schema name in the pg_restore -l output". Seems reasonable. I've applied the attached patch to 8.0; you can probably apply it locally without much trouble (the change is in PrintTOCS

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Steven Klassen
* Samik Raychaudhuri <[EMAIL PROTECTED]> [2004-10-07 21:12:31 -0500]: > I am trying to run a perl CGI program for accessing a database. The > program runs fine from command prompt, producing expected > output. But it gives errors while running as CGI. Has this ever worked? > $dbh=DBI->connect("d

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Michael Fuhr
On Fri, Oct 08, 2004 at 08:17:07AM -0700, Steven Klassen wrote: > * Samik Raychaudhuri <[EMAIL PROTECTED]> [2004-10-07 21:12:31 -0500]: > > > $dbh=DBI->connect("dbi:Pg:dbname='samik';host='abc.org';port=5432","samik",""); > > It seems that machine can't resolve abc.org (although I can). The >

Re: [GENERAL] 8.0 questions

2004-10-08 Thread Greg Stark
David Garamond <[EMAIL PROTECTED]> writes: > > We have a lot of 7.2.5 versions running which badly needs an update, but > > if version 8.0.0 comes in the near future, we could surely hold out a > > while longer and go for the top of the line. > > Unless you need a specific feature of 8.0 (savepo

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Samik Raychaudhuri
Hello, Thanks very much for the replies. Please find follow-ups inline. On 10/8/2004 11:05 AM, Michael Fuhr wrote: On Fri, Oct 08, 2004 at 08:17:07AM -0700, Steven Klassen wrote: * Samik Raychaudhuri <[EMAIL PROTECTED]> [2004-10-07 21:12:31 -0500]: $dbh=DBI->connect("dbi:Pg:dbname='samik';h

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Samik Raychaudhuri
On 10/8/2004 10:17 AM, Steven Klassen wrote: $dbh=DBI->connect("dbi:Pg:dbname='samik';host='abc.org';port=5432","samik",""); It seems that machine can't resolve abc.org (although I can). The format of your connect string is a little unorthodox, but it seems to work in general. Thanks very

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Steven Klassen
* Samik Raychaudhuri <[EMAIL PROTECTED]> [2004-10-08 11:37:49 -0500]: > Thanks very much for your reply. Why do you say that the connect > string is a little unorthodox? I just followed the standard DBI > documentation. Just not used to seeing the semi-colons in the DSN. Usually the dbname, host,

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Samik Raychaudhuri
Hello, Yes I am trying to run this under Cygwin. My apache server is running locally, but the postgresql server is running remote at freesql.org. I tried to search for the thread in postgresql-cygwin, but couldn't find it. The only thread I came up with is this one: http://archives.postgresql.or

Re: [GENERAL] About PostgreSQL's limit on arithmetic operations

2004-10-08 Thread Guy Fraser
Signed integers use a number system known as "two's compliment" and in order to make room for negative numbers the most significant bit is used to indicate a negative value and the compliment of the rest of the bits minus 1 {there is no such number as -0} evaluate to the negative numbers. This m

[GENERAL] Explain output question

2004-10-08 Thread Patrick Hatcher
I have the following SQL with explain Should I be concerned with the merge cond: Merge Cond: (("outer".masked_acct_id)::text = "inner"."?column5?")?  I have no idea what column5 is or the same token the column6 shown later. explain select fed.indiv_fkey, SUM(agg.purch_dollars) as val_purch_store,

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Samik Raychaudhuri
I solved the problem, getting hints from Maarten. This is for posterity. I looked at this thread: http://www.cygwin.com/ml/cygwin/2004-09/msg01159.html This thread (as well as Maarten) suggests to set/pass SYSTEMROOT environment variable in Apache. I didn't know how to do that, googling helped.

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Samik Raychaudhuri
I still couldn't configure apache not to remove the variable from the environ. Can you please let me know how to do that? Regards. -Samik On 10/8/2004 1:34 AM, Maarten Boekhold wrote: Are you trying to run this under cygwin? If so, there's a very recent thread on the cygwin mailing list about thi

Re: [GENERAL] Explain output question

2004-10-08 Thread Tom Lane
Patrick Hatcher <[EMAIL PROTECTED]> writes: > Should I be concerned with the merge cond: Merge Cond: > (("outer".masked_acct_id)::text = "inner"."?column5?")? I have no idea > what column5 is or the same token the column6 shown later. You should be able to figure that out by correlating the pla

Re: [GENERAL] Explain output question

2004-10-08 Thread Patrick Hatcher
thank you.  I thought it was correct but just wanted to make sure. Patrick Hatcher Macys.Com Tom Lane <[EMAIL PROTECTED]> 10/08/04 11:34 AM To Patrick Hatcher <[EMAIL PROTECTED]> cc [EMAIL PROTECTED] Subject Re: [GENERAL] Explain output question Patrick Hatcher <[EMAIL PRO

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Michael Fuhr
On Fri, Oct 08, 2004 at 11:35:34AM -0500, Samik Raychaudhuri wrote: > On 10/8/2004 11:05 AM, Michael Fuhr wrote: > > > >failed: could not create socket: Operation not permitted > > > >I wonder of packet filters are preventing the PostgreSQL connection > >from working, and possibly causing DNS probl

Re: [GENERAL] CGI program cannot access database

2004-10-08 Thread Dominic Mitchell
On Fri, Oct 08, 2004 at 10:09:13AM -0700, Steven Klassen wrote: > * Samik Raychaudhuri <[EMAIL PROTECTED]> [2004-10-08 11:37:49 -0500]: > > > Thanks very much for your reply. Why do you say that the connect > > string is a little unorthodox? I just followed the standard DBI > > documentation. > >

[GENERAL] foreign key constraints, cannot delete

2004-10-08 Thread Josh Close
How can a delete rows from a table that has foreign key constraints? Here is how I have it set up. I have 2 tables, tableA has fields and id's and tableB has fields that reference tableA's id's. I'm not able to do this BEGIN TRANSACTION; DELETE FROM tableB WHERE tableAid = 5; DELETE FROM tableA

Re: [GENERAL] foreign key constraints, cannot delete

2004-10-08 Thread Martijn van Oosterhout
You havn't posted the exact error message. You'll have to if you want people to properly explain what's going on... On Fri, Oct 08, 2004 at 04:07:43PM -0500, Josh Close wrote: > How can a delete rows from a table that has foreign key constraints? > Here is how I have it set up. > > I have 2 table

Re: [GENERAL] foreign key constraints, cannot delete

2004-10-08 Thread Josh Close
On Fri, 8 Oct 2004 23:15:24 +0200, Martijn van Oosterhout <[EMAIL PROTECTED]> wrote: > You havn't posted the exact error message. You'll have to if you want > people to properly explain what's going on... update or delete on "tblheadings" violates foreign key constraint "$1" on "tblheadings" DETAI

Re: [GENERAL] foreign key constraints, cannot delete

2004-10-08 Thread Michael Fuhr
On Fri, Oct 08, 2004 at 04:21:01PM -0500, Josh Close wrote: > On Fri, 8 Oct 2004 23:15:24 +0200, Martijn van Oosterhout > <[EMAIL PROTECTED]> wrote: > > You havn't posted the exact error message. You'll have to if you want > > people to properly explain what's going on... > > update or delete on "

Re: [GENERAL] foreign key constraints, cannot delete [SOLVED]

2004-10-08 Thread Josh Close
On Fri, 8 Oct 2004 18:14:50 -0600, Michael Fuhr <[EMAIL PROTECTED]> wrote: > This looks like tblheadings has a foreign key reference to itself. > Is this the *exact* error message, cut-and-pasted? What do your > table definitions look like? > > -- > Michael Fuhr There isn't a foreign key referen

Re: [GENERAL] Rollback on Error

2004-10-08 Thread Bruce Momjian
I assume this is to be saved for 8.1. This has been saved for the 8.1 release: http:/momjian.postgresql.org/cgi-bin/pgpatches2 --- Michael Paesold wrote: > Tom Lane wrote: > > > "Michael Paesold" <[EMAIL PROTECTED

Re: [GENERAL] Rollback on Error

2004-10-08 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > I assume this is to be saved for 8.1. > This has been saved for the 8.1 release: > http:/momjian.postgresql.org/cgi-bin/pgpatches2 It is not remotely ready to apply yet, so please do not put it in the queue. regards, tom l

Re: [GENERAL] Rollback on Error

2004-10-08 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > I assume this is to be saved for 8.1. > > > This has been saved for the 8.1 release: > > http:/momjian.postgresql.org/cgi-bin/pgpatches2 > > It is not remotely ready to apply yet, so please do not put it in the > queue. That que

Re: [GENERAL] Rollback on Error

2004-10-08 Thread Michael Paesold
Bruce Momjian <[EMAIL PROTECTED]> wrote: Bruce Momjian <[EMAIL PROTECTED]> writes: > I assume this is to be saved for 8.1. I assumed that to, so I did not want to disturb any more now. > This has been saved for the 8.1 release: > http:/momjian.postgresql.org/cgi-bin/pgpatches2 Tom Lane wrote: It i

Re: [HACKERS] [GENERAL] Rollback on Error

2004-10-08 Thread Alvaro Herrera Munoz
On Fri, Oct 08, 2004 at 08:40:56PM +0200, Michael Paesold wrote: > I hope you will be willing to comment on the issues when times come. I am > not really satisfied myself, but without further discussion I did not want > to continue to work on it. Anyway, I understand this is not the right time