[GENERAL] Error accessing db with psql

2007-12-06 Thread Paul Lambert
I wrote some records to a database to do some testing, which worked: AutoDRS=# insert into job_classification (dealer_id,date_changed,time_changed,jo b_id) VALUES ('F65','1-Jul-2007','00:00',generate_series(1,100)); INSERT 0 100 AutoDRS=# insert into job_classification (dealer_id,date_

Re: [GENERAL] Q: using generate_series to fill in the blanks

2007-12-06 Thread Ow Mun Heng
On Thu, 2007-12-06 at 23:06 -0500, Rodrigo De León wrote: > On Dec 6, 2007 10:44 PM, Ow Mun Heng <[EMAIL PROTECTED]> wrote: > > I've got a desired output which looks something like this.. > > > > vdt| count > > +--- > > 1 | 514 > > 2 |27 > >

Re: [GENERAL] Q: using generate_series to fill in the blanks

2007-12-06 Thread Rodrigo De León
On Dec 6, 2007 10:44 PM, Ow Mun Heng <[EMAIL PROTECTED]> wrote: > I've got a desired output which looks something like this.. > > vdt| count > +--- > 1 | 514 > 2 |27 > 3 |15 > 4 | > 5 |12 > 6 |1

[GENERAL] Q: using generate_series to fill in the blanks

2007-12-06 Thread Ow Mun Heng
I've got a desired output which looks something like this.. vdt| count +--- 1 | 514 2 |27 3 |15 4 | 5 |12 6 |15 the query in psql is something like this.. select vdt, count(*) from footable

Re: [GENERAL] Continual Postgres headaches...

2007-12-06 Thread Tom Lane
"Weber, Geoffrey M." <[EMAIL PROTECTED]> writes: > My problems really are with performance consistency. I have tweaked the > execution so that everything should run with sub-second execution times, but > even after everything is running well, I can get at most a week or two of > steady running bef

Re: [GENERAL] Understanding how partial indexes work?

2007-12-06 Thread Tom Lane
"Chris Velevitch" <[EMAIL PROTECTED]> writes: > On Dec 7, 2007 2:39 AM, Tom Lane <[EMAIL PROTECTED]> wrote: >> Is it worth the trouble? You didn't mention the statistics involved, >> but ordinarily I'd think a non-equal condition is too nonselective >> to justify the cost of maintaining an extra i

Re: [GENERAL] Understanding how partial indexes work?

2007-12-06 Thread Chris Velevitch
On Dec 7, 2007 2:39 AM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Chris Velevitch" <[EMAIL PROTECTED]> writes: > > I have a query on a table:- > > X between k1 and k2 or X < k1 and Y <> k3 > > > where k1, k2, k3 are constants. > > > How would this query work, if I created an index on X and a part

Re: [GENERAL] storage size of "bit" data type..

2007-12-06 Thread Decibel!
On Dec 6, 2007, at 5:10 PM, Gregory Stark wrote: It needs to store the number of bits present as well. Otherwise it wouldn't be able to tell apart B'1' and B'01' ... B'0001' ... Only in the sense that numeric also has to store some meta data as well like the weight and display precision

Re: [GENERAL] storage size of "bit" data type..

2007-12-06 Thread Decibel!
On Dec 6, 2007, at 5:19 PM, Vyacheslav Kalinin wrote: > It needs to store the number of bits present as well Couldn't that be reduced to 1 byte that'd say how many bits count in the last byte? > Only in the sense that numeric also has to store some meta data as well like the weight and di

Re: [GENERAL] Understanding how partial indexes work?

2007-12-06 Thread Chris Velevitch
On Dec 7, 2007 2:39 AM, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On Dec 6, 2007 1:44 AM, Chris Velevitch <[EMAIL PROTECTED]> wrote: > > I have a query on a table:- > > > > X between k1 and k2 or X < k1 and Y <> k3 > > > > where k1, k2, k3 are constants. > > > > How would this query work, if

Re: [GENERAL] storage size of "bit" data type..

2007-12-06 Thread Gregory Stark
"Decibel!" <[EMAIL PROTECTED]> writes: > On Dec 5, 2007, at 7:23 PM, Michael Glaesemann wrote: >> On Dec 5, 2007, at 14:19 , Alex Mayrhofer wrote: >>> i'm trying to find out the storage size for bit(n) data. My initial >>> assumption would be that for any 8 bits, one byte of storage is required.

