Re: [GENERAL] Installing on Windows without using msi Installer

2008-03-23 Thread Inoqulath
Hello Jeff Maybe this one helps: http://www.giftpilz-online.de/pg_installer_setup.zip Jeff Williams schrieb: I would like to install PostgreSQL manually as part of my applications install using InnoSetup. Is there anywhere the steps required to do this and if so where would I find them? Ma

[GENERAL] How to concatenate a boolean to a text string for an EXECUTE stmt in a stored proc

2008-03-23 Thread Keaton Adams
Postgres 8.1 on RHEL How do I formulate this EXECUTE statement so that cust_hold (boolean column in the table) can be set to the value in v_cust_on_hold (boolean variable in a function)? v_cust_on_hold BOOLEAN; EXECUTE 'UPDATE customer_action_ytd_' || v_tyear || ' ' || 'SET bytes_sc = b

[GENERAL] table size and storage location

2008-03-23 Thread chuckee
Hi, I have two questions: 1) how do I find out the size, in MB, of a particular table (called 'capture' in this case). I tried entering the SQL query SELECT (pg_tablespace_size('capture')); The result was the following: ERROR: tablespace "capture" does not exist 2) how do I find out where the a

Re: [GENERAL] How to concatenate a boolean to a text string for an EXECUTE stmt in a stored proc

2008-03-23 Thread Martijn van Oosterhout
On Wed, Mar 19, 2008 at 02:28:33PM -0600, Keaton Adams wrote: > > Postgres 8.1 on RHEL > > How do I formulate this EXECUTE statement so that cust_hold (boolean column > in the table) can be set to the value in v_cust_on_hold (boolean variable in > a function)? You're looking for quote_literal(),

Re: [GENERAL] --enable-thread-safety bug

2008-03-23 Thread Steve Clark
Craig Ringer wrote: Steve Clark wrote: I guess the real question is why we are running out of memory when this option is enabled. Since my app doesn't use threads that points to a memory leak in the ecpg library when enable thread safety is turned on. It might be worth building ecpg with

Re: [GENERAL] --enable-thread-safety bug

2008-03-23 Thread Tom Lane
Steve Clark <[EMAIL PROTECTED]> writes: > I could do that - but in my situation I am not using threads so I > really don't need --enable-thread-safety > turned on. The freebsd ports maintainer for postgresql decided > everybody should have it whether they > needed it or not. I simply deleted the

[GENERAL] scheduling stored procedure

2008-03-23 Thread Alain Roger
Hi, I have a temporary table in which i store all emails of users who want to receive a newsletter. to avoid spamming and to limit the size of this table, i would like to delete all requests (records) which are older than 72 hours. i was thinking to execute each hour a stored procedure which will

Re: [GENERAL] scheduling stored procedure

2008-03-23 Thread Ben
Traditionally, postgres lets other tools do things they're good at. like scheduling scripts to run every hour. :) I seem to recall there was a postgres-specific scheduler project somebody started, but I cannot seem to recall what it was called, much less how far along the project was. On S

Re: [GENERAL] scheduling stored procedure

2008-03-23 Thread Raymond O'Donnell
On 23/03/2008 16:08, Alain Roger wrote: i was thinking to execute each hour a stored procedure which will check the time and date (of now) if it is greater than "registration request time" stored in this temporary table. if it is greater, so record will be deleted. does postgresql have such ti

Re: [GENERAL] scheduling stored procedure

2008-03-23 Thread Pavel Stehule
On 23/03/2008, Alain Roger <[EMAIL PROTECTED]> wrote: > Hi, > > I have a temporary table in which i store all emails of users who want to > receive a newsletter. > to avoid spamming and to limit the size of this table, i would like to > delete all requests (records) which are older than 72 hours. >

Re: [GENERAL] table size and storage location

