[GENERAL] Is auto-analyze as thorough as manual analyze?

2017-09-23 Thread Jack Christensen
-analyze the same as manually running analyze or is a manual analyze more thorough? This is running version 9.6.3 on Heroku. Thanks, Jack -- 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] Coditional join of query using PostgreSQL

2017-05-15 Thread Jack
This is a join in a middle of query. How can I do such thing? -- View this message in context: http://www.postgresql-archive.org/Coditional-join-of-query-using-PostgreSQL-tp5961718p5961726.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general m

[GENERAL] Conditional join in function

2017-05-15 Thread Jack
Hi, I'm new to postgresql and couldn't find answer to this situation anywhere. I asked this here: http://stackoverflow.com/questions/43984208/coditional-join-of-query-using-postgresql I hope there is a better solution rather than creating two separated functions :( -- View this message in conte

Re: [GENERAL] Custom shuffle function stopped working in 9.6

2017-02-11 Thread Jack Christensen
(1 row) postgres=> select * from unnest(ARRAY['a','b','c','d','e','f']) order by random(); unnest d c a f e b (6 rows) postgres=> select * from unnest(ARRAY['a','b&#x

Re: [GENERAL] Permissions, "soft read failure" - wishful thinking?

2015-12-14 Thread Jack Christensen
not all application level changes. Jack -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Text to interval conversion can silently truncate data

2015-07-01 Thread Jack Christensen
jack=# select '1.51 years'::interval = '1.52 years'::interval; ?column? -- t (1 row) This is surprising. Once I looked at the C code for Interval it makes more sense given that it cannot represent fractional years, months, or days. Wouldn't it make more

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

2015-06-12 Thread Jack Christensen
I was recently surprised by changes that were not logged by log_statement = 'mod'. After changing log_statement to 'all', I found that the changes were occurring in a writable CTE. Is there a way to log all statements that update data? Jack -- Sent via pgsql-general

Re: [GENERAL] moving to PostgreSQL from MS-SQL and from Oracle, looking for feature comparison information

2015-05-09 Thread Jack Christensen
risks corrupting the entire cluster. http://www.postgresql.org/docs/9.4/static/manage-ag-tablespaces.html Jack -- 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] pg_upgrade could not connect to server

2015-01-22 Thread Jimmy Jack
leges…" On Thu, Jan 22, 2015 at 10:55 AM, Igal @ getRailo.org wrote: > Jimmy, > On 1/22/2015 10:53 AM, Jimmy Jack wrote: >> Did you try to use runas windows command? Should not make any >> difference based on your comment how you run it. >> >> https://technet.mi

Re: [GENERAL] pg_upgrade could not connect to server

2015-01-22 Thread Jimmy Jack
Did you try to use runas windows command? Should not make any difference based on your comment how you run it. https://technet.microsoft.com/en-us/library/cc771525(WS.10).aspx On Thu, Jan 22, 2015 at 10:48 AM, Igal @ getRailo.org wrote: > Bruce, > On 1/22/2015 10:38 AM, Bruce Momjian wrote:

Re: [GENERAL] GCC error while trying to install 9.4 via brew on MAC OS

2015-01-08 Thread Jimmy Jack
thank you so much! that solved my issue On Thu, Jan 8, 2015 at 6:23 PM, Tom Lane wrote: > "Jimmy Jack" writes: >> here it is, I apologize in advance for very large email > The problem is evidently here: > configure:12997: checking test program > configure:13007:

Re: [GENERAL] GCC error while trying to install 9.4 via brew on MAC OS

2015-01-08 Thread Jimmy Jack
pgac_cv_prog_cc_cflags__funroll_loops=yes pgac_cv_prog_cc_cflags__fwrapv=yes pgac_cv_type_locale_t='yes (in xlocale.h)' pgac_cv_var_PS_STRINGS=no pgac_cv_var_int_opterr=yes pgac_cv_var_int_optreset=yes pgac_cv_var_int_timezone=yes pgac_cv_var_rl_completion_append_character=yes On Thu, Jan 8, 2015

Re: [GENERAL] GCC error while trying to install 9.4 via brew on MAC OS

2015-01-08 Thread Jimmy Jack
ode 1 (use -v to see invocation) configure:12733: $? = 1 configure: failed program was: On Thu, Jan 8, 2015 at 5:40 PM, Tom Lane wrote: > "Jimmy Jack" writes: >> Here is the snippet of the error, I am really puzzled why I cannot install >> postgres. >> clang: e

[GENERAL] GCC error while trying to install 9.4 via brew on MAC OS

2015-01-08 Thread Jimmy Jack
Here is the snippet of the error, I am really puzzled why I cannot install postgres. clang: error: unsupported option '-V -isystem/opt/boxen/homebrew/include' clang: error: unknown argument: '-qversion’ any thoughts? thanks a lot This file contains any messages produced by compilers

[GENERAL] PLV8 for PostgreSQL 9.4 on Ubuntu 14.04

2014-12-19 Thread Jack Christensen
With PostgreSQL 9.3 I installed plv8 from apt.postgresql.org (http://www.postgresql.org/download/linux/ubuntu/). It doesn't appear that it is available for 9.4. Is this no longer offered or has it just not available yet? Thanks. Jack -- Sent via pgsql-general mailing list (pgsql-ge

Re: [GENERAL] new index type with clustering in mind.

2014-12-11 Thread Jack Douglas
> Currently, one issue you're going to face is that brin doesn't rescan a range to > find the tighest possible summary tuple. That's going to be an issue I think, thanks for mentioning it. We'd need some sort of mechanism for achieving this without a complete REINDEX, even if it only reset the min

Re: [GENERAL] new index type with clustering in mind.

2014-12-10 Thread Jack Douglas
ng BRIN being used for a continuous background re-clustering job (in parallel with or as part of vacuum), similar to the mechanism I experimented with before? If not is this something there might be support for adding to the TODO list? Kindest regards Jack -- Sent via pgsql-general mailing list (

Re: [GENERAL] new index type with clustering in mind.

2014-12-10 Thread Jack Douglas
> in 9.4, GIN indexes are pretty close to this already Do I understand correctly that BRIN indexes will be even closer to this? Kindest regards Jack -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: 24 May 2014 22:46 To: Martijn van Oosterhout Cc: Jack Douglas; pg

Re: [GENERAL] new index type with clustering in mind.

2014-06-03 Thread Jack Douglas
> > > To reduce complexity (eg MVCC/snapshot related issues), index entries > > > would be added when a row is inserted, but they would not be removed > > > when the row is updated/deleted (or when an insert is rolled back): > > It's an interesting idea, but, how can you *ever* delete index ent

Re: [GENERAL] new index type with clustering in mind.

2014-05-26 Thread Jack Douglas
discarding the row number portion - is there a better way than ` (replace(replace(ctid::text,'(','{'),')','}')::integer[])[1]`), I should be able to show some analysis demonstrating this working, albeit inefficiently as I'll have to scan the table itself for th

[GENERAL] new index type with clustering in mind.

2014-05-24 Thread Jack Douglas
has been rejected before or is obviously impractical. Jack

[GENERAL] Data Checksum feature and streaming replication

2014-05-24 Thread Jack Douglas
on a replication master, will that corrupt data replicate to slaves or will replication halt. Does it depend on the setting of ignore_checksum_failure? Thanks Jack

[GENERAL] returning clause and source columns

2014-05-12 Thread Jack Douglas
://www.postgresql.org/docs/9.3/static/sql-insert.html#VARIABLELIST). For example: insert into t1(id) select id from t2 returning *, t2.foo; Kindest regards Jack

Re: [GENERAL] CLOB & BLOB limitations in PostgreSQL

2014-04-11 Thread Jack . O'Sullivan
hich is in the BLOB type column. The particular client I'm doing this for uses the compressed version, so all of their data in this table is binary. Thanks Jack From: Andy Colson To: Jack.O'sulli...@tessella.com, pgsql-general@postgresql.org, Date: 11/04/2014 16:24 Subjec

[GENERAL] CLOB & BLOB limitations in PostgreSQL

2014-04-11 Thread Jack . O'Sullivan
I am working for a client who is interested in migrating from Oracle to Postgres. Their database is currently ~20TB in size, and is growing. The biggest table in this database is effectively a BLOB store and currently has around 1 billion rows. >From reading around Postgres, there are a couple

Re: [GENERAL] Forcing materialize in the planner

2013-08-16 Thread Jack Christensen
Have you tried putting those components in a common table expression? I'm not sure if it absolutely forces the materialization or not, but in practice that has been my experience. Robert James wrote: I have a query which, when I materialize by hand some of its components, runs 10x faster (incl

[GENERAL] Possible bug with row_to_json

2013-08-05 Thread Jack Christensen
When using a subquery as a source for row_to_json, depending on the order of arguments it may ignore renaming a column. jack=# create table player( jack(# player_id serial primary key, jack(# name varchar not null unique jack(# ); NOTICE: CREATE TABLE will create implicit sequence

Re: [GENERAL] Avoiding duplication of code via views -- slower? How do people typically do this?

2013-02-15 Thread Jack Christensen
Joe Van Dyk wrote: Perhaps I fat-fingered something somewhere... I tried that and I got this: https://gist.github.com/joevandyk/4958906/raw/5561f95ef2b5d82f81ab14913c4d36f6aac3ee0a/gistfile1.txt The with_filters view uses a different plan. Interesting. It is avoiding the hash join, but it

Re: [GENERAL] Avoiding duplication of code via views -- slower? How do people typically do this?

2013-02-14 Thread Jack Christensen
Joe Van Dyk wrote: See https://gist.github.com/joevandyk/4957646/raw/86d55472ff8b5a4a6740d9c673d18a7005738467/gistfile1.txt for the code. I have promotions(id, end_at, quantity) and promotion_usages(promotion_id). I have a couple of things I typically want to retrieve, and I'd like those t

Re: [GENERAL] Picking the first of an order in an aggregate query

2012-12-31 Thread Jack Christensen
), field_a, field_b from ... order by grouping_field, field_a asc, field_b asc http://www.postgresql.org/docs/9.2/static/sql-select.html#SQL-DISTINCT -- Jack Christensen http://jackchristensen.com/ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your su

Re: [GENERAL] Complex database infrastructure - how to?

2012-06-30 Thread Jack Christensen
son. Consider using one database with multiple schemas. You can separate your applications into their own schemas, and you can have cross-schema foreign keys. -- Jack Christensen http://jackchristensen.com/ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chang

Re: [GENERAL] Subselect with incorrect column not a syntax error?

2012-04-13 Thread Jack Christensen
c4 = 2 ); rollback; Mike Your subquery is correlated with the outer query. So the c2 in the subquery is referring to table x. -- Jack Christensen ja...@hylesanderson.edu -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Re: [GENERAL] Optimise PostgreSQL for fast testing

2012-02-23 Thread Jack Christensen
e test suite is of vital importance to developers. A 30 second difference 100's of times per day really can add up. -- Jack Christensen ja...@hylesanderson.edu -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Set returning functions in select column list

2012-02-16 Thread Jack Christensen
ve checked Google and the PostgreSQL docs, but it appears either I do not know the key words to search for or it is sparsely documented. -- Jack Christensen ja...@hylesanderson.edu -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscrip

[GENERAL] Functions that return a set in select column list

2012-02-16 Thread Jack Christensen
1 | 5 1 | 2 | 4 1 | 3 | 5 (12 rows) I really don't understand what is going on here. I have checked Google and the PostgreSQL docs, but it appears either I do not know the key words to search for or it is sparsel

[GENERAL] Set returning functions in select column list

2012-02-16 Thread Jack Christensen
2 | 4 1 | 3 | 5 (12 rows) I really don't understand what is going on here. I have checked Google and the PostgreSQL docs, but it appears either I do not know the key words to search for or it is sparsely documented. Jack -- Sent via pgsql-general ma

Re: [GENERAL] Why does aggregate query allow select of non-group by or aggregate values?

2011-12-10 Thread Jack Christensen
he outer query, and when I tried to use a non-grouped column from the outer query I correctly got a ERROR: subquery uses ungrouped column "foo" from outer query Thanks again. -- Jack Christensen ja...@hylesanderson.edu -- Sent via pgsql-general mailing list (pgsql-general@postg

[GENERAL] Why does aggregate query allow select of non-group by or aggregate values?

2011-12-09 Thread Jack Christensen
r an aggregate function be rejected? What am I not understanding? Thanks. -- Jack Christensen ja...@hylesanderson.edu -- 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] Failure controlling PG 9.1 service on Ubuntu 10.04 32-bit

2011-10-10 Thread Jack Christensen
On 10/8/2011 1:21 AM, Craig Ringer wrote: On 10/08/2011 02:23 AM, Jack Christensen wrote: Just upgraded a machine from PostgreSQL 9.0 to 9.1. I uninstalled the old version then installed the new one. Whenever I try to run a service command to start, stop, or restart the server it fails. jackc

[GENERAL] Failure controlling PG 9.1 service on Ubuntu 10.04 32-bit

2011-10-07 Thread Jack Christensen
* Error: Could not open /proc/2193/comm [fail] It seems to be happening in /usr/share/postgresql-common/PgCommon.pm:542 PostgreSQL is actually running fine, but the only way I can make any changes is to reboot the server (or kill all the postgres processes I suppose). -- Jack Christensen ja

Re: [GENERAL] WITH x AS (...) and visibility in UPDATE

2011-07-27 Thread Jack Christensen
ith some new values and some copied values? -- Jack Christensen ja...@hylesanderson.edu -- 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] implementing check-in/check-out of an items table

