[GENERAL] Foreign Key Non-Null Problem in 8.0

2004-10-31 Thread Jon Uhal
I'm having trouble trying to get my databases setup so that when I delete a row from the base table, all related information is removed as well. I've been testing this with PostgreSQL version (postmaster (PostgreSQL) 8.0.0beta1) on a Windows 2000 Pro machine. I have been unsuccessful in

Re: [GENERAL] Issue adding foreign key

2004-10-31 Thread Edmund Bacon
[EMAIL PROTECTED] (George Woodring) writes: I have 2 existing tables in my db: iss= \d pollgrpinfo Table public.pollgrpinfo Column | Type | Modifiers ---++--- pollgrpinfoid | integer| not

[GENERAL] View's rule on delete problem

2004-10-31 Thread Stanislaw Tristan
CREATE RULE new_rule2 AS ON DELETE TO public.klients_view DO INSTEAD ( DELETE FROM klients WHERE (klients.klient_id = old.klient_id); DELETE FROM klient_services WHERE (klient_services.klient_id = old.klient_id); ); It's 2 commands, but executing only first. Why? Stanislaw Tristan Kyiv,

Re: [GENERAL] Reasoning behind process instead of thread based

2004-10-31 Thread Marco Colombo
On Thu, 28 Oct 2004 [EMAIL PROTECTED] wrote: Marco, Wouldn't locking a process to a CPU cause the CPU to be idle during IO waits and semaphore locks? Even if you didn't lock each DB process to a CPU, IO waits and locks for one session would stop processing on other sessions managed by the same

Re: [GENERAL] Reasoning behind process instead of thread based

2004-10-31 Thread Marco Colombo
On Thu, 28 Oct 2004, Thomas Hallgren wrote: Marco Colombo wrote: [processes vs threads stuff deleted] In any modern and reasonable Unix-like OS, there's very little difference between the multi-process or the multi-thread model. _Default_ behaviour is different, e.g. memory is shared by default

[GENERAL] Replicating sequences

2004-10-31 Thread Ed L.
I asked this on the slony list, but maybe more appropriate to ask here... I'm using slony to replicate a database with 200 sequences. To replicate these with slony or our modified dbmirror, the replicator polls every sequence relation (select last_value...) on each syncronization interval.

Re: [GENERAL] Reasoning behind process instead of thread based

2004-10-31 Thread Thomas Hallgren
Marco, I mean an entirely event driven server. The trickiest part is to handle N-way. On 1-way, it's quite a clear and well-defined model. You need to clarify this a bit. You say that the scheduler is in user-space, yet there's only one thread per process and one process per CPU. You state that

[GENERAL] Interpolation of environment variables in SQL at runtime?

2004-10-31 Thread Andy Gimblett
Hi all, Question: is there any way to use environment variables (or something similar) in my saved SQL code, and have them expanded at runtime? I can't see a way to do this in the manuals, and a colleague tells me it can't be done, but I wanted to check, because if this _can_ be done it will

Re: [GENERAL] ms access app ?

2004-10-31 Thread Philippe Lang
Hello, Yes, you can do that, programmatically: Here is some DAO code for your Access project: Dim strTblName As String Dim strConn As String Dim db As DAO.DataBase Dim rs As DAO.Recordset Dim login As DAO.Recordset Dim tbl As DAO.TableDef Dim strDSN As String

Re: [GENERAL] Superuser log-in through a web interface?

2004-10-31 Thread Ken Tozier
On Oct 31, 2004, at 1:29 AM, Kevin Barnard wrote: You have a conceptual error. When connecting you are connecting to a database. With out the database you are not connecting to anything hence the failure. That explains it, thanks. Another pesky problem I've run into is that I can enter literally

Re: [GENERAL] Reasoning behind process instead of thread based

2004-10-31 Thread Martijn van Oosterhout
On Thu, Oct 28, 2004 at 04:32:34PM +0200, Marco Colombo wrote: On Thu, 28 Oct 2004 [EMAIL PROTECTED] wrote: Marco, Wouldn't locking a process to a CPU cause the CPU to be idle during IO waits and semaphore locks? Even if you didn't lock each DB process to a CPU, IO waits and locks for

Re: [GENERAL] Reasoning behind process instead of thread based

2004-10-31 Thread Thomas Hallgren
Martijn, I honestly don't think you could really do a much better job of scheduling than the kernel. The kernel has a much better idea of what processes are waiting on, and more importantly, what other work is happening on the same machine that also needs CPU time. I agree 100% with Martijn.

[GENERAL] procedural languages in 7.4.6

