Re: [GENERAL] function "XXX" already exists with same argument types

2011-10-14 Thread Alexander Farber
Thanks for your comments, the problem has disappeared on the 2nd restore, but I'll keep you suggestions in mind! On Thu, Oct 6, 2011 at 10:00 AM, Albe Laurenz wrote: >> template1=# \df >>                        List of functions >>  Schema | Name | Result data type | Argument data types | Type >>

Re: [GENERAL] Slow query: select * order by XXX desc offset 10 limit 10

2011-10-14 Thread Alexander Farber
Hello Bill and others, On Thu, Oct 13, 2011 at 4:09 PM, Bill Moran wrote: > In response to Alexander Farber : >> I use PostgreSQL 8.4.7 on CentOS 6.0 / 64 bit machine >> with Quad-Core AMD Opteron(tm) Processor 2352 and >> 16 GB RAM and use it for 1 PHP script - which selects >> and displays data

Re: [GENERAL] Transfer 8.3 to 8.4 - FUNCTION gtsq_in(cstring) does not exist

2011-10-14 Thread Rebecca Clarke
Your right. I'm actually transferring from 8.2. Dumb moment for me there! I am using tsvector so unable to uninstall. I will look into documentation.. Thanks for your help. Rebecca On Thu, Oct 13, 2011 at 3:43 PM, Tom Lane wrote: > Rebecca Clarke writes: > > I'm transferring a database from 8.3

Re: [GENERAL] Slow query: select * order by XXX desc offset 10 limit 10

2011-10-14 Thread Alexander Farber
I've also tried opening cursor: quincy=> open ref for select to_char(qdatetime, '-MM-DD') as QDATETIME,ID,NAME,CATEGORY,APPSVERSION,OSVERSION,DETAILS,DEVINFO from quincyview where qdatetime <= now() order by QDATETIME desc ; ERROR: syntax error at or near "open" LINE 1: open ref for select to

Re: [GENERAL] Slow query: select * order by XXX desc offset 10 limit 10

2011-10-14 Thread Pavel Stehule
Hello you should to use a DECLARE statement http://www.postgresql.org/docs/9.1/interactive/sql-declare.html and fetch statement http://www.postgresql.org/docs/9.1/interactive/sql-fetch.html Regards Pavel Stehule 2011/10/14 Alexander Farber : > I've also tried opening cursor: > > quincy=> op

Re: [GENERAL] Slow query: select * order by XXX desc offset 10 limit 10

2011-10-14 Thread Alexander Farber
Thank you - On Fri, Oct 14, 2011 at 11:30 AM, Pavel Stehule wrote: > you should to use a DECLARE statement > http://www.postgresql.org/docs/9.1/interactive/sql-declare.html > and fetch statement > http://www.postgresql.org/docs/9.1/interactive/sql-fetch.html I've managed to create a cursor and c

Re: [GENERAL] Slow query: select * order by XXX desc offset 10 limit 10

2011-10-14 Thread Pavel Stehule
2011/10/14 Alexander Farber : > Thank you - > > On Fri, Oct 14, 2011 at 11:30 AM, Pavel Stehule > wrote: >> you should to use a DECLARE statement >> http://www.postgresql.org/docs/9.1/interactive/sql-declare.html >> and fetch statement >> http://www.postgresql.org/docs/9.1/interactive/sql-fetch.h

[GENERAL] Client hangs in socket read

2011-10-14 Thread Janning Vygen
Hi, we have some trouble with a few cronjobs running inside a tomcat webapp. The problem is exactly described here by David Hustace : but wasn't solved, it was just recognized as "weired". http://archives.postgresql.org/pgsql-jdbc/2006-01/msg00115.php In short: we are running some jobs nightly

[GENERAL][HACKERS] register creation date of table

2011-10-14 Thread Willy-Bas Loos
Hi, We have several users working on a 8.4 database, using it as a back-end for several related apps and transfering data to and from it. The database tends to get a bit messy, so i've made a little table to provide an overview. This table is truncated and refilled daily, it shows all tables and v

