Re: [GENERAL] Insert query hangs

2014-07-09 Thread Greg Stark
On Wed, Jul 9, 2014 at 11:34 AM, M Tarkeshwar Rao m.tarkeshwar@ericsson.com wrote: We analysed one more thing when we removed the unique index from the table it is working fine. Is there any issue in indexing? Is there any option to repair the table or its indexing? REINDEX is useful

Re: [GENERAL] Insert query hangs

2014-07-09 Thread Greg Stark
On Wed, Jul 9, 2014 at 1:25 PM, M Tarkeshwar Rao m.tarkeshwar@ericsson.com wrote: I am sharing the table structure. When we removed the unique index it is working fine. And when created normal index(not unique) it is working fine. After removing unique index we tried to recreate it but

Re: [GENERAL] Sorting with materialized paths

2010-05-10 Thread Greg Stark
On Sun, May 9, 2010 at 4:47 PM, Tom Lane t...@sss.pgh.pa.us wrote: Ovid curtis_ovid_...@yahoo.com writes: My apologies. This isn't PG-specific, but since this is running on PostgreSQL 8.4, maybe there are specific features which might help. I have a tree structure in a table and it uses

Re: [GENERAL] Cannot read block 348938 of pdbsynchtable

2010-04-08 Thread Greg Stark
On Thu, Apr 8, 2010 at 7:12 AM, Utsav Turray utsav.tur...@newgen.co.in wrote: Even if If i try to pad the file  25205.3  using DD command I am not able to calculate the bytes to be padded as the total count of the blocks is comming out to be 521228 and the error is coming cannot read the 348938

Re: [GENERAL] pgreplay log file replayer released

2010-03-22 Thread Greg Stark
On Wed, Mar 17, 2010 at 2:06 PM, Albe Laurenz laurenz.a...@wien.gv.at wrote: I announce the first release of pgreplay, version 0.9.0 (Beta). Project home page: http://pgreplay.projects.postgresql.org/ pgreplay reads a PostgreSQL log file (*not* a WAL file), extracts the SQL statements and

Re: [GENERAL] autovacuum question

2010-03-09 Thread Greg Stark
On Tue, Mar 9, 2010 at 1:47 PM, Scot Kreienkamp skre...@la-z-boy.com wrote: I found a way to do it very easily using LVM snapshots and WAL log shipping, but the net effect is I'm bringing a new LVM snapshot copy of the database out of recovery every 1-2 hours.  That means I'd have to spend 15

Re: [GENERAL] has_schema_privilege function

2010-03-09 Thread Greg Stark
On Tue, Mar 9, 2010 at 10:28 AM, Jignesh Shah jignesh.shah1...@gmail.com wrote: Could you tell me is there any other robust way to make sure that user1 doesn't have CREATE permissions on mydb schema? It depends what you're worried about. If you're worried that plperl will begin mapping booleans

Re: [GENERAL] Scratching my head why results are different between machines.

2010-03-04 Thread Greg Stark
On Thu, Mar 4, 2010 at 2:14 PM, Justin Graf jus...@magwerks.com wrote: To pretty much anyone outside MS, a sane human would think 64 bit apps in SysWoW64 and 32Bit apps in System32. :'( Ah, but you all are forgetting that the 32 here is to distinguish it from the default odbc interface which

Re: [GENERAL] Hung postmaster (8.3.9)

2010-03-02 Thread Greg Stark
We should probably also check and prohibit including directories as files. On Tuesday, March 2, 2010, Tom Lane t...@sss.pgh.pa.us wrote: In the meantime, it seems like we ought to take two defensive steps: -- greg -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] Sorting performance vs. MySQL

2010-02-23 Thread Greg Stark
On Tue, Feb 23, 2010 at 6:48 AM, Scott Marlowe scott.marl...@gmail.com wrote: I'm relieved that Postgresql itself does not, in fact, suck, but slightly disappointed in the behavior of psql. I suppose it needs to buffer everything in memory to properly format its tabular output, among other

Re: [GENERAL] Sorting performance vs. MySQL

2010-02-23 Thread Greg Stark
On Tue, Feb 23, 2010 at 9:48 AM, Yeb Havinga yebhavi...@gmail.com wrote: Greg Stark wrote: You can do \set FETCH_COUNT to have psql use a cursor automatically. It seems like a big win in this case. What would be the downside of having a fetch_count set default in psql? They were mentioned

Re: [GENERAL] Implementing an Index Access Method in PG 8.4

2010-02-23 Thread Greg Stark
On Tue, Feb 23, 2010 at 10:00 AM, Carsten Kropf ckro...@fh-hof.de wrote: I have a question according to the implementation of a new index access method in Postgres. Is it necessary to implement a new resource manager for XLog when I am trying to achieve a stable new index access method?

Re: [GENERAL] DDL trigger kind functionality in PostGreSQL

2010-02-20 Thread Greg Stark
On Thu, Feb 18, 2010 at 4:55 AM, dipti shah shahdipti1...@gmail.com wrote: Hi, I was looking for SQL DDL trigger kind of functionality in PostGreSQL but couldn;t find any. There isn't any. Basically I want to make sure that no users should use DROP command directly on my database even

