[GENERAL] Seg fault in postgres 7.4.7?

2005-07-05 Thread Akash Garg
My postgres 7.4.7 installation crashed on its own today -- here is the error log: ERROR: duplicate key violates unique constraint "toolbar_pkey" LOG: server process (PID 22753) was terminated by signal 11 LOG: terminating any other active server processes WARNING: terminating connection becaus

Re: [GENERAL] How can I make SELECT return tuple numbers?

2005-07-05 Thread Michael Fuhr
On Tue, Jul 05, 2005 at 09:55:48PM -0600, Michael Fuhr wrote: > > You could reset a sequence's start value before each insert. You > might even be able to it automagically with a statement-level before > trigger that resets the sequence value and a DEFAULT expression or > row-level trigger that u

Re: [GENERAL] How can I make SELECT return tuple numbers?

2005-07-05 Thread Michael Fuhr
On Tue, Jul 05, 2005 at 09:34:51PM -0600, Roy Souther wrote: > > Is there any way to make a SELECT return an extra field that is a > sequential number for the tuples that are returned? You could use a sequence. > I am trying to populate a table with an INSERT SELECT and would like to > make one o

[GENERAL] How can I make SELECT return tuple numbers?

2005-07-05 Thread Roy Souther
Is there any way to make a SELECT return an extra field that is a sequential number for the tuples that are returned? I am trying to populate a table with an INSERT SELECT and would like to make one of the fields a sequence starting with 1 for the first tuple and incromenting. I don't want the

Re: [GENERAL] double entries into database when using IE

2005-07-05 Thread David Gagnon
[EMAIL PROTECTED] wrote: Hi, If a web page has _javascript_ called on a submit button, like ', and the function does some stuff, then does a form.submit(), and DOES NOT REMEMBER TO RETURN FALSE, then the browser is supposed to go ahead and submit the form. So, something like that coul

Re: [GENERAL] Custom C function shutdown-signaling

2005-07-05 Thread Tom Lane
"Otto Blomqvist" <[EMAIL PROTECTED]> writes: > How do I signal a custom C function that the Postmaster wants to shut down ? Do "CHECK_FOR_INTERRUPTS();" at a suitable spot in the C function's main loop. regards, tom lane ---(end of broadcast)--

Re: [GENERAL] PostgreSQL sequence within function

2005-07-05 Thread Clark Allan
ahhh... very nice. Thank you. On 7/5/05, Tony Caduto <[EMAIL PROTECTED]> wrote: Or upgrade your server to 8.x and use dollar quoting.with dollar quoting all that is a thing of the past. CREATE FUNCTION sp_slide_create(int4) RETURNS int4 AS$$DECLAREaScriptID ALIAS FOR $1;seqID int4 := nextval('gense

[GENERAL] Custom C function shutdown-signaling

2005-07-05 Thread Otto Blomqvist
How do I signal a custom C function that the Postmaster wants to shut down ? I want to use "pg_ctl restart -mf" and not "pg_ctl restart -mi" because of data integrity concerns... Any ideas ? Thanks /Otto Blomqvist ---(end of broadcast)--- T

Re: [GENERAL] double entries into database when using IE

2005-07-05 Thread SCassidy
Hi, If a web page has JavaScript called on a submit button, like 'onClick="someFunction();", and the function does some stuff, then does a form.submit(), and DOES NOT REMEMBER TO RETURN FALSE, then the browser is supposed to go ahead and submit the form. So, something like that could possibly h

Re: [GENERAL] PostgreSQL sequence within function

2005-07-05 Thread Tony Caduto
Or upgrade your server to 8.x and use dollar quoting. with dollar quoting all that is a thing of the past. CREATE FUNCTION sp_slide_create(int4) RETURNS int4 AS $$ DECLARE aScriptID ALIAS FOR $1; seqID int4 := nextval('genseq'); -- no magic needed with dollar qouting :-) BEGIN INSERT INTO tblsli

Re: [GENERAL] double entries into database when using IE

2005-07-05 Thread David Gagnon
Hi, I have seen IE posting request twice to the server when you post using a button that use javascript. Per example, if you have a submit button and call a javascript that actually post the form... IE will still do the post attached to the submit button. So you will have 2 submits It's

Re: [GENERAL] double entries into database when using IE

2005-07-05 Thread Michael Fuhr
On Tue, Jul 05, 2005 at 02:04:47PM -0400, D A GERM wrote: > > I am having a problem when a browser dumps data into a table. How exactly is the browser dumping data into a table? Via a form submission handled by a CGI program or the like? > When the browser is Firefox , it works perfect; when th

