[GENERAL] Optimize sort before groupping

2012-02-16 Thread pasman pasmański
Hi. Sometimes order of rows readed from index allows to skip sort node. But sometimes planner don't deduce it. In example below order from index "NumerStacji_NumerKierunkowy_KodBłędu_LP" is preserved in merge join and can be used in groupping node, but planner don't see it. First query and explai

Re: [GENERAL] Extensions btree_gist and cube collide?

2012-01-31 Thread pasman pasmański
Hi. I recreate database and a problem disapears. Thanks. pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Extensions btree_gist and cube collide?

2012-01-30 Thread pasman pasmański
Hi. When i add extensions: cube and btree_gist. First extension installs, but second not. There is a (spelled) error message: ERROR: operator 6(oid,oid) already exists in operator's family gist_oid_ops I try to install it in other schema, but i don't know how to use it. -- pasman

[GENERAL] I cant create excluding constaint

2012-01-24 Thread pasman pasmański
Hi. I have a table with two columns: create table "GroupsOfOrders" ( "Orders" text[]; -- a set of identifiers "Period" cube; -- a period of time for all identifiers in field "Orders" ); How to create excluding constraint, which prevent overlapping "Period" for all orders in a field "Orders"

[GENERAL] Feature request: pgsql's CASE...WHEN optimization

2012-01-20 Thread pasman pasmański
Hi. I think that in specific statement with many constants: CASE x WHEN const1 THEN action1 WHEN const2 THEN action2 WHEN const3 THEN action3 WHEN const4 THEN action4 END CASE; constants may be sorted at compile time, and when executed , it will be possible internally to use fast search:

Re: [GENERAL] Pgsql problem

2012-01-17 Thread pasman pasmański
Thanks. Hstore works perfectly. pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Pgsql problem

2012-01-12 Thread pasman pasmański
Hi. I write function in pgsql. This function needs to execute other functions by name. I do it using loop: declare r record; begin for r in execute 'select ' || $1 || '()' loop end loop; But I can't convert a record to array of text. How to do it ? pasman -- Sent via pgsql-g

[GENERAL] How to display the progress of query

2011-11-24 Thread pasman pasmański
Hi. I try to monitor a progress of the insert statement: insert into table1 (id,other fields) select id+0*nextval('public.progress'),other fields >From second session i run: select nextval('public.progress'); but sequence 'progress' looks unchanged. How to display number of processed rows

Re: [GENERAL] strange behavior, hoping for an explanation

2011-11-10 Thread pasman pasmański
See documentation, chapter Viii.E.2.2.2 2011/11/11, Chris Travers : > Hi; > > I have found recently that tables in certain contexts seem to have a > name pseudocolumn. I was wondering if there is any documentation as > to what this is and what it signifies. > > postgres=# CREATE table TEST2 (a te

Re: [GENERAL] Www emulator

2011-11-07 Thread pasman pasmański
>> On 07/11/2011 20:13, pasman pasmański wrote: >>> Hi. >>> >>> Is any application, which works as www server on client's side, and >>> loads pages from postgresql database? (free or commercial) >>> >> >> Many. Depends on what you

[GENERAL] Www emulator

2011-11-07 Thread pasman pasmański
Hi. Is any application, which works as www server on client's side, and loads pages from postgresql database? (free or commercial) -- pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpr

[GENERAL] pgAgent and encoding

2011-10-27 Thread pasman pasmański
Hi. I can't set proper encoding for pgAgent. I have two databases: postgres and www. postgres is encoded in UTF8, www is encoded in WIN1250. When i run pgAgent's task in www database, it fail (message char cant be converted to UTF8): 2011-10-27 14:50:29 CEST [nieznany] 1.COPY BŁĄD: k

[GENERAL] Problem with odbc_fdw