Re: [GENERAL] Truncate and delete adds wal logs for slave to process.

2010-02-11 Thread Greg Stark
On Thu, Feb 11, 2010 at 5:47 PM, Chris Barnes compuguruchrisbar...@hotmail.com wrote: Because both truncate and delete, I would think that this action would be put into the pg_log as a log file that can be rolled back. And, when complete, it would be shipped to the standby to be processed?

[GENERAL] Re: 8.5devel: unexpected and illogical error during transaction, but transaction don't rolled back

2010-02-10 Thread Greg Stark
On Wed, Feb 10, 2010 at 6:59 AM, A. Kretschmer andreas.kretsch...@schollglas.com wrote: test=*# analyse table_a; ERROR:  canceling autovacuum task CONTEXT:  automatic vacuum of table test.public.table_a ANALYZE Time: 1235,600 ms I think, that's not an ERROR, just a NOTICE for me. And yes,

Re: [GENERAL] Best way to handle multi-billion row read-only table?

2010-02-10 Thread Greg Stark
On Wed, Feb 10, 2010 at 2:32 PM, Asher as...@piceur.co.uk wrote: The data will initially be accessed via a simple GUI which will allow browsing over a subset of the data (subsampled down to 1 sample/minute/hour, etc. It sounds like you could use a tool like rrd that keeps various levels of

Re: [GENERAL] Multiple buffer cache?

2010-02-07 Thread Greg Stark
I doubt pinning buffers ever improve system on any halfway modern system. It will often *look* like it has improved performance because it improves the performance of the queries you're looking at -- but at the expense of slowing down everything else. There is a use case it would be useful for

Re: [GENERAL] surprised by non-strict array_append

2010-02-03 Thread Greg Stark
If it were strict wouldn't it return NULL? greg On 3 Feb 2010 07:16, J. Greg Davidson j...@well.com wrote: I was caught out today by the non-strict behavior of array_append causing me to get an undesired result for a COALESCE. My subsequent attempt to create a STRICT VARIADIC generalization of

Re: [GENERAL] Questions about connection clean-up and invalid page header

2010-01-25 Thread Greg Stark
On Mon, Jan 25, 2010 at 8:15 AM, Scott Marlowe scott.marl...@gmail.com wrote: Is there a parameter to set in the configuration or some other means to shorten the time before an abandoned backend's query is cancelled? You can shorten the tcp_keepalive settings so that dead connections get

Re: [GENERAL] Questions about connection clean-up and invalid page header

2010-01-25 Thread Greg Stark
On Mon, Jan 25, 2010 at 11:37 AM, Herouth Maoz hero...@unicell.co.il wrote: The tcp_keepalive setting would only come into play if the remote machine crashed or was disconnected from the network. That's the situation I'm having, so it's OK. Crystal, being a Windows application, obviously

Re: [GENERAL] Questions about connection clean-up and invalid page header

2010-01-25 Thread Greg Stark
On Mon, Jan 25, 2010 at 1:16 PM, Herouth Maoz hero...@unicell.co.il wrote: Well, I assume by the fact that eventually I get an Unexpected end of file message for those queries, that something does go in and check them. Do you have any suggestion as to how to cause the postgresql server to do so

Re: [GENERAL] postgres external table

2010-01-19 Thread Greg Stark
On Tue, Jan 19, 2010 at 4:41 AM, Craig Ringer cr...@postnewspapers.com.au wrote: How can that work without a transactional file system, though? If the external process writes to the file while you're half-way through reading it, what's the database to do? In general, how do external tables cope

Re: [GENERAL] postgres external table

2010-01-18 Thread Greg Stark
On Mon, Jan 18, 2010 at 2:57 PM, Tom Lane t...@sss.pgh.pa.us wrote: I'm finding it hard to visualize a use-case for that.  We must postulate that the table is so big that you don't want to import it, and yet you don't feel a need to have any index on it.  Which among other things implies that

Re: [GENERAL] type of field

2010-01-18 Thread Greg Stark
On Mon, Jan 18, 2010 at 8:24 PM, Jean-Yves F. Barbier 12u...@gmail.com wrote: I've got to store many small videos; to make things simple (backup/restore, because users don't know very much about IT) I've choosen BYTEA + EXTERNAL, is it the right choice? If you want to store them in the

Re: [GENERAL] Collate order on Mac OS X, text with diacritics in UTF-8

2010-01-16 Thread Greg Stark
On Thu, Jan 14, 2010 at 6:15 AM, Craig Ringer cr...@postnewspapers.com.au wrote: Out of interest: Why not? There's plenty of discussion in the archives about it, but basically ICU would represent a pretty enormous dependency and would lock us in to having no other backend encoding but UTF8.

Re: [GENERAL] WEIRD! postmaster: segfault with sub select??!

2010-01-03 Thread Greg Stark
On Sun, Jan 3, 2010 at 8:31 AM, Reto primz...@gmail.com wrote: Hi everybody, I'm facing a strange problem with a relatively simple sub select whereas everything else runs perfect on this machine (PG 8.4.2 @ Fedora 12, Core2 E4600, 4GB, 2 x 320GB). # SELECT DISTINCT name FROM bbr_parts WHERE

