Re: [GENERAL] Sharing data between stored functions?

2015-03-05 Thread Igor Neyman
Just create global temp tables once with “ON COMMIT PRESERVE ROWS“ option, and when any session uses them their contents will be private to this session. Regards, Igor Neyman

Re: [GENERAL] Sharing data between stored functions?

2015-03-05 Thread Igor Neyman
From: inspector morse [mailto:inspectormors...@gmail.com] Sent: Thursday, March 05, 2015 10:37 AM To: Adrian Klaver Cc: Merlin Moncure; Igor Neyman; pgsql-general@postgresql.org Subject: Re: [GENERAL] Sharing data between stored functions? I'm confused with what Igor said. He said to c

Re: [GENERAL] Sharing data between stored functions?

2015-03-05 Thread Igor Neyman
; > Compatibility > > The CREATE TABLE command conforms to the SQL standard, with exceptions > listed below. > > Temporary Tables > > > > > Regards, > > Igor Neyman > > > -- > Adrian Klaver > adrian.kla...@aklaver.com m.b. I'm mis

Re: [GENERAL] how would you speed up this long query?

2015-04-01 Thread Igor Neyman
; Seq Scan on z0 (cost=0.00..1538.30 rows=42530 width=38) (actual time=0.010..82.125 rows=42530 loops=1)" "Total runtime: 4414.655 ms" -- Didn't see replies to this message, so... Your query spends most of the time on sorting: "Sort Method: external merge Disk: 21648kB" and it doesn't fit in memory. Try increasing work_mem somewhat to 50MB, you could do it for this particular connection only, if you don't want to change it for the whole server. Regards, Igor Neyman -- 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] Would like to know how analyze works technically

2015-04-01 Thread Igor Neyman
, your RAM is 8GB. Your work_mem is too high. Actual memory used for sorting, etc... could be multiples of work_mem setting. That could be the reason for your memory problems. I'd suggest to set it to 16MB, and see if you can avoid "on disk" sorting. If not - gradually increase work_mem. Regards, Igor Neyman

Re: [GENERAL] Help with slow table update

2015-04-15 Thread Igor Neyman
B.col2 FROM table2 B WHERE A.col3 = B.col4; Regards, Igor Neyman

Re: [GENERAL] Best way to migrate a 200 GB database from PG 2.7 to 3.6

2015-04-15 Thread Igor Neyman
200 GB ? Thanks a lot, cheers Filip --- PG 2.7 to 3.6??? Anyway, did you look at pg_upgrade? Regards, Igor Neyman -- 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] Connection question

2015-05-14 Thread Igor Neyman
database using ODBC. Thanks Stuart Richler Montreal Sure. What appears to be a problem? Igor Neyman.

[GENERAL] Re: Query running slow for only one specific id. (Postgres 9.3) version

2015-06-05 Thread Igor Neyman
cords while really getting only 1. Regards, Igor Neyman

[GENERAL] Re: Query running slow for only one specific id. (Postgres 9.3) version

2015-06-05 Thread Igor Neyman
From: Sheena, Prabhjot [mailto:prabhjot.si...@classmates.com] Sent: Friday, June 05, 2015 2:38 PM To: Igor Neyman; pgsql-general@postgresql.org; pgsql-performa...@postgresql.org Subject: RE: Query running slow for only one specific id. (Postgres 9.3) version When I run vacuum analyze it fixes

Re: [GENERAL] [PERFORM] PGBOUNCER ISSUE PLEASE HELP(Slowing down the site)

2015-06-18 Thread Igor Neyman
t require much additional resource, but will eliminate some network traffic that you have with the current configuration. Regards, Igor Neyman -- 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] PgBouncer error - psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL

2015-07-06 Thread Igor Neyman
? Please tell me what Im doing wrong? And another question, if I want to specify remote postgres DB's in the .ini file. How do I do that? Thanks Ali. You should specify pgbouncer with “-d” option: -bash-4.2$ psql -p 6432 –d pgbouncer Regards, Igor Neyman

Re: [GENERAL] INSERT ... ON CONFLICT DO UPDATE