2011-10-16 Thread pasman pasmański
Hi. I can't compile odbc_fdw module: make: Entering directory `/e/pg91/postgres/contrib/odbc_fdw' dllwrap -o odbc_fdw.dll --dllname odbc_fdw.dll --def libodbc_fdwdll.def odbc_fd w.o -L../../src/port -Wl,--allow-multiple-definition -Wl,--as-needed -lodbc - L../../src/backend -lpostgres c:/min

Re: [GENERAL] Bulk processing & deletion

2011-10-13 Thread pasman pasmański
Unlogged tables can't be temporary. 2011/10/13, Ivan Voras : > On 13/10/2011 14:34, Alban Hertroys wrote: > >>> Any other ideas? >> >> CREATE TABLE to_delete ( >> job_created timestamp NOT NULL DEFAULT now(), >> fk_id int NOT NULL >> ); >> >> -- Mark for deletion >> INSERT INTO to_delete (fk_i

Re: [GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread pasman pasmański
This beaviour is normal. Bitmap index scan is faster than index scan. 2011/10/8, hubert depesz lubaczewski : > hi > did: > create table test as select i as id, i || ' ' || repeat('depesz', 100) as z > from generate_series(1,3000) i; > create index q on test (id); > vacuum verbose analyze test;

Re: [GENERAL] Restoring 2 Tables From All Databases Backup

2011-10-05 Thread pasman pasmański
You should to create new database with two empty tables, set access rights for all schemas readonly and pipe backup to this database. 2011/10/5, Dickson S. Guedes : > 2011/10/5 Adarsh Sharma : >> About 1 month ago, I take a complete databases backup of my Database >> server >> through pg_dumpall c

Re: [GENERAL] Hash index not being updated

2011-10-05 Thread pasman pasmański
Hi. Right direction is to use btree index. Hash indexes are sensitive to power failures. 2011/10/5, Justin Naifeh : > In Postgres 8.4, I have a table called java_types with two columns, > package_name and class_name. There is another table called java_objects > that defines a column called type

Re: [GENERAL] How to find freak UTF-8 character?

2011-10-02 Thread pasman pasmański
Its simple to remove strange chars with regex_replace. 2011/10/1, Leif Biberg Kristensen : > On Saturday 1. October 2011 21.29.45 Andrew Sullivan wrote: >> I see you found it, but note that it's _not_ a spurious UTF-8 >> character: it's a right-to-left mark, ans is a perfectly ok UTF-8 code >> po

Re: [GENERAL] how to improve this similarity query?

2011-09-30 Thread pasman pasmański
Look at doc chapter II.12 2011/9/30, haman...@t-online.de : > Hi, > > I have a table of names, and searches are usually performed on prefix match. > This could nicely translate into an index search > Suppose first name is stored as either 'Jim' or 'Jimmy', searching > ... where firstname ~* '^jim'

Re: [GENERAL] New feature: accumulative functions.

2011-09-27 Thread pasman pasmański
Thanks Marti for inspiration :). Monotonic functions allows to skip some sorts in window expressions containing them: select winfun1(...) over(order by x), winfun2(...) over(order by f(x)) from ... 2011/9/27, pasman pasmański : > Yes, accumulative functions may be used for sorting,groupp

Re: [GENERAL] New feature: accumulative functions.

2011-09-27 Thread pasman pasmański
Yes, accumulative functions may be used for sorting,groupping and merge joins with limit. Groupping looks simplest to implement, and comparable to performance of functional index . 2011/9/27, Marti Raudsepp : > 2011/9/25 pasman pasmański : >> My english is not perfect, by accumulativ

Re: [GENERAL] New feature: accumulative functions.

2011-09-25 Thread pasman pasmański
I write small summary. Feature details: additional flags for monotonical functions. Learn planner to use them. New node in execution plan - functional index scan. Pro: single btree index may be used in many expressions containing only monotonnical functions. Contra: big developement effort. No n

Re: [GENERAL] New feature: accumulative functions.

