Re: [GENERAL] Altering column type from text to bytea

2012-03-21 Thread Merlin Moncure
On Wed, Mar 21, 2012 at 2:56 PM, Alexander Reichstadt l...@mac.com wrote: Hi, when trying to change a text column to bytea I am getting the following error: *SQL error:* ERROR: column comment cannot be cast to type bytea *In statement:* ALTER TABLE public.persons ALTER COLUMN comment

Re: [BUGS] [GENERAL] Altering a table with a rowtype column

2012-03-20 Thread Merlin Moncure
On Tue, Mar 20, 2012 at 12:16 PM, Robert Haas robertmh...@gmail.com wrote: I think Tom's correct about what the right behavior would be if composite types supported defaults, but they don't, never have, and maybe never will.  I had a previous argument about this with Tom, and lost, though I am

Re: [GENERAL] nice'ing the postgres COPY backend process to make pg_dumps run more softly

2012-03-19 Thread Merlin Moncure
On Mon, Mar 19, 2012 at 3:51 PM, Guillaume Lelarge guilla...@lelarge.info wrote: On Sun, 2012-03-18 at 21:06 -0700, Aleksey Tsalolikhin wrote: Hi.  When pg_dump runs, our application becomes inoperative (too slow).  I was going to ask if nice'ing the postgres backend process that handles the

Re: [GENERAL] COPY and indices?

2012-03-14 Thread Merlin Moncure
2012/3/14 François Beausoleil franc...@teksol.info: Le mardi 13 mars 2012 à 11:15, Merlin Moncure a écrit : 2012/3/13 François Beausoleil franc...@teksol.info (mailto:franc...@teksol.info): I'll go with the COPY, since I can live with the batched requirements just fine. 30-40

Re: [GENERAL] COPY and indices?

2012-03-13 Thread Merlin Moncure
2012/3/12 François Beausoleil franc...@teksol.info: Hi all, When using COPY FROM STDIN to stream thousands of rows (20k and more hourly), what happens with indices? Are they updated only once after the operation, or are they updated once per row? Note that I'm not replacing the table's

Re: [GENERAL] COPY and indices?

2012-03-13 Thread Merlin Moncure
2012/3/13 François Beausoleil franc...@teksol.info: Le mardi 13 mars 2012 à 10:48, Merlin Moncure a écrit : 2012/3/12 François Beausoleil franc...@teksol.info (mailto:franc...@teksol.info): Currently, I can sustain 30-40 writes per second on a Rackspace VPS. I know it's not the ideal

Re: [GENERAL] Call for Google Summer of Code (GSoC) 2012: Project ideas?

2012-03-09 Thread Merlin Moncure
On Thu, Mar 8, 2012 at 2:01 PM, Andy Colson a...@squeakycode.net wrote: I know toast compresses, but I believe its only one row.  page level would compress better because there is more data, and it would also decrease the amount of IO, so it might speed up disk access. er, but when data is

Re: [GENERAL] Call for Google Summer of Code (GSoC) 2012: Project ideas?

2012-03-09 Thread Merlin Moncure
On Fri, Mar 9, 2012 at 10:19 AM, Andy Colson a...@squeakycode.net wrote: On 3/9/2012 9:47 AM, Merlin Moncure wrote: On Thu, Mar 8, 2012 at 2:01 PM, Andy Colsona...@squeakycode.net  wrote: I know toast compresses, but I believe its only one row.  page level would compress better because

Re: [GENERAL] Advisory transaction lock for 128-bit space

2012-03-08 Thread Merlin Moncure
On Thu, Mar 8, 2012 at 2:05 AM, Kiriakos Georgiou kg.postgre...@olympiakos.com wrote: Indeed, if there is not some sort of implementation limitation, it would be cool to be able to lock two big integers like so:     pg_try_advisory_xact_lock(key1 bigint, key2 bigint) Well, this would require

Re: [GENERAL] Synchronous replication + Fusion-io = waste of money OR significant performance boost? (compared to normal SATA-based SSD-disks)?

2012-03-08 Thread Merlin Moncure
On Wed, Mar 7, 2012 at 2:54 AM, Joel Jacobson j...@trustly.com wrote: My company is in the process of migrating to a new pair of servers, running 9.1. The database performance monetary transactions, we require synchronous_commit on for all transactions. Fusion-io is being considered, but

Re: [BUGS] [GENERAL] Altering a table with a rowtype column

2012-03-08 Thread Merlin Moncure
On Wed, Mar 7, 2012 at 2:49 PM, Merlin Moncure mmonc...@gmail.com wrote: On a practical level, the error blocks nothing -- you can bypass it trivially.   It's just an annoyance that prevents things that users would like to be able to do with table row types.  So I'd argue to remove the check

Re: [GENERAL] Altering a table with a rowtype column

2012-03-07 Thread Merlin Moncure
On Wed, Mar 7, 2012 at 11:22 AM, Mike Blackwell mike.blackw...@rrd.com wrote: Given a pair of tables: create table a (   id serial,   stuff text,   more_stuff text ); create table a_audit (   id serial,   old_record a,   new_record a ); How can one alter the structure of table a?  

Re: [GENERAL] Altering a table with a rowtype column

2012-03-07 Thread Merlin Moncure
On Wed, Mar 7, 2012 at 11:45 AM, Mike Blackwell mike.blackw...@rrd.com wrote: works for me -- what version are you on? merlin -- [wcs1459@aclnx-cisp01 ~]$ psql --version psql (PostgreSQL) 9.1.1 contains support for command-line editing [wcs1459@aclnx-cisp01 ~]$ cat x create table

