Re: [GENERAL] Operator based on data type

2012-01-13 Thread Chris Angelico
On Fri, Jan 13, 2012 at 5:27 PM, Craig Ringer ring...@ringerc.id.au wrote: Oooh, that's clever. Nice! People say function overloading is no good They do?? I wrote a similar set of functions to simplify a particular piece of UI code. Three functions called 'str2int'; one takes varchar and

Re: [GENERAL] select statment going slow and slow while using IN (xx,xx)

2012-01-13 Thread Yan Chunlu
seems similar to this problem: http://stackoverflow.com/questions/5198380/improving-postgres-psycopg2-query-performance-for-python-to-the-same-level-of-ja but no solution yet. On Thu, Jan 12, 2012 at 5:00 PM, Yan Chunlu springri...@gmail.com wrote: I also tried explain but found nothing

Re: [GENERAL] Postgresql allow connections without password

2012-01-13 Thread Raymond O'Donnell
On 12/01/2012 05:16, debian nick wrote: I have postgresql 8.4.9 installed now, my problem is that from time to time my postgresql let psql version 8.4.9 access the database without asking for password (psql -d mydatabase -h myhost -U myuser), and the connection attempts from psql 8.3 are not

[GENERAL] Appending a newline to a column value - in a psql cronjob

2012-01-13 Thread Alexander Farber
Hello! I'm using PostgreSQL 8.4.9 on CentOS 6.2 and with bash. The following cronjob works well for me (trying to send a mail to myself - for moderation): 6 6 * * * psql -c select 'http://mysite/user.php?id=' ||id, about from pref_rep where length(about) 1 and

Re: [GENERAL] Compiling C function with VC++ for Windows version

2012-01-13 Thread Edwin Quijada
Date: Fri, 13 Jan 2012 14:44:24 +0800 From: ring...@ringerc.id.au To: listas_quij...@hotmail.com; pgsql-general@postgresql.org Subject: Re: [GENERAL] Compiling C function with VC++ for Windows version On 13/01/2012 1:55 AM, Edwin Quijada wrote: Ok. This is the way that I compile.

Re: [GENERAL] Appending a newline to a column value - in a psql cronjob

2012-01-13 Thread Rob Sargentg
On 01/13/2012 05:11 AM, Alexander Farber wrote: Hello! I'm using PostgreSQL 8.4.9 on CentOS 6.2 and with bash. The following cronjob works well for me (trying to send a mail to myself - for moderation): 6 6 * * * psql -c select 'http://mysite/user.php?id=' ||id,

Re: [GENERAL] Appending a newline to a column value - in a psql cronjob

2012-01-13 Thread David Johnston
... || id || E'\n' ... To enable the backslash escape you prefix the literal with the letter E David J. On Jan 13, 2012, at 7:11, Alexander Farber alexander.far...@gmail.com wrote: Hello! I'm using PostgreSQL 8.4.9 on CentOS 6.2 and with bash. The following cronjob works well for me

[GENERAL] time zone problem

2012-01-13 Thread Cefull Lo
Hi everybody, I'm located in Hong Kong, UTC+8 time zone. When I select current_timestamp; gives now --- 2012-01-13 23:56:16.825558+08 However, when I select current_timestamp at time zone 'UTC+8'; I expect the result is the same as the above one. But

[GENERAL] pg_bulkloader

2012-01-13 Thread Hardy, Paul
I have no problem loading a table using bulkloader. Eg. OUTPUT = schema.tablename# [schema_name.]table_name INPUT = /filelocation/table.csv # Input data location (absolute path) TYPE = CSV

[GENERAL] ORAFCE - UTL_FILE - pul_line

2012-01-13 Thread bj77
Hi, OS: SUSE LINUX I am writing a logfile (batch process) with the ORAFCE utilities of UTL_FILE. I recently observed that the logfile is not refreshed after every new entry written. It appears to me that the every 4096 bytes of data are written at the same time. Can anyone explain me this

Re: [GENERAL] Corrupted index, what do i do?ruc

2012-01-13 Thread eshishki
Since you were running with fsync off, you must have had good backups or replication configured, because the documentation warns you that running with fsync=off will probably destroy your data and is only for expert users. Yes, i know, i have a replica and slow disk. In case you don't have a

Re: [GENERAL] time zone problem

2012-01-13 Thread Tom Lane
Cefull Lo cef...@gmail.com writes: I'm located in Hong Kong, UTC+8 time zone. When I select current_timestamp; 2012-01-13 23:56:16.825558+08 However, when I select current_timestamp at time zone 'UTC+8'; I expect the result is the same as the above one. Sorry, but it isn't. A time zone