2011-09-25 Thread pasman pasmański
For single argument strict increasing function f(x), estimation is simple: it is f(estimation of x). 2011/9/25, Pavel Stehule : > 2011/9/25 pasman pasmański : >> See that setting flag on function need less work than create new gist >> operator. Of course if postgresql's develo

Re: [GENERAL] New feature: accumulative functions.

2011-09-25 Thread pasman pasmański
Yes, i wrote this for pleasure and discusion, not for solve a real problem :). 2011/9/25, Tom Lane : > =?ISO-8859-2?Q?pasman_pasma=F1ski?= writes: >> I found second use case. Look at expression: >> where left(str,n)='value' > >> function left(str,n) increase monotonically for str and n. With this

Re: [GENERAL] New feature: accumulative functions.

2011-09-25 Thread pasman pasmański
See that setting flag on function need less work than create new gist operator. Of course if postgresql's developers do biggest work before. 2011/9/25, Pavel Stehule : > 2011/9/25 pasman pasmański : >> I found second use case. Look at expression: >> >> where left(str

Re: [GENERAL] New feature: accumulative functions.

2011-09-25 Thread pasman pasmański
This feature give profits for increasing muliti-arg functions. Example: WHERE f(x,param) = const it may be impossible to create functional indexes for all params. 2011/9/25, Pavel Stehule : > Hello > > what is a real use case? > > Regards > > Pavel > > 2011/9/

Re: [GENERAL] New feature: accumulative functions.

2011-09-25 Thread pasman pasmański
t; > Regards > > Pavel > > 2011/9/25 pasman pasmański : >> My english is not perfect, by accumulative i think about monotonically >> increasing function. >> >> It works that for clause WHERE f(x)=const: >> 1. Read root page of index_on_x and get x1 ... Xn &g

Re: [GENERAL] New feature: accumulative functions.

2011-09-25 Thread pasman pasmański
... When n changes of course. Sorry for top posting, phone not allows to move cite. 2011/9/25, pasman pasmański : > I found second use case. Look at expression: > > where left(str,n)='value' > > function left(str,n) increase monotonically for str and n. With this >

Re: [GENERAL] New feature: accumulative functions.

2011-09-25 Thread pasman pasmański
I think, it should be new node in executor. Planner select classic index scan or new functional index scan. 2011/9/25, Tom Lane : > =?ISO-8859-2?Q?pasman_pasma=F1ski?= writes: >> My english is not perfect, by accumulative i think about monotonically >> increasing function. > > Oh, I see how that

Re: [GENERAL] New feature: accumulative functions.

2011-09-25 Thread pasman pasmański
My english is not perfect, by accumulative i think about monotonically increasing function. It works that for clause WHERE f(x)=const: 1. Read root page of index_on_x and get x1 ... Xn 2. Calculate f(x1) ... f(xn) for this page 3. When f(x1)<=const<= f(xn) then x1 <= searched x <= xn and we can te

[GENERAL] New feature: accumulative functions.

2011-09-25 Thread pasman pasmański
Hi. I propose to add "accumulative" flag to a function definition. This flag would be set for function f(x) which is accumulative and immutable. This flag allows to use an index on x for clauses containing f(x): where f(x) = const where f(x) > const and so on. -- pasman -- S

Re: [GENERAL] how just install psql on windows?

2011-09-22 Thread pasman pasmański
You can install pgadmin, it contain s psql. 2011/9/22, Andreas : > Hi, > > can I just install psql on windows? > Just the client without the server. > There ist the server release as zip-file that includes psql so I at > least hadn't had to actually install a service with a db cluster but > having

[GENERAL] Pgadmin and foreign tables

2011-09-19 Thread pasman pasmański
Hi. In 9.1 is cool feature - foreign tables. But when create foreign table in pgadmin (file_fdw wrapper), strings in the OPTIONS section ignore setting standard_conforming_strings=on. I don't know if it is a bug in postgres or pgadmin. -- pasman -- Sent via pgsql-general mailing l