2011-05-20 Thread Jack Christensen
On 5/20/2011 10:15 AM, Seb wrote: On Fri, 20 May 2011 09:48:45 -0500, Jack Christensen wrote: Use a loans table with unique partial index to ensure that only one unreturned loan per item can exist at a time. [...] Thanks, this certainly avoids loaning an item before it's returned, b

Re: [GENERAL] implementing check-in/check-out of an items table

2011-05-20 Thread Jack Christensen
NOT NULL REFERENCES items, start_time timestamptz NOT NULL, end_time timestamptz ... ); CREATE UNIQUE INDEX ON loans(item_id) WHERE end_time IS NULL; -- Jack Christensen ja...@hylesanderson.edu -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to you

Re: [GENERAL] Multiple table relationship constraints

2011-05-09 Thread Jack Christensen
won't. Thanks everyone for your advice. I think this type of approach will be very helpful. -- Jack Christensen ja...@hylesanderson.edu -- 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] Multiple table relationship constraints

2011-05-05 Thread Jack Christensen
On 5/5/2011 2:53 PM, Rick Genter wrote: On Thu, May 5, 2011 at 3:50 PM, Jack Christensen mailto:ja...@hylesanderson.edu>> wrote: The trick is there are additional attributes of actions and achievements such as a category that must match for the link to be valid. These attr