2015-07-20 Thread Igor Neyman
0) a limit 10; and then check the size of the indexes: for "select pg_relation_size('U1')" I get 2834432 while " select pg_relation_size('U2')" returns 2285568. So, index based on randomly populated column is bigger than the one based on sequentially pop

Re: [GENERAL] instr detail

2015-07-29 Thread Igor Neyman
('12.32.42','.',-1) ,any help appreciated __ There are lots of string functions and operators: http://www.postgresql.org/docs/9.3/static/functions-string.html There is definitely a replacement for Oracle’s instr(…). Regards, Igor Neyman

Re: [GENERAL] Get additional constraint information

2015-08-04 Thread Igor Neyman
from information_schema.columns where table_name = 'install_crash'; Regards, Igor Neyman

Re: [GENERAL] PostgreSQL customer list

2015-08-19 Thread Igor Neyman
healthcare domain ( irrespective of open-source or proprietary tool ) We need to showcase to our customer for building analytical database Please do share, it will be really helpful Thanks Sridhar BN Did you check this page: http://www.postgresql.org/about/users/ Regards, Igor Neyman

Re: [GENERAL] PostgreSQL Developer Best Practices

2015-08-26 Thread Igor Neyman
al PK (for db convenience) and unique NATURAL key (for GUI representation). Regards, Igor Neyman

Re: [GENERAL] UPDATE an updatable view

2015-08-28 Thread Igor Neyman
ust for the sake of completeness... If the value (empname in the above example) can be NULL, the compare does not work, because SELECT NULL = NULL returns NULL which is treated as FALSE. But I am sure you know this :-) HTH, Ladislav Lenart ___ Right. And that

Re: [GENERAL] log_statement = 'mod' does not log all data modifying statements

2015-09-09 Thread Igor Neyman
d but doesn't address this use-case. It's unfortunate that we don't have a better answer at this time. Thanks! Stephen ___ Could you please provide reference to pg_audit? TIA, Igor Neyman -- Sent via pgsql-general mailing list (pgsql-general@postgresql

Re: [GENERAL] clone_schema function

2015-09-09 Thread Igor Neyman
ent sequnce values, table data, views and functions. As always, use with caution. -- Melvin Davidson I assume you are aware that this script does not produce complete copy of the source schema. Foregn Key constraints are not recreated along with the tables. Regards, Igor Neyman

Re: [GENERAL] clone_schema function

2015-09-10 Thread Igor Neyman
From: Melvin Davidson [mailto:melvin6...@gmail.com] Sent: Wednesday, September 09, 2015 4:48 PM To: Igor Neyman Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] clone_schema function Thanks Igor, hmm, apparently the "INCLUDING CONSTRAINTS' option of "CREATE TABLE' ha

Re: [GENERAL] clone_schema function

2015-09-11 Thread Igor Neyman
f schema “vector” is copied into some destination schema using your script? Melvin, you needn’t consider every critique of your script to be a personal attack on you. Regards, Igor Neyman

Re: [GENERAL] clone_schema function

2015-09-15 Thread Igor Neyman
ect column “field” from table “new”, which does not exists. Not sure, what other example you need. Regards, Igor Neyman

Re: [GENERAL] clone_schema function

2015-09-15 Thread Igor Neyman
in schema “new”. The obvious problem is that there is no table “new” in schema “new”, the table will still be called “old”. Jim’s example is very similar to what I provided a few days ago. Regards, Igor Neyman

Re: [GENERAL] @ operator

2015-09-21 Thread Igor Neyman
tml Regards, Igor Neyman

Re: [GENERAL] to pg

2015-09-25 Thread Igor Neyman
n load_id else null end ); how can i convert case expressed to postgres..above it is oracle. any help appreciated... CREATE UNIQUE INDEX idx_load_pick ON pick (load_id) where picked='y'; Regards, Igor Neyman

Re: [GENERAL] Format

2015-09-28 Thread Igor Neyman
Hi All, How to change sql format to look beautiful and understandable using pgadmin3 or else ther tools for postgres. any help appreciated.. Are you looking for SQL editor? If that’s the case, take a look at contexteditor.org Regards, Igor Neyman