2004-10-31 Thread Rajesh Kumar Mallah
Hi, In 7.4.6 there is only plpgsql under pl where as 7.4.5 includes it in the main distribution can anyone tell from where plperl for 7.4.6 can be got? Regds mallah. -- regds Mallah. Rajesh Kumar Mallah +---+ | Tradeindia.com (3,11,246) Registered

Re: [GENERAL] procedural languages in 7.4.6

2004-10-31 Thread Michael Fuhr
On Sun, Oct 31, 2004 at 07:24:20PM +0530, Rajesh Kumar Mallah wrote: In 7.4.6 there is only plpgsql under pl where as 7.4.5 includes it in the main distribution can anyone tell from where plperl for 7.4.6 can be got? Are you installing PostgreSQL from source or from a prebuilt package?

Re: [GENERAL] Interpolation of environment variables in SQL at runtime?

2004-10-31 Thread Tom Lane
Andy Gimblett [EMAIL PROTECTED] writes: Question: is there any way to use environment variables (or something similar) in my saved SQL code, and have them expanded at runtime? Only by preprocessing the script. Have you considered something like cat EOF ... WHERE $foo = ... EOF | psql ...

Re: [GENERAL] procedural languages in 7.4.6

2004-10-31 Thread Tom Lane
Rajesh Kumar Mallah [EMAIL PROTECTED] writes: In 7.4.6 there is only plpgsql under pl where as 7.4.5 includes it in the main distribution When complaining about a packaging problem, it would help if you mentioned which package you are complaining about. regards, tom

Re: [GENERAL] Replicating sequences

2004-10-31 Thread Tom Lane
Ed L. [EMAIL PROTECTED] writes: Are triggers on sequences a reasonable feature request/hope for Pgsql? I don't think so. Since sequences are inherently not transactional, it seems wrong to fire a transactional behavior as a side effect of nextval(). What exactly are you expecting the trigger

Re: [GENERAL] View's rule on delete problem

2004-10-31 Thread Tom Lane
Stanislaw Tristan [EMAIL PROTECTED] writes: It's 2 commands, but executing only first. Why? You didn't show us the view, but I suppose it's an inner join of the two tables? As soon as you delete the row from the first table, there's no longer any matching row in the view, so the second command

Re: [GENERAL] View's rule on delete problem

2004-10-31 Thread Michael Fuhr
On Thu, Oct 28, 2004 at 04:32:21AM +0300, Stanislaw Tristan wrote: CREATE RULE new_rule2 AS ON DELETE TO public.klients_view DO INSTEAD ( DELETE FROM klients WHERE (klients.klient_id = old.klient_id); DELETE FROM klient_services WHERE (klient_services.klient_id = old.klient_id); );

Re: [GENERAL] procedural languages in 7.4.6

2004-10-31 Thread Joshua D. Drake
Are you installing PostgreSQL from source or from a prebuilt package? Plperl is in the 7.4.6 source code. If you're downloading the split-up tarballs, then it's in postgresql-opt, just as it was in 7.4.5. You can also get plPerlNG for 7.4.6 here: http://plperlng.commandprompt.com/ Sincerely,

Re: [GENERAL] Replicating sequences

2004-10-31 Thread Ed L.
On Sunday October 31 2004 8:25, Tom Lane wrote: Ed L. [EMAIL PROTECTED] writes: Are triggers on sequences a reasonable feature request/hope for Pgsql? I don't think so. Since sequences are inherently not transactional, it seems wrong to fire a transactional behavior as a side effect of

[GENERAL] Daylight Savings Time handling on persistent connections

2004-10-31 Thread Randall Nortman
I assume I'm not the first person to have encountered this, but I couldn't find anything in the FAQ or on the mailing lists recently. My apologies if this is already documented somewhere... My application logs data to a Postgres table continuously (once every 15 seconds), maintaining a persistent

Re: [GENERAL] Daylight Savings Time handling on persistent connections

2004-10-31 Thread Tom Lane
Randall Nortman [EMAIL PROTECTED] writes: My suspicion is that Postgres calculates the local offset from UTC only once per session, during session initialization. This is demonstrably not so. We might be able to figure out what actually went wrong, if you would show us the exact commands your

Re: [GENERAL] Daylight Savings Time handling on persistent connections

2004-10-31 Thread Randall Nortman
On Sun, Oct 31, 2004 at 11:52:03AM -0500, Tom Lane wrote: Randall Nortman [EMAIL PROTECTED] writes: My suspicion is that Postgres calculates the local offset from UTC only once per session, during session initialization. This is demonstrably not so. We might be able to figure out what

Re: [GENERAL] Daylight Savings Time handling on persistent connections