Re: [GENERAL] Multiple table relationship constraints

2011-05-05 Thread Jack Christensen
On 5/5/2011 2:28 PM, Rick Genter wrote: On Thu, May 5, 2011 at 3:20 PM, Jack Christensen mailto:ja...@hylesanderson.edu>> wrote: What is the best way to handle multiple table relationships where attributes of the tables at the ends of the chain must match? Example:

[GENERAL] Multiple table relationship constraints

2011-05-05 Thread Jack Christensen
. Validate application side -- this can work well, but it leaves the hole of a bug in the application or a direct SQL statement going bad. Anyone have any advice on the best way to handle this? -- Jack Christensen ja...@hylesanderson.edu -- Sent via pgsql-general mailing list (pgsql-general

[GENERAL] "interval hour to minute" or "interval day to minute"

2011-04-17 Thread Jack Douglas
day + 10 hours 5 minutes'::interval hour to minute; interval -- 3 years 2 mons -1 days +10:05:00 (1 row) Warm regards Jack Douglas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Deferred foreign key constraint downsides

2011-04-08 Thread Jack Christensen
occurred since the error won't be raised until commit. Are there any other downsides to just setting all my foreign keys to initially deferred? Thanks. -- Jack Christensen ja...@hylesanderson.edu -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

[GENERAL] Win32 8.3.3 install fail (sufficient privileges to install system services)

2011-02-27 Thread Jack Su
Dear Yapt, Good day! My name is Jack from DT Research.We are using postgresql to develop our programs; Now we face with a problem when I reinstall the program,it show up: === > Service 'PostgreSQL Database Server 8.3' (pgsql-8.3) > could not be installed. Veri

Re: [GENERAL] What is the name pseudo column

2010-12-16 Thread Jack Christensen
On 12/15/2010 5:43 PM, Adrian Klaver wrote: On Wednesday 15 December 2010 1:27:19 pm David Fetter wrote: On Wed, Dec 15, 2010 at 01:50:54PM -0600, Jack Christensen wrote: I was just surprised when accidentally selecting a non-existent name column there was no error -- instead something came

[GENERAL] What is the name pseudo column

2010-12-15 Thread Jack Christensen
an array (but longer rows get truncated). I've searched Google and the PG docs but I haven't had any luck. -- Jack Christensen ja...@hylesanderson.edu -- 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 suggestions

2009-06-25 Thread Jack W
On Thu, Jun 25, 2009 at 12:10 PM, Bill Moran wrote: > In response to Jack W : > > > On Thu, Jun 25, 2009 at 11:37 AM, Bill Moran >wrote: > > > > > In response to Jack W : > > > > > > > I will create several databases on PostGreSQL. All the datab

[GENERAL] Need suggestions

2009-06-25 Thread Jack W
I will create several databases on PostGreSQL. All the databases have the same structure: same number of table/index. I have two choices: 1. For each database, I create a new tablespace and create a new database in the tablespace. 2. I only create one tablespace. Create all the databases on the sam

[GENERAL] JDBC prepared statements & server-side prepared statements

2009-06-24 Thread Jack Orenstein
I'm using postgresql 8.3.7. Under what conditions does a JDBC prepared statement result in a server-side prepared statement? Jack Orenstein -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/

[GENERAL] Query optimizer & prepared statements

2009-06-23 Thread Jack Orenstein
from T where x > $1 Jack Orenstein -- 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] Slight change in query leads to unexpected change in query plan

