Re: [GENERAL] changing the /tmp/ lock file?

2007-06-13 Thread Robin Ericsson
On 6/13/07, Ben <[EMAIL PROTECTED]> wrote: Why would that be a problem if each is configured to listen on different addresses? But maybe a better question to ask would be how people are doing failover in the case where you have two servers, each handling a seperate set of data and acting as back

Re: [GENERAL] [SQL] setof or array as input parameter to postgresql 8.2 functions

2007-06-13 Thread Jyoti Seth
Thanks a lot. Regards, Jyoti -Original Message- From: Pavel Stehule [mailto:[EMAIL PROTECTED] Sent: Thursday, June 14, 2007 11:27 AM To: Jyoti Seth Cc: pgsql-general@postgresql.org; [EMAIL PROTECTED] Subject: Re: [SQL] setof or array as input parameter to postgresql 8.2 functions 2007/6

Re: [GENERAL] [SQL] setof or array as input parameter to postgresql 8.2 functions

2007-06-13 Thread Pavel Stehule
2007/6/14, Jyoti Seth <[EMAIL PROTECTED]>: Thanks for the solution. With this I am able to pass arrays and multidimensional arrays in postgresql functions. One of my problem is still left I want to pass set of values with different datatypes.For eg: I want to pass following values to the functio

Re: [GENERAL] [SQL] setof or array as input parameter to postgresql 8.2 functions

2007-06-13 Thread Jyoti Seth
Thanks for the solution. With this I am able to pass arrays and multidimensional arrays in postgresql functions. One of my problem is still left I want to pass set of values with different datatypes.For eg: I want to pass following values to the function: 1 ajay 1000.12 2 rita 2300.24 3 leena 12

Re: [GENERAL] inner join problem with temporary tables

2007-06-13 Thread guillermo arias
could you please give me an example?. How could i make an inner join select with temporary tables? This function does not work: REATE OR REPLACE FUNCTION modelo.test2(OUT xart_cod character varying, OUT xart_descri character varying) RETURNS SETOF record AS $BODY$ begin create temp table t_art

Re: [GENERAL] pointer to feature comparisons, please

2007-06-13 Thread Stefan Kaltenbrunner
Kevin Hunter wrote: > At 3:26p -0400 on 13 Jun 2007, Stefan Kaltenbrunner wrote: >>> The way that I currently know how to do this in Postgres is with >>> PLpgSQL functions. Then I add something like >>> >>> CONSTRAINT away_team_is_playing CHECK ( NOT teamIsPlaying( >>> awayteamid, timeid ) ) >>> >

Re: [GENERAL] inner join problem with temporary tables

2007-06-13 Thread Alvaro Herrera
PFC wrote: > > >This message appears: > > > >ERROR: relation "t_arti" does not exist > >SQL state: 42P01 > >Context: SQL function "test1" > > > > > >Why it does not work??? > >thanks for your help > > Because plpgsql functions are compiled on first execution and all > queries are th

Re: [GENERAL] Using the GPU

2007-06-13 Thread Alejandro Torras
Alejandro Torras wrote: Billings, John wrote: Does anyone think that PostgreSQL could benefit from using the video card as a parallel computing device? I'm working on a project using Nvidia's CUDA with an 8800 series video card to handle non-graphical algorithms. I'm curious if anyone thinks

Re: [GENERAL] pointer to feature comparisons, please

2007-06-13 Thread Ron Johnson
On 06/13/07 17:23, PFC wrote: On Thu, 14 Jun 2007 00:09:20 +0200, Ron Johnson <[EMAIL PROTECTED]> wrote: On 06/13/07 16:59, PFC wrote: Isn't it *supposed* to mis UNcommitted changes from other transactions? Well, if the "uncommited change" is a DELETE of the row that allowed the constra

Re: [GENERAL] inner join problem with temporary tables

2007-06-13 Thread PFC
This message appears: ERROR: relation "t_arti" does not exist SQL state: 42P01 Context: SQL function "test1" Why it does not work??? thanks for your help Because plpgsql functions are compiled on first execution and all queries are then prepared. All tables are referenced directly in pre

Re: [GENERAL] pointer to feature comparisons, please

2007-06-13 Thread PFC
On Thu, 14 Jun 2007 00:09:20 +0200, Ron Johnson <[EMAIL PROTECTED]> wrote: On 06/13/07 16:59, PFC wrote: Isn't it *supposed* to mis UNcommitted changes from other transactions? Well, if the "uncommited change" is a DELETE of the row that allowed the constraint check to pass, then when

[GENERAL] inner join problem with temporary tables

2007-06-13 Thread guillermo arias
Hi people, i have a problem with inner join and temporary tablesI have 2 tables: articles and existencesarticles CREATE TABLE public.articles(  art_cod character varying(5) NOT NULL DEFAULT ''::character varying,  art_descri character varying(20) DEFAULT ''::character varying,  CONSTRAINT articles_

Re: [GENERAL] pointer to feature comparisons, please

2007-06-13 Thread Ron Johnson
On 06/13/07 16:59, PFC wrote: Isn't it *supposed* to mis UNcommitted changes from other transactions? Well, if the "uncommited change" is a DELETE of the row that allowed the constraint check to pass, then when this delete is commited, your data is no longer consistent. The DELETE shoul

Re: [GENERAL] Using the GPU

2007-06-13 Thread Alejandro Torras
Billings, John wrote: Does anyone think that PostgreSQL could benefit from using the video card as a parallel computing device? I'm working on a project using Nvidia's CUDA with an 8800 series video card to handle non-graphical algorithms. I'm curious if anyone thinks that this technology cou

Re: [GENERAL] pointer to feature comparisons, please

2007-06-13 Thread PFC
Isn't it *supposed* to mis UNcommitted changes from other transactions? Well, if the "uncommited change" is a DELETE of the row that allowed the constraint check to pass, then when this delete is commited, your data is no longer consistent. Consider this : CREATE TABLE A( attribu

Re: [GENERAL] pointer to feature comparisons, please

2007-06-13 Thread Joris Dobbelsteen
>-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of Kevin Hunter >Sent: woensdag 13 juni 2007 22:03 >To: Stefan Kaltenbrunner >Cc: PostgreSQL General List >Subject: Re: [GENERAL] pointer to feature comparisons, please > >At 3:26p -0400 on 13 Jun 2007, Stefa

Re: [GENERAL] how to speed up query

2007-06-13 Thread Tom Lane
"Andrus" <[EMAIL PROTECTED]> writes: > 2007-06-13 03:49:10 ERROR: deadlock detected > 2007-06-13 03:49:10 DETAIL: Process 3280 waits for AccessExclusiveLock on > relation 233893 of database 233756; blocked by process 2508. > Process 2508 waits for ShareUpdateExclusiveLock on relation 233988 of >

Re: [GENERAL] changing the /tmp/ lock file?

2007-06-13 Thread Tom Lane
Ben <[EMAIL PROTECTED]> writes: > Why would that be a problem if each is configured to listen on different > addresses? Because if they're all on the same port number, they're all trying to use the same Unix socket. Now, if you are mostly interested in communicating with them over IP, you could

Re: [GENERAL] pointer to feature comparisons, please

2007-06-13 Thread Ron Johnson
On 06/13/07 15:02, Kevin Hunter wrote: [snip] 'To enforce this rule without integrity constraints, you can use a trigger to query the department table and test that each new employee's department is valid. But this method is less reliable than the integrity constraint. SELECT in Oracle Databa

Re: [GENERAL] how to enforce index usage with +0

2007-06-13 Thread Andrew Sullivan
On Sun, Jun 10, 2007 at 05:32:55AM -0700, Timasmith wrote: > select s.order_id > from small_orders_table s, orders o > where s.find_these_id in > (select some_id from some_table where some_indexed_field = 'ABC') > and s.order_id+0 = o.order_id > and date_trunc('microseconds', o.valid_until_dt) <

Re: [GENERAL] pg_xlog - files are guaranteed to be sequentialy named?

2007-06-13 Thread Johannes Konert
Frank Wittig wrote: 24 Hex digits means 24^16 unique file names. Assuming your server saves a WAL file each second (you should review your config it it does) it takes (24^16)/(60*60*24*365)=3.84214066×10^14 years to reach the upper bound. (..) It has to be 16^24. But pg does forge filename

Re: [GENERAL] pg_xlog - files are guaranteed to be sequentialy named?

2007-06-13 Thread Johannes Konert
Greg Smith wrote: On Wed, 13 Jun 2007, Johannes Konert wrote: If someone corrects the servers computer-time/date to a date before current time (e.g. set the clock two hours back), then the newer WAL files will have an older timestamp and will be deleted by accident. This should never happen;

Re: [GENERAL] pointer to feature comparisons, please

2007-06-13 Thread Kevin Hunter
At 3:26p -0400 on 13 Jun 2007, Stefan Kaltenbrunner wrote: The way that I currently know how to do this in Postgres is with PLpgSQL functions. Then I add something like CONSTRAINT away_team_is_playing CHECK ( NOT teamIsPlaying ( awayteamid, timeid ) ) to the table schema. well doing it t

Re: [GENERAL] pg_xlog - files are guaranteed to be sequentialy named?

2007-06-13 Thread Frank Wittig
Frank Wittig schrieb: > 24 Hex digits means 24^16 unique file names. Assuming your server saves > a WAL file each second (you should review your config it it does) it > takes (24^16)/(60*60*24*365)=3.84214066×10^14 years to reach the upper > bound. How embarrassing - I messed up the calculation.

Re: [GENERAL] changing the /tmp/ lock file?

2007-06-13 Thread Greg Smith
On Wed, 13 Jun 2007, Ben wrote: Why would that be a problem if each is configured to listen on different addresses? I'm not sure if you can even get bind() to work like that portably, but ultimately it doesn't matter anyway. The benefit of how the current lock scheme keeps people from screw

Re: [GENERAL] pointer to feature comparisons, please

2007-06-13 Thread Stefan Kaltenbrunner
Kevin Hunter wrote: [...] > I originally had him code his project for Postgres, but for reasons > beyond our control we've had to move to Oracle. In designing the schema > we have need of a constraint that checks values in other tables. The > way that I currently know how to do this in Postgres

Re: [GENERAL] recursive function

2007-06-13 Thread Pavel Stehule
Hello please, look on http://people.planetpostgresql.org/merlin/index.php?/archives/2-Dealing-With-Recursive-Sets-With-PLPGSQL.html Regards Pavel Stehule 2007/6/13, Karen Springer <[EMAIL PROTECTED]>: Hi, I am struggling to write my first recursive function and think I'm missing something bas

Re: [GENERAL] how to speed up query

2007-06-13 Thread Andrus
I cannot make much sense of this information. I can see no reason why your script should take 11 minutes, while executing it from pgAdmin would take only a second. How do you run the script? I'm running my script from VFP client applicaton. Application sends every statement to server separately

Re: [GENERAL] PostGreSQL for a small Desktop Application

2007-06-13 Thread Oisin Glynn
David Gardner wrote: I'm not much of a .Net guy, but the pgsql-ODBC driver works rather well for me. Take a look at: http://psqlodbc.projects.postgresql.org/howto-csharp.html As for Windows XP, isn't there some limit to the number of incoming network connections? --- David Gardner, IT The Yuc

[GENERAL] recursive function

2007-06-13 Thread Karen Springer
Hi, I am struggling to write my first recursive function and think I'm missing something basic. I have written 2 functions that work if I pass over one parameter, but if I try to pass over a series of parameters say in a view for every field in the table it seems to run but never displays da

Re: [GENERAL] changing the /tmp/ lock file?

2007-06-13 Thread Ben
Why would that be a problem if each is configured to listen on different addresses? But maybe a better question to ask would be how people are doing failover in the case where you have two servers, each handling a seperate set of data and acting as backup for each other. I fully expect things

Re: [GENERAL] pg_xlog - files are guaranteed to be sequentialy named?

2007-06-13 Thread Frank Wittig
Hello Johannes, Johannes Konert schrieb: > Thus the newest WAL xlog-file is on top and I can delete all not needed > files at the bottom of the list. You're using pg_controldata to figure out which file's serial is older than the latest redo checkpoint. In case of restart of the slave server PgSQ

Re: [GENERAL] changing the /tmp/ lock file?

2007-06-13 Thread Greg Smith
On Wed, 13 Jun 2007, Ben wrote: when I try to start multiple postgres clusters on the same box, postgres will not start if /tmp/.s.PGSQL.5432.lock exists. There can only be one program listening on a specific port at a time. If you want multiple clusters on the same box, each of them has to

Re: [GENERAL] changing the /tmp/ lock file?

2007-06-13 Thread Tom Lane
Ben <[EMAIL PROTECTED]> writes: > I'm trying to impliment an automatic failover system, and am running into > the problem that when I try to start multiple postgres clusters on the > same box, postgres will not start if /tmp/.s.PGSQL.5432.lock exists. Can I > change the file it's looking for via

Re: [GENERAL] how to speed up query

2007-06-13 Thread Tom Lane
"Andrus" <[EMAIL PROTECTED]> writes: > from pgAdmin, it takes 1 second. > When I run this command from script it takes 11 minutes! > Any idea why running this command from script takes 11 minutes? Different plans maybe? Try EXPLAIN ANALYZE in both cases. Do you have work_mem set the same in both

[GENERAL] changing the /tmp/ lock file?

2007-06-13 Thread Ben
I'm trying to impliment an automatic failover system, and am running into the problem that when I try to start multiple postgres clusters on the same box, postgres will not start if /tmp/.s.PGSQL.5432.lock exists. Can I change the file it's looking for via an option? Nothing seemed obvious from

Re: [GENERAL] pg_xlog - files are guaranteed to be sequentialy named?

2007-06-13 Thread Greg Smith
On Wed, 13 Jun 2007, Johannes Konert wrote: If someone corrects the servers computer-time/date to a date before current time (e.g. set the clock two hours back), then the newer WAL files will have an older timestamp and will be deleted by accident. This should never happen; no one should ever

Re: [GENERAL] how to speed up query

2007-06-13 Thread Andrus
> delete from firma1.rid where dokumnr not in (select dokumnr from >firma1.dok) For future reference, I beleive the problem is the NOT IN. It has this "feature" where if any of the rows it searches has a NULL, it will return FALSE for *all* rows. So the whole table has to be scanned to check t

Re: [GENERAL] PostGreSQL for a small Desktop Application

2007-06-13 Thread Gabriele
I will probably try PostGreSQL for my needs as it seem powerful enough and easy to ship to my potential customers. For the data provider i will try npgsql as you and others suggested, as it seem enough reliable and stable to be used efficiently. I will probably use newsgroups again later if and wh

Re: [GENERAL] pg_xlog - files are guaranteed to be sequentialy named?

2007-06-13 Thread Johannes Konert
Johannes Konert wrote: But during the day I came out with an solution: I store the WAL-files with the time-stamp of archiving in their file-name. Thus I can order and delete them safely. Your hint was the one, that helped me to find that solution - so thanks for that, Greg.and the others.

Re: [GENERAL] pg_xlog - files are guaranteed to be sequentialy named?

2007-06-13 Thread Johannes Konert
Greg Smith wrote: He's talking about wiping out the ones on the backup server, so I think Johannes means erasing the old archived logs on the secondary here. That can screw up your backup if you do it wrong, but it's not an all-caps worthy mistake. yes, that's what I am talking about related t

Re: [GENERAL] PostGreSQL for a small Desktop Application

2007-06-13 Thread David Gardner
I'm not much of a .Net guy, but the pgsql-ODBC driver works rather well for me. Take a look at: http://psqlodbc.projects.postgresql.org/howto-csharp.html As for Windows XP, isn't there some limit to the number of incoming network connections? --- David Gardner, IT The Yucaipa Companies (310) 22

Re: [GENERAL] pointer to feature comparisons, please

2007-06-13 Thread Greg Smith
http://troels.arvin.dk/db/rdbms/ is where I go when I have to figure out how to cope with someone's MySQL mess [this week: it lets you put an arbitrary integer into a boolean column? seriously?]; it's also handy for comparing against Oracle. There is a helpful table http://www-css.fnal.gov/

Re: [GENERAL] pg_xlog - files are guaranteed to be sequentialy named?

2007-06-13 Thread Greg Smith
On Wed, 13 Jun 2007, Alvaro Herrera wrote: Johannes Konert wrote: I currently write a small script that deletes outdated xlog-files from my backup-location. Warning, this is NOT SAFE to do. You should NEVER delete "outdated" xlog files, unless you appreciate RANDOM CORRUPTION of your data.

Re: [GENERAL] pg_xlog - files are guaranteed to be sequentialy named?

2007-06-13 Thread Scott Marlowe
Alvaro Herrera wrote: Johannes Konert wrote: Hi pgsql-list-members, I currently write a small script that deletes outdated xlog-files from my backup-location. Because I do not want to rely on creation-date, I found it usable to use the result of ln | sort -g -r Thus the newest WAL xlog-fil

Re: [GENERAL] Regular expressions in procs

2007-06-13 Thread Rodrigo De León
On Jun 13, 9:02 am, [EMAIL PROTECTED] (Steve Manes) wrote: > I apologize if I'm having a rookie brain block, but is there a way to > massage a string inside a proc to, for instance, strip it of all > non-alpha characters using a regular expression? regexp_replace() could work for you, see: http://

Re: [GENERAL] psql : Error: Cannot stat /pgdata/8.2/main

2007-06-13 Thread Leif B. Kristensen
On Wednesday 13. June 2007 15:45, Tom Lane wrote: >psql itself has no business touching the database directory, and a > quick search of the source code shows no instance of "Cannot stat" > anywhere in released PG sources. > >I think you are being burnt by some misbehavior of Debian's wrapper >patch

Re: [GENERAL] pointer to feature comparisons, please

2007-06-13 Thread Rodrigo De León
On Jun 13, 8:57 am, [EMAIL PROTECTED] (Kevin Hunter) wrote: > So, motivation aside, what I'm wanting is a couple of pointers to > feature comparisons of Postgres vs Oracle. What else is going to > bite him while he works on this project? Would be handy to have this > reference since neither of us

[GENERAL] Regular expressions in procs

2007-06-13 Thread Steve Manes
I apologize if I'm having a rookie brain block, but is there a way to massage a string inside a proc to, for instance, strip it of all non-alpha characters using a regular expression? ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] PostGreSQL for a small Desktop Application

2007-06-13 Thread Owen Hartnett
At 12:34 PM +0200 6/13/07, Magnus Hagander wrote: On Mon, Jun 11, 2007 at 10:44:38AM -0700, Gabriele wrote: I'm going to develop a medium sized business desktop client server application which will be deployed mostly on small sized networks and later eventually, hopefully, on medium sized net

Re: [GENERAL] Plperl & create contstraint trigger

2007-06-13 Thread Tom Lane
"Chris Coleman" <[EMAIL PROTECTED]> writes: > When I run the trigger then this error appears in the logs: > FATAL: BeginInternalSubTransaction: unexpected state END See http://archives.postgresql.org/pgsql-committers/2007-05/msg00383.php regards, tom lane ---

[GENERAL] pointer to feature comparisons, please

2007-06-13 Thread Kevin Hunter
Hello List, Short version: I want pointers to feature comparisons of Postgres vs Oracle. Can the list help? Long version: I'm working with a student on a project for school. I'm trying to teach "right" methods of thinking and doing things, such as making the database/data model the au

Re: [GENERAL] Use of PROFILE in Makefiles

2007-06-13 Thread Tom Lane
Mayuresh Nirhali <[EMAIL PROTECTED]> writes: > I was wondering if there is any particular reason for having PROFILE > appended to CFLAGS. The usual use-case is to build a profilable backend with make PROFILE=-pg all regards, tom lane ---(e

Re: [GENERAL] psql : Error: Cannot stat /pgdata/8.2/main

2007-06-13 Thread Tom Lane
Joost Kraaijeveld <[EMAIL PROTECTED]> writes: > I have moved my database files from their default location to their own > partition on with their own controller and disks. PostgreSQL works OK > and I can connect with Pgadmin (Debian Lenny AMD64, PostgreSQL 8.2.4). > When I want to connect with psq

Re: [GENERAL] pg_xlog - files are guaranteed to be sequentialy named?

2007-06-13 Thread Alvaro Herrera
Johannes Konert wrote: > Hi pgsql-list-members, > I currently write a small script that deletes outdated xlog-files from > my backup-location. > Because I do not want to rely on creation-date, I found it usable to use > the result of > ln | sort -g -r > Thus the newest WAL xlog-file is on top and

Re: [GENERAL] setof or array as input parameter to postgresql 8.2 functions

2007-06-13 Thread Albe Laurenz
> I have to pass a set of values and arrays in postgresql 8.2 > functions. But I am not getting any help on that. Please let > me know if any one has idea. Something like this? CREATE OR REPLACE FUNCTION sample(avalue integer, anarray text[]) RETURNS void LANGUAGE plpgsql STRICT AS $$DECLARE

[GENERAL] pg_xlog - files are guaranteed to be sequentialy named?

2007-06-13 Thread Johannes Konert
Hi pgsql-list-members, I currently write a small script that deletes outdated xlog-files from my backup-location. Because I do not want to rely on creation-date, I found it usable to use the result of ln | sort -g -r Thus the newest WAL xlog-file is on top and I can delete all not needed files

Re: [GENERAL] [SQL] setof or array as input parameter to postgresql 8.2 functions

2007-06-13 Thread Pavel Stehule
Hello maybe: create function foo(varchar[][]) returns void as $$ begin end$$ language plpgsql; postgres=# select foo(array[array[1,2], array[2,2]]::varchar[][]); foo - (1 row) Regards Pavel Stehule 2007/6/13, Jyoti Seth <[EMAIL PROTECTED]>: Hi, I have to pass a set of values and

Re: [GENERAL] Apparent Wraparound?

2007-06-13 Thread g . hintermayer
On Jun 8, 3:23 pm, [EMAIL PROTECTED] (Alvaro Herrera) wrote: > Gunther Mayer wrote: > > Hi there, > > > I just found the following message in my logs: > > > Jun 8 10:38:38 caligula postgres[56868]: [1-1] : LOG: could not > > truncate directory "pg_subtrans": apparent wraparound > > > Should I be

[GENERAL] setof or array as input parameter to postgresql 8.2 functions

2007-06-13 Thread Jyoti Seth
Hi, I have to pass a set of values and arrays in postgresql 8.2 functions. But I am not getting any help on that. Please let me know if any one has idea. Thanks, Jyoti

Re: [GENERAL] PostGreSQL for a small Desktop Application

2007-06-13 Thread Magnus Hagander
On Mon, Jun 11, 2007 at 10:44:38AM -0700, Gabriele wrote: > I'm going to develop a medium sized business desktop client server > application which will be deployed mostly on small sized networks and > later eventually, hopefully, on medium sized networks. > It will probably be developed using C#. >

[GENERAL] sql server to postgreSQL

2007-06-13 Thread Ashish Karalkar
Hello All, I have a long list of sql server queries that needs to me remoulded in to postgres format can anyone please suggest me any tool that will convert sqlserver query into postgresql query except SwisSQL - SQLOne Console 3.0 Thanks in advance With regards Ashish Karalkar

[GENERAL] Plperl & create contstraint trigger

2007-06-13 Thread Chris Coleman
Hi, I have written a trigger in plperl (I could not use pgsql due to the nature of the trigger). I know CREATE CONSTRAINT TRIGGER is not intended for general use, but it is pretty important that this trigger be run on commit of the transaction, as it needs to use data in other tables that can onl

[GENERAL] Use of PROFILE in Makefiles

2007-06-13 Thread Mayuresh Nirhali
Hello, I could not build pg8.2.4 on Solaris x86 because the variable PROFILE was set in my path to desktop profile script. Pg makfiles (Makfile.global) appends value of PROFILE if set to CFLAGS. I was wondering if there is any particular reason for having PROFILE appended to CFLAGS. If this s