[GENERAL] New feature in file_fdw

2011-09-18 Thread pasman pasmański
Hi. I propose that some options for foreign tables may be stored as defaults in server object: format, encoding, delimiter, quote. -- pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpre

Re: [GENERAL] How to get Transaction Timestamp ?

2011-09-17 Thread pasman pasmański
Trigger may store timestamp to other table "timestamps". You join then xmin with xmin from this table to access timestamp. 2011/9/17, Raghavendra : > Thank you for your valuable inputs. > > Agreed, with the help of two workarounds we can pull the trx-timestamp one > with additional-column/trigger

Re: [GENERAL] Bit datatype performance?

2011-09-14 Thread pasman pasmański
Other option is use an array of int2 instead of bit(256). It can be indexed. 2011/9/14, Radosław Smogura : > On Wed, 14 Sep 2011 12:00:35 +0200, Antonio Vieiro wrote: >> Hi all, >> >> One of my entities 'E' may be 'tagged' with an arbitrary set of 256 >> tags 'T'. >> >> A first approach coul

Re: [GENERAL] Stability of 9.1.0

2011-09-14 Thread pasman pasmański
I think that using any function in plperlu language stops the server. Perl version is 5.14 from activestate. 2011/9/14, pasman pasmański : > Hi. > > I install postgresql 9.1.0 version Win32 from enterprisedb (WinXp+sp3). > Every about 0,5 - 6 hours server stops. > Whats going on

[GENERAL] Stability of 9.1.0

2011-09-14 Thread pasman pasmański
Hi. I install postgresql 9.1.0 version Win32 from enterprisedb (WinXp+sp3). Every about 0,5 - 6 hours server stops. Whats going on ?? Below a example log file: 2011-09-14 08:49:37 CEST FATAL: the database system is starting up 2011-09-14 08:49:38 CEST LOG: checkpoint complete: wrote 2179 buff

Re: [GENERAL] Compatibility 9.1rc and 9.1.0

2011-09-12 Thread pasman pasmański
Thank you. Have a nice day :) 2011/9/13, Tom Lane : > =?ISO-8859-2?Q?pasman_pasma=F1ski?= writes: >> I have the cluster created under 9.1rc version. When i do upgrade to >> 9.1.0, i can only reinstall binaries or i should import data too? > > Should work to just update the binaries. > >

[GENERAL] Compatibility 9.1rc and 9.1.0

2011-09-12 Thread pasman pasmański
Hi. I have the cluster created under 9.1rc version. When i do upgrade to 9.1.0, i can only reinstall binaries or i should import data too? -- pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [GENERAL] Index Corruption

2011-09-12 Thread pasman pasmański
Hi. Do you have triggers on corrupted tables? 2011/9/12, Dylan Adams : > We moved to PostgreSQL about 2 years ago and have been very happy with it > overall. The only major issue that we've had is intermittent index > corruption. > This manifests itself as either "duplicate key value violates uniq

Re: [GENERAL] feature request - update nowait

2011-09-08 Thread pasman pasmański
Try a command LOCK NOWAIT 2011/9/8, Eduardo Piombino : > Hi, would it be possible to implement a *nowait *modifier to the > *update*statement in order to tell it not to wait and raise an error > -just like a > select for update nowait would-, instead of defaulting to waiting forever > until the lo

Re: [GENERAL] Which perl works with pg9.1

2011-09-06 Thread pasman pasmański
>> The win32 packages require whatever version of Perl they were built >> against, AFAIK. Perl DLLs are only binary compatible within a major >> version, and I think the DLL naming changes too. >> Looks like 9.1 binaries are linked with perl 5.14. Thanks for answers pasman -- Sent via pgsql-g

[GENERAL] Which perl works with pg9.1