[GENERAL] dll files missing in postgrsql bin folder in Windows

2011-10-14 Thread Kalai R
Hi, I am facing this strange problem where my postgres service couldn't start because of some missing dll files in installation directory's bin folder. I copied files from other machine and it start working again. After some time the same problem appeared again on system reboot. I have no idea wha

[GENERAL] VACUUM touching file but not updating relation

2011-10-14 Thread Thom Brown
Hi, I just noticed that the VACUUM process touches a lot of relations (affects mtime) but for one file I looked at, it didn't change. This doesn't always happen, and many relations aren't touched at all. I had the following relation: -rw--- 1 thom staff 40960 13 Oct 16:06 11946 Ran

Re: [GENERAL] Slow query: select * order by XXX desc offset 10 limit 10

2011-10-14 Thread Alban Hertroys
On 14 Oct 2011, at 11:14, Alexander Farber wrote: > I've added 3 new indices on both tables: > > > quincy=> \d quincynoreset > Table "public.quincynoreset" > Column|Type | Modifiers > -+-+--- > apps

Re: [GENERAL] dll files missing in postgrsql bin folder in Windows

2011-10-14 Thread Alban Hertroys
On 14 Oct 2011, at 12:25, Kalai R wrote: > Hi, > > I am facing this strange problem where my postgres service couldn't start > because of some missing dll files in installation directory's bin folder. > I copied files from other machine and it start working again. After some time > the same pro

Re: [GENERAL] Slow query: select * order by XXX desc offset 10 limit 10

2011-10-14 Thread Alexander Farber
Hi Alban and others - On Fri, Oct 14, 2011 at 1:34 PM, Alban Hertroys wrote: > Anyway, I think you get the sequential scans because the UNION requires to > sort all the data from both tables to guarantee that the results are unique > (hence that long Sort Key at the 7th line of explain output).

Re: [GENERAL][HACKERS] register creation date of table

2011-10-14 Thread Guillaume Lelarge
Hi, On Fri, 2011-10-14 at 12:20 +0200, Willy-Bas Loos wrote: > [...] > We have several users working on a 8.4 database, using it as a > back-end for several related apps and transfering data to and from it. > The database tends to get a bit messy, so i've made a little table to > provide an overvi

Re: [GENERAL][HACKERS] register creation date of table

2011-10-14 Thread Willy-Bas Loos
On Fri, Oct 14, 2011 at 2:51 PM, Guillaume Lelarge wrote: >> When you edit the description in the table (or the view, but no >> support in pgAdmin), the comment in the system tables is updated also. > I'm not sure I understand your comment: "no support in pgAdmin". No > support for what? Editabl

Re: [GENERAL] Test for cascade delete in plpgsql

