Re: [GENERAL] Concatenate table name in Pl/Pgsql

2013-06-25 Thread Adarsh Sharma
Able to fix but still new error :( test=# CREATE OR REPLACE FUNCTION tmp_trigger_function() test-# RETURNS TRIGGER AS $$ test$# DECLARE test$# stmt text; test$# abc varchar; test$# BEGIN test$# select to_char(NEW.a::timestamp,'mmdd') into abc ; test$# stmt := 'insert into tmp'||abc|| ' values

Re: [GENERAL] Concatenate table name in Pl/Pgsql

2013-06-25 Thread Adarsh Sharma
Passing each column seems not good because if column additon/deletion happens in future , we also need to change function as well. I think below will work :- test=# CREATE OR REPLACE FUNCTION tmp_trigger_function() test-# RETURNS TRIGGER AS $$ test$# DECLARE test$# abc varchar; test$# BEGIN test$#

Re: [GENERAL] Concatenate table name in Pl/Pgsql

2013-06-25 Thread Ian Lawrence Barwick
> Thanks > > > On Wed, Jun 26, 2013 at 10:52 AM, Ian Lawrence Barwick > wrote: >> >> 2013/6/26 Adarsh Sharma : >> > Hi , >> > >> > Today i m creating a function that includes dynamic concatenation of a >> > partitioned table name as below :- >> > >> > test=# CREATE OR REPLACE FUNCTION tmp_trigger_

Re: [GENERAL] Archiving and recovering pg_stat_tmp

2013-06-25 Thread Amit Langote
On Wed, Jun 26, 2013 at 2:10 PM, Jeff Janes wrote: > On Wednesday, June 19, 2013, Sameer Thakur wrote: >> >> Hello, >> I was trying to figure out how does one recover server statistics to the >> same snapshot to which a database is restored after PITR. > > > Do you think that it is important to do

Re: [GENERAL] Concatenate table name in Pl/Pgsql

2013-06-25 Thread Adarsh Sharma
Thanks Ian for such a quick response. But my NEW.* will be 10-15 columns row. test=# CREATE OR REPLACE FUNCTION tmp_trigger_function() test-# RETURNS TRIGGER AS $$ test$# DECLARE test$# stmt text; test$# abc varchar; test$# BEGIN test$# select to_char(NEW.a::timestamp,'mmdd') into abc ; test$#

Re: [GENERAL] Concatenate table name in Pl/Pgsql

2013-06-25 Thread Ian Lawrence Barwick
2013/6/26 Adarsh Sharma : > Hi , > > Today i m creating a function that includes dynamic concatenation of a > partitioned table name as below :- > > test=# CREATE OR REPLACE FUNCTION tmp_trigger_function() > test-# RETURNS TRIGGER AS $$ > test$# DECLARE > test$# tbl_name text; > test$# abc varchar;

Re: [GENERAL] Concatenate table name in Pl/Pgsql

2013-06-25 Thread Adarsh Sharma
EXECUTE 'insert into tmp'||abc|| 'values ( NEW.* )'; This works :)

Re: [GENERAL] Archiving and recovering pg_stat_tmp

2013-06-25 Thread Jeff Janes
On Wednesday, June 19, 2013, Sameer Thakur wrote: > Hello, > I was trying to figure out how does one recover server statistics to the > same snapshot to which a database is restored after PITR. > Do you think that it is important to do so? Are you experiencing problems which you believe are due

[GENERAL] Concatenate table name in Pl/Pgsql

2013-06-25 Thread Adarsh Sharma
Hi , Today i m creating a function that includes dynamic concatenation of a partitioned table name as below :- test=# CREATE OR REPLACE FUNCTION tmp_trigger_function() test-# RETURNS TRIGGER AS $$ test$# DECLARE test$# tbl_name text; test$# abc varchar; test$# BEGIN test$# tbl_name := 'tmp'; test