Re: [GENERAL] Format

2015-09-28 Thread Igor Neyman
From: David G. Johnston [mailto:david.g.johns...@gmail.com] Sent: Monday, September 28, 2015 3:14 PM To: Igor Neyman Cc: Ramesh T ; pgsql-general@postgresql.org Subject: Re: [GENERAL] Format On Mon, Sep 28, 2015 at 1:59 PM, Igor Neyman mailto:iney...@perceptron.com>> wrote:

Re: [GENERAL] Selecting pairs of numbers

2015-10-05 Thread Igor Neyman
OM my_table WHERE (x*10 + y) >= (1*10 + 3) AND (x*10 + y) <= (3*10 + 2) ORDER BY x, y; Regards, Igor Neyman -- 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] Merge join vs merge semi join against primary key

2015-10-12 Thread Igor Neyman
r: 212699113 Total runtime: 201995.044 ms (7 rows) What if you rewrite your second query like this: SELECT ac.* FROM balances ac JOIN customers o ON (o.id<http://o.id> = ac.customer_id AND o.group_id = 45); Regards, Igor Neyman

Re: [GENERAL] Merge join vs merge semi join against primary key

2015-10-12 Thread Igor Neyman
From: Sean Rhea [mailto:sean.c.r...@gmail.com] Sent: Friday, October 09, 2015 4:30 PM To: Igor Neyman Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Merge join vs merge semi join against primary key It does the merge (not-semi) join: production=> explain analyze SELECT ac.* F

Re: [GENERAL] Waiting on ExclusiveLock on extension 9.3, 9.4 and 9.5

2015-10-28 Thread Igor Neyman
ld be greatly appreciated. Do you know what “process 41915” is? And what it was doing to cause ExclusiveLock? Regards, Igor Neyman

Re: [GENERAL] Drop/Re-Creating database extremely slow + doesn't lose data

2016-05-31 Thread Igor Neyman
reate new db). Probably your unexpected table and sequence are coming from there. Regards, Igor Neyman

Re: [GENERAL] Hot disable WAL archiving

2016-06-17 Thread Igor Neyman
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Job Sent: Friday, June 17, 2016 9:01 AM To: Albe Laurenz ; pgsql-general@postgresql.org Subject: [GENERAL] R: Hot disable WAL archiving Hi Albe and thank you, first of all

Re: [GENERAL] Multiple NOTIFY is ignored

2016-07-28 Thread Igor Neyman
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of David G. Johnston Sent: Thursday, July 28, 2016 11:05 AM To: Markus Kolb Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Multiple NOTIFY is ignored On Thu, Jul 28, 2016 at 10:29 AM, Markus

Re: [GENERAL] Uber migrated from Postgres to MySQL

2016-07-28 Thread Igor Neyman
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Alex Ignatov Sent: Thursday, July 28, 2016 10:59 AM To: Rakesh Kumar Cc: PostgreSQL General Subject: Re: [GENERAL] Uber migrated from Postgres to MySQL On 28.07.2016 17:

Re: [GENERAL] Uber migrated from Postgres to MySQL

2016-07-28 Thread Igor Neyman
-Original Message- From: Alex Ignatov [mailto:a.igna...@postgrespro.ru] Sent: Thursday, July 28, 2016 11:26 AM To: Igor Neyman ; Rakesh Kumar Cc: PostgreSQL General Subject: Re: [GENERAL] Uber migrated from Postgres to MySQL On 28.07.2016 18:09, Igor Neyman wrote: > -Origi

Re: [GENERAL] Uber migrated from Postgres to MySQL

2016-07-28 Thread Igor Neyman
-Original Message- From: Alex Ignatov [mailto:a.igna...@postgrespro.ru] Sent: Thursday, July 28, 2016 11:26 AM To: Igor Neyman ; Rakesh Kumar Cc: PostgreSQL General Subject: Re: [GENERAL] Uber migrated from Postgres to MySQL On 28.07.2016 18:09, Igor Neyman wrote: > -Origi

Re: [GENERAL] Forward declaration of table