2011-10-14 Thread Robert Fitzpatrick
On 10/13/2011 5:45 PM, David Johnston wrote: > the company record should not be visible > if you execute a SELECT against the companies table using the given > company_id value. The previous is not tested and I am not totally sure > about the visibility rules in this situation (mainly whether the

Re: [GENERAL][HACKERS] register creation date of table

2011-10-14 Thread Guillaume Lelarge
On Fri, 2011-10-14 at 14:55 +0200, Willy-Bas Loos wrote: > On Fri, Oct 14, 2011 at 2:51 PM, Guillaume Lelarge > wrote: > >> When you edit the description in the table (or the view, but no > >> support in pgAdmin), the comment in the system tables is updated also. > > > I'm not sure I understand y

Re: [GENERAL] dll files missing in postgrsql bin folder in Windows

2011-10-14 Thread Albe Laurenz
Kalai R wrote: > I am facing this strange problem where my postgres service couldn't start because of some missing dll > files in installation directory's bin folder. > I copied files from other machine and it start working again. After some time the same problem > appeared again on system reboot.

[GENERAL] array_append from user-defined C function

2011-10-14 Thread Leonardo Francalanci
Hi, how can I call array_append from a user-defined C function? I know the type of the array I'm going to use (int4[]) so if there's an equivalent function that can be called without going through PG_FUNCTION_ARGS stuff... Thank you Leonardo -- Sent via pgsql-general mailing list (pgsql-g

Re: [GENERAL] array_append from user-defined C function

2011-10-14 Thread Leonardo Francalanci
> how can I call array_append from a user-defined C function? > I know the type of the array I'm going to use (int4[]) so if there's an > equivalent > > function that can be called without going through PG_FUNCTION_ARGS stuff... I just found "array_set" (the array I'm using is one-dimensional

Re: [GENERAL] array_append from user-defined C function

2011-10-14 Thread Pavel Stehule
2011/10/14 Leonardo Francalanci : > > >> how can I call array_append from a user-defined C function? >> I know the type of the array I'm going to use (int4[]) so if there's an >> equivalent >> >> function that can be called without going through PG_FUNCTION_ARGS stuff... > > > I just found "array_s

Re: [GENERAL][HACKERS] register creation date of table

2011-10-14 Thread Willy-Bas Loos
On Fri, Oct 14, 2011 at 3:38 PM, Guillaume Lelarge wrote: > Not sure which pgAdmin release you use, but 1.14 can edit comments on an > already existing views. Of course it supports editting comments on the view itself, but that's not what i mean. I have a view that shows the comments on all the t

Re: [GENERAL] PostGIS: Approximating a house number from street address range

2011-10-14 Thread Andy Colson
On 2011-10-12, at 6:31 PM, Andy Colson wrote: On 10/12/2011 06:38 PM, Andy Colson wrote: On 10/12/2011 06:29 PM, Andy Colson wrote: On 10/12/2011 01:01 PM, René Fournier wrote: Hi, I'm developing a reverse-geocoder for Canada. So far, given a lat/lng, I can find the nearest street (line segm

Re: [GENERAL][HACKERS] register creation date of table

2011-10-14 Thread Guillaume Lelarge
On Fri, 2011-10-14 at 15:59 +0200, Willy-Bas Loos wrote: > On Fri, Oct 14, 2011 at 3:38 PM, Guillaume Lelarge > wrote: > > Not sure which pgAdmin release you use, but 1.14 can edit comments on an > > already existing views. > > Of course it supports editting comments on the view itself, but that'

Re: [GENERAL] Error: timestamp with timezone + interval is not immutable while creating index

2011-10-14 Thread Phil Couling
On 14 October 2011 00:49, Steve Crawford wrote: > On 10/13/2011 04:32 PM, Tom Lane wrote: >> >> Phil Couling  writes: >>> >>> main=>  create index foo_next_update on foo( (last_updated + >>> update_cycle) ) ; >>> ERROR:  functions in index expression must be marked IMMUTABLE... >> >> timestamptz +

[GENERAL] information_schema.referential_constraints contains NULLs

2011-10-14 Thread CG
PostgreSQL 9.1.0 For some of the referential constraints listed in my information_schema.referential_constraints table the values for the fields unique_constraint_catalog, unique_constraint_schema, and unique_constraint_name are NULL. There doesn't seem to be any rhyme or reason to which ones

Re: [GENERAL] information_schema.referential_constraints contains NULLs

2011-10-14 Thread Tom Lane
CG writes: > For some of the referential constraints listed in my > information_schema.referential_constraints table the values for the fields > unique_constraint_catalog, unique_constraint_schema, and > unique_constraint_name are NULL. There doesn't seem to be any rhyme or reason > to which o

[GENERAL] Postgres Account Inherit Question

2011-10-14 Thread Carlos Mennens
I've configured my 'pg_hba.conf' file to look as follows: # "local" is for Unix domain socket connections only local all all md5 # IPv4 local connections: hostall all 127.0.0.1/32 md5 hostall all 192.168.0.0/2

Re: [GENERAL] Postgres Account Inherit Question

2011-10-14 Thread Julien Rouhaud
On Fri, Oct 14, 2011 at 6:38 PM, Carlos Mennens wrote: > I've configured my 'pg_hba.conf' file to look as follows: > > # "local" is for Unix domain socket connections only > local all all md5 > # IPv4 local connections: > hostall all 127.

[GENERAL] Confused About pg_* Tables

2011-10-14 Thread Carlos Mennens
I'm confused about how I'm able to access the following pg_* tables regardless of connected database. I thought these tables were hidden or stored in the 'postgres' database but I'm still able to access this data regardless of which database I'm connected to: Code: zoo=# SELECT * FROM pg_user; u

Re: [GENERAL] Confused About pg_* Tables

2011-10-14 Thread Julien Rouhaud
On Fri, Oct 14, 2011 at 6:06 PM, Carlos Mennens wrote: > I'm confused about how I'm able to access the following pg_* tables > regardless of connected database. I thought these tables were hidden > or stored in the 'postgres' database but I'm still able to access this > data regardless of which da

Re: [GENERAL] exclusive OR possible within a where clause?

2011-10-14 Thread David Fetter
On Thu, Oct 13, 2011 at 07:49:59PM -0400, Tom Lane wrote: > David Salisbury writes: > > Short version, is there a way to implement an exclusive OR in a where > > clause? > > The boolean <> operator will do the trick. > > (x = y) <> (a = b) > > regards, tom lane Fac

Re: [GENERAL] Confused About pg_* Tables

2011-10-14 Thread Julien Rouhaud
On Fri, Oct 14, 2011 at 6:57 PM, Julien Rouhaud wrote: > On Fri, Oct 14, 2011 at 6:06 PM, Carlos Mennens > wrote: > >> I'm confused about how I'm able to access the following pg_* tables >> regardless of connected database. I thought these tables were hidden >> or stored in the 'postgres' databa

[GENERAL] plpython on postgresql 9.1

2011-10-14 Thread Dario Beraldi
Hello, I have installed postgresql on a mac using the 'one click' installer (postgresql-9.1.1-1-osx.dmg). I then tried to import the python language but I get the error: create language plpythonu; ERROR: could not access file "$libdir/plpython2": No such file or directory Can you help me in fig

Re: [GENERAL] Postgres Account Inherit Question

2011-10-14 Thread Guillaume Lelarge
On Fri, 2011-10-14 at 18:44 +0200, Julien Rouhaud wrote: > On Fri, Oct 14, 2011 at 6:38 PM, Carlos Mennens > wrote: > > > I've configured my 'pg_hba.conf' file to look as follows: > > > > # "local" is for Unix domain socket connections only > > local all all

Re: [GENERAL] Postgres Account Inherit Question

2011-10-14 Thread Carlos Mennens
On Fri, Oct 14, 2011 at 12:44 PM, Julien Rouhaud wrote: > > Hi > Did you check for a .pgpass file ? I'm assuming you're talking about a hidden file in my Linux shell for the 'postgres' user. I don't see one anywhere. I just had a .psql_history file which I removed. On Fri, Oct 14, 2011 at 1:31 P

Re: [GENERAL] Postgres Account Inherit Question

2011-10-14 Thread Guillaume Lelarge
On Fri, 2011-10-14 at 13:43 -0400, Carlos Mennens wrote: > On Fri, Oct 14, 2011 at 12:44 PM, Julien Rouhaud wrote: > > > > Hi > > Did you check for a .pgpass file ? > > I'm assuming you're talking about a hidden file in my Linux shell for > the 'postgres' user. I don't see one anywhere. I just ha

Re: [GENERAL] could not reattach to shared memory

2011-10-14 Thread Merlin Moncure
On Fri, Oct 14, 2011 at 1:30 AM, Sabin Coanda wrote: > Hi, > > The requested info: >        - "PostgreSQL 8.3.5, compiled by Visual C++ build 1400" >        - Windows 7 Enterprise v6.1 build 7601:sp1 >        - postgres.conf is attached > > Thanks, > Sabin > > -Original Message- > From: Me

Re: [GENERAL] pg 8.3 replication causing corruption

2011-10-14 Thread Merlin Moncure
On Thu, Oct 13, 2011 at 4:20 PM, Merlin Moncure wrote: > On Thu, Oct 13, 2011 at 4:07 PM, Bob Hatfield wrote: >>> have you had any power events?  hard shutdowns, etc? I wonder if the >>> problem is in the clog files, and not the heap itself. >> >> Nothing unusual for as long as I can tell.  Remi

Re: [GENERAL] Slow query: select * order by XXX desc offset 10 limit 10

2011-10-14 Thread Alban Hertroys
On 14 Oct 2011, at 13:58, Alexander Farber wrote: > Hi Alban and others - > > On Fri, Oct 14, 2011 at 1:34 PM, Alban Hertroys wrote: >> Anyway, I think you get the sequential scans because the UNION requires to >> sort all the data from both tables to guarantee that the results are unique >> (

Re: [GENERAL] how to list or array of key value pairs

2011-10-14 Thread J.V.
Yes, I have seen this before. But I need an array of key/value pairs (key is string, value is string) and I need to iterate through the array accessing both the key and the value. I look at this page and it does not translate very well into what I need to do. If there are any specific examp

Re: [GENERAL] how to list or array of key value pairs

2011-10-14 Thread Merlin Moncure
On Fri, Oct 14, 2011 at 3:22 PM, J.V. wrote: > Yes, I have seen this before. > > But I need an array of key/value pairs (key is string, value is string) and > I need to iterate through the array accessing both the key and the value. > > I look at this page and it does not translate very well into

Re: [GENERAL] Confused About pg_* Tables

2011-10-14 Thread Tom Lane
Carlos Mennens writes: > I'm confused about how I'm able to access the following pg_* tables > regardless of connected database. I thought these tables were hidden > or stored in the 'postgres' database but I'm still able to access this > data regardless of which database I'm connected to: The un

Re: [GENERAL] pg 8.3 replication causing corruption

2011-10-14 Thread Bob Hatfield
> Any movement on this? There is considerable interest in any known > issues resolving reproducible issues with postgres replication.   Do > you happen to remember if set up the standby when the master was under > high load conditions?  Any interesting/unexplained messages in the > standby logs? I

Re: [GENERAL] dll files missing in postgrsql bin folder in Windows

2011-10-14 Thread Kalai R
Hi, I find out the problem. Windows has been restoring a checkpoint with those dll's not installed. I don't know how to inatall dll. Please help me to install those dll's in windows. On Fri, Oct 14, 2011 at 5:12 PM, Alban Hertroys wrote: > On 14 Oct 2011, at 12:25, Kalai R wrote: > > > Hi, >

Re: [GENERAL] dll files missing in postgrsql bin folder in Windows

2011-10-14 Thread John R Pierce
On 10/14/11 4:59 PM, Kalai R wrote: I find out the problem. Windows has been restoring a checkpoint with those dll's not installed. I don't know how to inatall dll. Please help me to install those dll's in windows. how to install *what* DLL's ? -- john r pierceN 3

Re: [GENERAL] dll files missing in postgrsql bin folder in Windows

2011-10-14 Thread Brar Piening
John R Pierce wrote: how to install *what* DLL's ? This is probably part of the problem - if some files are gone it's sometimes hard to find out which ones ;-) So let's see for my 64-bit installation... PS C:\Users\Brar> & "C:\Program Files\PostgreSQL\9.0\bin\pg_config.exe" | where { $_ -m

Re: [GENERAL] dll files missing in postgrsql bin folder in Windows

2011-10-14 Thread Brar Piening
Kalai R wrote: Windows has been restoring a checkpoint with those dll's not installed. I don't know how to inatall dll. Please help me to install those dll's in windows. Personally I wouldn't bother reinstalling single dll files (how do you know that there are no other files that you will miss a

[GENERAL] find_psql_error

2011-10-14 Thread Jay Levitt
I got tired of this: psql:lib/sql/similarity.sql:97: ERROR: column o.user_id does not exist at character 426 So I wrote this: https://github.com/jaylevitt/find_psql_error And you call it like this: find_psql_error "psql:lib/sql/similarity.sql:97: ERROR: column o.user_id does not exist at ch