2009-06-23 Thread Jack Orenstein
Tom Lane wrote: Jack Orenstein writes: Limit (cost=0.00..324.99 rows=100 width=451) -> Index Scan using t_pkey on t (cost=0.00..296027.98 rows=91088 width=451) Index Cond: (pk > 10) Adding the value restriction at the top of this query plan wouldn'

Re: [GENERAL] Slight change in query leads to unexpected change in query plan

2009-06-23 Thread Jack Orenstein
Sam Mason wrote: On Mon, Jun 22, 2009 at 05:55:28PM -0400, Jack Orenstein wrote: ris-# select * ris-# from T ris-# where pk > 10 ris-# and value = 'asdf'::bytea ris-# order by pk ris-# limit 100; PG thinks that you're going to get 16 rows back matching those condi

[GENERAL] Slight change in query leads to unexpected change in query plan

2009-06-22 Thread Jack Orenstein
and this produces a good query plan. But this means that fewer than 100 rows are returned. For reasons too boring to go into, that would be very inconvenient for my application. Why does adding the value restriction so radically change the execution plan? Jack Orenstein -- Sent via pgsql-ge

[GENERAL] Question about Warm Standby

2009-03-17 Thread Jack W
the transaction log file 0001004C was copied and renamed to RECOVERYXLOG in the pg_xlog folder of the standby server, right? So the standby server only keeps each transaction log from the primary server temporarily in its pg_xlog folder during the recovery procedure, right? Thanks. Jack