Re: [GENERAL] corrupted table postgresql 8.3

2012-03-07 Thread Merlin Moncure
On Tue, Mar 6, 2012 at 6:34 PM, Matteo Sgalaberni sg...@sgala.com wrote: - Original Message - On 6.3.2012 21:24, Matteo Sgalaberni wrote: Hi people! I have a pg 8.3. Today I issued in a database that comand: Which minor version? The last one in this branch is 8.3.18 and if

Re: [GENERAL] Converting stored procedures from SQL Anywhere to PostGres.

2012-03-07 Thread Merlin Moncure
On Wed, Mar 7, 2012 at 12:51 PM, mgo...@isstrucksoftware.net wrote: I am trying to convert stored procedures from SQL Anywhere to Postgres. I am getting error ERROR:  syntax error at or near return LINE 2: return integer AS        ^ ** Error ** ERROR: syntax error at or

Re: [GENERAL] Altering a table with a rowtype column

2012-03-07 Thread Merlin Moncure
On Wed, Mar 7, 2012 at 1:17 PM, Mike Blackwell mike.blackw...@rrd.com wrote: As a followup, the workaround fails if there is data in the source table due to the initial null value placed in the existing data rows. [wcs1459@aclnx-cisp01 ~]$ psql --port=5433 -e -f x begin; BEGIN create table

Re: [BUGS] [GENERAL] Altering a table with a rowtype column

2012-03-07 Thread Merlin Moncure
On Wed, Mar 7, 2012 at 2:31 PM, Tom Lane t...@sss.pgh.pa.us wrote: Merlin Moncure mmonc...@gmail.com writes: On Wed, Mar 7, 2012 at 11:45 AM, Mike Blackwell mike.blackw...@rrd.com wrote: alter table a add column even_more_stuff boolean not null default false; aha! that's not what you posted

Re: [GENERAL] Return unknown resultset from a function

2012-03-05 Thread Merlin Moncure
On Sun, Mar 4, 2012 at 1:52 PM, Jan Meyland Andersen j...@agile.dk wrote: How do I return an unknown resultset from a function My main problem is that I do not know how many columns or the data type of the columns before runtime. It this possible at all? I also tried to return the data as a

Re: [GENERAL] Return unknown resultset from a function

2012-03-05 Thread Merlin Moncure
On Mon, Mar 5, 2012 at 10:08 AM, Tom Lane t...@sss.pgh.pa.us wrote: Merlin Moncure mmonc...@gmail.com writes: The only exception to this rule is cursors.  Reading from cursors via FETCH allows you to pull data from a refcursor that was set up in a previous function call and works pretty well

Re: [GENERAL] Memory usage and configuration settings

2012-03-05 Thread Merlin Moncure
On Mon, Mar 5, 2012 at 6:37 AM, Mike C smith.not.west...@gmail.com wrote: Hi, I have been using table 17-2, Postgres Shared Memory Usage (http://www.postgresql.org/docs/9.1/interactive/kernel-resources.html) to calculate approximately how much memory the server will use. I'm using Postgres

Re: [GENERAL] Re: [PERFORM] Disable-spinlocks while compiling postgres 9.1 for ARM Cortex A8

2012-02-27 Thread Merlin Moncure
On Sun, Feb 26, 2012 at 6:16 AM, Jayashankar K B jayashankar...@lnties.com wrote: Ok. I did a manual patch and it Postgres 9.1.1 compiled for me without using the --disable-spinlocks option. Thanks a lot for the patch. :) By the way, could you please point me to the explanation on the

Re: [GENERAL] Re: [PERFORM] Disable-spinlocks while compiling postgres 9.1 for ARM Cortex A8

2012-02-23 Thread Merlin Moncure
On Thu, Feb 23, 2012 at 3:09 PM, Jayashankar K B jayashankar...@lnties.com wrote: Hi Tom, Sorry about the cross-post. I am not aware of the procedures for patch etc. Could you please tell me how to use the patch ? see general instructions here:

Re: [GENERAL] select as params to function