2016-08-23 Thread Igor Neyman
Regards, Igor From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Alexander Farber Sent: Tuesday, August 23, 2016 1:11 PM To: pgsql-general Subject: [GENERAL] Forward declaration of table Good evening, with PostgreSQL 9.5.3 I am using the follow

Re: [GENERAL] Forward declaration of table

2016-08-23 Thread Igor Neyman
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Alexander Farber Sent: Tuesday, August 23, 2016 3:33 PM Cc: pgsql-general Subject: Re: [GENERAL] Forward declaration of table Hi Igor, On Tue, Aug 23, 2016 at 8:15 PM, Igor Neyman mailto:iney

Re: [GENERAL] Foreign key against a partitioned table

2016-08-23 Thread Igor Neyman
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Craig James Sent: Tuesday, August 23, 2016 4:00 PM To: pgsql-general@postgresql.org Subject: [GENERAL] Foreign key against a partitioned table How do you create a foreign key that references a parti

Re: [GENERAL] Clustered index to preserve data locality in a multitenant application?

2016-09-01 Thread Igor Neyman
ustered index (with the heap row stored in the index leaf) because of the way how MVCC implemented: multiple row versions are stored in the table itself (e.g. Oracle for that purpose keeps table “clean” and stores multiple row versions in UNDO tablespace/segment). Regards, Igor Neyman

Re: [GENERAL] performance problems with bulk inserts/updates on tsrange with gist-based exclude constrains

2016-09-16 Thread Igor Neyman
a new row with a start ts running on from that. Of course, the adds are just inserting new rows. cheers, Chris So, what is the value for "end ts", when the record is inserted (the range

Re: [GENERAL] isnull() function in pgAdmin3

2016-09-27 Thread Igor Neyman
ry' else 'Owner_Inventory' end) AS `Lot_Status`, __ isnull(`s`.`Actual_Close_Date`) in MySQL is equivalent to: s.actual_close_date IS NULL in Postgres. What exactly didn't

Re: [GENERAL] Update two tables returning id from insert CTE Query

2016-09-27 Thread Igor Neyman
, they are not obligated to read your mind. Regards, Igor Neyman

Re: [GENERAL] executing os commands from a function

2016-09-30 Thread Igor Neyman
er alternatives ? In Ingres for example I can use dbevent and an esqlc app which listens Thank you Armand __ Similar mechanism exists in Postgresql. Read about LISTEN/NOTIFY in the docs.

Re: [GENERAL] pg_class (system) table increasing size.

2016-11-21 Thread Igor Neyman
be the possible ways, where i can look into. Due to business impact auto vacuum is off. Sent from Outlook<http://aka.ms/weboutlook> You just stated the reason: "auto vacuum is off" Regards, Igor Neyman

Re: [GENERAL] Can PostgreSQL use multi-column index for FK constraint validation?

2016-01-26 Thread Igor Neyman
ex on FK (col1, col2) are in the same order (and in the beginning) of PK index. So, no need for additional index (col1, col2). Regards, Igor Neyman

Re: [GENERAL] BRIN indexes

2016-01-30 Thread Igor Neyman
ightly worse performance. It seems like a huge improvement, given that your data fits BRIN's use case. Felipe, What kind of queries you used in your test? Where they based on clustering columns? Regards Igor Neyman

Re: [GENERAL] Windows performance

2016-02-15 Thread Igor Neyman
Regards, Igor Neyman

Re: [GENERAL] multiple UNIQUE indices for FK

2016-03-01 Thread Igor Neyman
W dniu 28.02.2016 o 03:35, David G. Johnston pisze: > W dniu 23.02.2016 o 09:39, Rafal Pietrak pisze: > > Can anybody suggest any other way out of this mass? > > > ​The only thought that sticks while reading your prose is:​ > > ​message > message-person < person​ > > > ​mess

Re: [GENERAL] Including SQL files

2016-03-21 Thread Igor Neyman
/www.postgresql.org/docs/9.5/static/ecpg-preproc.html seems to be something different? Regards Alex Psql directive \i – is your friend. In your words.sql: \i words_hash \i words_join_new_game \i … Regards, Igor Neyman

Re: [GENERAL] Way to get at parsed trigger 'WHEN' clause expression?

2016-03-28 Thread Igor Neyman
e_tree, relation_oid)” – looks like it doesn’t work with pg_trigger, because as a second parameter (Var) it expects relation_oid, and relation could have multiple triggers, so pg_get_expr() wouldn’t know which trigger’s tgqual you want to decompile. Regards, Igor Neyman