[GENERAL] pg_ctl issue

2009-03-15 Thread Jack W
Program Files\PostgreSQL\8.3\bin>FATAL: postgres: could not locate matching postgres executable And the following command works well: C:\Program Files\PostgreSQL\8.3\bin>pg_ctl stop -D "C:\Program Files\PostgreSQL\8.3\data" Thanks. Jack

Fwd: [GENERAL] Question about Privileges

2009-03-12 Thread Jack W
On Thu, Mar 12, 2009 at 3:45 PM, John R Pierce wrote: > Jack W wrote: > >> >> I also find that if I only grant privileges on database to dbuser as >> below, without granting privileges on Schema and table to dbuser, dbuser >> still can not do SELECT on the tables.

[GENERAL] Question about Privileges

2009-03-12 Thread Jack W
granting privileges on Schema and table to dbuser, dbuser still can not do SELECT on the tables. mydb=# grant all privileges on Database mydb to dbuser; Is there any simple way to grant All privileges to dbuser on all the 10 tables? Thanks. Jack

[GENERAL] user mode

2009-03-11 Thread Jack W
The default user mode of PostgreSQL is single user mode. How to enable multi-users mode? Thanks. Jack

[GENERAL] Maximum transaction rate

2009-03-06 Thread Jack Orenstein
g seem way too high: 2800-2900 with one thread, 5000-7000 with ten threads. I'm guessing that writes aren't really reaching the disk. Can someone suggest how to figure out where, below postgres, someone is lying about writes reaching the disk? Jack -- Sent via pgsql-general mailing