Re: [GENERAL] Archiving and recovering pg_stat_tmp

2013-06-25 Thread Sameer Thakur
> > > > I did the following > > 1. Enabled archiving > > 2. Executed SQL's 3. Shutdown 4. copied data directory (including the > > pgstats.stat under global) and archive directory under backup/1 > > repeated 2,3,4 once more > > So now i have 2 backup directories. > > Now i created recovery.conf und

Re: [GENERAL] pg_receivexlog 9.2 client working with 9.1 server?

2013-06-25 Thread Dan Birken
Update: I have successfully used this configuration with a month's worth of WALs (tens of thousands), run a test restore, and everything appears to have worked as expected. So at least based on that test, this configuration seems fine. -Dan On Fri, May 24, 2013 at 4:42 PM, Dan Birken wrote: >

[GENERAL] LDAP referrals

2013-06-25 Thread James Sewell
Hello All, Is there a way to disable chasing LDAP referrals in PostgreSQL? Take the following LDAP config options from pg_hba.conf ldapserver=server.org.com ldapbinddn="cn=bindUser,cn=users,dc=core,dc=dir,dc=org,dc=com" ldapbindpasswd="bindPass" ldapbasedn="dc=core,dc=dir,dc=org,dc=com" ldapsear

Re: [GENERAL] utf8 errors

2013-06-25 Thread Pavel Stehule
2013/6/25 Jiří Pavlovský : > On 25.6.2013 21:39, Pavel Stehule wrote: >> Hello >> >> in this mailing list is not high traffic, >> >> please try to ask on postgresql general mailing list >> >> http://www.postgresql.org/list/pgsql-general/ >> >> or >> >> Czech google groups >> https://groups.google.

Re: [GENERAL] utf8 errors

2013-06-25 Thread Jiří Pavlovský
On 25.6.2013 21:39, Pavel Stehule wrote: > Hello > > in this mailing list is not high traffic, > > please try to ask on postgresql general mailing list > > http://www.postgresql.org/list/pgsql-general/ > > or > > Czech google groups > https://groups.google.com/forum/?hl=cs#!forum/postgresql-cz > >

Re: [GENERAL] utf8 errors

2013-06-25 Thread Pavel Stehule
Hello in this mailing list is not high traffic, please try to ask on postgresql general mailing list http://www.postgresql.org/list/pgsql-general/ or Czech google groups https://groups.google.com/forum/?hl=cs#!forum/postgresql-cz 2013/6/25 Jiří Pavlovský : > Hello, > > I have a win32 applicat

Re: [GENERAL] utf8 errors

2013-06-25 Thread Adrian Klaver
On 06/25/2013 12:18 PM, Jiří Pavlovský wrote: Hello, I have a win32 application. It uses gtk for GUI and postgres. Recently I upgraded to newer gtk and postgres 9.2. I'm now getting utf8 errors from postgres. The thing I don't understand that the queries, which postgres complains about, seem to

[GENERAL] utf8 errors

2013-06-25 Thread Jiří Pavlovský
Hello, I have a win32 application. It uses gtk for GUI and postgres. Recently I upgraded to newer gtk and postgres 9.2. I'm now getting utf8 errors from postgres. The thing I don't understand that the queries, which postgres complains about, seem to be perfectly valid. For example LOG: statemen

Re: [GENERAL] Data Minning and analisys tool for Postgres?

2013-06-25 Thread kathyn
i need to do clustering, association rules and classification... i tried with weka and rapidminer but i need "true" relational dm tool -- View this message in context: http://postgresql.1045698.n5.nabble.com/Data-Minning-and-analisys-tool-for-Postgres-tp5760818p5760963.html Sent from the Pos

Re: [GENERAL] autovacuum: found orphan temp table