Re: [GENERAL] indexes no longer used after shutdown during reindexing

2012-01-13 Thread Matt Dew
On 01/12/2012 01:21 PM, Tom Lane wrote: Matt Dewma...@consistentstate.com writes: On 01/11/2012 04:29 PM, Tom Lane wrote: What exactly is your definition of a clean shutdown? Is a reboot command considered a clean shutdown? It's a redhat box which called /etc/init.d/postgresql stop, which

Re: [GENERAL] time zone problem

2012-01-13 Thread Steve Crawford
On 01/13/2012 08:18 AM, Tom Lane wrote: Cefull Locef...@gmail.com writes: I'm located in Hong Kong, UTC+8 time zone. When I select current_timestamp; 2012-01-13 23:56:16.825558+08 However, when I select current_timestamp at time zone 'UTC+8'; I expect the result is the same as the above one.

Re: [GENERAL] unnest array of row type

2012-01-13 Thread seiliki
What I really intend to do is slightly more complicate than the original code. I need to iterate RECORD variable in PL/pgSQL. By combining both ideas from Pavel and Merlin, I get the following working function. CREATE FUNCTION test() RETURNS VOID AS $$ DECLARE rec RECORD; BEGIN

Re: [GENERAL] ORAFCE - UTL_FILE - pul_line

2012-01-13 Thread Pavel Stehule
Hello 2012/1/13 bj77 jovino_bla...@hotmail.com: Hi, OS: SUSE LINUX I am writing a logfile (batch process) with the ORAFCE utilities of UTL_FILE. I recently observed that the logfile is not refreshed after every new entry written. It appears to me that the every 4096 bytes of data are

[GENERAL] PG9.1.2 -- 3 day old orphaned/non-responsive query -- pg_(cancel)(terminate)_backend has no effect

2012-01-13 Thread Reid Thompson
Looking for some quidance or suggestions. PostgreSQL 9.1.2 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.5 20110214 (Red Hat 4.4.5-6), 64-bit $ uname -a Linux db1.hw.ateb.com 2.6.32-131.21.1.el6.x86_64 #1 SMP Tue Nov 22 19:48:09 GMT 2011 x86_64 x86_64 x86_64 GNU/Linux datid|

Re: [GENERAL] Postgresql allow connections without password [SOLVED]

2012-01-13 Thread debian nick
Thanks raymond, you were right, i never think that psql was using .pgpass file. When a delete it psql ask me for the password. THANKS I’ll never figure that out. 2012/1/13 Raymond O'Donnell r...@iol.ie On 12/01/2012 05:16, debian nick wrote: I have postgresql 8.4.9 installed now, my problem

Re: [GENERAL] Postgresql allow connections without password [SOLVED]

2012-01-13 Thread Adrian Klaver
On 01/13/2012 09:10 AM, debian nick wrote: Thanks raymond, you were right, i never think that psql was using .pgpass file. When a delete it psql ask me for the password. THANKS I’ll never figure that out. You still should check your pg_hba.conf file for trust and ident connection rules.

Re: [GENERAL] indexes no longer used after shutdown during reindexing

2012-01-13 Thread Matt Dew
On 01/12/2012 01:21 PM, Tom Lane wrote: Matt Dewma...@consistentstate.com writes: On 01/11/2012 04:29 PM, Tom Lane wrote: What exactly is your definition of a clean shutdown? Is a reboot command considered a clean shutdown? It's a redhat box which called /etc/init.d/postgresql stop, which

Re: [GENERAL] indexes no longer used after shutdown during reindexing

2012-01-13 Thread Tom Lane
Matt Dew ma...@consistentstate.com writes: An interesting sidenote we realized. the nice system shutdown script /etc/init.d/postgres doesn't actually wait for the db to be down, it just waits for pg_ctl to return. By default, pg_ctl stop does wait for the server to shut down ...

[GENERAL] Schedule for PostgreSQL devroom at FOSDEM 2012

2012-01-13 Thread Andreas 'ads' Scherbaum
Hi all, the schedule for the PostgreSQL devroom at FOSDEM 2012 is now available: http://www.fosdem.org/2012/schedule/track/postgresql_devroom We will have 8 talks on Saturday, February 4th. -- Andreas 'ads' Scherbaum German PostgreSQL User Group European

Re: [GENERAL] indexes no longer used after shutdown during reindexing

2012-01-13 Thread Tomas Vondra
On 13.1.2012 22:20, Tom Lane wrote: Matt Dew ma...@consistentstate.com writes: An interesting sidenote we realized. the nice system shutdown script /etc/init.d/postgres doesn't actually wait for the db to be down, it just waits for pg_ctl to return. By default, pg_ctl stop does wait for