2012-02-17 Thread Merlin Moncure
On Fri, Feb 17, 2012 at 2:32 PM, Andy Colson a...@squeakycode.net wrote: On 2/17/2012 2:11 PM, Pavel Stehule wrote: Hello PostgreSQL has no table data type. You can use a array of records instead and then select fx((select array(select * from tab))); select fx(array(select t from tab

Re: [GENERAL] How to dereference 2 dimensional array?

2012-02-16 Thread Merlin Moncure
On Thu, Feb 16, 2012 at 9:48 AM, ChoonSoo Park luisp...@gmail.com wrote: I would like to construct hstore array from 2 dimensional array. For example, '{{f1, 1, f2, 123, f3, ABC, ...}, {f1, 2, f2, 345, f3, DEF, ...}}' Should be converted to 2 hstore values f1=1, f2=123, f3=ABC, ...

Re: [GENERAL] easy function or trigger to UPPER() all alpha data

2012-02-13 Thread Merlin Moncure
On Wed, Feb 8, 2012 at 10:51 AM, Andreas Kretschmer akretsch...@spamfence.net wrote: mgo...@isstrucksoftware.net mgo...@isstrucksoftware.net wrote: We need to ensure that our data is in upper case only in the db.  Is there a easy way to do this via a function without having to name each column

Re: [GENERAL] easy function or trigger to UPPER() all alpha data

2012-02-13 Thread Merlin Moncure
On Mon, Feb 13, 2012 at 11:42 AM, mgo...@isstrucksoftware.net wrote: Thank you very much.  This is most helpful. you're welcome. Keep in mind hstore features you need start with postgres 9.0 and it's an extension aka contrib you have to add to the database. (also as Andreas noted, please try

Re: [GENERAL] around fields with psql

2012-02-13 Thread Merlin Moncure
On Sat, Feb 11, 2012 at 2:03 AM, Jasen Betts ja...@xnet.co.nz wrote: On 2012-02-10, Steve Clark scl...@netwolves.com wrote: Is there a way with psql to get column output to be data1,data2,...,datan assuming you are trying to be compatible with CSV:  copy ( your_query_here ) to stdout with

Re: [GENERAL] around fields with psql

2012-02-10 Thread Merlin Moncure
On Fri, Feb 10, 2012 at 1:33 PM, Steve Clark scl...@netwolves.com wrote: On 02/10/2012 02:12 PM, Scott Marlowe wrote: On Fri, Feb 10, 2012 at 11:26 AM, Steve Clark scl...@netwolves.com wrote: Hello, Is there a way with psql to get column output to be data1,data2,...,datan I tried -F ,

Re: [GENERAL] Strategy for Primary Key Generation When Populating Table

2012-02-09 Thread Merlin Moncure
On Thu, Feb 9, 2012 at 10:49 AM, Rich Shepard rshep...@appl-ecosys.com wrote:  I have a lot of data currently in .pdf files. I can extract the relevant data to plain text and format it to create a large text file of INSERT INTO ... rows. I need a unique ID for each row and there are no columns

Re: [GENERAL] Strategy for Primary Key Generation When Populating Table

2012-02-09 Thread Merlin Moncure
On Thu, Feb 9, 2012 at 4:20 PM, Andy Colson a...@squeakycode.net wrote: On 2/9/2012 4:10 PM, David Salisbury wrote: On 2/9/12 10:08 AM, Rich Shepard wrote: I have reports containing macroinvertebrate collection data for several hundred (or several thousand) of taxa. There is no natural key

Re: [GENERAL] How to write in Postgres

2012-02-07 Thread Merlin Moncure
On Tue, Feb 7, 2012 at 8:03 AM, mgo...@isstrucksoftware.net wrote:  I have a SQL statement that I'm trying to convert from a SQL Anywhere function, but I'm getting a error.  Can't seem to figure out why.  Is the substring usage incorrect and if it is how do I accomplish this.  I'm trying

Re: [GENERAL] Puzzling full database lock

2012-02-06 Thread Merlin Moncure
On Fri, Feb 3, 2012 at 2:55 PM, Christopher Opena counterv...@gmail.com wrote: Merlin, thanks for the response. no problem. if you're open to architecture suggestions you might also want to consider going with HS/SR and getting those large olap queries off your main database. you'll have to

Re: [GENERAL] multiple parameters to an AGGREGATE function

2012-02-03 Thread Merlin Moncure
On Fri, Feb 3, 2012 at 11:27 AM, Graham graham.st...@virtual-worlds.biz wrote: Hi,   first time poster here ... I'm trying to write a simple Aggregate function which returns the nth element in a collection - ultimately I want to find 95th, 90th percentiles and so on. It'd be called like:

Re: [GENERAL] Puzzling full database lock

2012-02-02 Thread Merlin Moncure
On Wed, Feb 1, 2012 at 6:38 PM, Christopher Opena counterv...@gmail.com wrote: Hello folks, We've been running into some very strange issues of late with our PostgreSQL database(s).  We have an issue where a couple of queries push high CPU on a few of our processors and the entire database

Re: [GENERAL] Issue with CREATE EXTENSION tablefuncKreiter

2012-02-01 Thread Merlin Moncure
On Wed, Feb 1, 2012 at 8:52 AM, Chris Travers chris.trav...@gmail.com wrote: Hi all; We have gotten a report from a user who is having issues with CREATE EXTENSION tablefunc.  I figured I would ask for additional insight and assistance at this point. When the user tries to run CREATE

Re: [GENERAL] Index on parent/child hierarchy

2012-01-31 Thread Merlin Moncure
On Sun, Jan 29, 2012 at 5:55 AM, Dmitriy Igrishin dmit...@gmail.com wrote: The point here is that you can exploit the tree structure with a btree index.  Before we got recursive queries, this was often the best way to do it, but now it's kind of a niche solution to be used when certain things

Re: [GENERAL] Composite Type : pros and cons

2012-01-26 Thread Merlin Moncure
On Thu, Jan 26, 2012 at 3:22 AM, Leguevaques Alex alex.leguevaq...@wanadoo.fr wrote: Hello, I'm new to Pg and exploring its advanced functionalities for a project. I find composite type very interesting, but what are problems/limitations ? I'd want to create this structure for example:

Re: [GENERAL] Don't Thread On Me (PostgreSQL related)

2012-01-26 Thread Merlin Moncure
On Thu, Jan 26, 2012 at 3:52 PM, Rodrigo E. De León Plicet rdele...@gmail.com wrote: Quote: == This thread http://postgresql.1045698.n5.nabble.com/Multithread-Query-Planner-td5143643.html was mentioned in a performance

Re: [GENERAL] Index on parent/child hierarchy

2012-01-25 Thread Merlin Moncure
On Wed, Jan 25, 2012 at 5:54 AM, Jason Armstrong j...@riverdrums.com wrote: Hi I'm looking for advice on the best way to index a table that is defined as: create table uuid.master(id uuid, parent uuid references uuid.master(id), type_id smallint, primary key(id)); Besides the primary key,

Re: [GENERAL] Best way to create unique primary keys across schemas?

2012-01-24 Thread Merlin Moncure
On Tue, Jan 24, 2012 at 5:23 AM, panam pa...@gmx.net wrote: Wow, this is pretty useful. Just to fit it more to my original use case, I used this: CREATE schema schema1; CREATE schema schema2; CREATE TABLE tbl (ID serial primary key,foo varchar,bar varchar);  --in public schema CREATE TABLE

Re: [GENERAL] unnest array of row type

2012-01-12 Thread Merlin Moncure
On Thu, Jan 12, 2012 at 8:47 AM, Pavel Stehule pavel.steh...@gmail.com wrote: 2012/1/12  seil...@so-net.net.tw: Hi! CREATE TYPE my_row_type AS (c1 SMALLINT,c2 TEXT); CREATE FUNCTION tmp_get_c1(my_row_type) RETURNS SMALLINT AS 'SELECT $1.c1' LANGUAGE SQL; CREATE FUNCTION

Re: [GENERAL] question about the money type

2012-01-11 Thread Merlin Moncure
On Wed, Jan 11, 2012 at 9:32 AM, Szymon Guz mabew...@gmail.com wrote: Hi, in the documentation for 8.2 (http://www.postgresql.org/docs/8.2/interactive/datatype-money.html) there is info: Note: The money type is deprecated. Use numeric or decimal instead, in combination with theto_char 

Re: [GENERAL] (check) constraints on composite type

2012-01-10 Thread Merlin Moncure
On Tue, Jan 10, 2012 at 1:44 PM, David Johnston pol...@yahoo.com wrote: Sorry for not answering the main question but you really need to avoid phrases like near future.  That said, new features are only released during major releases and so at best you would have to wait for 9.2 which is

Re: [GENERAL] Radial searches of cartesian points?

2012-01-05 Thread Merlin Moncure
On Thu, Jan 5, 2012 at 11:01 AM, thatsanicehatyouh...@mac.com wrote: Hi, I have a data set of several hundred thousand points. Each point is saved as a three dimensional coordinate, i.e. (x, y, z). What I'd like to do is given a point in that space, get a list of all of the points in the

Re: [GENERAL] Duplicated entries are not ignored even if a do instead nothing rule is added.

2012-01-03 Thread Merlin Moncure
On Tue, Jan 3, 2012 at 1:42 AM, Alban Hertroys haram...@gmail.com wrote: On 3 Jan 2012, at 5:20, 邓尧 wrote: Hi, I'm new to pgsql, I need the do something like the INSERT IGNORE in mysql. After some searching I got a solution, which is adding a do instead nothing rule to the corresponding

Re: [GENERAL] PostgreSQL 9.1 pg_dump setval() sets wrong value

2011-12-29 Thread Merlin Moncure
On Thu, Dec 29, 2011 at 10:20 AM, Greg Donald gdon...@gmail.com wrote: On Wed, Dec 28, 2011 at 4:57 PM, Tom Lane t...@sss.pgh.pa.us wrote: SELECT pg_catalog.setval('cp_state_id_seq', 52, true); SELECT pg_catalog.setval('cp_state_id_seq', 1, false); These grep calls are showing just exactly

Re: [GENERAL] PostgreSQL 9.1 pg_dump setval() sets wrong value

2011-12-29 Thread Merlin Moncure
On Thu, Dec 29, 2011 at 10:53 AM, Greg Donald gdon...@gmail.com wrote: On Thu, Dec 29, 2011 at 10:27 AM, Merlin Moncure mmonc...@gmail.com wrote: if you take a bzipped schema only dump (pg_dump -s), I'd be happy to look it over and eliminate the 'operator error' class of issues that Tom

Re: [GENERAL] PostgreSQL 9.1 pg_dump setval() sets wrong value

2011-12-28 Thread Merlin Moncure
On Wed, Dec 28, 2011 at 10:20 AM, Adrian Klaver adrian.kla...@gmail.com wrote: On Wednesday, December 28, 2011 7:51:24 am Greg Donald wrote: On Wed, Dec 28, 2011 at 9:30 AM, Adrian Klaver adrian.kla...@gmail.com wrote: Wonder if it is related to this:

Re: [GENERAL] PostgreSQL 9.1 pg_dump setval() sets wrong value

2011-12-28 Thread Merlin Moncure
On Wed, Dec 28, 2011 at 12:34 PM, Adrian Klaver adrian.kla...@gmail.com wrote: On Wed, Dec 28, 2011 at 8:38 AM, Merlin Moncure mmonc...@gmail.com wrote: On Wed, Dec 28, 2011 at 10:20 AM, Adrian Klaver adrian.kla...@gmail.com wrote: I was thinking of the more generic case. The problem

Re: [GENERAL] postgresql triggers - defining a global resource (java)

2011-12-27 Thread Merlin Moncure
On Mon, Dec 26, 2011 at 8:32 AM, Aman Gupta gupta.a...@gmail.com wrote: Hey Alban, Thanks for the reply. I had a follow up question w.r.t listen/notify: I am planning to associate a NOTIFY with an update on a table - a trigger is associated with the update, and we execute NOTIFY in the

Re: [GENERAL] invalid memory alloc request size

2011-12-27 Thread Merlin Moncure
On Tue, Dec 27, 2011 at 4:07 PM, Tomas Vondra t...@fuzzy.cz wrote: Googling around, it sounds like this is often due to table corruption, which would be unfortunate, but usually seems to be repeatable. I can re-run that query without issue, and in fact can select * from the entire table

Re: [GENERAL] Kindly Please Help Me

2011-12-27 Thread Merlin Moncure
On Tue, Dec 27, 2011 at 5:11 PM, saqi...@igis.nust.edu.pk wrote: Hi every1 how are u all??? Members i am new in postgres and want to work on pgrouting but i am facing some issue will u please help me??? I have loaded my line shapefile in pgadmin environment but when i made a query at it it

Re: [GENERAL] PostgreSQL DBA in SPAAAAAAAACE

2011-12-20 Thread Merlin Moncure
On Tue, Dec 6, 2011 at 10:56 AM, Joe Miller joe.d.mil...@gmail.com wrote: You may have seen this, but RedGate software is sponsoring a contest to send a DBA on a suborbital space flight. And there is a PostgreSQL representativeme! https://www.dbainspace.com/finalists/joe-miller Voting

Re: [GENERAL] Logical Aggregate Functions (eg ANY())

2011-12-19 Thread Merlin Moncure
On Mon, Dec 19, 2011 at 3:42 AM, Marti Raudsepp ma...@juffo.org wrote: In fact, there's no reason why bool_or/bool_and couldn't do the same thing. bool_or() is like the max() for boolean values, and bool_and() is min(). CREATE AGGREGATE my_bool_or(bool) (sfunc=boolor_statefunc, stype=bool,

Re: [GENERAL] Logical Aggregate Functions (eg ANY())

2011-12-18 Thread Merlin Moncure
On Sat, Dec 17, 2011 at 6:06 PM, Robert James srobertja...@gmail.com wrote: On 12/15/11, Marti Raudsepp ma...@juffo.org wrote: On Thu, Dec 15, 2011 at 18:10, Robert James srobertja...@gmail.com wrote: How do I do the equivalent of an ANY() or ALL() in PG Aggregate SQL? Note that in many

Re: [GENERAL] Logical Aggregate Functions (eg ANY())

2011-12-15 Thread Merlin Moncure
On Thu, Dec 15, 2011 at 10:10 AM, Robert James srobertja...@gmail.com wrote: I see Postgres (I'm using 8.3) has bitwise aggregate functions (bit_or), but doesn't seem to have logical aggregate functions. How do I do the equivalent of an ANY() or ALL() in PG Aggregate SQL? CREATE OR REPLACE

Re: [GENERAL] CREATE OR REPLACE AGGREGATE

2011-12-15 Thread Merlin Moncure
On Thu, Dec 15, 2011 at 11:29 AM, Robert James srobertja...@gmail.com wrote: Is there anyway to do the equivalent of CREATE OR REPLACE AGGREGATE? Or - maybe even better - CREATE AGGREGATE if it doesn't already exist? Well, you have DROP [IF EXISTS] which should cover at least some of the use

Re: [GENERAL] Controlling complexity in queries

2011-12-14 Thread Merlin Moncure
On Tue, Dec 13, 2011 at 4:27 PM, Jay Levitt jay.lev...@gmail.com wrote: Merlin Moncure wrote: Breaking your large queries into functions OTOH can make significant changes to the plan, often to the worse. As an end-user, I think this is an area where PostgreSQL could really stand out

Re: [GENERAL] order of (escaped) characters in regex range

2011-12-13 Thread Merlin Moncure
On Tue, Dec 13, 2011 at 7:51 AM, InterRob rob.mar...@gmail.com wrote: Thanks guys, i see what you mean. I do intend to use the PG escaping, in order to avoid that annoying warning... Hence, my expression should indeed be: SELECT regexp_matches('123-A' , E'(3[A-Z\\-\\(\\) ])'); In the above

Re: [GENERAL] order of (escaped) characters in regex range

2011-12-13 Thread Merlin Moncure
On Tue, Dec 13, 2011 at 10:53 AM, David Johnston pol...@yahoo.com wrote: Aside from backward compatibility, and the various warnings, is there any reason to prefer dollar-quoting over a non-SQL-escaped string literal (i.e., '3[A-Z\-\(\) ]'   ) ? yeah -- because sooner or later you have to

Re: [GENERAL] query for all values linked to a field

2011-12-13 Thread Merlin Moncure
On Tue, Dec 13, 2011 at 2:37 PM, anisoptera dragon...@elseworld.com wrote: hi, i'm trying to output all values that can be reached from a specific record by a foreign key link. for example, if tblimage has image_id, image_info and tblstack has stack_id=tblimage.image_id, stack_info_1,

Re: [GENERAL] Controlling complexity in queries

2011-12-12 Thread Merlin Moncure
On Sun, Dec 11, 2011 at 9:10 PM, Craig Ringer ring...@ringerc.id.au wrote: On 12/12/2011 09:15 AM, David Johnston wrote: Use a WITH clause on the SELECT statement. Note that WITH is an optimisation fence, so if you're relying on Pg pushing WHERE clauses down into subqueries or anything like

Re: [GENERAL] Hope for a new PostgreSQL era?

2011-12-08 Thread Merlin Moncure
On Wed, Dec 7, 2011 at 8:52 PM, Rodrigo E. De León Plicet rdele...@gmail.com wrote: http://www.dbms2.com/2011/11/23/hope-for-a-new-postgresql-era/ Some of the points mentioned: - MySQL is narrowing the gap, but PostgreSQL is still ahead of MySQL  in some ways.  (Database extensibility if

Re: [GENERAL] Hope for a new PostgreSQL era?

2011-12-08 Thread Merlin Moncure
On Thu, Dec 8, 2011 at 9:11 AM, Marc Cousin cousinm...@gmail.com wrote: Le Thu, 8 Dec 2011 12:27:22 +, Simon Riggs si...@2ndquadrant.com a écrit : On Thu, Dec 8, 2011 at 11:24 AM, Craig Ringer ring...@ringerc.id.au wrote: Areas in which Pg seems significantly less capable include:

Re: [GENERAL] Hope for a new PostgreSQL era?

2011-12-08 Thread Merlin Moncure
On Thu, Dec 8, 2011 at 10:11 AM, Marc Cousin cousinm...@gmail.com wrote: Le Thu, 8 Dec 2011 09:29:28 -0600, Merlin Moncure mmonc...@gmail.com a écrit : On Thu, Dec 8, 2011 at 9:11 AM, Marc Cousin cousinm...@gmail.com wrote: Le Thu, 8 Dec 2011 12:27:22 +, Simon Riggs si

Re: [GENERAL] dblink performance

2011-12-07 Thread Merlin Moncure
On Wed, Dec 7, 2011 at 10:14 AM, Alex Bible alex.bi...@ctg.com wrote: Hello All, I’m currently on a development team utilizing PostgreSQL and we are looking into the possibility of using dblink to reference an external database (read only). Our system administrator and DBA were concerned

Re: [GENERAL] dblink performance

2011-12-07 Thread Merlin Moncure
On Wed, Dec 7, 2011 at 2:47 PM, Marc Mamin m.ma...@intershop.de wrote: On Wed, Dec 7, 2011 at 10:14 AM, Alex Bible alex.bi...@ctg.com wrote: Hello All, I'm currently on a development team utilizing PostgreSQL and we are looking into the possibility of using dblink to reference an

Re: [GENERAL] dblink performance

2011-12-07 Thread Merlin Moncure
On Wed, Dec 7, 2011 at 3:37 PM, Marc Mamin m.ma...@intershop.de wrote: I find dblink being a nice tool as long as the data volume to transfer remains low. I've evaluated it to implement a clustered Postgres environment, but gave it up due to the poor performances. Still waiting for

Re: [GENERAL] PostgreSQL DBA in SPAAAAAAAACE

2011-12-06 Thread Merlin Moncure
On Tue, Dec 6, 2011 at 10:56 AM, Joe Miller joe.d.mil...@gmail.com wrote: You may have seen this, but RedGate software is sponsoring a contest to send a DBA on a suborbital space flight. And there is a PostgreSQL representativeme! https://www.dbainspace.com/finalists/joe-miller Voting

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Merlin Moncure
On Fri, Dec 2, 2011 at 8:16 AM, Torsten Zuehlsdorff f...@meisterderspiele.de wrote: Damien Churchill schrieb: after several attempts I have finally succeeded in developing a urlencode() function to encode text correctly like defined in RFC 1738. Now i have a big problem: how to decode the

Re: [GENERAL] Limiting number of connections to PostgreSQL per IP (not per DB/user)?

2011-12-02 Thread Merlin Moncure
On Wed, Nov 30, 2011 at 6:03 PM, Tomas Vondra t...@fuzzy.cz wrote: On 29.11.2011 23:38, Merlin Moncure wrote: On Tue, Nov 29, 2011 at 7:49 AM, Heiko Wundram modeln...@modelnine.org wrote: Hello! Sorry for that subscribe post I've just sent, that was bad reading on my part

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Merlin Moncure
On Fri, Dec 2, 2011 at 10:42 AM, Marti Raudsepp ma...@juffo.org wrote: Sorry, but AFAICT this makes a mess of encodings and only works by pure luck. The server thinks it's sending the client LATIN1 text, but it's actually UTF8-encoded and the last decoding step is done by your terminal. yup

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Merlin Moncure
On Fri, Dec 2, 2011 at 11:15 AM, Pavel Stehule pavel.steh...@gmail.com wrote: 2011/12/2 Merlin Moncure mmonc...@gmail.com: On Fri, Dec 2, 2011 at 10:42 AM, Marti Raudsepp ma...@juffo.org wrote: Sorry, but AFAICT this makes a mess of encodings and only works by pure luck. The server thinks it's

Re: [GENERAL] How to convert HEX to ASCII?

2011-12-02 Thread Merlin Moncure
On Fri, Dec 2, 2011 at 2:01 PM, Pavel Stehule pavel.steh...@gmail.com wrote: so bytea_agg - one param aggregate has sense it's very easy to implement it yup: create aggregate bytea_agg (bytea) (  sfunc=byteacat,  stype=bytea ); this is workaround :) without a memory preallocating it

Re: [GENERAL] Limiting number of connections to PostgreSQL per IP (not per DB/user)?

2011-11-30 Thread Merlin Moncure
On Tue, Nov 29, 2011 at 7:49 AM, Heiko Wundram modeln...@modelnine.org wrote: Hello! Sorry for that subscribe post I've just sent, that was bad reading on my part (for the subscribe info on the homepage). Anyway, the title says it all: is there any possibility to limit the number of

Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread Merlin Moncure
On Tue, Nov 22, 2011 at 11:25 AM, Kenneth Tilton ktil...@mcna.net wrote: Bit of a trigger NOOB Q: I am trying to use a trigger function to automatically populate new rows in a table with  a public ID of the form -NNN such that the 42nd row created in 2011 would get the ID 2011-042. Each

Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread Merlin Moncure
On Tue, Nov 22, 2011 at 2:43 PM, David Johnston pol...@yahoo.com wrote: Just create a single sequence for each year and then call the proper one on-the-fly.  You can create multiple sequences in advance and possible even auto-create the sequence the first time one is attempted to be used in a

Re: [GENERAL] Incremental backup with RSYNC or something?

2011-11-22 Thread Merlin Moncure
On Sun, Nov 13, 2011 at 5:38 AM, Phoenix Kiula phoenix.ki...@gmail.com wrote: Hi. I currently have a cronjob to do a full pgdump of the database every day. And then gzip it for saving to my backup drive. However, my db is now 60GB in size, so this daily operation is making less and less

Re: [GENERAL] function within a function/rollbacks/exception handling

2011-11-08 Thread Merlin Moncure
On Tue, Nov 8, 2011 at 9:13 AM, Lori Corbani lori.corb...@jax.org wrote: Richard, I manage to find one comment about an implicit rollback in a section of the developer's guide when porting from Oracle-to-Postgres:  when an exception is caught by an EXECPTION clause, all database changes since

Re: [GENERAL] PostgreSQL references in the Middle East

2011-11-07 Thread Merlin Moncure
On Sun, Nov 6, 2011 at 11:04 PM, Jan Geluk (Collis) ge...@collis.nl wrote: Dear all, For our customer in Dubai, we are looking for references of PostgreSQL implementations in the Middle East, preferably in the GCC countries, preferably in the United Arab Emirates (Dubai / Abu Dhabi).

Re: [GENERAL] Behavior of negative OFFSET

2011-11-07 Thread Merlin Moncure
On Mon, Nov 7, 2011 at 3:47 PM, Robert James srobertja...@gmail.com wrote: I've been using a query on Postgres 8.4 with a negative OFFSET, which works fine:   SELECT DISTINCT s.* FROM s WHERE ... ORDER BY s.bday ASC, s.name ASC LIMIT 15 OFFSET -15 When I run the same query on Postgres 9.1,

Re: [GENERAL] select where not exists returning multiple rows?

2011-11-02 Thread Merlin Moncure
On Wed, Nov 2, 2011 at 6:22 AM, Chris Dumoulin ch...@blaze.io wrote: We're using postgresql 9.1, and we've got a table that looks like this: testdb=# \d item Table public.item  Column   |   Type   | Modifiers ---+--+---  sig   | bigint   | not null  type  | smallint |  

Re: [GENERAL] select where not exists returning multiple rows?

2011-11-02 Thread Merlin Moncure
On Wed, Nov 2, 2011 at 8:20 AM, Chris Dumoulin ch...@blaze.io wrote: On 11-11-02 09:13 AM, Martijn van Oosterhout wrote: On Wed, Nov 02, 2011 at 07:22:09AM -0400, Chris Dumoulin wrote: And we're doing an insert like this: INSERT INTO Item (Sig, Type, Data) SELECT $1,$2,$3 WHERE NOT EXISTS (

Re: [GENERAL] Recommendations for SSDs in production?

2011-11-02 Thread Merlin Moncure
On Wed, Nov 2, 2011 at 12:01 PM, Benjamin Smith li...@benjamindsmith.com wrote: Well, After reading several glowing reviews of the new OCZ Vertex3 SSD last spring, we did some performance testing in dev on RHEL6. (CentOS) The results were nothing short of staggering. Complex query results

Re: [GENERAL] [PL/pgSQL] function call

2011-10-31 Thread Merlin Moncure
On Mon, Oct 31, 2011 at 8:31 AM, Tarlika Elisabeth Schmitz postgres...@numerixtechnology.de wrote: I have created a function log_insert(), which is simply a shorthand for an INSERT table and which I want to call from various trigger functions. CREATE OR REPLACE FUNCTION log_insert(vseverity

Re: [GENERAL] nextval skips values between consecutive calls

2011-10-28 Thread Merlin Moncure
On Fri, Oct 28, 2011 at 10:28 AM, depst...@alliedtesting.com wrote: -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Friday, October 28, 2011 7:22 PM To: Dmitry Epstein Cc: pgsql-general@postgresql.org; Peter Gagarinov Subject: Re: [GENERAL] nextval skips values

Re: [GENERAL] nextval skips values between consecutive calls

2011-10-28 Thread Merlin Moncure
On Fri, Oct 28, 2011 at 11:32 AM, depst...@alliedtesting.com wrote: -Original Message- From: Merlin Moncure [mailto:mmonc...@gmail.com] Sent: Friday, October 28, 2011 8:29 PM To: Dmitry Epstein Cc: t...@sss.pgh.pa.us; pgsql-general@postgresql.org; Peter Gagarinov Subject: Re

Re: [GENERAL] Primary key Index Error

2011-10-25 Thread Merlin Moncure
On Tue, Oct 25, 2011 at 2:41 AM, Raghavendra raghavendra@enterprisedb.com wrote: On Tue, Oct 25, 2011 at 11:40 AM, Manoj K P ma...@comodo.com wrote: Server log Oct 1 00:06:59 server_host_name postgres[1453]: [5-1] 2011-10-01 00:06:59.831 EDT 1453 4e869041.5ad postgres [local] postgres LOG:

Re: [GENERAL] missing chunk 0 for toast value ...

2011-10-25 Thread Merlin Moncure
On Tue, Oct 25, 2011 at 3:47 PM, Andrew Hammond andrew.george.hamm...@gmail.com wrote: I found the following error message in my logfiles. Oct 24 04:05:57 db-app02 postgres[24640]: [2-1] user=nutricate,db=admin_production ERROR:  missing chunk number 0 for toast value 2411466 in pg_toast_2619

Re: [GENERAL] Primary key Index Error

2011-10-24 Thread Merlin Moncure
On Mon, Oct 24, 2011 at 8:32 AM, manoj ma...@comodo.com wrote: On 10/24/2011 06:38 PM, Merlin Moncure wrote: On Mon, Oct 24, 2011 at 3:22 AM, Manoj K P ma...@comodo.com wrote: Postgres recovered from data folder , after that some queries shows error select * from table2 order by app_id

Re: [GENERAL] Primary key Index Error

2011-10-24 Thread Merlin Moncure
On Mon, Oct 24, 2011 at 3:22 AM, Manoj K P ma...@comodo.com wrote: Postgres recovered from data folder , after that some queries shows error select * from table2 order by app_id  ; - its work ( 5000 data) select * from table2 order by app_id   desc ; - its work Here app_id contains  

Re: [GENERAL] Reading PG data from MySQL stored procedure

2011-10-20 Thread Merlin Moncure
On Thu, Oct 20, 2011 at 2:22 PM, Gauthier, Dave dave.gauth...@intel.com wrote: Here's a real long shot, but what the heck... I have a user that's using a system that gives him a single MySQL DB handle to work with.  He must get all his data through this handle.  He wants some of my PG based

Re: [GENERAL] a set of key/value pairs

2011-10-20 Thread Merlin Moncure
On Thu, Oct 20, 2011 at 1:53 PM, J.V. jvsr...@gmail.com wrote: Does anyone have a specific example of how to:    1) create a variable that is a set or array of key value pairs?    2) how to populate each element of the array (each element being a key / value pair)    3) how to iterate through

Re: [GENERAL] Composite type, DEFAULT, NOT NULL, REFERENCES

2011-10-19 Thread Merlin Moncure
On Wed, Oct 19, 2011 at 9:32 AM, erhaminus erhami...@o2.pl wrote: Hi, Is a way to define DEFAULT, NOT NULL and REFERENCES for members of composite type? For example: -- type CREATE TYPE bibl.bibliography AS (        edition TEXT,        publisher_id BIGINT ); -- table def create

Re: [GENERAL] many sql file and one transaction

2011-10-18 Thread Merlin Moncure
On Tue, Oct 18, 2011 at 7:57 AM, Cédric Villemain cedric.villemain.deb...@gmail.com wrote: 2011/10/18 salah jubeh s_ju...@yahoo.com: Hello, Thanks for the reply. I considered  cat as an option but I did not go for it, because of the number of sql files I have is large  which makes the code

Re: [GENERAL] plpgsql; execute query inside exists

2011-10-17 Thread Merlin Moncure
On Mon, Oct 17, 2011 at 2:32 AM, jozsef.kur...@invitel.hu wrote: Hi there, I would like to use EXISTS in a small plpgsql function but I always get a syntax error. How can I execute a query inside the EXISTS function? IF NOT EXISTS(EXECUTE 'SELECT * FROM '|| tmp_tbl)   THEN      CREATE

Re: [GENERAL] plpgsql; execute query inside exists

2011-10-17 Thread Merlin Moncure
On Mon, Oct 17, 2011 at 8:20 AM, Merlin Moncure mmonc...@gmail.com wrote: On Mon, Oct 17, 2011 at 2:32 AM,  jozsef.kur...@invitel.hu wrote: Hi there, I would like to use EXISTS in a small plpgsql function but I always get a syntax error. How can I execute a query inside the EXISTS function

Re: [GENERAL] index bloat question

2011-10-17 Thread Merlin Moncure
On Mon, Oct 17, 2011 at 2:15 AM, Szymon Guz mabew...@gmail.com wrote: On 17 October 2011 02:01, Scott Marlowe scott.marl...@gmail.com wrote: On Sun, Oct 16, 2011 at 2:41 PM, Szymon Guz mabew...@gmail.com wrote: Hi, just a couple of questions: will there be an index bloat if I have: -

Re: [GENERAL] plpgsql; execute query inside exists

2011-10-17 Thread Merlin Moncure
On Mon, Oct 17, 2011 at 8:44 AM, Alban Hertroys haram...@gmail.com wrote: On 17 October 2011 15:20, Merlin Moncure mmonc...@gmail.com wrote: A better way to do this is to query information_schema: PERFORM 1 FROM information_schema.tables where schema_name = x and table_name = y; IF FOUND

Re: [GENERAL] plpgsql; execute query inside exists

2011-10-17 Thread Merlin Moncure
On Mon, Oct 17, 2011 at 10:28 AM, Alban Hertroys haram...@gmail.com wrote: On 17 October 2011 16:24, Merlin Moncure mmonc...@gmail.com wrote: On Mon, Oct 17, 2011 at 8:44 AM, Alban Hertroys haram...@gmail.com wrote: On 17 October 2011 15:20, Merlin Moncure mmonc...@gmail.com wrote: A better

<    3   4   5   6   7   8   9   10   11   12   >