[GENERAL] Trying to deal with a bloated index

2009-02-19 Thread Jack Orenstein
er? What about optimization of any prepared statements on connections whose lifetime spans the creation of idx2? Jack Orenstein -- 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] LIKE with pattern containing backslash

2009-02-03 Thread Jack Orenstein
is expressed, then I believe the doc is confusing. (It confused me, anyway.) Another possibility is that the doc is correct, and that the driver is getting things wrong. For now, I'm trying to understand what the correct behavior is. Jack Here is my entire test program. It runs stand

[GENERAL] LIKE with pattern containing backslash

2009-02-03 Thread Jack Orenstein
g of what is correct behavior (in the literal and bound variable cases)? Is there a bug in the driver? in postgres? in the docs? Or in my understanding? Jack Orenstein P.S. If you want to play with this, I can send you my test programs for the cases described above. -- Sent via pgsql-general m

Re: [GENERAL] Table bloat and vacuum

2008-11-12 Thread Jack Orenstein
Scott Marlowe wrote: On Wed, Nov 12, 2008 at 8:13 AM, Jack Orenstein <[EMAIL PROTECTED]> wrote: My application is running on 7.4. We have one huge table that drives SNIP We're in the process of upgrading to 8.3.4, so I'd appreciate any throughs on whether and how this beha

[GENERAL] Table bloat and vacuum

2008-11-12 Thread Jack Orenstein
resolve itself? We're not doing any full vacuums. We're in the process of upgrading to 8.3.4, so I'd appreciate any throughs on whether and how this behavior will change with the newer release. Jack Orenstein -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] Postgres optimizer choosing wrong index

2008-10-28 Thread Jack Orenstein
Tom Lane wrote: Jack Orenstein <[EMAIL PROTECTED]> writes: EXPLAIN says that the correct index is being used -- it didn't used to. However, pg_stat* says otherwise. In my test, I have exactly one dh value. Running EXPLAIN with this value produces a plan using idx_dh (the correct

Re: [GENERAL] Postgres optimizer choosing wrong index

2008-10-27 Thread Jack Orenstein
Tom Lane wrote: Jack Orenstein <[EMAIL PROTECTED]> writes: - I created two schemas, NOVAC and VAC, each with a table T as described above. - Before loading data, I ran VACUUM ANALYZE on VAC.T. - I then started loading data. The workload is a mixture of INSERT, SELECT and UPDAT

Re: [GENERAL] Postgres optimizer choosing wrong index

2008-10-24 Thread Jack Orenstein
Tom Lane wrote: Jack Orenstein <[EMAIL PROTECTED]> writes: I may have simplified too far. Our application runs a number of different queries. All our WHERE clauses restrict dh and fh. For a given pair of (dh, fh) values, the initial query should come up empty and then insert this pair, an

Re: [GENERAL] Postgres optimizer choosing wrong index

2008-10-23 Thread Jack Orenstein
Tom Lane wrote: Jack Orenstein <[EMAIL PROTECTED]> writes: Tom Lane wrote: If you plug in a value that *does* occur in the table it should probably choose the more-relevant index consistently. Unfortunately, it matters a lot at runtime. The dh value is not very selective, as shown

Re: [GENERAL] Postgres optimizer choosing wrong index

2008-10-23 Thread Jack Orenstein
om t where dh = 1 and fh = 2; select '*** vacuum t (no analyze)'; vacuum t; select '*** explain select * from t where dh = 1 and fh = 2'; explain select * from t where dh = 1 and fh = 2; This output was produced by 7.4.8. Version 8.3.4 uses the "wrong" execution p

Re: [GENERAL] Postgres optimizer choosing wrong index