2008-03-23 Thread paul rivers
chuckee wrote: 1) how do I find out the size, in MB, of a particular table (called 'capture' in this case). I tried entering the SQL query SELECT (pg_tablespace_size('capture')); The result was the following: ERROR: tablespace "capture" does not exist You're looking for pg_relation_size('ca

Re: [GENERAL] How to concatenate a boolean to a text string for an EXECUTE stmt in a stored proc

2008-03-23 Thread Gurjeet Singh
On Thu, Mar 20, 2008 at 1:58 AM, Keaton Adams <[EMAIL PROTECTED]> wrote: > > Postgres 8.1 on RHEL > > How do I formulate this EXECUTE statement so that cust_hold (boolean > column in the table) can be set to the value in v_cust_on_hold (boolean > variable in a function)? > > v_cust_on_hold BO

Re: [GENERAL] --enable-thread-safety bug

2008-03-23 Thread Michael Meskes
On Sat, Mar 22, 2008 at 04:58:28PM -0400, Steve Clark wrote: > Not exactly sure what you are asking about - descriptors and auto > allocating. So I guess you don't use either feature. :-) > The program processes about 80 packets a day, which can update > several tables. > It runs continou

Re: [GENERAL] --enable-thread-safety bug

2008-03-23 Thread Steve Clark
Michael Meskes wrote: On Sat, Mar 22, 2008 at 04:58:28PM -0400, Steve Clark wrote: Not exactly sure what you are asking about - descriptors and auto allocating. So I guess you don't use either feature. :-) The program processes about 80 packets a day, which can update several tables

[GENERAL] Insert

2008-03-23 Thread Bob Pawley
I have two tables - p_id.association and p_id.devices If a new row in p_id.association has a value - say 2 in column mon_function and a value 5 in column monitoring_fluid I want the new value for mon_function inserted into table p_id.devices ONLY when 2 AND 5 do not appear in the same row in p

Re: [GENERAL] Insert

2008-03-23 Thread Adrian Klaver
On Sunday 23 March 2008 1:48 pm, Bob Pawley wrote: > I have two tables - p_id.association and p_id.devices > > If a new row in p_id.association has a value - say 2 in column mon_function > and a value 5 in column monitoring_fluid I want the new value for > mon_function inserted into table p_id.devi

Re: [GENERAL] Insert

2008-03-23 Thread Bob Pawley
CREATE OR REPLACE FUNCTION monitor_install() RETURNS trigger AS $$ Declare xmon_function varchar; Begin Select mon_function into xmon_function From p_id.association Where mon_function = new.mon_function; If xmon_function = p_id.devices.device_number From p_id.association, p_id.devices Where

[GENERAL] INFINITE RECURSION with rules...

2008-03-23 Thread srdjan
Hi to everyone. I've got some problem with rules. -- I have 2 tables CREATE TABLE a (email varchar(20), name varchar(10), num1 smallint, num2 smallint, PRIMARY KEY (email, name)); CREATE TABLE b (id smallint PRIMARY KEY, email_a varchar(20), name_a varchar(10), tot smallint, FOREIGN KEY (e

Re: [GENERAL] Insert

2008-03-23 Thread Adrian Klaver
On Sunday 23 March 2008 2:40 pm, Bob Pawley wrote: > CREATE OR REPLACE FUNCTION monitor_install() RETURNS trigger AS $$ > > > Declare > xmon_function varchar; > > Begin > Select mon_function into xmon_function > From p_id.association > Where mon_function = new.mon_function; > > > > If xmon_

Re: [GENERAL] Insert

2008-03-23 Thread Bob Pawley
Is this what you need?? Bob CREATE TABLE p_id.association ( monitor integer, devices_id integer NOT NULL, mon_function integer, monitoring_fluid integer, ps_open character varying(5), ps_closed character varying(5), CONSTRAINT association_pkey PRIMARY KEY (devices_id) ) WITHOUT OIDS; ALTE

Re: [GENERAL] INFINITE RECURSION with rules...