2004-10-31 Thread Tom Lane
Randall Nortman [EMAIL PROTECTED] writes: I can't reproduce the error without messing up my clock, but from my logs, here's the text of the SQL sent to the server: insert into sensor_readings_numeric (sensor_id, reading_ts, reading, min, max) values (3, '2004-10-31 01:00:00', 0.540602,

Re: [GENERAL] Superuser log-in through a web interface?

2004-10-31 Thread Vinko Vrsalovic
On Sun, Oct 31, 2004 at 05:24:34AM -0500, Ken Tozier wrote: On Oct 31, 2004, at 1:29 AM, Kevin Barnard wrote: You have a conceptual error. When connecting you are connecting to a database. With out the database you are not connecting to anything hence the failure. That explains it,

Re: [GENERAL] Daylight Savings Time handling on persistent connections

2004-10-31 Thread Randall Nortman
On Sun, Oct 31, 2004 at 12:47:31PM -0500, Tom Lane wrote: Randall Nortman [EMAIL PROTECTED] writes: I can't reproduce the error without messing up my clock, but from my logs, here's the text of the SQL sent to the server: insert into sensor_readings_numeric (sensor_id, reading_ts,

Re: [GENERAL] Daylight Savings Time handling on persistent connections

2004-10-31 Thread Tom Lane
Randall Nortman [EMAIL PROTECTED] writes: Ah, I see now. PostgreSQL is behaving a bit differently than I expected. The timestamp string above is ambiguous in the timezone US/Eastern -- it could be EST or EDT. I was expecting PostgreSQL to resolve this ambiguity based on the current time

Re: [GENERAL] Superuser log-in through a web interface?

2004-10-31 Thread Ken Tozier
On Oct 31, 2004, at 12:40 PM, Vinko Vrsalovic wrote: snip This is probably because pg_hba.conf settings. By default, it trusts connections from localhost, which means that any connection being made from localhost (which is the case when the web server and database are running in the same machine)

Re: [GENERAL] Daylight Savings Time handling on persistent connections

2004-10-31 Thread Randall Nortman
On Sun, Oct 31, 2004 at 02:44:51PM -0500, Tom Lane wrote: Randall Nortman [EMAIL PROTECTED] writes: Ah, I see now. PostgreSQL is behaving a bit differently than I expected. The timestamp string above is ambiguous in the timezone US/Eastern -- it could be EST or EDT. I was expecting

Re: [GENERAL] procedural languages in 7.4.6

2004-10-31 Thread mallah
Very sorry had downloaded the -base package by mistake. Regds mallah. Rajesh Kumar Mallah [EMAIL PROTECTED] writes: In 7.4.6 there is only plpgsql under pl where as 7.4.5 includes it in the main distribution When complaining about a packaging problem, it would help if you mentioned

Re: [GENERAL] Daylight Savings Time handling on persistent connections

2004-10-31 Thread Tom Lane
Randall Nortman [EMAIL PROTECTED] writes: On Sun, Oct 31, 2004 at 02:44:51PM -0500, Tom Lane wrote: Actually, the intended and documented behavior is that it should interpret an ambiguous time as local standard time (e.g., EST not EDT). I'm finding it hard to see how either way is likely to

Re: [GENERAL] Interpolation of environment variables in SQL at runtime?

2004-10-31 Thread Joe Conway
Andy Gimblett wrote: Hopefully what I'm asking is fairly obvious. But is it possible? I can imagine some fairly unwiedly ways to do this involving preprocessing, but would involve jumping through lots of hoops, and I'd hope for a cleaner solution. Environment variables seems the obvious Unixy

[GENERAL] Suggested Triggers Functions Naming Convention?

2004-10-31 Thread Bruno Lavoie
Hello, i'm etablishing a naming convention for a new project under postgresql. For tables, sequences, views, that's ok! I used good naming conventions for this in the past and i'll keep these rules for the new project. but, i plan to use a lot of triggers and functions in this project, but I'm

Re: [GENERAL] Daylight Savings Time handling on persistent connections

2004-10-31 Thread Martijn van Oosterhout
On Sun, Oct 31, 2004 at 04:14:52PM -0500, Tom Lane wrote: That line of argument leads directly to the conclusion that we shouldn't allow timezone-less input strings at all, since it's unlikely that anyone would code their app to append a timezone spec only during the two hours a year when it

Re: [GENERAL] Daylight Savings Time handling on persistent connections

2004-10-31 Thread Tom Lane
Martijn van Oosterhout [EMAIL PROTECTED] writes: On Sun, Oct 31, 2004 at 04:14:52PM -0500, Tom Lane wrote: That line of argument leads directly to the conclusion that we shouldn't allow timezone-less input strings at all, since it's unlikely that anyone would code their app to append a

Re: [GENERAL] Reasoning behind process instead of thread based

2004-10-31 Thread Thomas Hallgren
Marco, You ask what an event is? An event can be: - input from a connection (usually a new query); - notification that I/O needed by a pending query has completed; - if we don't want a single query starve the server, an alarm of kind (I think this is a corner case, but still possible;) -

[GENERAL] PostgreSQL on Windows

2004-10-31 Thread Michael Shtelma
Hi! Can I use postgresql on windows without cygwin? ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

[GENERAL] export-import problem

2004-10-31 Thread GreyGeek
I export data from a table that contains a varchar field that stores whole names in it. Some of the names include the apostrophe character O'Neal, etc... When I attempt to import the data (using the copy command the apostrophe kills the import. If I export the data with quotes around the

Re: [GENERAL] adding missing FROM-clause

2004-10-31 Thread Edmund Bacon
[EMAIL PROTECTED] (C G) writes: Dear All, I have a simple join query SELECT c1 FROM t1 INNER JOIN t2 ON t2.c2 = t1.c2 WHERE t3.c3= t2.c3; Which gives the expected result but I get the message NOTICE: adding missing FROM-clause entry for table t3 How do I get rid of this NOTICE,

[GENERAL] logging queries and time used

2004-10-31 Thread stig erikson
Hi. i would like to log every single query coming in to the database into a table. i would like the log to include the entire query and execution time and execution cost, and if possible the user that executed the query. A trigger is what i was thinking of, but how can i find out the actual

[GENERAL] PQSQL - binary data question

2004-10-31 Thread Bastian Voigt
Hallo List! I just found this old posting on google. Now my question is how can I read an integer value from the PGresult using the binary format? Can someone plz gimme a code example? (please mail to me, because I have not subscribed to the list) Thanks a bunch! Now here's the old posting:

Re: [GENERAL] PostgreSQL on Windows

2004-10-31 Thread GreyGeek
Michael Shtelma wrote: Hi! Can I use postgresql on windows without cygwin? YES! Look for the PostgreSQL 8 beta version on their website. It works great! Don't forget to download pgadminIII for windows too! -- GreyGeek ---(end of broadcast)---

Re: [GENERAL] PostgreSQL on Windows

2004-10-31 Thread Bruce Momjian
Michael Shtelma wrote: Hi! Can I use postgresql on windows without cygwin? You can test the 8.0 beta using pginstaller. Just google for pginstaller. You should subscribe to hackers to discuss any problems you have. -- Bruce Momjian| http://candle.pha.pa.us

Re: [GENERAL] Upgrading from beta3 to beta4

2004-10-31 Thread Claudio Duffini
I had the same issue jumping from 8b2 to 8b4. The readme stated infact that dump and restore should occur only if one does not have an 8.0.x release. Jerry LeVan [EMAIL PROTECTED] ha scritto nel messaggio news:[EMAIL PROTECTED] I did not notice in the Install instructions that a dump

[GENERAL] Max length name of a database/schema

2004-10-31 Thread Fred BROUARD - SQLpro
Did you know what is the maximum character length for a name of : a database or schema ? a table or a view ? a column ? a constraint ? an index ? thanks -- Frédéric BROUARD, MVP SQL Server. Expert SQL / spécialiste Delphi, web Livre SQL - col. Référence :

[GENERAL] oracle synchronization strategy

2004-10-31 Thread Randall Smith
I am going to sync a schema in postgres with one in an oracle db. The tables are simple, but there are 200 of them. I would like to try to keep the sync lag 1 minute. Here is my idea. Please critique/suggest. 1. Set up stored proc on oracle that records a INSERT, UPDATE, DELETE SQL action

Re: [GENERAL] export-import problem

2004-10-31 Thread Oliver Elphick
On Thu, 2004-10-28 at 19:39 -0500, GreyGeek wrote: I export data from a table that contains a varchar field that stores whole names in it. Some of the names include the apostrophe character O'Neal, etc... When I attempt to import the data (using the copy command the apostrophe kills

Re: [GENERAL] PQSQL - binary data question

2004-10-31 Thread David Helgason
On 29. okt 2004, at 14:09, Bastian Voigt wrote: I just found this old posting on google. Now my question is how can I read an integer value from the PGresult using the binary format? Can someone plz gimme a code example? (please mail to me, because I have not subscribed to the list) Easy peasy:

[GENERAL] Functions not dropped.

2004-10-31 Thread Glen Eustace
I was a little surprised today when I tried to move a production database on to my test server. The test server already had a copy of the database so I did psql -Uadmin template1 drop database admin; create database admin; When I tried to reload the production database dump, I got a series of