2011-09-06 Thread pasman pasmański
Hi. I have installed activeperl 5.10. It works with pg8.4, but not with 9.1rc1 (win32 installer). Do this version need perl 5.12? -- pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [GENERAL] UPDATE using query; per-row function calling problem

2011-09-02 Thread pasman pasmański
That's interpretation of subselect is ok, when it contains only stable functions. Maybe add a warning when subselect contains volatile function. 2011/9/2, Rory Campbell-Lange : > On 02/09/11, Tom Lane (t...@sss.pgh.pa.us) wrote: >> Rory Campbell-Lange writes: >> > I'm doing an UPDATE something l

Re: [GENERAL] Backups and binary mode

2011-08-29 Thread pasman pasmański
> Simple benchmark show that COPY BINARY is 8 times faster > than COPY CSV on my desktop. > > I retry benchmark, and differences are small. pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/

[GENERAL] Backups and binary mode

2011-08-29 Thread pasman pasmański
Hi. Is this possible to force pg_dump to make backups using COPY ... BINARY ? Simple benchmark show that COPY BINARY is 8 times faster than COPY CSV on my desktop. Postgresql 8.4.8 , WinXp sp3 pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make ch

Re: [GENERAL] Feature request: per user connections limit

2011-08-28 Thread pasman pasmański
Thanks, i'll try it tomorrow -- 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] Problem importing a csv file

2011-08-27 Thread pasman pasmański
What if you run this query using psql? -- pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Feature request: per user connections limit

2011-08-27 Thread pasman pasmański
Hi. Is this possible to limit number of connections for given user/role? Postgres 8.4.8. -- pasman -- 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] Array syntax in the copier

2011-08-27 Thread pasman pasmański
Do you tried "," ? -- pasman -- 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] Need help with dropping a view please

2011-08-26 Thread pasman pasmański
Hi. Maybe last bugfix helps you. -- pasman -- 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] documentation for hashtext?

2011-08-26 Thread pasman pasmański
The better solution is you write own hashing function. -- pasman -- 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] COPY FROM how long should take ?

2011-08-26 Thread pasman pasmański
You can add a trigger and send message every 10 rows -- pasman -- 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] array_agg problem

2011-08-19 Thread pasman pasmański
Array_agg is not implemented for arrays. -- pasman -- 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] Problem with planner

2011-08-08 Thread pasman pasmański
Try to change index: objects_endings_tsz_active(state,endings_tsz) where state='active'. 2011/8/8, hubert depesz lubaczewski : > Hi, > we have 8.3.11 installation on client site, with table, which looks like > this: > > $ \d objects > Table "public.obj

Re: [GENERAL] Query with rightmost function does not use index

2011-08-07 Thread pasman pasmański
Here may be other problem. Show us the result of EXPLAIN Analyze. 2011/8/8, Pavel Stehule : > Hello > > use a functional index > > http://www.postgresql.org/docs/8.4/interactive/indexes-expressional.html > > Regards > > Pavel Stehule > > 2011/8/8 - - : >> For a table where column col has an index,

Re: [GENERAL] New feature: cached foreign keys