2008-10-23 Thread Jack Orenstein
Tom Lane wrote: Jack Orenstein <[EMAIL PROTECTED]> writes: If I run EXPLAIN on this query, (plugging in values 1 and 2 for the variables), before VACUUM ANALYZE, I get the desired execution plan: Index Scan using idx_df on T (cost=0.00..4.83 rows=1 width=454) Index Cond: ((dh =

[GENERAL] Postgres optimizer choosing wrong index

2008-10-23 Thread Jack Orenstein
ns: - Why would the optimizer ever choose idx_dn over idx_df given that idx_df has to be more selective? - Is there any way to force the use of idx_df? Jack Orenstein P.S. Yes, I know, 7.4. We're upgrading to 8.3 but we have this problem right now. -- Sent via pgsql-general mailing list (pgs

Re: [GENERAL] Autocommit, isolation level, and vacuum behavior

2008-09-14 Thread Jack Orenstein
On Sep 13, 2008, at 4:39 AM, Tomasz Ostrowski wrote: On 2008-09-12 15:52, Jack Orenstein wrote: Sorry, I misspoke. I have an index, but preferred doing a scan without the index in this case. Why? The only reason I can think of is that you'd like to avoid disk seeking. But you g

Re: [GENERAL] Autocommit, isolation level, and vacuum behavior

2008-09-12 Thread Jack Orenstein
Tomasz Ostrowski wrote: On 2008-09-11 17:21, Jack Orenstein wrote: The id > last_id trick doesn't work for me -- I don't have an index that would support it efficiently. You do not have a primary key? If you do then you have an index as it is automatically created. Sorry,

Re: [GENERAL] Autocommit, isolation level, and vacuum behavior

2008-09-12 Thread Jack Orenstein
Tomasz Ostrowski wrote: On 2008-09-11 18:03, Jack Orenstein wrote: When you do: result = query("select something from sometable") then all rows of a result will be cached by a client program. I am very sure this is not happening. Maybe some rows are being cached (specifying fetch

Re: [GENERAL] Autocommit, isolation level, and vacuum behavior

2008-09-11 Thread Jack Orenstein
Tomasz Ostrowski wrote: On 2008-09-11 17:21, Jack Orenstein wrote: Then do the processing in separate transactions like this (in pseudocode): The id > last_id trick doesn't work for me -- I don't have an index that would support it efficiently. Turning on autocommit seems to w

Re: [GENERAL] Autocommit, isolation level, and vacuum behavior

2008-09-10 Thread Jack Orenstein
Martijn van Oosterhout wrote: On Wed, Sep 10, 2008 at 09:45:04AM -0400, Jack Orenstein wrote: Am I on the right track -- does autocommit = false for the BIG scan force versions of TINY to accumulate? I played around with a JDBC test program, and so far cannot see how the autocommit mode causes

[GENERAL] Autocommit, isolation level, and vacuum behavior

2008-09-10 Thread Jack Orenstein
umulation of row versions have anything to do with autocommit mode (as opposed to isolation level) on a connection used for the scan? Jack Orenstein -- 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] Unlinked files in PGDATA/base following unclean shutdown

2008-08-11 Thread Jack Orenstein
Tom Lane wrote: Jack Orenstein <[EMAIL PROTECTED]> writes: The question is how to check for consistency in the case of large tables, which are split into multiple segments, (e.g. 123456.1, 123456.2). I.e., how can I find out how many segments there should be? The kernel-defined EOF

[GENERAL] Unlinked files in PGDATA/base following unclean shutdown

2008-08-08 Thread Jack Orenstein
s + SUITABLE_CONSTANT - 1) / SUITABLE_CONSTANT? Jack -- 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] Postgres 8.3.x installation on Fedora 9 system

2008-08-07 Thread Jack Orenstein
Tom Lane wrote: Jack Orenstein <[EMAIL PROTECTED]> writes: Pardon a dumb question. Installing Postgres 7.x on FC4-6, I would install a large set of RPMs, these I think: postgresql postgresql-contrib postgresql-devel postgresql-jdbc postgresql-libs post

[GENERAL] Postgres 8.3.x installation on Fedora 9 system

2008-08-07 Thread Jack Orenstein
ed. Am I just on the wrong path here, starting with the postgresql and postgresql-libs RPMs? Jack Orenstein -- 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 between 7.4.x and 8.3.x