Re: [GENERAL] DELETE ERROR: tuple concurrently updated

2009-12-29 Thread Greg Stark
On Tue, Dec 29, 2009 at 9:41 AM, Михаил Кечинов kechin...@gmail.com wrote: One week ago our database has crashed and after restore begins some problems. What version? And how was this backup taken? It sounds like it might be an inconsistent backup. -- greg -- Sent via pgsql-general mailing

Re: [GENERAL] DELETE ERROR: tuple concurrently updated

2009-12-29 Thread Greg Stark
On Tue, Dec 29, 2009 at 9:41 AM, Михаил Кечинов kechin...@gmail.com wrote: When I try to delete one row from database (for example): delete from document where numdoc = 901721617 I have this error: ERROR: tuple concurrently updated SQL state: XX000 I know, that no one deleting this row at

Re: [GENERAL] date_trunc on date is immutable?

2009-12-25 Thread Greg Stark
On Fri, Dec 25, 2009 at 1:58 AM, Scott Marlowe scott.marl...@gmail.com wrote: Isn't it the client timezone and not the system timezone that actually sets the tz the tstz is set to on retrieval? It's the GUC: stark= set timezone = 'America/Los_Angeles'; SET stark= select now();

Re: [GENERAL] date_trunc on date is immutable?

2009-12-24 Thread Greg Stark
On Fri, Dec 25, 2009 at 12:56 AM, Scott Marlowe scott.marl...@gmail.com wrote: On Thu, Dec 24, 2009 at 4:36 PM, Kian Wright kian.wri...@senioreducators.com wrote: I'm trying to create an index on the month and year of a date field (in 8.3), and I'm getting the functions in index expression

Re: [GENERAL] logtrigger/denyaccess triggers removed from master/slave

2009-12-21 Thread Greg Stark
On Fri, Dec 18, 2009 at 6:59 PM, tamanna madaan tamanna.ma...@globallogic.com wrote: I am using postgres-8.1.2 and slony-1.1.5 for replication. I don't know about your Slony problems but the current bug-fix release for 8.1 is 8.1.19. That's 17 releases to fix security holes, crashes, data

Re: [GENERAL] postgre...@fosdem 2010 - Call for talks

2009-12-03 Thread Greg Stark
On Thu, Dec 3, 2009 at 10:48 AM, Dave Page dp...@pgadmin.org wrote: We will have a number of 45 minutes slots, and may split one or more into 3 back-to-back 15 minute slots if we receive suitable proposals. I would like to suggest we reduce the number of talks and have instead some more

Re: [GENERAL] Catastrophic changes to PostgreSQL 8.4

2009-12-03 Thread Greg Stark
On Thu, Dec 3, 2009 at 8:33 AM, Craig Ringer cr...@postnewspapers.com.au wrote: While true in theory, in practice it's pretty unusual to have filenames encoded with an encoding other than the system LC_CTYPE on a modern UNIX/Linux/BSD machine. I'd _very_ much prefer to have Bacula back my

Re: [GENERAL] Postgresql8.4 install breaks Evolution on Ubuntu 9.10

2009-11-29 Thread Greg Stark
On Sun, Nov 29, 2009 at 4:17 PM, Magnus Hagander mag...@hagander.net wrote: On Sun, Nov 29, 2009 at 16:18, Sachin Srivastava sachin.srivast...@enterprisedb.com wrote: Apart from libxml2 (which is now being fixed) all other libraries you mentioned , dint get installed (or copied) to the

Re: [GENERAL] pg_attribute.attnum - wrong column ordinal?

2009-11-24 Thread Greg Stark
On Wed, Nov 25, 2009 at 1:03 AM, Konstantin Izmailov pgf...@gmail.com wrote: My question: can pg_attribute.attnum be used to determine the sequential ordinal positions of columns in a table? What is a right way to get the ordinal numbers? You could use something like: row_number() over

Re: [GENERAL] pg_attribute.attnum - wrong column ordinal?

2009-11-24 Thread Greg Stark
On Wed, Nov 25, 2009 at 2:00 AM, Konstantin Izmailov pgf...@gmail.com wrote: Greg, this is brilliant - thank you very much! Is partition by compatible to PostgreSQL 8.0/8.2? I could not find compatibility information. It works fine with PG 8.3/8.4 and Greenplum 3.3 thou. It's 8.4 only. You

Re: [GENERAL] safelly erasing dirs/files

2009-11-14 Thread Greg Stark
On Sat, Nov 14, 2009 at 7:42 PM, Joao Ferreira gmail joao.miguel.c.ferre...@gmail.com wrote: vacuum/reindex is saying: I can't do it cause I have no space :( Hm, vacuum shouldn't require any extra space. I suppose you need enough space for the transaction log though. You can probably get away

Re: [GENERAL] Incremental Backups in postgres

2009-11-10 Thread Greg Stark
On Tue, Nov 10, 2009 at 11:03 AM, Alban Hertroys dal...@solfertje.student.utwente.nl wrote: IMHO The simplest solution is to just write a dump to the same file every now and then and have the backup software take care of storing only the differences. It does have a few drawbacks; it means

