Re: [GENERAL] How to find out unused indexes?

2013-09-02 Thread Raghavendra
On Tue, Sep 3, 2013 at 11:36 AM, ascot.m...@gmail.com wrote: > Hi, > > Can you please advise how to find out all unused indexes in PG? > > regards > Below wiki link should help; under "Unused Index" section: http://wiki.postgresql.org/wiki/Index_Maintenance --- Regards, Raghavendra EnterpriseDB

[GENERAL] How to find out unused indexes?

2013-09-02 Thread ascot.m...@gmail.com
Hi, Can you please advise how to find out all unused indexes in PG? regards -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] A QUESTION ABOUT evaluation of two-dimensional Associative Arrays

2013-09-02 Thread BladeOfLight16
On Tue, Aug 27, 2013 at 9:24 AM, superzhangfei wrote: > When the package be excused,an error occured. > Hello. First, can you reproduce the error without the PACKAGE? As in just CREATE TYPE and CREATE PROCEDURE statements? If so, what are the errors? And I think you mean "executed" instead of "e

Re: [GENERAL] ALTER TABLE transaction isolation problem

2013-09-02 Thread David Johnston
DT wrote > Hi, > > I'm reading code of ALTER TABLE, and I found when target table needs > rewrite, tuple inserted into new heap uses current transaction's xid as > xmin. Does this behavior satisfy serializable isolation? I wrote some test > cases: > CREATE TABLE t1(a INT);CREATE TABLE t2(a INT);

Re: [GENERAL] Stored Procedure table/column args

2013-09-02 Thread Bret Stern
On Mon, 2013-09-02 at 18:20 -0700, Adrian Klaver wrote: > On 09/02/2013 06:06 PM, Bret Stern wrote: > > 'psuedo > > > > Can you create stored procedures that are built from parameters as > > below, or does this defeat the pre-compiled purpose of an SP? > > > > create function item_exists (tbl chara

Re: [GENERAL] Stored Procedure table/column args

2013-09-02 Thread Adrian Klaver
On 09/02/2013 06:06 PM, Bret Stern wrote: 'psuedo Can you create stored procedures that are built from parameters as below, or does this defeat the pre-compiled purpose of an SP? create function item_exists (tbl character varying, col character varying, col_val character varying) DECLARE x i

[GENERAL] Stored Procedure table/column args

2013-09-02 Thread Bret Stern
'psuedo Can you create stored procedures that are built from parameters as below, or does this defeat the pre-compiled purpose of an SP? create function item_exists (tbl character varying, col character varying, col_val character varying) DECLARE x integer; PERFORM col FROM tbl WHERE co

Re: [GENERAL] My Experiment of PG crash when dealing with huge amount of data

2013-09-02 Thread 高健
Thanks, I'll consider it carefully. Best Regards 2013/9/3 Jeff Janes > On Sun, Sep 1, 2013 at 6:25 PM, 高健 wrote: > >>To spare memory, you would want to use something like: > > > >>insert into test01 select generate_series, > >>repeat(chr(int4(random()*26)+65),1024) from > >>generate_series(1,2

Re: [GENERAL] My Experiment of PG crash when dealing with huge amount of data

2013-09-02 Thread Jeff Janes
On Sun, Sep 1, 2013 at 6:25 PM, 高健 wrote: >>To spare memory, you would want to use something like: > >>insert into test01 select generate_series, >>repeat(chr(int4(random()*26)+65),1024) from >>generate_series(1,2457600); > > Thanks a lot! > > What I am worrying about is that: > If data grows rapi

Re: [GENERAL] psql --command option ignores --variable's

2013-09-02 Thread Tim Kane
Ahh, ok. It is documented. I'll get back in my box :) On 02/09/2013 16:04, "Adrian Klaver" wrote: >On 09/02/2013 07:54 AM, Tim Kane wrote: >> Hi all, >> >> It seems the behaviour of the ‹command / -c option is such that it will >> ignore any variables set on the command-line. >> >> >> :~ psql

Re: [GENERAL] STABLE marker on functions with single select

2013-09-02 Thread David Johnston
Laszlo Hornyak-3 wrote > hi, > > We have some plpgsql functions that return a setof rows from some tables > by a single query, they are quite simple. Only the application invokes > these functions to query the database, one at a time. e.g. select > getFooById(1) > Do I correctly assume that markin

[GENERAL] STABLE marker on functions with single select

2013-09-02 Thread Laszlo Hornyak
hi, We have some plpgsql functions that return a setof rows from some tables by a single query, they are quite simple. Only the application invokes these functions to query the database, one at a time. e.g. select getFooById(1) Do I correctly assume that marking the functions as STABLE will not

Re: [GENERAL] psql --command option ignores --variable's

2013-09-02 Thread Adrian Klaver
On 09/02/2013 07:54 AM, Tim Kane wrote: Hi all, It seems the behaviour of the —command / -c option is such that it will ignore any variables set on the command-line. :~ psql --variable TESTVAR='123' --command 'select :TESTVAR;' ERROR: syntax error at or near ":" LINE 1: select :TESTVAR;

Re: [GENERAL] psql --command option ignores --variable's

2013-09-02 Thread Tom Lane
Tim Kane writes: > It seems the behaviour of the --command / -c option is such that it will > ignore any variables set on the command-line. If memory serves, the string given to -c is just fired off to the server as-is. It's not broken into separate commands, and I think we don't do substitution

[GENERAL] psql --command option ignores --variable's

2013-09-02 Thread Tim Kane
Hi all, It seems the behaviour of the ‹command / -c option is such that it will ignore any variables set on the command-line. :~ psql --variable TESTVAR='123' --command 'select :TESTVAR;' ERROR: syntax error at or near ":" LINE 1: select :TESTVAR; ^ :~$ psql --variable TESTVAR='

[GENERAL] ALTER TABLE transaction isolation problem

2013-09-02 Thread DT
Hi, I'm reading code of ALTER TABLE, and I found when target table needs rewrite, tuple inserted into new heap uses current transaction's xid as xmin. Does this behavior satisfy serializable isolation? I wrote some test cases: CREATE TABLE t1(a INT);CREATE TABLE t2(a INT);INSERT INTO t1 VALUES

Re: [GENERAL] SSI and predicate locks - a non-trivial use case

2013-09-02 Thread Gianni Ceccarelli
On 2013-08-31 Kevin Grittner wrote: > Of course, the subject line gives me some pause -- I'm aware of many > uses of SSI in non-trivial production environments, including > multi-terrabyte databases with thousands of concurrent users. In > some cases the performance hit compared to REPEATABLE READ

Re: [GENERAL] store multiple rows with the SELECT INTO statement

2013-09-02 Thread Pavel Stehule
Hello PostgreSQL doesn't support a table variables, but you can use a arrays. postgres=# create table foo2(a int, b int); CREATE TABLE postgres=# insert into foo2 select i, i+1 from generate_series(1,4) g(i); INSERT 0 4 postgres=# select * from foo2; a | b ---+--- 1 | 2 2 | 3 3 | 4 4 | 5 (4