2011-07-09 Thread pasman pasmański
Reality is crude, seems than this idea is not as good as i think :( Thanks for answer. 2011/7/9, Craig Ringer : > On 9/07/2011 3:06 PM, pasman pasmański wrote: >> Hi. >> >> Today i have an idea for increase performance of foreign keys. After >> search parent record,

[GENERAL] New feature: cached foreign keys

2011-07-09 Thread pasman pasmański
Hi. Today i have an idea for increase performance of foreign keys. After search parent record, store ctid in shared memory. Subsequent searches look first to the record at stored ctid, and when it is deleted do regular search using index. Pro: faster searching for common keys when parent table is

Re: [GENERAL] plpgsql function with update and seeing changed data from outside during run

2011-06-09 Thread pasman pasmański
If you rewrite your function in plperlu , you can store data in shared memory. 2011/6/9, Clemens Schwaighofer : > Hi, > > I have a plpgsql function where I read data from a table in a loop and > update data in a different table. > > Is it possible to see the updated data from a different access du

Re: [GENERAL] Cannot reproduce why a query is slow

2011-05-06 Thread pasman pasmański
Try auto_explain module. 2011/5/5, John Cheng : > Hi, > We have certain types of query that seems to take about 900ms to run > according to postgres logs. When I try to run the same query via > command line with "EXPLAIN ANALYZE", the query finishes very quickly. > What should I do to try to learn

Re: [GENERAL] Short-circuit boolean evaluation

2011-04-30 Thread pasman pasmański
No. 2011/4/30, Jon Smark : > Hi, > > Does Postgresql perform short-circuit boolean evaluation both in SQL > and PL/pgSQL functions? As an example, suppose I have a function called > "do_stuff" which is computationally intensive. In the example below, > will it be called for rows for which the fi

[GENERAL] New feature: skip row locks when table is locked.

2011-04-27 Thread pasman pasmański
Hi. Yesterday i have an idea, that sometimes row locks may be skipped, when table is already locked with LOCK command. It may to reduce an overhead from row locks. What do you think about it? -- pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make ch

Re: [GENERAL] Using column aliasses in the same query

2011-04-17 Thread pasman pasmański
Maybe you think about WITH queries? 2011/4/17, Robert J.C. Ivens : > > On 17 apr 2011, at 13:21, Leif Biberg Kristensen wrote: > >> On Sunday 17 April 2011 13:01:45 Robert J.C. Ivens wrote: >>> Hi, >>> >>> I am not sure if there ever was a feature request for using defined >>> column >>> aliases i

[GENERAL] New feature: selectivity - new attribute in function

2011-04-16 Thread pasman pasmański
Hi. It is sometimes hard to tune complicated queries. Maybe add new attribute to functions returning boolean - selectivity, defining how big is percent of rows for which the function returns true. 2011/4/15, Edison So : > I have a DELL server running Windows server 2003 and Postgres 8.1. > > I use

Re: [GENERAL] Why security-definer functions are executable by public by default?

2011-04-06 Thread pasman pasmański
> was pointed to the fact that security definer functions have the same > default privileges as normal functions in the same language - i.e. if > the language is trusted - public has the right to execute them. > > maybe i'm missing something important, but given the fact that security > definer fun

Re: [GENERAL] Database "gnu make" equivalent

2011-04-05 Thread pasman pasmański
> > A perl script, perhaps? You would of course have to make a query to > determine that the specific row you are looking for is either null or > nonexistant, then send your additional queries. > > Yes, it is simplest. I try to do it pasman -- Sent via pgsql-general mailing list (

[GENERAL] Database "gnu make" equivalent

2011-04-05 Thread pasman pasmański
Hello. I search a tool to send queries to database when specific rows contain null or not exist. What can be used for this purpose ? pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mail

[GENERAL] Convert xmin to format used by txid_current

2011-04-01 Thread pasman pasmański
Hi. How to convet xmin field (32bit) to format used by txid_current (64bit) ? I use it to track updates in table. pasman -- 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] Out of memory

2011-03-26 Thread pasman pasmański
Hi. Your idea is cool - i think this feature ought to be added to TODO. Sorted rows should be materialized when memory is exhaused, and memory reused. 2011/3/26, Jeremy Palmer : > Hi Scott, > > It was the work_mem that was set too high. I reduced it to 32mb and the > function executed. > > Just so

Re: [GENERAL] help understanding explain output

2011-02-16 Thread pasman pasmański
> Naturally a boolean can only have two values, really? pasman -- 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] read and restore deleted record

2011-02-15 Thread pasman pasmański
You read the doc about archiving and pitr. 2011/2/15, Emi Lu : > >> Start from vacuum feature information from PGSQL helps documentation, it >> telling me that Postgresql didn’t delete data permanently when we >> execute delete command, it just made the data invalid. By following this >> email arc

