Re: [GENERAL] about the RULE system

2006-12-14 Thread Rafal Pietrak
Looks like this thread have died away. But since this permission check looks like a security issue to me too, I'd really apreciate someones explanation on why it is not ... if it is not. But if it is a security leak I'd like to pass it over as bug report - so it does not disapear from sight. -R

Re: [GENERAL] A few SQL questions

2006-12-14 Thread Peter Koczan
Perfect. Exactly what I needed. Thank you very much Richard. Peter Richard Broersma Jr wrote: 1. In sybase, each column can have the same rule applied to it. You don't have to create multiple rules for columns in different tables. For instance, let's suppose that we require 5 digit numeric ids,

Re: [GENERAL] updating a view

2006-12-14 Thread Tom Lane
[EMAIL PROTECTED] writes: > so maybe i'm using the word crash too liberally. this is the error > message i get: > server closed the connection unexpectedly Looks like a crash to me. > version is 8.2.0, just downloaded a few days ago. There's a known bug in 8.2.0 having to do with failing out o

Re: [GENERAL] updating a view

2006-12-14 Thread m . c . wilkins
hi tom, so maybe i'm using the word crash too liberally. this is the error message i get: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting rese

Re: [GENERAL] updating a view

2006-12-14 Thread Tom Lane
[EMAIL PROTECTED] writes: > i would like to allow updates to a view, but pgsql crashes, > presummably from an infinite loop. If it crashes, that's a bug, regardless of whether the code is doing what you want. However, if the thing is indeed into an infinite recursion, you might be running out of

[GENERAL] updating a view

2006-12-14 Thread m . c . wilkins
hi, i would like to allow updates to a view, but pgsql crashes, presummably from an infinite loop. i add a rule like so: CREATE RULE update_myview AS ON UPDATE TO myview DO INSTEAD SELECT updater(OLD, NEW); where updater is a plperl function. the function updater does a few comparisons of

Re: [GENERAL] a question for the way-back machine

2006-12-14 Thread Ben
OK, thanks. On Thu, 14 Dec 2006, Martijn van Oosterhout wrote: On Thu, Dec 14, 2006 at 09:35:47AM -0800, Ben wrote: Interesting. Is that plan cached for the life of the session doing the inserts, the life of the trigger, or until the database is restarted? Duration of a session, there is no

Re: [GENERAL] Temp file space (Re: creating an index with tablespace on a dedicated filesystem)

2006-12-14 Thread Tom Lane
Vlad <[EMAIL PROTECTED]> writes: > which means that earlier suggestion you've made - to host temp dir on > a separate hd linked to temp dir under data tree it's not quite a > straight solution I assume that link will be erased by postgres > every time it finishes operating with temp directory.

Re: [GENERAL] A few SQL questions

2006-12-14 Thread Richard Broersma Jr
> 1. In sybase, each column can have the same rule applied to it. You don't > have to create multiple rules for columns in different tables. For instance, > let's suppose that we require 5 digit numeric ids, using only a char(5) > type, but there's a constraint on that column that says it must adhe

[GENERAL] A few SQL questions

