[GENERAL] Delete trigger

2015-09-18 Thread Leif Jensen
Hi, I am running PostgreSQL 9.3.4. I have a simple table with 3 fields: CREATE TABLE devicegroup ( groupid integer NOT NULL, ctrlid integer NOT NULL, userid integer NOT NULL ); ALTER TABLE ONLY devicegroup ADD CONSTRAINT pk_devicegroup PRIMARY KEY (groupid, ctrlid, userid);

Re: [GENERAL] Delete trigger

2015-09-18 Thread Leif Jensen
statement. Leif - Original Message - > Leif Jensen wrote: > >If I do "DELETE FROM devicegroup WHERE group=1" I do not want to delete > >anything. I only want to > > delete if I do "DELETE FROM devicegroup WHERE groupid=x AND ctrlid=y AND > &g

Re: [GENERAL] Delete trigger

2015-09-18 Thread Leif Jensen
> > -Original Message- > > From: pgsql-general-ow...@postgresql.org > > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Leif Jensen > > Sent: Freitag, 18. September 2015 10:23 > > To: pgsql-general <pgsql-general@postgresql.org> > > Subject: [GENER

Re: [GENERAL] Delete trigger

2015-09-18 Thread Leif Jensen
Hi Ioana and David. Thank you. Yes, I can see the problem. I will look into your suggestions. Leif - Original Message - > On Friday, September 18, 2015, Leif Jensen <l...@crysberg.dk> wrote: > > >Hello Laurenz, > > > >Thank you for you sugg

Re: [GENERAL] Server process crash - Segmentation fault

2014-05-09 Thread Leif Jensen
Hello Tom, Adrian Thank you for your help and the patch. Things works nicely for me now :-). Leif - Original Message - Adrian Klaver adrian.kla...@aklaver.com writes: On 05/08/2014 07:19 AM, Tom Lane wrote: 9.3 patch is here:

Re: [GENERAL] Server process crash - Segmentation fault

2014-05-08 Thread Leif Jensen
Hi Tom, I already compiled postgreSQL myself and now using 9.3.4, so I would very much like a patch. Where can I find that ? Leif - Original Message - Leif Jensen l...@crysberg.dk writes: Could it be related to the OFFSET part of the statement ? I have another query

Re: [GENERAL] Server process crash - Segmentation fault

2014-05-07 Thread Leif Jensen
of the ApplDBConn_22854_f6adeb70_query, which has been used many many times before the log shown (167 in all to be exact ;-) ). Leif - Original Message - On 05/06/2014 07:08 AM, Leif Jensen wrote: Hello. I was running PostgreSQL 9.1.4 when I got a server process crash

Re: [GENERAL] Server process crash - Segmentation fault

2014-05-07 Thread Leif Jensen
Could it be related to the OFFSET part of the statement ? I have another query on the same table without OFFSET, which seems to work fine. Leif - Original Message - Leif Jensen l...@crysberg.dk writes: Here is a gdb dump of the backtrace at the server process crash. I

[GENERAL] Server process crash - Segmentation fault

2014-05-06 Thread Leif Jensen
Hello. I was running PostgreSQL 9.1.4 when I got a server process crash (Segmentation fault) as the postgres log shown below. I tried upgrade to newest version 9.3.4, but this gives exactly the same problem. It is an (ecpg based) C-program that does tons of these scroll cursor

[GENERAL] ECPG SET CONNECTION

2013-05-31 Thread Leif Jensen
Hi guys. In the ECPG manual (including latest 9.1.9) about ECPG SQL SET CONNECTION connection name; it is stated that This is not thread-aware. When looking in the ecpg library code connect.c for ECPGsetconn( ... ), it looks very much like it is thread-aware if translated with the

[GENERAL] Rules on views - Changes from 8.4 to 9.1 ?