2008-03-23 Thread Jaime Casanova
On Sun, Mar 23, 2008 at 10:30 AM, srdjan <[EMAIL PROTECTED]> wrote: [...] > CREATE TABLE b (id smallint PRIMARY KEY, email_a varchar(20), name_a > varchar(10), tot smallint, FOREIGN KEY (email_a, name_a) REFERENCES a(email, > name)); > [...] > > -- And this easy rule > > CREATE RULE rrr_a_b AS ON I

Re: [GENERAL] INFINITE RECURSION with rules...

2008-03-23 Thread Alvaro Herrera
srdjan wrote: > /* > *My goal is to calculate and insert automatically the value of "tot" > when I insert a row into table b.* > */ Use a trigger. It's a lot simpler. -- Alvaro Herrerahttp://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Dev

Re: [GENERAL] Insert

2008-03-23 Thread Adrian Klaver
On Sunday 23 March 2008 3:04 pm, Bob Pawley wrote: > Is this what you need?? > > Bob > > CREATE TABLE p_id.association > ( > monitor integer, > devices_id integer NOT NULL, > mon_function integer, > monitoring_fluid integer, > ps_open character varying(5), > ps_closed character varying(

Re: [GENERAL] Insert

2008-03-23 Thread Adrian Klaver
On Sunday 23 March 2008 3:04 pm, Bob Pawley wrote: > Is this what you need?? > > Bob > > CREATE TABLE p_id.association > ( > monitor integer, > devices_id integer NOT NULL, > mon_function integer, > monitoring_fluid integer, > ps_open character varying(5), > ps_closed character varying(

[GENERAL] tabs in psql

2008-03-23 Thread Seb
Hi, I'm fairly new to postgresql, and I'm having some problems understanding the syntax of SQL statements in psql. According to the documentation, white space can be used freely. However, the following fails: CREATE TABLE test ( id Int8, phenotype Varchar(510), genotype Varchar

Re: [GENERAL] tabs in psql

2008-03-23 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, 23 Mar 2008 19:35:46 -0500 Seb <[EMAIL PROTECTED]> wrote: > CREATE TABLE test > ( > idInt8, > phenotype Varchar(510), > genotype Varchar(510) > ); serial_test=# CREATE TABLE test ( id Int8, phenotype Varchar

Re: [GENERAL] tabs in psql

2008-03-23 Thread Seb
On Sun, 23 Mar 2008 17:48:09 -0700, "Joshua D. Drake" <[EMAIL PROTECTED]> wrote: [...] > I can not duplicate your problem. However when I copy and paste > directly from your email it does indeed fail watch: [...] > That is a direct copy and paste from your email. Notice that there is > no space

Re: [GENERAL] tabs in psql

2008-03-23 Thread Joshua D. Drake
On Sun, 23 Mar 2008 20:01:28 -0500 Seb <[EMAIL PROTECTED]> wrote: > Thanks Joshua, that is the problem I wanted to illustrate; i.e. > whenever a tab separates the field name from the data type spec, the > tab character gets swallowed and psql cannot parse correctly. So it > seems tabs are not int

Re: [GENERAL] tabs in psql

2008-03-23 Thread Seb
On Sun, 23 Mar 2008 18:15:55 -0700, "Joshua D. Drake" <[EMAIL PROTECTED]> wrote: [...] > Actually that would make sense as psql supports tab complete so if the > terminal interprets a tab, it isn't going to treat it as spaces. I > would suggest changing your editor to treat tabs as 4 spaces. But

Re: [GENERAL] tabs in psql

2008-03-23 Thread Tom Lane
Seb <[EMAIL PROTECTED]> writes: > But the problem still occurs with 'psql -f INPUTFILE', where tab > complete is irrelevant, so I'm confused. You sure? I can't make the example fail that way. It does fail when the example-with-tab is cut and pasted directly into a terminal window, which is exact