Re: [GENERAL] Way to get at parsed trigger 'WHEN' clause expression?

2016-03-28 Thread Igor Neyman
-Original Message- From: James Robinson [mailto:jlrob...@socialserve.com] Sent: Friday, March 25, 2016 11:29 AM To: Igor Neyman Cc: Melvin Davidson ; pgsql-general@postgresql.org Subject: Re: [GENERAL] Way to get at parsed trigger 'WHEN' clause expression? > On Mar 25, 2

Re: [GENERAL] Increased I/O / Writes

2016-05-10 Thread Igor Neyman
ind the queries that are causing that much IO? Please, if anyone can share anything.. Thanks a lot! Lucas So, what’s wrong with using pg_stat_statements? It has a set of columns pertaining to IO. Regards, Igor Neyman

Re: [GENERAL] Release Notes Link is broken on the website

2016-05-12 Thread Igor Neyman
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Allan Kamau Sent: Thursday, May 12, 2016 9:59 AM To: Daniel Westermann Cc: Postgres General Postgres General Subject: Re: [GENERAL] Release Notes Link is broken on the website Provide a link to th

[GENERAL] pglogical

2016-05-25 Thread Igor Neyman
for 9.4 and 9.5) on various Linux platforms, and I'm stuck with Windows, hence the question. If it didn't make 9.6 core, is there plan to include it in 9.7, or may be pglogical becomes available on Windows? Regards, Igor Neyman

Re: [GENERAL] [ADMIN] Postgres VS Oracle

2007-06-18 Thread Igor Neyman
This document: http://www-css.fnal.gov/dsg/external/freeware/mysql-vs-pgsql.html could answer some of your questions. Igor From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Tokmatchi Sent: Monday, June 18, 2007 11:55 AM To: [EMAIL PROTECTE

Re: [GENERAL] 8.1 Table partition and getting error

2010-10-07 Thread Igor Neyman
(NEW.deleted = 1) THEN INSERT INTO crm_deleted VALUES (NEW.*); DELETE FROM crm_active WHERE crmid = NEW.crmid; RETURN NULL; -- so that that trigger doesn't proceed with UPDATE on crm_active table ELSE RETURN (NEW.*); END IF; END; $$ LANGUAGE plpgsql; Regards, Igor Neyman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] problem with PG install script on Windows

2010-10-12 Thread Igor Neyman
WScript.Echo "Service " & objService.Name & " started successfully" Else WScript.Echo "Failed to start the database server (" & iRetVal & ")" WScript.Quit 1 End If Else WScript.Echo "Service " & objService.Name & " is already running" End If /**/ If it really waits for service to start, checking it's status in a loop. Same status check probably needed earlier in the script, where it's trying to start dependencies services. oh, and I have to admit that I have zero VB scripting experience, so please correct me if my code modification is wrong. Regards, Igor Neyman

Re: [GENERAL] problem with PG install script on Windows

2010-10-13 Thread Igor Neyman
From: Ashesh Vashi [mailto:ashesh.va...@enterprisedb.com] Sent: Wednesday, October 13, 2010 1:32 AM To: Igor Neyman Cc: pgsql-general@postgresql.org; Dave Page Subject: Re: [GENERAL] problem with PG install script on

Re: [GENERAL] are there any method that "Update" command not affect other unrelated indices?

2010-10-13 Thread Igor Neyman
using the other indices. > > Alban Hertroys > > -- > Screwing up is an excellent way to attach something to the ceiling. > > > !DSPAM:737,4cb55404678308231573016! > Just to make clear what Alban said, because it looks like OP is not familiar with Postgres MVCC model. All i

Re: [GENERAL] how to write an optimized sql with two same subsql?