Re: [GENERAL] virtualidx exclusive lock

2009-11-09 Thread Greg Stark
On Mon, Nov 9, 2009 at 7:38 AM, Uwe Schroeder u...@oss4u.com wrote: What I noticed is when I look at pg_locks, pretty much all of the processes being idle in transaction have an exclusive lock of locktype virtualidx. It's virtualxid as in virtual transaction id and hopefully more than pretty

Re: [GENERAL] sudoku in an sql statement

2009-11-04 Thread Greg Stark
On Sun, Nov 1, 2009 at 3:19 PM, Tom Lane t...@sss.pgh.pa.us wrote: I think the Oracle guy's version could easily be adapted to PG 8.4 --- those little rownum subqueries seem to be just a substitute for not having generate_series(1,9), and everything else is just string-pushing. Don't have time

Re: [GENERAL] R-Trees in PostgreSQL

2009-11-02 Thread Greg Stark
On Mon, Nov 2, 2009 at 4:41 PM, Jeff Davis pg...@j-davis.com wrote: On Tue, 2009-11-03 at 00:25 +0100, Viktor Rosenfeld wrote: I'd like to know what kind of functions I have to implement for a R-Tree index on numeric columns, NUMERIC is scalar, so an R-Tree doesn't make much sense. You can

Re: [GENERAL] Help with postgresql memory issue

2009-10-28 Thread Greg Stark
On Wed, Oct 28, 2009 at 1:05 PM, Brooks Lyrette brooks.lyre...@gmail.com wrote: The machine is running a moderate load. This is running on a Solaris Zone. Memory: 32G phys mem, 942M free mem, 76G swap, 74G free swap   PID USERNAME LWP PRI NICE  SIZE   RES STATE    TIME    CPU COMMAND  5069

Re: [GENERAL] contrib/plantuner - enable PostgreSQL planner hints

2009-10-16 Thread Greg Stark
On Fri, Oct 16, 2009 at 10:04 AM, decibel deci...@decibel.org wrote: Out of curiosity, did you look at doing hints as comments in a query? I'm guessing you couldn't actually do that in just a contrib module, but it's how Oracle handles hints, and it seems to be *much* more convenient, because

Re: [GENERAL] Errors regarding transporting database using pg_dump

2009-10-05 Thread Greg Stark
On Mon, Oct 5, 2009 at 7:34 AM, Martijn van Oosterhout klep...@svana.org wrote: That said, why are you doint this anyway. A better solution may be to install a trusted language (like plperlu or plpython) and do the system call from there. If you just want system(3) you might as well use

Re: [GENERAL] How useful is the money datatype?

2009-10-03 Thread Greg Stark
2009/10/3 Grzegorz Jaśkiewicz gryz...@gmail.com: depending on the countries, etc - keep currencies in 10.4 , or you can compromise to 10.3 , otherwise you might run into problems with rounding, etc. Keeping more digits of precision than the application actually can use is more likely to

[GENERAL] Re: PostgreSQL reads each 8k block - no larger blocks are used - even on sequential scans

2009-10-03 Thread Greg Stark
On Sun, Sep 27, 2009 at 11:18 AM, Sam Mason s...@samason.me.uk wrote: On Sun, Sep 27, 2009 at 06:05:51PM +0200, Gerhard Wiesinger wrote: A google research has shown that Gregory Stark already worked on that issue (see references below) but as far as I saw only on bitmap heap scans. Greg

Re: [GENERAL] How to simulate crashes of PostgreSQL?

2009-08-27 Thread Greg Stark
On Fri, Aug 28, 2009 at 4:13 AM, Alvaro Herreraalvhe...@commandprompt.com wrote: Maybe we should have another inter-backend signal: when a process gets ENFILE, signal all other backends and they close a bunch of files each. I wonder if this is a new problem due to the FSM and VM using up extra

Re: [GENERAL] Tagged types module and varlena changes