[GENERAL] Logging planner estimates.

2011-02-14 Thread pasman pasmański
Hi. Is it possible to log plans which planner discard? I want to tune planner settings for some queries. -- pasman -- 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] partitioning and dynamic query creation

2011-02-12 Thread pasman pasmański
Try: execute ... using new.* 2011/2/10, Gerd Koenig : > Hello list, > > I'm currently thinking about a possibility to create a dynamic insert > statement inside a trigger function to put the data in the correct > partition. > What am I talking about ? > I want to put data dependant on a timestamp

Re: [GENERAL] Heavy queries not run by user application

2011-02-12 Thread pasman pasmański
2011/2/13, Ruben Blanco : > Hi: > > I'm running a Postgres database with a total disk occupation of 100Gb, > largest and most used table up to 40Gb (about 30.000.000 tuples). > > Overall performance degrades sometimes due to some queries that are not run > by the final user app. I guess they are ru

Re: [GENERAL] Multithreaded query onto 4 postgresql instances

2011-02-11 Thread pasman pasmański
I think this is bad idea. Better you use cursors. 2011/2/10, Alessandro Candini : > Here you are my probably uncommon situation. > > I have installed 4 different instances of postgresql-9.0.2 on the same > machine, on ports 5433, 5434, 5435, 5436. > On these instances I have splitted a huge databa

Re: [GENERAL] Permission denied error - best way to fix?

2011-02-08 Thread pasman pasmański
2011/2/8, Mike Christensen : > Here's the error: > > pg_dump: SQL command failed > pg_dump: Error message from server: ERROR: permission denied for > relation pantryitems > pg_dump: The command was: LOCK TABLE public.pantryitems IN ACCESS SHARE MODE > > Does the user need to be a superuser, or is

[GENERAL] Feature: vacuum page before write

2011-02-04 Thread pasman pasmański
Hi. I propose new feature. Before flushing page of table to disk it may be scanned to reclaim deleted rows. And assigned as partially vacuumed or vacuumed. It may reduce bloat in frequently updated tables and make normal (auto)vacuum faster. Additional scan adds overhead to cpu (for update/delete),

Re: [GENERAL] isn't "insert into where not exists" atomic?

2011-02-03 Thread pasman pasmański
Mage, add "raise notice" at the begin of your buggy trigger. -- 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] Tip: Transposing rows using generate_series()

2011-02-03 Thread pasman pasmański
Look at unnest function. -- 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] isn't "insert into where not exists" atomic?

2011-02-03 Thread pasman pasmański
Your trigger is wrong. You try to insert the same row twice. -- 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] Adding an "and is not null" on an indexed field slows the query down immensely.

2011-01-15 Thread pasman pasmański
I think this is a planner's bug. Can you send these explains to pgsql-bugs ? On 1/15/11, Tim Uckun wrote: > 2011/1/15 pasman pasmański : >> Try : >> order by index_delta+1 desc >> > > I have attached the explain analyze for that below why does this > retur

Re: [GENERAL] Adding an "and is not null" on an indexed field slows the query down immensely.