2010-10-15 Thread Igor Neyman
upid, COUNT(*) AS CNT FROM A GROUP BY groupid) SELECT C.groupid AS groupid1, D.groupid AS groupid2 FROM gr_counts C, gr_counts D WHERE D.groupid > C.groupid AND D.count > C.count; This will execute: SELECT groupid, COUNT(*) AS CNT FROM A GROUP

Re: [GENERAL] Return key from query

2010-11-03 Thread Igor Neyman
the new ID is once the query is done. > My problem is simpler than soft folk here think, however I > feer that the solution is harder than I think :( > No, it's not hard at all. You were already given a solution: INSERT with "RETURNING" clause. Check PG

Re: [GENERAL] REINDEX requirement?

2010-11-09 Thread Igor Neyman
(...) function for specific index. It's part of pgstattupple contrib module - read it up in the docs. Regards, Igor Neyman -- 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] How to obtain the maximum value of a date, between 3 tables...

2010-12-08 Thread Igor Neyman
gt; This: SELECT GREATEST(q.d1, q.d2, q.d3) FROM (select a.last_refresh_date as d1, ae.last_refresh_date as d2, ha.last_refresh_date as d3 from tbl1 a join tbl2 ae on a.id_anuncio_externo = ae.id_anuncio_externo join tbl3 ha on a.id_anuncio_externo = ha.id_anuncio_externo) q; should do it. Igor

Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Igor Neyman
t; Based on your PG version there are different solutions to your problem. Not to re-invent the wheel, check this article: http://www.postgresonline.com/journal/archives/191-String-Aggregation-in -PostgreSQL%2C-SQL-Server%2C-and-MySQL.html%23extended Regards, Igor Neyman -- 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] Crosstab query on huge amount of values

2011-01-17 Thread Igor Neyman
Twitter: http://www.twitter.com/stevelitt > > > Hello Steve, > > Thanks a lot for your answer. > Indeed, I actually want to denormalize my table for a report, > but I need to join the denormalized table with another table > of the database for this report. > So whe

Re: [GENERAL] why is there no TRIGGER ON SELECT ?

2011-02-22 Thread Igor Neyman
lect. The > same applies for a rule. > > Melvin Davidson > > Somewhat OT (but, m.b. related?): With every view there is: RULE "_RETURN" AS ON SELECT TO ... DO INSTEAD ... Which PG creates automatically (behind the scene), when view is created. Is there a wa

Re: [GENERAL] Why count(*) doest use index?

2011-03-08 Thread Igor Neyman
, and couldn't be the default > behavior for an index. > > -- > Glenn Maynard > Indexes don't "maintain counts", indexes maintain pointers to the table records. What you need is "materialized view" storing aggregates. And it looks like you already have i

Re: [GENERAL] sort mem: size in RAM vs size on Disk

2011-03-11 Thread Igor Neyman
work_mem size and the size that sort operation occupies on disk. work_mem needs to be 2-3 times greater than sort occupies on disk. As for "temp" files, PG has separate from work_mem memory area called temp_buffers, try to play with this configuration parameter. And, yes there is a 1GB

Re: [GENERAL] How do you change the size of the WAL files?

2011-03-14 Thread Igor Neyman
27;t what you want, > although it's still barely possible that it is. > > A > > -- > Andrew Sullivan > a...@crankycanuck.ca > A bit out of topic, but a small correction here: Oracle's analog of WAL files is RedoLog files, and they rollback segments

Re: [GENERAL] Partitioned Database and Choosing Subtables

2011-03-15 Thread Igor Neyman
mn name? > > -- > *Bill Thoen* > GISnet - www.gisnet.com > 303-786-9961 > Try using "dynamic" sql: EXECUTE 'SELECT lions, tigers, bears, statecode FROM WildLife WHERE state_pt = ' || statecode INTO ...; See: http://www.postgresql.org/docs/8.4/interactive/plpgs

Re: [GENERAL] A join of 2 tables with sum(column) > 30

2011-03-16 Thread Igor Neyman
uot;HAVING" close (not "WHERE") for an aggregate as a condition: Select id, sum(col1) from tab Where id > 10 Group by id Having sum)col1) >30; Spend some time reading basic SQL docs/books - it'll help you tremendously. Regards, Igor Neyman -- Sent via pgsql-general mailing

Re: [GENERAL] Need help on triggers - postgres 9.1.2

2014-05-22 Thread Igor Neyman
t; > END; > > $center_changed$ LANGUAGE plpgsql; > > > > CREATE TRIGGER center_changed > > AFTER INSERT OR UPDATE ON center > > FOR EACH ROW EXECUTE PROCEDURE check_center_changes(); > > This should work: CREATE OR REPLACE FUNCTION check_center_changes() RETURNS TRIGGE

Re: [GENERAL] what does pg_activity mean when the database is stuck?

2014-06-11 Thread Igor Neyman
When you query pg_stat_activity, what do you see in state column, and how state_change compares to query_start? Regards, Igor Neyman -- 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] what does pg_activity mean when the database is stuck?