Re: [GENERAL] Replication Monitoring

2007-12-06 Thread Alvaro Herrera
Glyn Astill wrote: > How did that happen? The subject is totally different, so is the > body. It has an "In-Reply-To:" and possibly "References:" header which relates it to the other thread. The solution is simple. Don't reply to an existing message when you want to post a new thread. Compose a

Re: [GENERAL] ldap authentication allows logon with blank password

2007-12-06 Thread lighthouse . software
After some investigation into Open LDAP I discovered that a post that states: "A bind with a DN but with an empty password is equivalent to an anonymous bind, while a bind with a DN and with a wrong password is not;" So could this cause a blank password to allow access to the database as the LDAP

[GENERAL] Replication Monitoring

2007-12-06 Thread Glyn Astill
[posted again as it found it's way into another thread] Hi people, I intend to set up two slave servers, one using WAL shipping and one using Slony I. Are there any good tools, or scripts that'll help us check that both replication methods are working? I know theres Nagios - but what does this

Re: [GENERAL] Replication Monitoring

2007-12-06 Thread Glyn Astill
How did that happen? The subject is totally different, so is the body. This is shit. --- Gregory Stark <[EMAIL PROTECTED]> wrote: > "Glyn Astill" <[EMAIL PROTECTED]> writes: > > > Hi people, > > > > I intend to set up two slave servers, one using WAL shipping and > one > > using Slony I. > > T

Re: [GENERAL] storage size of "bit" data type..

2007-12-06 Thread Decibel!
On Dec 5, 2007, at 7:23 PM, Michael Glaesemann wrote: On Dec 5, 2007, at 14:19 , Alex Mayrhofer wrote: i'm trying to find out the storage size for bit(n) data. My initial assumption would be that for any 8 bits, one byte of storage is required. select pg_column_size(B'1') as "1bit",

Re: [GENERAL] Determining current block size?

2007-12-06 Thread John Wells
On 12/6/07, Gregory Stark <[EMAIL PROTECTED]> wrote: > "John Wells" <[EMAIL PROTECTED]> writes: > > > I see that BLOCK_SIZE can be set at compile time, but is there a way > > to determine what block size is in use in a running system? I've been > > searching but have been unsuccessful so far. > > p

Re: [GENERAL] Determining current block size?

2007-12-06 Thread Gregory Stark
"John Wells" <[EMAIL PROTECTED]> writes: > I see that BLOCK_SIZE can be set at compile time, but is there a way > to determine what block size is in use in a running system? I've been > searching but have been unsuccessful so far. postgres=# show block_size; block_size 8192 (1 row

Re: [GENERAL] Replication Monitoring

2007-12-06 Thread Gregory Stark
"Glyn Astill" <[EMAIL PROTECTED]> writes: > Hi people, > > I intend to set up two slave servers, one using WAL shipping and one > using Slony I. This has nothing to do with "aggregate and ordering" the subject of the message to which you're replying. You're more likely to see responses if you pos

Re: [GENERAL] Rules slower than Dynamic SQL ?

2007-12-06 Thread Decibel!
On Nov 26, 2007, at 6:09 PM, Simon Riggs wrote: On Mon, 2007-11-26 at 16:01 -0800, Alex Vinogradovs wrote: I've got a data warehouse with pretty high rate of insert into partitioned tables. What I've noticed, is that rule-based partitioning seems to be somewhat slower than insertions made dir

Re: [GENERAL] Calculation for Max_FSM_pages : Any rules of thumb?

2007-12-06 Thread Decibel!
On Nov 20, 2007, at 6:14 PM, Ow Mun Heng wrote: On Mon, 2007-11-19 at 08:24 -0500, Bill Moran wrote: In response to Ow Mun Heng <[EMAIL PROTECTED]>: Even with the regular vacuuming and even a vacuum full ( on my test DB) I still see that perhaps something is wrong (from the below) (I got t

Re: [GENERAL] SQL design pattern for a delta trigger?

2007-12-06 Thread Erik Jones
On Dec 6, 2007, at 2:36 PM, Ted Byers wrote: IS there such a thing? I can be the first to consider this. What I am aiming for is a solution with a couple coupled tables, one of which represents state through time and the other represents transactions or deltas on the state. With one field

[GENERAL] Determining current block size?

2007-12-06 Thread John Wells
I see that BLOCK_SIZE can be set at compile time, but is there a way to determine what block size is in use in a running system? I've been searching but have been unsuccessful so far. Thanks! John ---(end of broadcast)--- TIP 6: explain analyze is y

Re: [GENERAL] Nested loop in simple query taking long time

2007-12-06 Thread Alvaro Herrera
Gauthier, Dave wrote: > Future Enhancement? > If the column's new value can fit in the space already being used by the > existing value, just change the column value in place and leave the > record alone. Would reduce the need for vacuum in many cases. That's in 8.3. Not exactly like that (becau

Re: [GENERAL] SQL design pattern for a delta trigger?

2007-12-06 Thread Ted Byers
--- Ted Byers <[EMAIL PROTECTED]> wrote: > IS there such a thing? I can be the first to > consider > this. > OOPS. The mind is faster than the fingers. That should have been "I can NOT be the first to consider this. Ted ---(end of broadcast)--

[GENERAL] Replication Monitoring

2007-12-06 Thread Glyn Astill
Hi people, I intend to set up two slave servers, one using WAL shipping and one using Slony I. Are there any good tools, or scripts that'll help us check that both replication methods are working? I know theres Nagios - but what does this actually allow us to monitor? Also if I want to make bac

Re: [GENERAL] aggregate and order by

2007-12-06 Thread Gregory Stark
"Matthew Dennis" <[EMAIL PROTECTED]> writes: > So, my question is if I can have PostgreSQL honor order by clauses such as: > > select trip_id, avg_vel(position, pos_time) > from (select position, pos_time, trip_id from data order by pos_time) > sorted_data > > Would this in fact guarantee that

[GENERAL] SQL design pattern for a delta trigger?

2007-12-06 Thread Ted Byers
IS there such a thing? I can be the first to consider this. What I am aiming for is a solution with a couple coupled tables, one of which represents state through time and the other represents transactions or deltas on the state. With one field (a floating point number) in the state table (or sh

Re: [GENERAL] Continual Postgres headaches...

2007-12-06 Thread Gauthier, Dave
Sometimes breaking the query down using nested cursors can help, especially if the query has many joins. It usually makes behavior more predicatable anyway. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Merlin Moncure Sent: Thursday, December 06, 2007 2

Re: [GENERAL] Continual Postgres headaches...

2007-12-06 Thread A.M.
On Dec 6, 2007, at 2:22 PM, Weber, Geoffrey M. wrote: I've been trying for quite a while to get Postgresql tuned for use as an OLTP system. I have several PL/pgSQL functions that handle inserts and updates to the main table and several near-real-time daemons written that access the data a

Re: [GENERAL] Nested loop in simple query taking long time

2007-12-06 Thread Gauthier, Dave
Future Enhancement? If the column's new value can fit in the space already being used by the existing value, just change the column value in place and leave the record alone. Would reduce the need for vacuum in many cases. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTE

Re: [GENERAL] Continual Postgres headaches...

2007-12-06 Thread Erik Jones
On Dec 6, 2007, at 1:22 PM, Weber, Geoffrey M. wrote: I've been trying for quite a while to get Postgresql tuned for use as an OLTP system. I have several PL/pgSQL functions that handle inserts and updates to the main table and several near-real-time daemons written that access the data a

Re: [GENERAL] Recovering data via raw table and field separators

2007-12-06 Thread John Wells
On 12/6/07, Martijn van Oosterhout <[EMAIL PROTECTED]> wrote: > On Thu, Dec 06, 2007 at 02:35:42PM -0500, John Wells wrote: > > A bit beyond me I'm afriad, at least at my current level with > > postgresql. Does anyone offer a commercial tool to do this? Or, would > > anyone be interested in doing i

[GENERAL] aggregate and order by

2007-12-06 Thread Matthew Dennis
I want to create an aggregate that will give the average velocity (sum of distance traveled / sum of elapsed time) from position and timestamps. example: create table data(position integer, pos_time timestamp, trip_id integer); insert into data values(1, "time x", 1); insert into data values(2,

Re: [GENERAL] Recovering data via raw table and field separators

2007-12-06 Thread Martijn van Oosterhout
On Thu, Dec 06, 2007 at 02:35:42PM -0500, John Wells wrote: > A bit beyond me I'm afriad, at least at my current level with > postgresql. Does anyone offer a commercial tool to do this? Or, would > anyone be interested in doing it for a fee? There was a tool pgfsck which could dump table data, but

Re: [GENERAL] Continual Postgres headaches...

2007-12-06 Thread Merlin Moncure
On Dec 6, 2007 2:22 PM, Weber, Geoffrey M. <[EMAIL PROTECTED]> wrote: > In my efforts to correct these consistency in execution problems, I have > gone from vacuuming (with analyze) twice a day to every 30 minutes (how long > it takes a vacuum analyze to run - another seeming problem because it > s

Re: [GENERAL] Recovering data via raw table and field separators

2007-12-06 Thread John Wells
On 12/5/07, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > Not that I know of. > > I think the simplest thing to get your tuples back is: > > 1. mark the transaction that deleted them as aborted in pg_clog > 2. reset the hint bits in the deleted tuples, or hack your postgres copy > to ignore hint bits

Re: [GENERAL] Nested loop in simple query taking long time

2007-12-06 Thread Alvaro Herrera
Henrik wrote: > I think I have a clue why its so off. We update a value in that table about > 2 - 3 million times per night and as update creates a new row it becomes > bloated pretty fast. The table hade a size of 765 MB including indexes and > after vacuum full and reindex it went down to 80k

[GENERAL] Continual Postgres headaches...

2007-12-06 Thread Weber, Geoffrey M.
I've been trying for quite a while to get Postgresql tuned for use as an OLTP system. I have several PL/pgSQL functions that handle inserts and updates to the main table and several near-real-time daemons written that access the data and can take automated actions on it (email/page concerned peopl

Re: [GENERAL] Nested loop in simple query taking long time

2007-12-06 Thread Henrik
6 dec 2007 kl. 18.12 skrev Tom Lane: Henrik Zagerholm <[EMAIL PROTECTED]> writes: 5 dec 2007 kl. 16.25 skrev Tom Lane: Henrik Zagerholm <[EMAIL PROTECTED]> writes: -> Bitmap Index Scan on tbl_archive_idx1 (cost=0.00..1150.47 rows=8 width=0) (actual time=1505.456..1505.456 rows=86053 loops=1

Re: [GENERAL] reformatting floats ?

2007-12-06 Thread Gauthier, Dave
Both work (to_char and casting to numeric) Thanks ! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andreas Kretschmer Sent: Thursday, December 06, 2007 1:46 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] reformatting floats ? Gauthier, Dave

Re: [GENERAL] reformatting floats ?

2007-12-06 Thread Andreas Kretschmer
Gauthier, Dave <[EMAIL PROTECTED]> schrieb: > > > Hi: > > if... > create table coords (id int, x float, y float); > then... > insert into coords (id,x,y) values (1,1.000,2.001) > and then... > select * from coords > i get... > 1,1,2.001 > i want... > 1.1.

Re: [GENERAL] record-based log shipping

2007-12-06 Thread SHARMILA JOTHIRAJAH
Thanks > Have anyone implemented or tried record-based log shipping? > If so is there any other materials in the web other than the > documentation (it has very few details about this) > >>I don't know exactly what you mean by "record-based log shipping", but >>perhaps you're looking for somethin

Re: [GENERAL] reformatting floats ?

2007-12-06 Thread Martijn van Oosterhout
On Thu, Dec 06, 2007 at 01:22:55PM -0500, Gauthier, Dave wrote: > i get... > > 1,1,2.001 > > i want... > > 1.1.000,2.001 > > while retaining the numeric nature of the x,y data (for math ops in > other operations). I imagine you want to_char(). Have a nice day, -- Mart

[GENERAL] reformatting floats ?

2007-12-06 Thread Gauthier, Dave
Hi: if... create table coords (id int, x float, y float); then... insert into coords (id,x,y) values (1,1.000,2.001) and then... select * from coords i get... 1,1,2.001 i want... 1.1.000,2.001 while retaining the numeric nature of the x,y data

Re: [GENERAL] record-based log shipping

2007-12-06 Thread Jeff Davis
On Thu, 2007-12-06 at 09:30 -0800, SHARMILA JOTHIRAJAH wrote: > Hi, > Have anyone implemented or tried record-based log shipping? > If so is there any other materials in the web other than the > documentation (it has very few details about this) > Thanks > sharmila > I don't know exactly what yo

Re: [GENERAL] Import LDAP data to a Postgres database

2007-12-06 Thread Chris Browne
[EMAIL PROTECTED] (Marco Curtolo) writes: > Hi, my question is this: it is possible to query, using SQL, an LDAP > server and put these data to a table of a Postgres database (under > linux) ??? Unfortunately, the LDAP model is more or less a "network model," which doesn't fit terribly elegantly o

[GENERAL] record-based log shipping

2007-12-06 Thread SHARMILA JOTHIRAJAH
Hi, Have anyone implemented or tried record-based log shipping? If so is there any other materials in the web other than the documentation (it has very few details about this) Thanks sharmila Be a bett

Re: [GENERAL] Avoid huge perfomance loss on string concatenation

2007-12-06 Thread Martijn van Oosterhout
On Wed, Dec 05, 2007 at 11:32:59AM +0200, Andrus wrote: > I do'nt have this index. > dok.kuupaev||dok.kellaaeg conditon should applied after index search is > performed. > It filters out only a small number of rows additionally to the plain kuupaev > filter. > So adding index on dok.kuupaev||dok.

Re: [GENERAL] Nested loop in simple query taking long time

2007-12-06 Thread Tom Lane
Henrik Zagerholm <[EMAIL PROTECTED]> writes: > 5 dec 2007 kl. 16.25 skrev Tom Lane: >> Henrik Zagerholm <[EMAIL PROTECTED]> writes: >>> -> Bitmap Index Scan on tbl_archive_idx1 >>> (cost=0.00..1150.47 rows=8 width=0) (actual time=1505.456..1505.456 >>> rows=86053 loops=16) >>> Index Cond: (tbl_sha

Re: [GENERAL] Unreasonable size of table pg 8.2.5

2007-12-06 Thread Henrik
6 dec 2007 kl. 15.25 skrev Bill Moran: Henrik <[EMAIL PROTECTED]> wrote: Hello list, I have a table with 135 rows and it still takes up about 360MB with only small columns. Details below. db=# vacuum full tbl_archive; VACUUM db=# select * from pg_size_pretty(pg_total_relation_size('tbl_arch

Re: [GENERAL] Disconnects hanging server

2007-12-06 Thread Tom Lane
Brian Wipf <[EMAIL PROTECTED]> writes: > Nearly 100% of the CPU is going into pmap_remove_range. The stack > trace for pmap_remove_range, viewable within Shark, is: > -> pmap_remove_range > --> pmap_remove > ---> vm_map_simplify > > vm_map_remove > -> task_terminate_internal > --> exi

Re: [GENERAL] pg_dump and server responsiveness

2007-12-06 Thread Erik Jones
On Dec 6, 2007, at 9:58 AM, Bryan Murphy wrote: On Dec 5, 2007 9:49 PM, Tom Lane <[EMAIL PROTECTED]> wrote: Only access-share locks, but that could still be an issue if anything in your system likes to take exclusive locks. Have you looked into pg_locks to see if anything's getting blocked?

Re: [GENERAL] pg_dump and server responsiveness

2007-12-06 Thread Bryan Murphy
On Dec 6, 2007 10:09 AM, Tom Lane <[EMAIL PROTECTED]> wrote: > Why dump such a table at all? It evidently doesn't contain any > data you need to preserve ... > > I forget which version you are running, but 8.2 pg_dump has an > --exclude-table switch which'd work peachy for this. I did not know ab

Re: [GENERAL] pg_dump and server responsiveness

2007-12-06 Thread Tom Lane
"Bryan Murphy" <[EMAIL PROTECTED]> writes: > It does appear to be lock contention. I took a closer look this > morning, and I noticed our web site was consistently locking up on a > particular table, and there were a number of exclusive locks. I > started eliminating various jobs, and found the o

Re: [GENERAL] pg_dump and server responsiveness

2007-12-06 Thread Bryan Murphy
On Dec 5, 2007 9:49 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > Only access-share locks, but that could still be an issue if anything in > your system likes to take exclusive locks. Have you looked into > pg_locks to see if anything's getting blocked? > > pg_dump is entirely capable of causing an un

Re: [GENERAL] Understanding how partial indexes work?

2007-12-06 Thread Scott Marlowe
On Dec 6, 2007 1:44 AM, Chris Velevitch <[EMAIL PROTECTED]> wrote: > I have a query on a table:- > > X between k1 and k2 or X < k1 and Y <> k3 > > where k1, k2, k3 are constants. > > How would this query work, if I created an index on X and a partial > index on X where Y <> k3? Ummm. Using A

[GENERAL] Question in dblink

2007-12-06 Thread Abraham, Danny
I would like the code below to accept the returned value from t2. How do I do it? Thanks Danny === err := dblink_connect('C',cname); begin execute dblink('C','SELECT t2()'); exception when others then null; end; err :=

Re: [GENERAL] Understanding how partial indexes work?

2007-12-06 Thread Tom Lane
"Chris Velevitch" <[EMAIL PROTECTED]> writes: > I have a query on a table:- > X between k1 and k2 or X < k1 and Y <> k3 > where k1, k2, k3 are constants. > How would this query work, if I created an index on X and a partial > index on X where Y <> k3? Is it worth the trouble? You didn't me

Re: [GENERAL] simple update on boolean

2007-12-06 Thread Obe, Regina
You could use a COALESCE instead of a case statement for simple case like this. The below will treat a NULL as false and then when you do not it becomes true. So NULLS will be set to true UPDATE boolean_column SET boolean_column = NOT COALESCE(boolean_column, false) hope that helps, Regina

Re: [GENERAL] simple update on boolean

2007-12-06 Thread Ivan Sergio Borgonovo
On Thu, 06 Dec 2007 14:53:13 +0100 Cedric Boudin <[EMAIL PROTECTED]> wrote: > > What if boolean_column is NULL? > > > > btw set bolean_column= not bolean_column works "as expected". > > > > template1=# select (not 't'::boolean),(not 'f'::boolean),(not > > NULL::boolean); > > > > ?column? | ?column

Re: [GENERAL] Unreasonable size of table pg 8.2.5

2007-12-06 Thread Bill Moran
Henrik <[EMAIL PROTECTED]> wrote: > > Hello list, > > I have a table with 135 rows and it still takes up about 360MB with > only small columns. Details below. > > db=# vacuum full tbl_archive; > VACUUM > db=# select * from > pg_size_pretty(pg_total_relation_size('tbl_archive')); > pg_size_p

[GENERAL] Unreasonable size of table pg 8.2.5

2007-12-06 Thread Henrik
Hello list, I have a table with 135 rows and it still takes up about 360MB with only small columns. Details below. db=# vacuum full tbl_archive; VACUUM db=# select * from pg_size_pretty(pg_total_relation_size('tbl_archive')); pg_size_pretty 360 MB (1 row) db=# select *

Re: [GENERAL] autovacuum is stopping automatically....

2007-12-06 Thread Alvaro Herrera
Charles.Hou wrote: > this is the pg_log... > after 2007-12-04 10:40:37 CST 15533 , it always autovacuum "template0" > not mydatabase... Is there an ERROR in the log? My guess is that template0 is in danger of Xid wraparound and autovacuum wants to process it, but it can't for some reason. My sec

Re: [GENERAL] simple update on boolean

2007-12-06 Thread Cedric Boudin
Ivan Sergio Borgonovo wrote: > On Thu, 06 Dec 2007 13:38:31 +0100 > Cedric Boudin <[EMAIL PROTECTED]> wrote: > > >> It was indeed a forest problem. >> both: >> >> set bolean_column= not bolean_column >> and >> set bolean_column= case when bolean_column then 'f'::bool else >> 't'::bool end; >> >>

Re: [GENERAL] Error in creating function

2007-12-06 Thread A. Kretschmer
am Thu, dem 06.12.2007, um 4:16:14 -0800 mailte Yancho folgendes: > I am trying to create a function, which takes the nearest 3 hospitals > to a point making use of a PostGIS function), and then check each > hospital for the exact distance on roads (by making use of a pgRouting > function). > >

Re: [GENERAL] how to redirect output to a file

2007-12-06 Thread A. Kretschmer
am Tue, dem 04.12.2007, um 20:19:29 -0800 mailte pc folgendes: > Hi, > > How to redirect the output of an sql command to a file? > Thanks in advance within psql you can use \o , from the shell you can use this: [EMAIL PROTECTED]:~$ echo "select now()" | psql test > now.txt [EMAIL PROTECTED]:~$

Re: [GENERAL] how to redirect output to a file

2007-12-06 Thread Usama Dar
On Dec 5, 2007 9:19 AM, pc <[EMAIL PROTECTED]> wrote: > Hi, > > How to redirect the output of an sql command to a file? > Thanks in advance if you are using psql postgres=# \o ~/sql.out postgres=# select * from foo; the output will be directed to a file, when you need to stop doing it postgre

Re: [GENERAL] Avoid huge perfomance loss on string concatenation

2007-12-06 Thread Andrus
Thank you very much for quick reply. > can you please give us the types of dok.kuupaev and dok.kellaaeg? I > think a simple fix is possible here. dok.kuupaev type is DATE dok.kellaaeg type is character(5) NOT NULL DEFAULT '' and is used to represent dokument time in format hh mm Databas

[GENERAL] Error in creating function

2007-12-06 Thread Yancho
I am trying to create a function, which takes the nearest 3 hospitals to a point making use of a PostGIS function), and then check each hospital for the exact distance on roads (by making use of a pgRouting function). Below please find a copy of my function, and u can also find it highlighted here

Re: [GENERAL] Deadlock when updating table partitions (and presumed solution)

2007-12-06 Thread Paul Boddie
On 5 Des, 05:00, [EMAIL PROTECTED] (Tom Lane) wrote: > > Yeah, this is a problem. The SELECT will acquire AccessShareLock > on R and P, and subsequently try to acquire AccessShareLock on all > the inheritance children of P (and I don't think the order in which > these locks are acquired is very cl

Re: [GENERAL] Avoid huge perfomance loss on string concatenation

2007-12-06 Thread Andrus
> I'm not sure what that comment is supposed to mean. > > PG is using the index for the condition > dok.kuupaev BETWEEN '2007-11-01' AND '2007-12-04' > > but there is no index that matches the expression > dok.kuupaev||dok.kellaaeg BETWEEN '2007-11-01' AND '2007-12-0423 59' > > If you look at your

[GENERAL] how to redirect output to a file

2007-12-06 Thread pc
Hi, How to redirect the output of an sql command to a file? Thanks in advance ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] WAL shipping question

2007-12-06 Thread Alvaro Herrera
SHARMILA JOTHIRAJAH wrote: > How do you install pg_standby. I get the following error when i try the > Makefile > > [EMAIL PROTECTED]:~/postgres8.3/pgsql> > /export/home/sj/postgresql-8.3beta3/contrib/pg_standby/Makefile The Makefile is not a shell script. Run just "make" and then "make insta

Re: [GENERAL] Vacuum output redirect

2007-12-06 Thread Wim Chalmet
Yes, the write access is fine. I think I have a problem with syntax. I don't know if there is a command switch on psql to redirect standard output to a logfile. THere is one for any query results, but that does not happen to contain the output of vacuum. On 12/4/07, Martin Gainty <[EMAIL PROTECTED

[GENERAL] autovacuum is stopping automatically....

2007-12-06 Thread Charles.Hou
this is the pg_log... after 2007-12-04 10:40:37 CST 15533 , it always autovacuum "template0" not mydatabase... why? i didn't change any configuration... 2007-12-04 10:14:55 CST 23858 LOG: autovacuum: processing database "mydatabase" 2007-12-04 10:23:15 CST 31601 LOG: autovacuum: processing datab

Re: [GENERAL] Avoid huge perfomance loss on string concatenation

2007-12-06 Thread Andrus
> just small correction here...expressions like that in the create index > need an extra set of parens (but I agree with your sentiment): > CREATE INDEX dokindex ON dok ((kuupaeve||kellaaeg)) I tried CREATE INDEX dok_kuupaev_kellaaeg_idx ON dok ((kuupaev||kellaaeg)); but got error ERROR: functi

Re: [GENERAL] Older version of PGSQL help

2007-12-06 Thread Ed Burgstaler
Thank you very much for your help Greg ... I'll do as you say and install version 7.3 from rpm on a new Centos4.5 system and try to import the dump file. If I'm sucsessful in getting it working on version 7.3 can you suggest the next version I should upgrade to after that? Very grateful Ed

Re: [GENERAL] Transaction isolation and constraints

2007-12-06 Thread cliff
Hi, Tom: >Whichever one manages to get to the index page first will go through. >The second one will block waiting to see if the first one commits, >and will error out if so --- or proceed, if it aborts. I see, this makes sense. What if the two transactions insert rows that don't violate the con

Re: [GENERAL] simple update on boolean

2007-12-06 Thread Ivan Sergio Borgonovo
On Thu, 06 Dec 2007 13:38:31 +0100 Cedric Boudin <[EMAIL PROTECTED]> wrote: > It was indeed a forest problem. > both: > > set bolean_column= not bolean_column > and > set bolean_column= case when bolean_column then 'f'::bool else > 't'::bool end; > > do work perfectly. What if boolean_column is

Re: [GENERAL] WAL shipping question

2007-12-06 Thread SHARMILA JOTHIRAJAH
>The main thing that's improved in 8.3 is the integration of pg_standby as >a more rugged restore_command than most people were coding on their own: >http://www.postgresql.org/docs/8.3/static/pgstandby.html >You should use it instead of the example restore.sh included in the >message I refe

Re: [GENERAL] simple update on boolean

2007-12-06 Thread Cedric Boudin
Cedric Boudin wrote: > Most honourable members of the list, > > this is a simple one, but I can't find the solution ( probably a > forest/tree problem). > > update table set bolean_column = set_it_to_its_inverse where fk = > some_value; > > or join me in the dark forest > > cedric > > > ---

Re: [GENERAL] libpq messages language

2007-12-06 Thread Usama Dar
On Dec 6, 2007 8:03 AM, Efraín López <[EMAIL PROTECTED]> wrote: > Thank you for your reply > > but I got the error 'LC_MESSAGES' : undeclared identifier > > locale.h only defines LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, > LC_TIME > > I tried to set a system variable LC_MESSAGES, but didn't w

Re: [GENERAL] Import LDAP data to a Postgres database

2007-12-06 Thread Albe Laurenz
Marco Curtolo write: > Hi, my question is this: it is possible to query, using SQL, > an LDAP server and put these data to a table of a Postgres > database (under linux) ??? Yes, by writing a function in C that uses the LDAP API. Yours, Laurenz Albe ---(end of broadcast

Re: [GENERAL] simple update on boolean

2007-12-06 Thread Frank Millman
Cedric Boudin wrote: > > Most honourable members of the list, > > this is a simple one, but I can't find the solution ( > probably a forest/tree problem). > > update table set bolean_column = set_it_to_its_inverse where > fk = some_value; > I am usually a newbie around here, but this is one

[GENERAL] Orthodox use of PQtransactionStatus

2007-12-06 Thread luca . ciciriello
CON TODOMONDO: occasioni speciali a prezzi straordinari, fino al 50% di sconto su voli e viaggi! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7277&d=20071206 ---(end of broadcast)--- TIP 4: Have you searched our list a

Re: [GENERAL] simple update on boolean

2007-12-06 Thread Daniel Drotos
On Thu, 6 Dec 2007, A. Kretschmer wrote: update table set bolean_column = set_it_to_its_inverse where fk = some_value; I've used: update table set bolean_column = not boolean_column where fk = some_value; which has worked for me well. Daniel ---(end of broadcast)---

Re: [GENERAL] simple update on boolean

2007-12-06 Thread A. Kretschmer
am Thu, dem 06.12.2007, um 10:25:26 +0100 mailte Cedric Boudin folgendes: > Most honourable members of the list, > > this is a simple one, but I can't find the solution ( probably a > forest/tree problem). > > update table set bolean_column = set_it_to_its_inverse where fk = > some_value; test=

[GENERAL] simple update on boolean

2007-12-06 Thread Cedric Boudin
Most honourable members of the list, this is a simple one, but I can't find the solution ( probably a forest/tree problem). update table set bolean_column = set_it_to_its_inverse where fk = some_value; or join me in the dark forest cedric ---(end of broadcast)-

Re: [GENERAL] Import LDAP data to a Postgres database

2007-12-06 Thread Magnus Hagander
On Thu, Dec 06, 2007 at 09:42:19AM +0100, Marco Curtolo wrote: > > Hi, my question is this: it is possible to query, using SQL, an LDAP server > and put these data to a table of a Postgres database (under linux) ??? Depending on exactly what you nede to do, check out dblink-ldap (http://pgfoundr

Re: [GENERAL] Import LDAP data to a Postgres database

2007-12-06 Thread Andrej Ricnik-Bay
On 12/6/07, Marco Curtolo <[EMAIL PROTECTED]> wrote: > Hi, my question is this: it is possible to query, using SQL, an LDAP server > and put these data to a table of a Postgres database (under linux) ??? I don't know of any LDAP server implementations that can be queried via SQL, and getting LDAP

[GENERAL] Import LDAP data to a Postgres database

2007-12-06 Thread Marco Curtolo
Hi, my question is this: it is possible to query, using SQL, an LDAP server and put these data to a table of a Postgres database (under linux) ??? Thanks to all. _ Scarica GRATIS 30 emoticon per Messenger! http://www.emoticons-livem