2008-07-21 Thread Jack Orenstein
Francisco Reyes wrote: On 4:05 pm 07/21/08 Jack Orenstein <[EMAIL PROTECTED]> wrote: What if we do a binary copy instead? What do you mean by a binary copy? pg_dump -Fc? No, I mean changing this: psql -h $SOURCE_HOST ... -c "copy $SOURCE_SCHEMA.$SOURCE_TABLE to stdout&q

[GENERAL] COPY between 7.4.x and 8.3.x

2008-07-21 Thread Jack Orenstein
ctions? What if we do a binary copy instead? (We're going to investigate BINARY to see if there is a performance improvement.) Jack Orenstein -- 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] creating "a perfect sequence" column

2008-07-07 Thread Jack Brown
> On Sun, Jul 6, 2008 at 7:33 PM, Berend Tober wrote: > > This question comes up a lot. A term used in prior > discussions is "gapless > > sequence". > > > Thank you, i didn't know the term so when I'd searched the archives, i hadn't found much. > > What would be really more interesting for disc

[GENERAL] creating "a perfect sequence" column

2008-07-06 Thread Jack Brown
value on delete. There are many mechanisms (rules, triggers, sequences, locks etc.) but I'm not sure which combination would result in the most elegant implementation. Oh, and if you know the right term for what I just described, I'd be more than pleased to hear it! :-) All the best, Jac

Re: [GENERAL] [OT] xkcd - A webcomic of romance, sarcasm, math, and language

2007-10-12 Thread Jack Orenstein
Erik Jones wrote: On Oct 12, 2007, at 2:40 PM, John D. Burger wrote: DB-related humor: http://xkcd.com/327/ Sanitize database inputs, by all means, but also use prepared statements. Jack Orenstein ---(end of broadcast)--- TIP 4: Have you

[GENERAL] Missing files under pg_data following power failure

2007-10-12 Thread Jack Orenstein
omenon? Why are these files lost? Are they really lost, or have they simply moved somewhere? What happens to the disk blocks formerly occupied by the files? Getting back in service following this file loss is not a problem; I'm just trying to understand how postgres gets into this st

Re: [GENERAL] the future of pljava development

2007-05-28 Thread Jack Orenstein
i++ instead of i = i + 1. This was over 4 years ago, and Oracle/java integration may have improved, but slight improvements in this area really don't change the equation much. Jack Orenstein ---(end of broadcast)--- TIP 1: if posting/reading th

Re: [GENERAL] postgresql vs mysql

2007-02-21 Thread Jack Orenstein
drive to alter the table for the rewrite that's going to take place. Forgive a dumb question: What does postgresql do with ALTER TABLE? What sort of modifications do not require time proportional to the number of rows in the table? Jack Orenstein

Re: [GENERAL] Buffer overflow in psql

2006-11-22 Thread Jack Orenstein
Tom Lane wrote: Jack Orenstein <[EMAIL PROTECTED]> writes: The problem has occurred again, and I've found a buffer overflow in psql that explains it. Here is code from src/bin/psql/common.c, from the PrintQueryResults function: case PGRES

[GENERAL] Buffer overflow in psql

2006-11-22 Thread Jack Orenstein
strategy? (I can summarize my vacuuming strategy for anyone interested.) Jack Orenstein ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your

Re: [GENERAL] Storing images in PostgreSQL databases (again)

2006-10-04 Thread Jack Orenstein
sary to compress the space away. All of these seem incompatible with your requirements. I agree with another responder who suggested using the filesystem for your images. Jack Orenstein ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] Row versions and indexes

2006-09-28 Thread Jack Orenstein
;s a cost issue involved, as I need to update every row in a large table, never updating the index key. Will this run faster if I drop the index? (Yes, I can run the experiment, but I'd like to understand the fundamentals better.) Jack Orenstein

[GENERAL] Problems converting between C string and Datum

2006-09-20 Thread Jack Orenstein
psql:test.sql:23: WARNING: MY DEBUG OUTPUT CONTEXT: SQL statement "insert into log select insert_ifs( $1 , $2 , $3 , $4 , $5 , $6 , $7 )" PL/pgSQL function "regress" line 5 at SQL statement for each line of output. Jack Orenstein ---(

  1   2   >