2014-06-12 Thread Igor Neyman
.t.w., PgBouncer can also disconnect idle client connections (if you really wish) based on configuration setting. Regards, Igor Neyman -- 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] Re: Cannot start Postgresql 9.3 as a service in Windows 2012 Server with a domain account

2014-06-12 Thread Igor Neyman
But I suspect that the inability to access system32 might be the cause of the > failure to start the service. But when I tried to add the domain user to the > permission for system32 (READ & EXECUTE), Windows would not allow me to > proceed. Has anybody seen such issues? Any help

Re: [GENERAL] Re: Cannot start Postgresql 9.3 as a service in Windows 2012 Server with a domain account

2014-06-12 Thread Igor Neyman
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of boca2608 Sent: Thursday, June 12, 2014 11:05 AM To: pgsql-general@postgresql.org Subject: [GENERAL] Re: Cannot start Postgresql 9.3 as a service in Windows 2012 Server with a domain account Igor,  

Re: [GENERAL] Re: Cannot start Postgresql 9.3 as a service in Windows 2012 Server with a domain account

2014-06-12 Thread Igor Neyman
my > big thanks to Krystian Bigaj, Igor Neyman and Raymond O'Donnell for > offering timely help and making this user mailing list a great resource to the > postgresql user community. > > Thanks, > John > Just a heads-up: These domain/network security people like to chang

Re: [GENERAL] Getting "cache lookup failed for aggregate" error

2014-06-25 Thread Igor Neyman
;ve thoroughly answered by question. Thanks! So, instead of dropping aggregate “if exists” why not check pg_catalog for aggregate existence, and create it only if it does NOT exist? Regards, Igor Neyman

Re: [GENERAL] Joining on a view containing a UNION ALL produces a suboptimal plan on 9.3.4

2014-07-10 Thread Igor Neyman
EXPLAIN ANALYZE > SELECT * > FROM e > JOIN tables ON e.col = tables.id > WHERE e.id = 568; -- Big merge joins, when simple index scans should be > possible? > > - > > Would this be considered a deficiency in the optimizer? Is there a simple fix? > > Thanks! > Chris >

Re: [GENERAL] invalid connection type "listen_addresses='*'

2014-07-10 Thread Igor Neyman
EDT CONTEXT:  line 75 of configuration file "/etc/postgresql/9.1/main/pg_hba.conf" 2014-07-10 16:34:39 EDT FATAL:  could not load pg_hba.conf Adam, "listen_addresses='*'" parameter doesn't belong in pg_hba.conf This parameter should be in postgresql.conf Regar

Re: [GENERAL] Windows Installation User account - Correct database for us