2011-01-15 Thread pasman pasmański
Try : order by index_delta+1 desc On 1/15/11, Tim Uckun wrote: > I have this query it runs reasonably quickly. > > > SELECT "consolidated_urls".* FROM "consolidated_urls" INNER JOIN > "topical_urls" > ON "consolidated_urls".id = "topical_urls".consolidated_url_id > WHERE (("topical_urls".domain

[GENERAL] Pl/perl and perl version-tip in doc

2011-01-06 Thread pasman pasmański
It is need tip in doc which version of perl must be installed. Error message tells nothing. For example Postgres 8.4 works only with perl 5.10. -- Sent from my mobile device pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscr

[GENERAL] Archive command and used size of wal

2011-01-05 Thread pasman pasmański
Hi. I propose new feature - allow archive command to copy part of not full filled wal segment. It need new parameter %b - number of bytes used in segment . Then one can use head or dd to archive wal and reduce network traffic to standby server. -- Sent from my mobile device pasman

Re: [GENERAL] Cursors WITH HOLD

2011-01-03 Thread pasman pasmański
Thanks for reply. I do some checking and some queries boost very well :) pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Cursors WITH HOLD

2010-12-30 Thread pasman pasmański
Hello. I use Postgres 8.4.5 via perl DBI. And i try to use cursors WITH HOLD to materialize often used queries. My question is how many cursors may be declared per session and which memory setting s to adjust for them ? regards. pasman -- Sent via pgsql-general mailing list (pgsq

Re: [GENERAL] Compress data sent to client

2010-12-25 Thread pasman pasmański
I read in doc that by default longer text fields are compressed. They may be sent to client without decompression - this reduce netword load. pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org

[GENERAL] Compress data sent to client

2010-12-24 Thread pasman pasmański
Hello. Is postgresql able to compress data sent to the client? -- Sent from my mobile device pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] [feature request] left/right join + limit optimization

2010-12-21 Thread pasman pasmański
hello. I think that left/right joins and limit may be optimized. When there aren't WHERE conditions this may be executed as below: Limit N Merge Left Join Sort Top N Bitmap Heap Scan ... Sort Bitmap Heap Scan ... pasman -- Sent via pgsql-general mailing li

[GENERAL] Fatal accident :)

2010-12-13 Thread pasman pasmański
2010-12-13 11:19:35 CET FATAL: the database system is starting up pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Optimizing query

2010-11-24 Thread pasman pasmański
Hello. I have a query which works a bit slow. It's runned on desktop computer: AMD Athlon X2 2GHz , Win Xp sp2, 1GB ram. Postgres 8.4.5 with some changes in config: shared_buffers = 200MB # min 128kB # (change requires restart) temp_buffers = 8MB

[GENERAL] Read binary records

2010-11-17 Thread pasman pasmański
Hello. How to read binary file ? I try pg_read_file() but this returns text (not bytea) and skip part of record pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Comments on tables

2010-11-10 Thread pasman pasmański
Hello. How to add comment on table with calculated value ? COMMENT ON TABLE test IS 'Updated ' || current_date; not works ... Regards. pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/ma

[GENERAL] Planner features, discussion

2010-07-13 Thread pasman pasmański
Hello. I propose 2 features for planner: 1. Planner will estimate 2 x statistics: time of query with cache empty and with cache filled. 2. Two levels of plannig: standard and long. Long planning may be used when standard optimization generate slow plan, and may use advanced algebraic transformat

[GENERAL] Manual for small project

2010-07-05 Thread pasman pasmański
Hello. I have to prepare manual to simple database in postgresql 8.4.4, Winxp+sp2. I want to store doc pages in comment field, format html. Is a better idea to store documentation ? thanks for answer -- pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

[GENERAL] effective_io_concurrency details

2010-05-26 Thread pasman pasmański
Hello. I have 2 questions: Is effective_io_concurrency working on WinXP sp2 ? and what is the difference between effective_io_concurrency = 0 and effective_io_concurrency = 1 Postgres 8.4.4 pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make change

[GENERAL] Multilevel partitioning

2010-05-05 Thread pasman pasmański
I create partitions as below. And run query: select * from test where grupa='A'; Is planner skip to analyze partitions: test2d, test2e, test2f ? best regards - CREATE TABLE test ( grupa character varying(1), id

[GENERAL] File compression in WinXP

2010-05-02 Thread pasman pasmański
Hello. I'm install postgresql 8.4.3 on WinXPsp3. Because of small disk i create tablespace pointing to commpressed folder and move some tables to it. Compression is good: 10GB to 3-4GB speed acceptable (small activity,10 users) But is this safe ? pasman