2013-01-28 Thread Leif Jensen
Hello. We have a system that has been running using PostgreSQL 8.4. We have now upgraded to PostgreSQL 9.1. The system has several rules on views and now most of these does not seem to work anymore. It is rather simple rules with mainly only 1 replacement sql (update for 'on update' and

Re: [GENERAL] Update rule on a view - what am I doing wrong

2013-01-22 Thread Leif Jensen
for the parameter type. Could you please expand a little on your example ? Leif - Jasen Betts ja...@xnet.co.nz wrote: On 2013-01-18, Leif Jensen l...@crysberg.dk wrote: I have been fighting a problem with an update rule on a view. I have a view that combines two tables where

Re: [GENERAL] Update rule on a view - what am I doing wrong

2013-01-22 Thread Leif Jensen
Hi Marc, Thanks a lot. That works fine. The names 'NEW' and 'OLD' works fine. Leif - Marc Schablewski m...@clickware.de wrote: Hi Leif, Am 22.01.2013 14:34, schrieb Leif Jensen: CREATE update_rule_func( old record, new record ) AS ... I am told, that I cannot use record

[GENERAL] Update rule on a view - what am I doing wrong

2013-01-18 Thread Leif Jensen
Hello, I have been fighting a problem with an update rule on a view. I have a view that combines two tables where the 'sub' table (scont) can have several rows per row in the 'top' table (icont). The view combines these to show only one record per row in the top table. To be able to

Re: [GENERAL] Postgres 8.3.5 - ECPG and the use of descriptors and cursors in multi-threaded programs

2011-05-30 Thread Leif Jensen
connection for the ALLOCATE DESCRIPTOR statement even though it allows it ? Please help, Leif - Bosco Rama postg...@boscorama.com wrote: Leif Jensen wrote: Is it really not possible to use 2 separate connection within 1 thread at the same time ? or is it an error in the ecpg library

Re: [GENERAL] Postgres 8.3.5 - ECPG and the use of descriptors and cursors in multi-threaded programs

2011-05-30 Thread Leif Jensen
PS.: That goes for the AT clause on the GET DESCRIPTOR statement too. The connection name is not included in the ECPGget_desc() call. - Leif Jensen l...@crysberg.dk wrote: Hello Bosco, Thank you for your comment. Yes, it would be nice to get some more comments on the allocate

Re: [GENERAL] Postgres 8.3.5 - ECPG and the use of descriptors and cursors in multi-threaded programs

2011-05-25 Thread Leif Jensen
: Leif Jensen wrote: This seems to be working most of the time, but looking at the generated C code from the ecpg compiler and the associated library functions, we are not sure whether we should put mutex locks around the 'select' part to avoid several threads are using the same

[GENERAL] Postgres 8.3.5 - ECPG and the use of descriptors and cursors in multi-threaded programs

2011-05-23 Thread Leif Jensen
Hello Guys, In a multi-threaded server program using Postgresql 8.3.5 with ECPG interface for C, we have problems using descriptors (and possibly cursors). We have created a common database interface module with basically 1 function: SQLExec(). In the 'select' part of this function

[GENERAL] ECPG selecting into char arrays

2011-05-19 Thread Leif Jensen
Hi guys, In version 8.2 of the ECPG documentation, section 31.6.3. Different types of host variables has been added and includes the following (new) note: 'Note that you have to take care of the length for yourself. If you use this host variable as the target variable of a query which

[GENERAL] Help on explain analyze

2010-11-26 Thread Leif Jensen
Hi guys, I have a rather complex view that sometimes takes an awful long time to execute. I have tried to do an 'explain analyze' on it. My intention was to try to optimize the tables involved by creating some indexes to help the lookup. I looked for the Seq Scan's and created

[GENERAL] ECPG threads

2010-08-23 Thread Leif Jensen
Hello guys, PostgreSQL 8.3.5. Compiled and installed on Slackware 10.2, kernel 2.6.15. We have a transaction based system that creates a new process every time a user connects (just fork()s, no exec()s). Each of these processes has several threads. Some database connections are

[GENERAL] Open Source references

2010-07-09 Thread Leif Jensen
Hej Guys, I'm looking for design ideas (and implementation specifics, not just tutorials) to a transaction heavy multi-process, multi-threaded system using PostgreSQL. Are there some good references to existing open source systems for me to see how other people has solved that kind of

[GENERAL] Process- or SessionID with ECPG

2010-07-01 Thread Leif Jensen
Hi guys, I have an ECPG based program and I would very much like to get either the process id of the backend or the session id for debugging purposes. Is there a way to call PQbackendPID() directly from my program (I suppose that will require getting hold of the PGconn from within ECPG?)

[GENERAL] Slave server: FATAL: incorrect checksum in control file

2009-01-16 Thread Leif Jensen
Hi Guys, I'm trying to set up a warm standby server, but have problems with running it on the backup. I feel that I have done like the documentation says: The WAL is being copied to the slave using rsync. Doing SELECT pg_start_backup(); (in psql) Copying the data directory to the

Re: [GENERAL] Slave server: FATAL: incorrect checksum in control file

2009-01-16 Thread Leif Jensen
(linux) box ? Leif - Tom Lane t...@sss.pgh.pa.us wrote: Leif Jensen l...@crysberg.dk writes: So far I don't get any errors, but when I start postgres on the slave (I'm using pg_ctl), I get the error 'FATAL: incorrect checksum in control file'. Both servers are running PostgreSQL

Re: [GENERAL] Slave server: FATAL: incorrect checksum in control file

2009-01-16 Thread Leif Jensen
That is almost too simple ;-) Thanks for the suggestion, Leif - Christopher Browne cbbro...@gmail.com wrote: On Fri, Jan 16, 2009 at 9:18 PM, Leif Jensen l...@crysberg.dk wrote: You are perfectly right, master is 32bit and slave is 64bit. I didn't even consider