2014-07-11 Thread Igor Neyman
runs. Using Control Panel you can try to revoke "log in local" from PostgreSQL account (in Win7 it's actually "deny log in local"). Regards, Igor Neyman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] PG index architecture

2014-07-15 Thread Igor Neyman
ce? > > Said another way: > > I think of table scanning as sequential, and fast. That would be loading db > record 1,2,3, etc. > > Would it be faster to load db records "mostly sequential": 1,3,4,7,10 > compared to randomly: 7,3,10,1,4 > > -Andy >

Re: [GENERAL] postgresql_fdw issues with triggers on the foreign tables

2014-07-23 Thread Igor Neyman
L” in BEFORE INSRT trigger, you could assign NEW.id value nextval('...'::regclass) right then and there explicitly in such cases. Regards, Igor Neyman

Re: [GENERAL] Why is unique constraint needed for upsert?

2014-07-23 Thread Igor Neyman
;s exactly why OP prefers Mongo, which doesn't care about such "small" things as ACID. Regards, Igor Neyman -- 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] how to pass tablename to a function

2014-09-05 Thread Igor Neyman
t) up from _tbl where id between startid and stopid ) a where (up).userid is not NULL ) I want to pass the _tbl to the select query integrated in the unpacking(), how can I make it? thanks Alec You can't. You have to use dynamic s

Re: [GENERAL] How to get good performance for very large lists/sets?

2014-10-06 Thread Igor Neyman
your query, corresponding plans, and what don't you like about them? Regards, Igor Neyman -- 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] How to get good performance for very large lists/sets?

2014-10-06 Thread Igor Neyman
-Original Message- From: Richard Frith-Macdonald [mailto:richard.frith-macdon...@brainstorm.co.uk] Sent: Monday, October 06, 2014 1:53 PM To: Igor Neyman Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] How to get good performance for very large lists/sets? On 6 Oct 2014, at 17

Re: [GENERAL] Misunderstanding deadlocks

2014-10-16 Thread Igor Neyman
only means that some resource that this query is looking for was not released by some other connection (user locked some object and went for a coffee break ☺ Regards, Igor Neyman

Re: [GENERAL] To increase RAM or not

2014-10-22 Thread Igor Neyman
m/a-large-database-does-not-mean-large-shared_buffers/#comment-945 Regards, Igor Neyman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [SPAM] - [GENERAL] Performance of UPDATE SET = FROM vs UPDATE SET = (SELECT ...)

2014-11-03 Thread Igor Neyman
alue from the matched row to every record in "second" table. Regards, Igor Neyman -- 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] Avoiding deadlocks when performing bulk update and delete operations

2014-11-24 Thread Igor Neyman
G (SELECT … FOR UPDATE)… Can’t you just do: DELETE FROM table_name WHERE id_A = ANY(array_of_id_A) AND id_B = ANY(array_of_id_B); ? Regards, Igor Neyman

Re: [GENERAL] Error: could not read symbolic link "pg_tblspc/940585". No such file or directory

2015-02-05 Thread Igor Neyman
ed. Try dropping it now. Regards, Igor Neyman

Re: [GENERAL] SELECT, GROUP BY, and aggregates

2015-02-13 Thread Igor Neyman
This works just fine. It's not in the spec, but postgres supports it. I'll leave it to others to argue about it being a best practice or not. --- I use this feature a lot. Igor Neyman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

Re: [GENERAL] Determine all listeners subscribed to notifcations and what channels

2015-02-17 Thread Igor Neyman
.3.x). Is there a way to find out which channels have listeners? thanks --Cory Take a look at pg_listening_channels() in PG docs. Regards, Igor Neyman

Re: [GENERAL] Issue dumping schema using readonly user

2015-02-17 Thread Igor Neyman
org/docs/9.3/interactive/app-pgdump.html " Diagnostics pg_dump internally executes SELECT statements. If you have problems running pg_dump, make sure you are able to select information from the database using, for example, psql." To answer your question, this is intentional. At the mome

Re: [GENERAL] stored procedure variable names

2015-02-20 Thread Igor Neyman
nce in Postgres when using dynamic SQL variables inside EXECUTE ‘…’ are “positional” prefixed with ‘$’, eg.: $1, $2,… Regards, Igor Neyman

Re: [GENERAL] Large number of rows in pg_type and slow gui (pgadmin) refresh

2013-01-04 Thread Igor Neyman
o many types? > That sounds like something in your design is not right. > > Thomas > Probably those are not the types Robert created explicitly. There must be lots of tables/views (m.b. lots of partitions) in the database. Every table/view adds couple records to pg_type: one type for tab

  1   2   3   >