2009-08-26 Thread Greg Stark
On Wed, Aug 26, 2009 at 1:14 PM, Alban Hertroysdal...@solfertje.student.utwente.nl wrote: struct varlena* tv = (struct varlena*)tt_palloc( VARSIZE( datum ) ); tv-vl_len = VARSIZE( datum ) - sizeof(Oid); memcpy( tv-vl_dat,        ((struct taggedtypev*)DatumGetPointer( datum ))-val,        

Re: [GENERAL] Multiple table entries?

2009-08-24 Thread Greg Stark
On Mon, Aug 24, 2009 at 2:03 AM, Tom Lanet...@sss.pgh.pa.us wrote: Jeff Ross jr...@wykids.org writes: Tom Lane wrote: heap_update is broken.  Details left as an exercise for the reader Well, as the reader that started this all ;-) should I be worried? Should I do a pg_dump and reinstall?  

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 2:18 PM, Jeff Rossjr...@wykids.org wrote: I had to modify your query slightly to make it run--hope I got what you are after! select (h).* from (select heap_page_items(get_raw_page('pg_namespace',0)) as h) as x; http://www.openvistas.net/pageinspect.html

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 5:37 PM, Jeff Rossjr...@wykids.org wrote: pg_clog is 32K.  I've put it at http://www.openvistas.net/pg_clog Sorry, I'm getting a 404 -- greg http://mit.edu/~gsstark/resume.pdf -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 6:23 PM, Greg Starkgsst...@mit.edu wrote: On Sun, Aug 23, 2009 at 5:37 PM, Jeff Rossjr...@wykids.org wrote: pg_clog is 32K.  I've put it at http://www.openvistas.net/pg_clog Sorry, I'm getting a 404 For what it's worth this is what the heap dump shows. I don't

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 7:00 PM, Tom Lanet...@sss.pgh.pa.us wrote: Greg Stark gsst...@mit.edu writes: The last tuple is marked strangely I think. I don't think it's supposed to have XMAX_INVALID if xmax is 0 but I could be wrong. Also, I don't understand why it's marked as UPDATED if ctid

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 7:34 PM, Tom Lanet...@sss.pgh.pa.us wrote: Greg Stark gsst...@mit.edu writes: On Sun, Aug 23, 2009 at 7:00 PM, Tom Lanet...@sss.pgh.pa.us wrote: But we don't use that while examining individual tuples, do we? We don't use the visibility map itself but we *do* use

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 5:02 PM, Greg Starkgsst...@mit.edu wrote: On Sun, Aug 23, 2009 at 2:18 PM, Jeff Rossjr...@wykids.org wrote: Incidentally, may as well ask the usual questions: And just for reference, what does pg_controldata print? -- greg http://mit.edu/~gsstark/resume.pdf -- Sent

Re: [GENERAL] Multiple table entries?

2009-08-23 Thread Greg Stark
On Sun, Aug 23, 2009 at 9:06 PM, Jeff Rossjr...@wykids.org wrote: pglogd=# select (h).* from (select  page_header(get_raw_page('pg_namespace',0)) pglogd(# as h) as x;   lsn    | tli | flags | lower | upper | special | pagesize | version | prune_xid

Re: [GENERAL] Multiple table entries?

2009-08-22 Thread Greg Stark
On Sat, Aug 22, 2009 at 9:31 PM, Jeff Rossjr...@wykids.org wrote: Hi, I recently upgraded to 8.4 and everything went great.  All databases are working as they are supposed to, no problems seen. Today, however, I did a \d on a database and was surprised to see sets of 5 identical table

Re: [GENERAL] Multiple table entries?

2009-08-22 Thread Greg Stark
On Sat, Aug 22, 2009 at 9:31 PM, Jeff Rossjr...@wykids.org wrote: I browsed through the system catalogs but haven't found anything yet that can shine some light on this. Actually, I wonder if this isn't more likely to show the problem -- it would explain why *all* your tables are showing up

Re: [GENERAL] join from array or cursor