Re: [GENERAL] Please Help! Was: Multithread problem: Error in transaction processing

2008-03-14 Thread Leif Jensen
.) As a workaround we close the database and reopen it when we get this error. Is this a normal/bug situation ? Any suggestions will be most welcome, Leif - Original Message - From: Leif Jensen [EMAIL PROTECTED] To: Leif Jensen [EMAIL PROTECTED] Sent: Friday, March 14, 2008 9:44:27 AM GMT +01

[GENERAL] Multithread problem: Error in transaction processing

2008-03-10 Thread Leif Jensen
Hi Guys, We have a system with a multithreaded daemon running on Linux using PostgreSQL 8.2.4 Embedded SQL in C. Most of the threads are doing database access and they have each their own conection which is opened when the thread is created (as one of the first things within the thread).

Re: [GENERAL] Advantages of PostgreSQL over MySQL 5.0

2006-03-25 Thread Leif Jensen
Hello, I have with great interrest been following this thread. We have a (small) flame war in house about this and I'm very happy about all the arguments I have seen. I'm a long time user of PostgreSQL (which possibly makes me a bit biased ;-) ) and I think it's great. I'm not a big

[GENERAL] ftp download won't work

2006-02-06 Thread Leif Jensen
Hi all, I have been using PostgreSQL for many years now and have never had any problems downloading it. The last one I got hold of is 8.0.3, but now when I try to get 8.1.2, I can get nothing to work. I am behind a rather strict firewall, it has been like this for years. I checked

[GENERAL] Mambo (CMS) PostgreSQL

2005-11-20 Thread Leif Jensen
Hi all, Anyone using the CMS called Mambo with PostgreSQL ? Leif ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your

Re: [GENERAL] Mambo (CMS) PostgreSQL

2005-11-20 Thread Leif Jensen
, 20 Nov 2005, Peter Eisentraut wrote: Leif Jensen wrote: Anyone using the CMS called Mambo with PostgreSQL ? Yes. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 9: In versions below 8.0

[GENERAL] Mambo/Joomla (CMS) on PostgreSQL ?

2005-11-17 Thread Leif Jensen
Hi All, I have been using PostgreSQL ever since version 6.3 and are very happy about it. Many of our company corporate registration systems are based on PostgreSQL and are web based using PHP. Unfortunately someone has decided that our (external) homepage(s) are gonna use the Mambo CMS

[GENERAL] Recursive stored procedure in C.

2005-07-14 Thread Leif Jensen
Hi all, I am trying to make a stored procedure in C that is used as a trigger on before/after insert/update on a certain table. This procedure might do inserts/updates on the same table (recursively triggering itself). I have made (pretty) sure that I'm not using 'global' variables in

Re: [GENERAL] Recursive stored procedure in C.

2005-07-14 Thread Leif Jensen
Oops, I forgot to say that I have tried PostgreSQL 7.4.1, 7.4.6, and 7.4.7 all with the same result. I'm running this on a Linux (Slackware 10.0), kernel 2.6.10y. Leif On Thu, 14 Jul 2005, Leif Jensen wrote: Hi all, I am trying to make a stored procedure in C that is used

Re: [GENERAL] Recursive stored procedure in C.

2005-07-14 Thread Leif Jensen
Jul 2005, Tom Lane wrote: Leif Jensen [EMAIL PROTECTED] writes: I am trying to make a stored procedure in C that is used as a trigger on before/after insert/update on a certain table. This procedure might do inserts/updates on the same table (recursively triggering itself). I have made

Re: [GENERAL] Recursive stored procedure in C.

2005-07-14 Thread Leif Jensen
Hi again, Thanks. No changes on this 7.x.x - 8.x.x ? .. and just to be sure: SPI_exec does the SPI_push/SPI_pop thing too ? Leif On Thu, 14 Jul 2005, Tom Lane wrote: Leif Jensen [EMAIL PROTECTED] writes: Thank you for the suggestions. I didn't know anything about SPI_push

Re: [GENERAL] Newbie question on RULEs .. or .. bug ?

2005-05-18 Thread Leif Jensen
need to use rules to do update/insert on tasks, how can I make it 'transparent' as in the above example (the update that does nothing) ? Greetings, Leif On Tue, 17 May 2005, Tom Lane wrote: Leif Jensen [EMAIL PROTECTED] writes: CREATE RULE update_tasks2taskshead AS ON UPDATE TO tasks

[GENERAL] Newbie question on RULEs .. or .. bug ?

2005-05-17 Thread Leif Jensen
Hello, I have been working with a great database system called PostgreSQL for many years ;-) but never had to use any RULEs. I now have to use and update through a view and have written a few rules to make this possible as per the manual. My insert rules seems to work fine, but I