Re: [GENERAL] PITR problems

2005-07-05 Thread Frank Finner
Hi, I can tell you how I do this on Linux: 1. Set up the archiving command in postgresql.conf. Archiving of complete WAL files (that is, of WALs whose 16M space is completely filled) starts automatically after restarting the engine. No renaming, no nothing else with complete WALs. No deleting

Re: [GENERAL] PostgreSQL sequence within function

2005-07-05 Thread Tony Caduto
Try this version of your function. I don't think you can assign a value to a variable in the declaration section with the return value of a function. CREATE OR REPLACE FUNCTION sp_slide_create(int4, bool, bool, bool, varchar, text, varchar, varchar, int4) RETURNS int4 AS' DECLARE aScriptID AL

[GENERAL] double entries into database when using IE

2005-07-05 Thread D A GERM
I am having a problem when a browser dumps data into a table. When the browser is Firefox , it works perfect; when the browser is IE, it dumps 2 entries into the table just thousandths of a second apart. What could be causing this? Is this an issue with IE, Apache or Postgres. Thanks in advan

Re: [GENERAL] How can this be optimized, if possible?

2005-07-05 Thread Dann Corbit
Would it help if you created a trigger that puts a category count into a statistics table for each table? Perhaps you could gather most of the information you need from such a process. If an estimate is good enough and you are using the statistics collector and if you have an index on that column

Re: [GENERAL] Regex escape [ character and change text result into

2005-07-05 Thread David Pratt
Hi Tom. I misread the manual. I thought I could not do array_upper on multidimensional array but it was specific concatenation functions. Thank you for clarifying this. Regards, David On Tuesday, July 5, 2005, at 01:22 PM, Tom Lane wrote: David Pratt <[EMAIL PROTECTED]> writes: Hi. I am

[GENERAL] default tablespaces

2005-07-05 Thread Jaime Casanova
Hi all, is there a way to specify a default tablespace for tables and a different one for indexes without put it in the CREATE statement? i guess one way is to set 'default_tablespace' for table's tablespace create or table without any indexes and then set it for idx's tablespace and create all

Re: [GENERAL] Regex escape [ character and change text result into integer

2005-07-05 Thread Tom Lane
David Pratt <[EMAIL PROTECTED]> writes: > Hi. I am using array_dims to give me dimensions of multidimensional > array ie: > [1:5][1:2] > In my function I want to retreive the value of the second number from > array_dims (5 in example above) Why aren't you using array_upper()? > This is what

[GENERAL] Regex escape [ character and change text result into integer

2005-07-05 Thread David Pratt
Hi. I am using array_dims to give me dimensions of multidimensional array ie: [1:5][1:2] In my function I want to retreive the value of the second number from array_dims (5 in example above) This is what I am trying: count_str = substr(dimensions from '\[\d\:(\d+)\]\[\d\:\d\]') (this shou

Re: [GENERAL] How can this be optimized, if possible?

2005-07-05 Thread Greg Stark
"Net Virtual Mailing Lists" <[EMAIL PROTECTED]> writes: > The query I want to run against these two tables is something like this: > > SELECT > count(*) as count, > category.category, > nlevel(category.category) AS level, > subpath(category.category,0,nlevel(category.category)-1) as parent, >

Re: [GENERAL] Statistics and Indexes

2005-07-05 Thread Bricklen Anderson
[EMAIL PROTECTED] wrote: > Hi > > I am from a MSSQL background and am trying to understand something about > statistics in PostgreSQL. > > Question 1: > In MSSQL, if you create an index (and you are using MSSQL's default > settings) the Server will automatically create appropriate statistics for

[GENERAL] PITR problems

2005-07-05 Thread Per LauvÄs
Title: PITR problems Hi PITR (Point in Time Recovery) seams like an excellent feature, but I have trouble getting the hang of it. My environment: PostgreSQL 8.0.3 on windows 2000. My procedure: - Set up archiving with the archive_command. The files are stored on a remote computer in a

[GENERAL] Statistics and Indexes

2005-07-05 Thread postgresql
Hi I am from a MSSQL background and am trying to understand something about statistics in PostgreSQL. Question 1: In MSSQL, if you create an index (and you are using MSSQL's default settings) the Server will automatically create appropriate statistics for you. Does this happen in PostgreSQL? Or s