2013-06-25 Thread Raghavendra
On Tue, Jun 25, 2013 at 6:43 PM, Nicolau Roca wrote: > Hi, > after a server crash the following messages appear in the log file every > minute: > > 2013-06-25 15:02:15 CEST [::18264:1:] LOG: autovacuum: found orphan temp > table "pg_temp_47"."est_backup_ids_temp" in database "estudis1314" > 2

Re: [GENERAL] autovacuum: found orphan temp table

2013-06-25 Thread Bosco Rama
On 06/25/13 06:13, Nicolau Roca wrote: > > 2013-06-25 15:02:15 CEST [::18264:1:] LOG: autovacuum: found orphan > temp table "pg_temp_47"."est_backup_ids_temp" in database "estudis1314" > 2013-06-25 15:02:15 CEST [::18264:2:] LOG: autovacuum: found orphan > temp table "pg_temp_47"."est_backup_f

Re: [GENERAL] Data Minning and analisys tool for Postgres?

2013-06-25 Thread Atri Sharma
On Tue, Jun 25, 2013 at 10:46 AM, kathyn wrote: > Hello, > > I am researching about a Data Minning and analisys tool for Postgres (or > even Mysql). > > Do you know any tool for relational data mining? > What exactly are your goals here exactly? If there is a specific goal you are trying to achi

[GENERAL] autovacuum: found orphan temp table

2013-06-25 Thread Nicolau Roca
Hi, after a server crash the following messages appear in the log file every minute: 2013-06-25 15:02:15 CEST [::18264:1:] LOG: autovacuum: found orphan temp table "pg_temp_47"."est_backup_ids_temp" in database "estudis1314" 2013-06-25 15:02:15 CEST [::18264:2:] LOG: autovacuum: found orphan

[GENERAL] Data Minning and analisys tool for Postgres?

2013-06-25 Thread kathyn
Hello, I am researching about a Data Minning and analisys tool for Postgres (or even Mysql). Do you know any tool for relational data mining? Regards. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Data-Minning-and-analisys-tool-for-Postgres-tp5760818.html Sent fr

Re: [GENERAL] Archiving and recovering pg_stat_tmp