2006-12-14 Thread Peter Koczan
Hi all, I have a few slightly more advanced SQL questions (which is why I'm here in the first place I suppose). I'm looking to migrate some applications and databases from Sybase to Postgres, and I have a few portability-type questions, or rather, questions on how to do the equivalent in Postgres.

Re: [GENERAL] Temp file space (Re: creating an index with tablespace

2006-12-14 Thread Glen Parker
Vlad wrote: which means that earlier suggestion you've made - to host temp dir on a separate hd linked to temp dir under data tree it's not quite a straight solution I assume that link will be erased by postgres every time it finishes operating with temp directory. Why would the postmaster

Re: [GENERAL] PITR / what directories/files can be ignored?

2006-12-14 Thread Tom Lane
Glen Parker <[EMAIL PROTECTED]> writes: > I am continuing to refine my PITR backup script, and there are some > directories I do not know what to do with. First off, here are the > directories/files I am currently ignoring... > pg_xlog (ours is a symlink, so I ignore it altogether) > pg_log/*

Re: [GENERAL] could not write to log -> PANIC -> System down

2006-12-14 Thread Tom Lane
Martijn van Oosterhout writes: > On Thu, Dec 14, 2006 at 05:13:30PM -0500, Brandon Aiken wrote: >> No idea on the frequent autovacuuming. Do you do a lot of deletes? > In those messages "processing" just means it woke up to see if there > was anything to do. It probably didn't do anything. Wakin

Re: [GENERAL] Temp file space (Re: creating an index with tablespace on a dedicated filesystem)

2006-12-14 Thread Vlad
Tom, which means that earlier suggestion you've made - to host temp dir on a separate hd linked to temp dir under data tree it's not quite a straight solution I assume that link will be erased by postgres every time it finishes operating with temp directory. Yup, they're only temp files (i

Re: [GENERAL] could not write to log -> PANIC -> System down

2006-12-14 Thread Martijn van Oosterhout
On Thu, Dec 14, 2006 at 05:13:30PM -0500, Brandon Aiken wrote: > Of course, it's Windows. "Should not" is often a suggestion, it seems. > As a port, postmaster.exe was presumably not written with VSS in mind, > so it might object to the shadow copy instantiation (which, again, it > *should* not be

Re: [GENERAL] could not write to log -> PANIC -> System down

2006-12-14 Thread Brandon Aiken
That should not occur if NetBackup is at all a recent version and you're on WinXP or Win2k3. The backup client should be using Volume Shadow Copy. You should only have file locking issues on Windows 2000 or if your partitions are FAT32 (which is a terrible idea). Of course, it's Windows. "Sho

[GENERAL] PITR / what directories/files can be ignored?

2006-12-14 Thread Glen Parker
I am continuing to refine my PITR backup script, and there are some directories I do not know what to do with. First off, here are the directories/files I am currently ignoring... pg_xlog (ours is a symlink, so I ignore it altogether) pg_log/* base/*/pgsql_tmp/* postmaster.opts postmaster.pid

Re: [GENERAL] Temp file space (Re: creating an index with tablespace on a dedicated filesystem)

2006-12-14 Thread Tom Lane
Glen Parker <[EMAIL PROTECTED]> writes: > Tom, is it safe to assume that the contents of the temp directory do not > need to persist across Postgres restarts? Yup, they're only temp files (in fact, I think there is code somewhere that actually runs around and cleans out the temp directories durin

Re: [GENERAL] could not write to log -> PANIC -> System down

2006-12-14 Thread Merlin Moncure
On 12/14/06, Scott Marlowe <[EMAIL PROTECTED]> wrote: On Thu, 2006-12-14 at 11:28, dev wrote: > Hello friends, > > we have some strange problem, postmaster (pg 8.1 /win32) > suddenly shutdown because of "no reason". > > The interesting thing is that this occurs always at > almost same t

Re: [GENERAL] shell script to populate array values

2006-12-14 Thread Paul Silveira
Thanks again Susan. I agree that this is truly a shell scripting question. I placed it here because I was hoping that someone (like yourself :) ) would have easy examples of other things they've done in the psql space. I actually did want to insert a litteral version of the variable. I found m

[GENERAL] Temp file space (Re: creating an index with tablespace on a dedicated filesystem)

2006-12-14 Thread Glen Parker
Tom Lane wrote: Temp files are created in $PGDATA/base/yourdb/pgsql_tmp/. If you have a mind to, you can replace that subdirectory with a symlink to a (suitably secure) directory elsewhere. Tom, is it safe to assume that the contents of the temp directory do not need to persist across Postgre

Re: [GENERAL] could not write to log -> PANIC -> System down

2006-12-14 Thread Glen Parker
dev wrote: Hello friends, we have some strange problem, postmaster (pg 8.1 /win32) suddenly shutdown because of "no reason". The interesting thing is that this occurs always at almost same time (between 0.00 and 0.30h), in that time period is running system backup (Veristas backupexec agent) - st

Re: [pgsql-www] [GENERAL] Subcribing to this list, what's the

2006-12-14 Thread Joshua D. Drake
> > I posted about this issue, the failure of the website subscription form > > to accept (at least) an @yahoo.com email acct, and no one replied > > (though that was one of the posts that didnt' seem to make it onto the > > mailing list, but is on google & newsgroup). Can someone tell me what

Re: [GENERAL] a question for the way-back machine

2006-12-14 Thread Martijn van Oosterhout
On Thu, Dec 14, 2006 at 09:35:47AM -0800, Ben wrote: > Interesting. Is that plan cached for the life of the session doing the > inserts, the life of the trigger, or until the database is restarted? Duration of a session, there is no support to cache a plan for any other period. > I guess I'm try

Re: [GENERAL] Are updateable view as a linked table in ms-access a bad idea?[solved]

2006-12-14 Thread Richard Broersma Jr
I think I've solved my problem with connecting an update-able view as a linked table in MS Access. I invite all to comment on flaws or suggest improvements or other solutions. This is a test case that I am eventually going to use to model a document hierarchy. This test case is only modeli

Re: [GENERAL] could not write to log -> PANIC -> System down

2006-12-14 Thread Scott Marlowe
On Thu, 2006-12-14 at 11:28, dev wrote: > Hello friends, > > we have some strange problem, postmaster (pg 8.1 /win32) > suddenly shutdown because of "no reason". > > The interesting thing is that this occurs always at > almost same time (between 0.00 and 0.30h), in that time period is > running

Re: [GENERAL] a question for the way-back machine

2006-12-14 Thread Ben
Interesting. Is that plan cached for the life of the session doing the inserts, the life of the trigger, or until the database is restarted? I guess I'm trying to figure out how to get the plan to re-cache, without making it entirely dynamic. On Thu, 14 Dec 2006, Richard Huxton wrote: Ben w

[GENERAL] could not write to log -> PANIC -> System down

2006-12-14 Thread dev
Hello friends, we have some strange problem, postmaster (pg 8.1 /win32) suddenly shutdown because of "no reason". The interesting thing is that this occurs always at almost same time (between 0.00 and 0.30h), in that time period is running system backup (Veristas backupexec agent) - starts at

[GENERAL] Performing backup from VB.NET

2006-12-14 Thread RPK
I want to perform database backup (pgdump) from within VB.NET. Can it be done? -- View this message in context: http://www.nabble.com/Performing-backup-from-VB.NET-tf2821997.html#a7876541 Sent from the PostgreSQL - general mailing list archive at Nabble.com. ---(end of

Re: [GENERAL] out of memory woes

2006-12-14 Thread Martijn van Oosterhout
On Wed, Dec 13, 2006 at 01:49:08PM -0800, Angva wrote: > Hi everyone, > > First, this group has been good to me, and I thank you guys for the > valuable help I've found here. I come seeking help with another > problem. I am not even sure my problem lies in Postgres, but perhaps > someone here has

Re: [GENERAL] out of memory woes

2006-12-14 Thread Brandon Aiken
I wonder if this is related to the Linux memory overcommit problem: http://www.postgresql.org/docs/current/interactive/kernel-resources.html #AEN19361 -- Brandon Aiken CS/IT Systems Engineer -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Angva Sent: We

Re: [GENERAL] out of memory woes

2006-12-14 Thread Tom Lane
"Angva" <[EMAIL PROTECTED]> writes: > As I've mentioned in a few other posts, I run a daily job that loads > large amounts of data into a Postgres database. It must run > efficiently, so one of the tricks I do is run table loads, and commands > such as cluster, in parallel. I am having a problem wh

Re: [GENERAL] 8.2 server core dump

2006-12-14 Thread Tom Lane
Marc Evans <[EMAIL PROTECTED]> writes: > While working with plperl, I stumbled into a repeatable way to cause the > postgresql server to core dump. I think this is the same problem already fixed here: http://archives.postgresql.org/pgsql-committers/2006-12/msg00063.php Please apply that patch and

Re: [GENERAL] How to check constraints before call of simple_heap_insert()?

2006-12-14 Thread Alvaro Herrera
Vanyel wrote: > Hi all. > I'm writting some trigger i C, and I use simple_heap_insert() function > to insert HeapTuple to a table. But unfortunatelly that function does > not check constraints before inserting values to the table. Does anyone > know there is some function that checks constraints wh

[GENERAL] Subcribing to this list, what's the secret?

2006-12-14 Thread wheel
I seem to have a natural knack for hitting the ruts around here, which is exciting. I've tried to subscribe to the list using both yahoo and gmail email accounts and the webform always reports "The email address you entered does not appear to be valid." I would like to use either yahoo or gmail

[GENERAL] How to check constraints before call of simple_heap_insert()?

2006-12-14 Thread Vanyel
Hi all. I'm writting some trigger i C, and I use simple_heap_insert() function to insert HeapTuple to a table. But unfortunatelly that function does not check constraints before inserting values to the table. Does anyone know there is some function that checks constraints while inserting HeapTuple

Re: [GENERAL] A VIEW mimicing a TABLE

2006-12-14 Thread William Leite Araújo
14 Dec 2006 02:45:12 -0800, SunWuKung <[EMAIL PROTECTED]>: > CREATE RULE new_entry AS ON INSERT to logview DO INSTEAD INSERT >(id,tm,info) VALUES (COALESCE(new.id,[default]),COALESCE(new.tm > ,[default]),COALESCE(new.info,[default])); what would [default] insert here? A constant, a

Re: [GENERAL] TOAD-like query builder for PostgreSQL?

2006-12-14 Thread dananrg
Lightning Admin sounds good, but can it be used with databases other than postgreSQL? It's always nice, when investing time learning a tool, if it can be used elsewhere. ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] out of memory woes

2006-12-14 Thread Angva
Hi everyone, First, this group has been good to me, and I thank you guys for the valuable help I've found here. I come seeking help with another problem. I am not even sure my problem lies in Postgres, but perhaps someone here has had a similar problem and could point me in the right direction. A

Re: [GENERAL] error messages without schema name

2006-12-14 Thread Shoaib Mir
You can not truncate table 'foo' because there is referential integrity between 'foo' and 'bar', so try using TRUNCATE nsp2.foo CASCADE; You can find the schema name for 'bar' using a query like: select nspname from pg_namespace where oid = (select relnamespace from pg_class where relname = 'ba

Re: [GENERAL] Statement timeout not working on broken connections with active queries

2006-12-14 Thread Brendan O'Shea
Brian Wipf writes: On 12-Dec-06, at 4:30 PM, Tom Lane wrote: "Brendan O'Shea" <[EMAIL PROTECTED]> writes: We have discovered a situation where the statement_timeout is not = honored for broken connections. If a connection is in the process of = returning results to the client and the connect

Re: [GENERAL] Statement timeout not working on broken connections with active queries

2006-12-14 Thread Brendan O'Shea
"Tom Lane" <[EMAIL PROTECTED]> "Brendan O'Shea" <[EMAIL PROTECTED]> writes: We have discovered a situation where the statement_timeout is not = honored for broken connections. If a connection is in the process of = returning results to the client and the connection is severed (for = example, n

Re: [GENERAL] Online index builds

2006-12-14 Thread Tom Lane
Csaba Nagy <[EMAIL PROTECTED]> writes: > With the "mess" you refer to the new index, and the fact it is > impossible to delete it if not possible to replace the old one ? I fail > to see why... you WILL get an exclusive lock, so you should be able to > delete the index. Consider the ALTER OWNER ex

Re: [GENERAL] creating functions with variable argument lists

2006-12-14 Thread Marc Evans
On Fri, 8 Dec 2006, Tom Lane wrote: Marc Evans <[EMAIL PROTECTED]> writes: I am trying to make use of table partitions. In doing so I would like to use a rule to call a functioning which inserts the data into the proper partition. Basically, you're guaranteeing yourself large amounts of pain

Re: [GENERAL] creating an index with tablespace on a dedicated filesystem (postgresql 8.1.5)

2006-12-14 Thread Vlad
so I guess for performance sake it makes sense do that under $TABLESPACEPATH/yourdb/pgsql_tmp/ in case $TABLESPACEPATH for the object is being created is set to a non-default value Temp files are created in $PGDATA/base/yourdb/pgsql_tmp/. If you have a mind to, you can replace that subdirect

Re: [GENERAL] Large Object to Bytea Conversion

2006-12-14 Thread Markus Schiltknecht
Hi, I've sort of solved the problem for me. I'm now doing one single lo_read() to fetch the bytea field. Those functions do not operate on the large object OID, but one needs to open them first with lo_open(). I'm doing another hack to get the size of the large object. All combined in a sql

[GENERAL] 8.2 server core dump

2006-12-14 Thread Marc Evans
Hi - While working with plperl, I stumbled into a repeatable way to cause the postgresql server to core dump. The example is shown here (yes, I know that I didn't code $query properly for the spi_prepare, but that should not cause a server core dump): CREATE OR REPLACE FUNCTION insert_date_p

Re: [GENERAL] A VIEW mimicing a TABLE

2006-12-14 Thread Rafal Pietrak
On Thu, 2006-12-14 at 02:45 -0800, SunWuKung wrote: > > CREATE RULE new_entry AS ON INSERT to logview DO INSTEAD INSERT > >(id,tm,info) VALUES (COALESCE(new.id,[default]),COALESCE(new.tm > > ,[default]),COALESCE(new.info,[default])); > > what would [default] insert here? > the default of the v

Re: [GENERAL] about the RULE system

2006-12-14 Thread Albe Laurenz
>>> "REVOKE ALL ON FUNCTION piti() FROM PUBLIC" >>> >>> Doe not seam to have any effect on functions installed as a trigger. >> >> Does your "common user" have the permission to create users? > > No (although the one I've initially tested this scenario on, was in a > group that did have that per

Re: [GENERAL] plperl exception catching

2006-12-14 Thread Marc Evans
On Wed, 13 Dec 2006, Martijn van Oosterhout wrote: On Wed, Dec 13, 2006 at 05:04:42PM -0500, Tom Lane wrote: Bricklen Anderson <[EMAIL PROTECTED]> writes: Marc Evans wrote: OK, I must be missing something obvious: ERROR: creation of Perl function failed: 'eval "string"' trapped by operation

[GENERAL] unix/linux administration tools

2006-12-14 Thread Luca Ferrari
Hi all, I'm just curios to know what is, in your opinion, the best tools for managing and interacting with a postgresql server under Linux or Unix. I've seen a lot of discussion about a toad like tool (for making queries) but the tools seemed to be only Windows based. Disregarding the great pgad

Re: [GENERAL] A VIEW mimicing a TABLE

2006-12-14 Thread SunWuKung
> CREATE RULE new_entry AS ON INSERT to logview DO INSTEAD INSERT >(id,tm,info) VALUES (COALESCE(new.id,[default]),COALESCE(new.tm > ,[default]),COALESCE(new.info,[default])); what would [default] insert here? the default of the view or the default of the underlying table? B. -

Re: [GENERAL] A VIEW mimicing a TABLE

2006-12-14 Thread Rafal Pietrak
On Thu, 2006-12-14 at 08:01 -0200, William Leite Araújo wrote: > > On 12/13/06, Rafal Pietrak <[EMAIL PROTECTED]> wrote: > CREATE RULE new_entry_notm AS ON INSERT to logview WHERE > new.tm IS NULL > DO INSTEAD INSERT (id,info) VALUES (new.id,new.info); > CREATE RULE

Re: [GENERAL] iplike.so permission denied

2006-12-14 Thread Richard Huxton
Faqeer ALI wrote: trying to install opennms on fc5 Error.. this comes when running ./install -disU of opennms i have opened all the permission on iplike.so and all its parent directories. .. til.PSQLException: ERROR:

Re: [GENERAL] A VIEW mimicing a TABLE

2006-12-14 Thread William Leite Araújo
On 12/13/06, Rafal Pietrak <[EMAIL PROTECTED]> wrote: Hi, May be someone could help me with this: For some time now, I exercise the use of VIEWs to expose just the features of TABLES a particular user is supposed to see/have. I can see that with a VIEW, I can do prity mutch everything I can d

[GENERAL] iplike.so permission denied

2006-12-14 Thread Faqeer ALI
trying to install opennms on fc5 Error.. this comes when running ./install -disU of opennms i have opened all the permission on iplike.so and all its parent directories. .. til.PSQLException: ERROR: could not load libr

Re: [GENERAL] MySQL drops support for most distributions

2006-12-14 Thread Alban Hertroys
Joshua D. Drake wrote: > FreeBSD (Stable releases only) I suppose you meant stable _and_ releases? ;) -- Alban Hertroys [EMAIL PROTECTED] magproductions b.v. T: ++31(0)534346874 F: ++31(0)534346876 M: I: www.magproductions.nl A: Postbus 416 7500 AK Enschede // Integrate Your World //

Re: [GENERAL] dynamic plpgsql question

2006-12-14 Thread Alban Hertroys
Marc Evans wrote: >>> How can I get the value of NEW.{column_name} (aka NEW.magic in this >>> specific test case) into the variable data? >> EXECUTE 'SELECT ' || NEW.column_name ';' INTO data; > > Thanks for the suggestion. Unfortunately, it does not work: > > CREATE OR REPLACE FUNCTION foo() RET

Re: [GENERAL] A VIEW mimicing a TABLE

2006-12-14 Thread Alban Hertroys
Tom Lane wrote: > Rafal Pietrak <[EMAIL PROTECTED]> writes: >> I can see that with a VIEW, I can do prity mutch everything I can do >> with a TABLE, so a VIEW mimics a TABLE quite well but one feature: a >> default value for a row on INSERT. > > You can add a default to a view's column, either