2009-08-22 Thread Greg Stark
On Sun, Aug 23, 2009 at 1:30 AM, John DeSoide...@pgedit.com wrote: While it avoids the sort of my method, it appears to be almost 5 times slower (about 4000 keys in the cursor, Postgres 8.4.0): Function Scan on cursor_pk arr  (cost=0.00..116011.72 rows=1000 width=4) (actual

Re: [GENERAL] Multiple table entries?

2009-08-22 Thread Greg Stark
On Sun, Aug 23, 2009 at 4:06 AM, Jeff Rossjr...@wykids.org wrote: Greg Stark wrote: Actually, I wonder if this isn't more likely to show the problem -- it would explain why *all* your tables are showing up with duplicates rather than just one. select xmin,xmax,ctid,oid,* from pg_namespace

Re: [GENERAL] Multiple table entries?

2009-08-22 Thread Greg Stark
On Sun, Aug 23, 2009 at 4:40 AM, Greg Starkgsst...@mit.edu wrote: On Sun, Aug 23, 2009 at 4:06 AM, Jeff Rossjr...@wykids.org wrote: Greg Stark wrote: Yeah, that's a problem. Would you be able to load the pageinspect contrib module and run a query? select (h).* from (select heap_page_items

Re: [GENERAL] join from array or cursor

2009-08-21 Thread Greg Stark
On Fri, Aug 21, 2009 at 1:16 PM, John DeSoide...@pgedit.com wrote: Yes, this is the best I have come up with so far. I have a set returning function which returns the key and the index number. The implementation with a cursor looks like this: SELECT * FROM cursor_pk('c1') c LEFT JOIN foo ON

Re: [GENERAL] join from array or cursor

2009-08-21 Thread Greg Stark
On Fri, Aug 21, 2009 at 2:16 PM, Greg Starkgsst...@mit.edu wrote: On Fri, Aug 21, 2009 at 1:16 PM, John DeSoide...@pgedit.com wrote: Yes, this is the best I have come up with so far. I have a set returning function which returns the key and the index number. The implementation with a cursor

Re: [GENERAL] Error inserting data to bytea column in 8.4

2009-08-21 Thread Greg Stark
2009/8/21 Andrus Moor kobrule...@hot.ee: In 8.4, script create temp table test ( test bytea ); insert into test values(E'\274') Try E'\\274' -- greg http://mit.edu/~gsstark/resume.pdf -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] unique index for periods

2009-08-20 Thread Greg Stark
On Thu, Aug 20, 2009 at 3:14 PM, Tom Lanet...@sss.pgh.pa.us wrote: I don't believe it is possible to use a btree index for this purpose, because there just isn't a way to express overlaps as a total order. That's true for the general case of indexing ranges but I don't think that's true for the

[GENERAL] Re: Unit conversion database (was: multiple paramters in aggregate function)

2009-08-19 Thread Greg Stark
On Wed, Aug 19, 2009 at 8:24 PM, Alvaro Herreraalvhe...@commandprompt.com wrote: [1] It doesn't correctly convert °C to °F or vv, that was one of the first things I tried. Seems it's easy to misuse it.  You need tempF(x) and tempC notation for converting absolute temperature differences:

Re: [GENERAL] Stock Market Price Data postgreSQL? HELLPPP Please

2009-08-19 Thread Greg Stark
On Wed, Aug 19, 2009 at 9:22 PM, Sanjay Arorasanjay.k.ar...@gmail.com wrote: - This is Time Series Data (I don't know what that is except that it relates to data marked/related to time) and not suited to a RDBMS. - You need it in Esper (a CEP engine used by Marketcetera, an open source trading

Re: [GENERAL] PQgetlength vs. octet_length()

2009-08-18 Thread Greg Stark
On Tue, Aug 18, 2009 at 6:39 PM, Michael Clarkcodingni...@gmail.com wrote: But it seems pretty crazy that a 140meg bit of data goes to 1.3 gigs.  Does that seem a bit excessive? From what you posted earlier it looked like it was turning into about 500M which sounds about right. Presumably

Re: [GENERAL] ERROR: attempted to delete invisible tuple

2009-08-17 Thread Greg Stark
On Mon, Aug 17, 2009 at 4:23 PM, Bryan Murphybmurphy1...@gmail.com wrote:  I've identified 82 bad records.  When I try to query for the records, we get the following: ERROR:  missing chunk number 0 for toast value 25692661 in pg_toast_25497233 That's fine.  I've run into that in a few other

Re: [GENERAL] ERROR: attempted to delete invisible tuple

2009-08-17 Thread Greg Stark
On Mon, Aug 17, 2009 at 6:17 PM, Tom Lanet...@sss.pgh.pa.us wrote: Bryan Murphy bmurphy1...@gmail.com writes: Here's the xmin/xmax/ctid for three problematic records: prodpublic=# select xmin,xmax,ctid from items_extended where id in ('34537ed90d7546d78f2c172fc8eed687',

Re: [GENERAL] ERROR: attempted to delete invisible tuple

2009-08-17 Thread Greg Stark
On Mon, Aug 17, 2009 at 6:17 PM, Tom Lanet...@sss.pgh.pa.us wrote: Hm, what's your current XID counter?  (pg_controldata would give an approximate answer.)  I'm wondering if the xmax's are marked committed but are in the future ... FWIW that doesn't look right. That would result in

Re: [GENERAL] ERROR: attempted to delete invisible tuple

2009-08-17 Thread Greg Stark
On Mon, Aug 17, 2009 at 7:59 PM, Tom Lanet...@sss.pgh.pa.us wrote: Greg Stark gsst...@mit.edu writes: Excluding the cases where our own xid is in the tuple I think the relevant cases are either xmin aborted or in progress (or in future) MOVED_OFF and xvac committed MOVED_IN and xvac aborted

Re: [GENERAL] Rapid Seek Devices (feature request)

2009-08-17 Thread Greg Stark
2009/8/17 Jeremy Harris j...@wizmail.org: Could not pgsql *measure* these costs (on a sampling basis, and with long time-constants)? In theory, sure. In practice, well, there are some engineering challenges to solve. 1) The cost model isn't perfect so the it's not clear exactly what to measure

Re: [GENERAL] Failover, Wal Logging, and Multiple Spares

2009-08-17 Thread Greg Stark
On Tue, Aug 18, 2009 at 1:25 AM, Yaroslav Tykhiyy...@barnet.com.au wrote: Encouraged by Bruce Momjian, I tried and had some success in this area.  It was a controlled failover but it worked like a charm.  An obvious condition was that the warm standbys be in perfect sync; you can't do the trick

Re: [GENERAL] Getting database data from the PostgreSQL file system

2009-08-14 Thread Greg Stark
On Fri, Aug 14, 2009 at 4:31 PM, Ewgenij Sokolovskiewgenij...@gmx.de wrote: Hello, Guys! Is that kind of thing possible at all? We have a problem that our database is corrupted, and we are not able to get any table data by executing SQL requests/running the PG_Admin tool. So, we thought,

Re: [GENERAL] comparing NEW and OLD (any good this way?)

2009-08-13 Thread Greg Stark
On Thu, Aug 13, 2009 at 11:44 PM, Daniel Veritedan...@manitou-mail.org wrote: In other discussions about similar issues I've said that the expression:   ROW(NULL,NULL) IS DISTINCT FROM NULL should evaluate to FALSE.  I still think this is correct and generally useful behavior. I see no

Re: [GENERAL] max_allowed_packet equivalent in Postgres?

2009-08-13 Thread Greg Stark
On Thu, Aug 13, 2009 at 11:20 PM, Sam Masons...@samason.me.uk wrote: On Thu, Aug 13, 2009 at 03:31:39PM -0400, Greg Smith wrote: If your client app is coded correctly to handle large packets of data, it should work up to the size limits documented at http://www.postgresql.org/about/ , so you

Re: [GENERAL] max_allowed_packet equivalent in Postgres?

2009-08-13 Thread Greg Stark
On Fri, Aug 14, 2009 at 12:33 AM, Sam Masons...@samason.me.uk wrote: On Fri, Aug 14, 2009 at 12:03:37AM +0100, Greg Stark wrote: On Thu, Aug 13, 2009 at 11:20 PM, Sam Masons...@samason.me.uk wrote: There would be no way of creating a row 1.6TB in size in one go I was thinking

Re: [GENERAL] synchronous_commit and mvcc

2009-08-12 Thread Greg Stark
On Wed, Aug 12, 2009 at 8:28 PM, Kelly Burkhartkelly.burkh...@gmail.com wrote: Hello, We have synchronous_commit=off in our postgresql.conf file.  Does this setting affect mvcc? If you don't have a crash then there is absolutely no difference from the clients' point of view (besides speed).

Re: [GENERAL] 'a' = any( $${'a','x'} )

2009-08-08 Thread Greg Stark
On Sat, Aug 8, 2009 at 12:08 PM, Jasen Bettsja...@xnet.co.nz wrote: select 'a' = any( $${'a','x'}$$ ) ; postgres=# select 'a' = any( $${a,x}$$ ) ; ?column? -- t (1 row) -- greg http://mit.edu/~gsstark/resume.pdf -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] smart or dumb partition?

2009-08-07 Thread Greg Stark
On Sat, Aug 8, 2009 at 12:27 AM, Bob Gobeillebob.gobei...@hp.com wrote: I gather from rtfm that it is typical to set up partitions so that the master table has no records.  But from my understanding of partitions and doing some tests, I don't see any reason that has to be.  So I'm wondering if

[GENERAL] Re: character 0xe29986 of encoding UTF8 has no equivalent in LATIN2

2009-08-04 Thread Greg Stark
On Tue, Aug 4, 2009 at 4:02 PM, Alban Hertroysdal...@solfertje.student.utwente.nl wrote: P.S. Please don't top post and keep some context of what you're replying to. Your messages are a bit confusing the way you write them. These arguments are more convincing if you don't leave the remainder

Re: [GENERAL] Clients disconnect but query still runs

2009-07-30 Thread Greg Stark
On Thu, Jul 30, 2009 at 8:41 AM, Tatsuo Ishiiis...@postgresql.org wrote: Well SIGPIPE is no help since it would only fire if we tried to write to the socket anyways. Right. For this purpose, pgpool sends param packet to client periodically while waiting for a reply from backend to detect if

Re: [GENERAL] Clients disconnect but query still runs

2009-07-30 Thread Greg Stark
On Thu, Jul 30, 2009 at 7:43 AM, Craig Ringercr...@postnewspapers.com.au wrote: On Wed, 2009-07-29 at 14:56 +0100, Greg Stark wrote: SIGURG might be useful but it would be more complex to use and less widely useful since it would only work if the client disconnects gracefully (though it might

Re: [GENERAL] Clients disconnect but query still runs

2009-07-30 Thread Greg Stark
On Thu, Jul 30, 2009 at 10:27 AM, Csaba Nagyn...@ecircle-ag.com wrote: Sorry, I have to disagree here. If there's a spurious network error, you have usually bigger problems. I prefer to have the connection killed even if the network recovers I know this is a popular feeling. But you're

Re: [GENERAL] Clients disconnect but query still runs

2009-07-30 Thread Greg Stark
On Thu, Jul 30, 2009 at 10:59 AM, Csaba Nagyn...@ecircle-ag.com wrote: But if I get bad memory or bad wire I'll get much worse problems already, and don't tell me it will work more reliably if you don't kill the connection. It's a lot better to find out sooner that you have those problems and

Re: [GENERAL] Clients disconnect but query still runs

2009-07-30 Thread Greg Stark
On Thu, Jul 30, 2009 at 12:22 PM, Craig Ringercr...@postnewspapers.com.au wrote: In fact, I'm not even sure _how_ one goes about exiting without sending an RST. A quick check shows that when I `kill -9' a process with an open client socket (ssh, in this case) the OS sends a FIN, and responds

Re: [GENERAL] Clients disconnect but query still runs

2009-07-30 Thread Greg Stark
On Thu, Jul 30, 2009 at 3:20 PM, Tom Lanet...@sss.pgh.pa.us wrote: The earlier part of the discussion was focused on getting the kernel to actively tell us when the connection had dropped.  That would be workable if we found a way to request it, but I think we'd run out of options :-( Yeah,

Re: [GENERAL] Clients disconnect but query still runs

2009-07-29 Thread Greg Stark
On Wed, Jul 29, 2009 at 1:58 PM, Jasen Bettsja...@xnet.co.nz wrote: can't coerce a signal from the network stack? the linux socket(2) manpage is full of promise (SIGPIPE, SIGURG, SIGIO) [please don't quote the entire message back, just the part you're responding to] Well SIGPIPE is no help

Re: [GENERAL] Clients disconnect but query still runs

2009-07-29 Thread Greg Stark
On Wed, Jul 29, 2009 at 3:17 PM, Tom Lanet...@sss.pgh.pa.us wrote: Greg Stark gsst...@mit.edu writes: On Wed, Jul 29, 2009 at 1:58 PM, Jasen Bettsja...@xnet.co.nz wrote: can't coerce a signal from the network stack? the linux socket(2) manpage is full of promise (SIGPIPE, SIGURG, SIGIO

Re: [GENERAL] Strange Planner Issues

2009-07-29 Thread Greg Stark
On Wed, Jul 29, 2009 at 8:01 PM, Jake Stridej...@omelett.es wrote: Hi, I have 2 databases running on the same server. One is a dump of the other, however the query plans for the same query on the same tables in each database is wildly different and I cannot work out why.                    

Re: [GENERAL] Video available for PGDay SJC '09

2009-07-28 Thread Greg Stark
On Tue, Jul 28, 2009 at 1:41 PM, Andreas Wenka.w...@netzmeister-st-pauli.de wrote: Bill Moran schrieb:   While I've no objection to someone helping out by converting files, I find it odd that flv is suggested.  I've yet to find anything that can play flv files on my FreeBSD desktop machine.  

Re: [GENERAL] Video available for PGDay SJC '09

2009-07-28 Thread Greg Stark
On Tue, Jul 28, 2009 at 3:38 PM, Christophe Pettusx...@thebuild.com wrote: Historically, MOV has been the least-bad container format; Flash support on anything besides Windows has, traditionally, been very spotty.  The files themselves are pretty much the same size; FLV is (as noted) a

Re: [GENERAL] Video available for PGDay SJC '09

2009-07-28 Thread Greg Stark
On Wed, Jul 29, 2009 at 12:10 AM, John R Piercepie...@hogranch.com wrote: Greg Stark wrote: I think I'm scarred from Quicktime files because they often were encoded with codecs like Sorensen which produced proprietary formats. agreed, and the quicktime installer dragging in itunes if you

Re: [GENERAL] general question on two-partition table

2009-07-27 Thread Greg Stark
On Tue, Jul 28, 2009 at 1:08 AM, David Wilsondavid.t.wil...@gmail.com wrote: On Mon, Jul 27, 2009 at 7:52 PM, Janet Jacobsenjsjacob...@lbl.gov wrote: Can you suggest other strategies? Something that might be easier to play with is to create a (or several, to speed up other queries)

Re: [GENERAL] Disable databse listing for non-superuser (\l) ?

2009-07-25 Thread Greg Stark
On Sat, Jul 25, 2009 at 2:53 PM, Andreas Wenka.w...@netzmeister-st-pauli.de wrote: I mean, didn't Apple just kill someone for letting their new iPhone design leak? this is now going off topic - but what do you mean with your last sentence? Please don't quote an entire message if you're only

Re: [GENERAL] problem with pg_restore?

2009-07-23 Thread Greg Stark
On Thu, Jul 23, 2009 at 3:14 PM, Sam Masons...@samason.me.uk wrote: On Thu, Jul 23, 2009 at 07:40:18AM -0600, Scott Marlowe wrote: On Tue, Jul 14, 2009 at 5:47 PM, Jim Michaelsjmich...@yahoo.com wrote: could somebody rewrite pg_dumpall and pg_dump so that it makes editable dumps? most

Re: [GENERAL] 3des key lengths and key management

2009-07-23 Thread Greg Stark
On Thu, Jul 23, 2009 at 6:11 PM, bulkb...@bohlman.org wrote: 1)   What are the default 3des key lengths when you load postgresql enterprise db on a redhat ES x86_64 box? Traditionally 3des can use either 112-bit or 56-bit keys. I think the openssl interface actually lets you set the third key

[GENERAL] Re: user/grant - best practices handling permission in production system

2009-07-23 Thread Greg Stark
On Thu, Jul 23, 2009 at 10:09 PM, Stefano Nichelestefano.nich...@gmail.com wrote: 2. using the user used in step 1, create the schema and populate tables with At this point the webapp should work correctly. The main missing point for me is how to perform step 4 in a simple way since it seems

Re: [GENERAL] Can LIKE under utf8 use INDEXes?

2009-07-22 Thread Greg Stark
On Wed, Jul 22, 2009 at 5:57 PM, Robert Jamessrobertja...@gmail.com wrote: Hi.  I'm confused about the behavior of LIKE under utf8 locale. Accoding to the docs ( http://www.postgresql.org/docs/8.2/interactive/locale.html - excerpted below), it seems that LIKE ignores locale and hence can't use

  1   2   3   4   5   6   >