2013-06-25 Thread Amit Langote
On Tue, Jun 25, 2013 at 11:32 PM, Sameer Thakur wrote: >>>But, if you do PITR using the same directory (which I haven't), I >>>think you would need to somehow replace the stats with the ones you >>>want, may be from your backup of the same (that is, of >>>pg_stat/*.stat), though I am not sure if t

Re: [GENERAL] [HACKERS] Frontend/backend protocol improvements proposal (request).

2013-06-25 Thread Dmitriy Igrishin
2013/6/25 Albe Laurenz > Dmitriy Igrishin wrote: > While developing a C++ client library for Postgres I felt lack of > extra > information in command tags in the CommandComplete (B) message [...] > > >>> It seems like bad design to me to keep a list of prepared statements > >>> on the c

Re: [GENERAL] PostgreSQL 9.1.10 release date?

2013-06-25 Thread Bruce Momjian
On Fri, Jun 21, 2013 at 11:58:27AM -0700, hartrc wrote: > I was wondering what is the expected release data for the next PostgreSQL > patch - presumably 9.1.10? Although there is no documentation stating > release timeframes I'd become accustomed to them being released in the first > week of the mo

Re: [GENERAL] Archiving and recovering pg_stat_tmp

2013-06-25 Thread Sameer Thakur
>>But, if you do PITR using the same directory (which I haven't), I >>think you would need to somehow replace the stats with the ones you >>want, may be from your backup of the same (that is, of >>pg_stat/*.stat), though I am not sure if that would be correct. I >>doubt if WAL replay (as in a consi

Re: [GENERAL] .pgpass being ignored

2013-06-25 Thread Magnus Hagander
On Sat, Jun 22, 2013 at 12:19 AM, Stephen Rasku wrote: > I am trying to write a script that will create and populate a > database. I don't want to enter a password every time so I want to > use a .pgpass file. It has the correct permissions: > > $ ls -l $PGPASSFILE > -rw--- 1 Stephe

Re: [GENERAL] greatest cannot be used as sfunc for CREATE AGGREGATE

2013-06-25 Thread Pavel Stehule
Hello GREATEST and LEAST are SQL functions, but it is not internal functions listed in pg_proc table due different implementation. It is much more similar to CASE statement than function although syntax is same. for your purpose, you should to create SQL function wrapper of this construct - then

Re: [GENERAL] pgloader error : permission denied to set parameter "lc_messages"

2013-06-25 Thread Adrian Klaver
On 06/25/2013 12:05 AM, ascot.m...@gmail.com wrote: Hi, I am trying to load CSV files into postgresql via pgloader, it returned the following error, any suggestions to fix it? I have a line "lc_messages = C" in my pgloader.conf, would this line cause the problem? Assuming you are not runnin

Re: [GENERAL] .pgpass being ignored

2013-06-25 Thread Adrian Klaver
On 06/24/2013 11:36 PM, Frank Broniewski wrote: However, when I call createdb, it fails: $ createdb -h 192.168.1.4 -U postgres --no-password JobSearch createdb: could not connect to database postgres: fe_sendauth: no password supplied Hi,

[GENERAL] PostgreSQL 9.3 pg_dump issue

2013-06-25 Thread dinesh kumar
Hi All, Greetings for the day. Recently, I have installed the PostgreSQL 9.3 on my local ubuntu machine for testing the new features in PG 9.3. I have created few test tables as well. Now, I am trying to take the dump from the 9.3 binaries and getting the below error. postgres@test-ubuntu:/opt/P

[GENERAL] greatest cannot be used as sfunc for CREATE AGGREGATE

2013-06-25 Thread Ryan Kelly
In trying to learn about aggregates, I came across this seemingly odd behavior: (postgres@[local]:5435 08:27:42) [postgres]> CREATE AGGREGATE example_max (TEXT) (SFUNC = greatest, STYPE = TEXT); ERROR: syntax error at or near "greatest" LINE 1: CREATE AGGREGATE example_max (TEXT) (SFUNC = greate

[GENERAL] Debian Weezy PGDG CD/DVD iso image

2013-06-25 Thread Daniel Cristian Cruz
Hello, I'm trying to find a description file to build a DVD with all PostgreSQL software for one architecture. I would like to carry it, with the Debian set, since I'm always downloading it from Internet, and sometimes it's boring to wait. Does someone already build a jigdo file for this? Would

Re: [GENERAL] Tow kinds of different result while using create index concurrently

2013-06-25 Thread 高健
Hello: When I traced the source code of PG more deeply. I can find the following: VirtualTransactionId * GetCurrentVirtualXIDs(TransactionId limitXmin, bool excludeXmin0, bool allDbs, int excludeVacuum, int *nvxids) { …… for (index =

Re: [GENERAL] In memory Database for postgres

2013-06-25 Thread Xiaobogu
Hi, where did you put your WAL? -- View this message in context: http://postgresql.1045698.n5.nabble.com/In-memory-Database-for-postgres-tp1917268p5760845.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general@postgre

[GENERAL] Re: [HACKERS] Frontend/backend protocol improvements proposal (request).

2013-06-25 Thread Albe Laurenz
Dmitriy Igrishin wrote: While developing a C++ client library for Postgres I felt lack of extra information in command tags in the CommandComplete (B) message [...] >>> It seems like bad design to me to keep a list of prepared statements >>> on the client side when it is already kept on

[GENERAL] pgloader error : permission denied to set parameter "lc_messages"

2013-06-25 Thread ascot.m...@gmail.com
Hi, I am trying to load CSV files into postgresql via pgloader, it returned the following error, any suggestions to fix it? I have a line "lc_messages = C" in my pgloader.conf, would this line cause the problem? regards pgloader ERRORpermission denied to set parameter "lc_messages" p