Re: [GENERAL] partitioning a dataset + employing hysteresis condition

2011-11-15 Thread David Johnston
On Nov 15, 2011, at 15:28, Gavin Flower wrote: > On 14/11/11 18:35, Amit Dor-Shifer wrote: >> >> >> On Mon, Nov 14, 2011 at 4:29 PM, Amit Dor-Shifer >> wrote: >> Hi, >> I've got this table: >> create table phone_calls >> ( >> start_time timestamp, >> device_id integer, >> term_st

Re: [GENERAL] partitioning a dataset + employing hysteresis condition

2011-11-15 Thread Gavin Flower
On 14/11/11 18:35, Amit Dor-Shifer wrote: On Mon, Nov 14, 2011 at 4:29 PM, Amit Dor-Shifer mailto:amit.dor.shi...@gmail.com>> wrote: Hi, I've got this table: create table phone_calls ( start_time timestamp, device_id integer, term_status integer );

Re: [GENERAL] partitioning a dataset + employing hysteresis condition

2011-11-15 Thread Gavin Flower
On 14/11/11 18:35, Amit Dor-Shifer wrote: On Mon, Nov 14, 2011 at 4:29 PM, Amit Dor-Shifer mailto:amit.dor.shi...@gmail.com>> wrote: Hi, I've got this table: create table phone_calls ( start_time timestamp, device_id integer, term_status integer );

Re: [GENERAL] how to adjust auto increment id offset?

2011-11-15 Thread Scott Marlowe
On Tue, Nov 15, 2011 at 9:03 PM, Yan Chunlu wrote: > thanks a lot for the tip! > sorry for used the wrong word, it is just multi-master but not sharding,  I > would like to setup two master server across two datacenter.  one's id > increased by 1, and the other by 2. > so I could have a queue sync

Re: [GENERAL] how to adjust auto increment id offset?

2011-11-15 Thread Yan Chunlu
thanks a lot for the tip! sorry for used the wrong word, it is just multi-master but not sharding, I would like to setup two master server across two datacenter. one's id increased by 1, and the other by 2. so I could have a queue sync the record in the background by myself. kind of a dumb way

Re: [GENERAL] how to drop function?

2011-11-15 Thread John R Pierce
On 11/15/11 5:48 PM, J.V. wrote: the drop function works when running from a pgAdmin III Sql window but when I try to do from the command line and script it: psql -h $PGHOST -p $PGPORT -d $PGDATABASE -U $PGUSER -c "*drop function *" the above fails. can you please give the complete

Re: [GENERAL] deferring pk constraint

2011-11-15 Thread Nathan Wagner
On Tue, 15 Nov 2011 18:56:37 -0700, J.V. wrote: I have a table with existing data for which I need to: 1) drop the single primary key column (int4) 2) recreate the column with the pk (not null) constraint deferred 3) repopulate the column from a sequence 4) enable the constraint When I issue th

Re: [GENERAL] how to drop function?

2011-11-15 Thread Scott Marlowe
On Tue, Nov 15, 2011 at 6:48 PM, J.V. wrote: > the drop function works when running from a pgAdmin III Sql window > > but when I try to do from the command line and script it: >     psql -h $PGHOST -p $PGPORT -d $PGDATABASE -U $PGUSER -c "drop function > " > > the above fails. What's the res

[GENERAL] deferring pk constraint

2011-11-15 Thread J.V.
I have a table with existing data for which I need to: 1) drop the single primary key column (int4) 2) recreate the column with the pk (not null) constraint deferred 3) repopulate the column from a sequence 4) enable the constraint When I issue this command to add the column: alter table add c

Re: [GENERAL] how to drop function?

2011-11-15 Thread David Johnston
On Nov 15, 2011, at 20:24, "J.V." wrote: > this did not work. > > On 11/15/2011 4:56 PM, Craig Ringer wrote: >> On 11/16/2011 07:38 AM, J.V. wrote: >>> How do I drop a function that was created like so: >>> >>> create or replace function process_table (action TEXT, v_table_name >>> varchar(100)

Re: [GENERAL] how to drop function?

2011-11-15 Thread J.V.
the drop function works when running from a pgAdmin III Sql window but when I try to do from the command line and script it: psql -h $PGHOST -p $PGPORT -d $PGDATABASE -U $PGUSER -c "*drop function *" the above fails. It does however work with functions with no params or a single param

Re: [GENERAL] how to drop function?

2011-11-15 Thread J.V.
this does not work. On 11/15/2011 4:56 PM, Rebecca Clarke wrote: DROP FUNCTION process_table; should work. On Tue, Nov 15, 2011 at 11:38 PM, J.V. > wrote: How do I drop a function that was created like so: create or replace function process_table (action T

Re: [GENERAL] how to drop function?

2011-11-15 Thread J.V.
this did not work. On 11/15/2011 4:56 PM, Craig Ringer wrote: On 11/16/2011 07:38 AM, J.V. wrote: How do I drop a function that was created like so: create or replace function process_table (action TEXT, v_table_name varchar(100)) RETURNS BOOLEAN AS $$ DECLARE BEGIN ... END; $$ LANGUAGE p

Re: [GENERAL] how to drop function?

2011-11-15 Thread Ivan Sergio Borgonovo
On Tue, 15 Nov 2011 16:38:20 -0700 "J.V." wrote: > How do I drop a function that was created like so: > > create or replace function process_table (action TEXT, > v_table_name varchar(100)) RETURNS BOOLEAN > AS $$ > DECLARE > > BEGIN >... > END; > $$ LANGUAGE plpgsql; > > --- > I have

Re: [GENERAL] how to drop function?

2011-11-15 Thread Adrian Klaver
On Tuesday, November 15, 2011 3:56:32 pm Rebecca Clarke wrote: > DROP FUNCTION process_table; > > should work. > Actually no, for the following reason:( http://www.postgresql.org/docs/9.0/interactive/sql-dropfunction.html "DROP FUNCTION removes the definition of an existing function. To execute

Re: [GENERAL] how to drop function?

2011-11-15 Thread Rebecca Clarke
DROP FUNCTION process_table; should work. On Tue, Nov 15, 2011 at 11:38 PM, J.V. wrote: > How do I drop a function that was created like so: > > create or replace function process_table (action TEXT, v_table_name > varchar(100)) RETURNS BOOLEAN > AS $$ > DECLARE > > BEGIN > ... > END; >

Re: [GENERAL] how to drop function?

2011-11-15 Thread Craig Ringer
On 11/16/2011 07:38 AM, J.V. wrote: How do I drop a function that was created like so: create or replace function process_table (action TEXT, v_table_name varchar(100)) RETURNS BOOLEAN AS $$ DECLARE BEGIN ... END; $$ LANGUAGE plpgsql; --- I have tried various ways, but it always fails. D

[GENERAL] how to drop function?

2011-11-15 Thread J.V.
How do I drop a function that was created like so: create or replace function process_table (action TEXT, v_table_name varchar(100)) RETURNS BOOLEAN AS $$ DECLARE BEGIN ... END; $$ LANGUAGE plpgsql; --- I have tried various ways, but it always fails. J.V. -- Sent via pgsql-general ma

[GENERAL] Questions about "EXPLAIN"

2011-11-15 Thread David Johnston
Hey, PostgreSQL 9.0 1) While comparing a simple GROUP/COUNT query I noticed that TEXT and JSON formats identify the Top-Level Plan Node differently (GroupAggregate vs. Aggregate). More curiosity than anything but I would have expected them to match. 2) For the same query I was hoping to be able

Re: [GENERAL] syntax highlighting in emacs after \e in psql

2011-11-15 Thread Peter Eisentraut
On mån, 2011-11-14 at 08:08 -0800, MikeW wrote: > When I open *.sql files in my emacs it highlights the SQL and Postgres > syntax correctly. But does anybody know how to make it behave like > that also after invoking \e command in psql (so that I don't need to > say: M-x sql-mode each time). My .pr

Re: [GENERAL] Where to get PG 9.0.5 SLES RPM's !?

2011-11-15 Thread David Morton
No suggestions about where to get the phantom RPM's ? I've managed to locate a source RPM for 9.0.3 which I'm going to look at using with source from 9.0.5 From: David Morton To: "pgsql-general@postgresql.org" Sent: Monday, 14 November 2011 4:18 PM Subjec

Re: [GENERAL] Syntax To Create Table As One In Another Database

2011-11-15 Thread John R Pierce
On 11/15/11 8:42 AM, Rich Shepard wrote: I need a pointer to the appropriate docs that show me how to specify a table in a different database. What I want is to CREATE TABLE AS TABLE ; but using a period (dot) to separate the source database and table name doesn't work. My searches of the 9

Re: [GENERAL] Syntax To Create Table As One In Another Database

2011-11-15 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Rich Shepard Sent: Tuesday, November 15, 2011 11:42 AM To: pgsql-general@postgresql.org Subject: [GENERAL] Syntax To Create Table As One In Another Database I need a poin

Re: [GENERAL] Syntax To Create Table As One In Another Database

2011-11-15 Thread Rich Shepard
On Tue, 15 Nov 2011, David Johnston wrote: Aside from roles/users each database exists in isolation and so what you describe cannot be done. The syntax you describe "." is reserved for "SCHEMA" usage within PostgreSQL. David, This was pointed out to me. What I did was display the schema

Re: [GENERAL] PostgresSQL 8.4 to 9.0 on Windows 7

2011-11-15 Thread John R Pierce
On 11/15/11 4:45 AM, Twaha Daudi wrote: Iam newbie here and have been trying to install postgresSQL 8.4 to 9.0 on windows 7 home premium (64).I would like to talk with tomcat 6.0.33.Sometimes it works but it does not communicate to tomcat.What could be the problem? insufficient information t

Re: [GENERAL] encoding and LC_COLLATE

2011-11-15 Thread LPlateAndy
Hi Adrian/Mark Thanks again for your help, i have now got the load working by setting the encoding to WIN1252. I had been assuming i was setting it to UTF8 SET CLIENT_ENCODING TO 'WIN1252'; Andy -- View this message in context: http://postgresql.1045698.n5.nabble.com/encoding-and-LC-COLLATE-tp

[GENERAL] Syntax To Create Table As One In Another Database

2011-11-15 Thread Rich Shepard
I need a pointer to the appropriate docs that show me how to specify a table in a different database. What I want is to CREATE TABLE AS TABLE ; but using a period (dot) to separate the source database and table name doesn't work. My searches of the 9.0.x docs have missed finding this informa

Re: [GENERAL] all non-PK columns from information schema

2011-11-15 Thread Richard Broersma
On Tue, Nov 15, 2011 at 8:00 AM, Tarlika Elisabeth Schmitz wrote: > Interesting. I have previously used the information_schema for similar > queries. > > What are the pros and cons for using either pg_catalog or > information_schema? My understanding is that pg_catalog tables and views *can* chan

Re: [GENERAL] encoding and LC_COLLATE

2011-11-15 Thread LPlateAndy
Hi Mark (and Adrian), As as update i've now found the same data fails on my postgres 8 which doesn't seem to have the LC_COLLATE etc setting and is just UTF-8 so i guess there is possibly just something about the way the data is getting passed in. This is the error message from postgres 9

Re: [GENERAL] all non-PK columns from information schema

2011-11-15 Thread Tarlika Elisabeth Schmitz
On Tue, 15 Nov 2011 09:26:35 -0600 Mike Blackwell wrote: >On Tue, Nov 15, 2011 at 02:59, Tarlika Elisabeth Schmitz < >postgres...@numerixtechnology.de> wrote: > >> I'd like to select all column names for a specific table except >> those that are part of the PK. >> -- >> Tarlika Elisabeth Schmitz

Re: [GENERAL] EXECUTE USING problem

2011-11-15 Thread Raymond O'Donnell
On 15/11/2011 12:45, Graham wrote: > Using PG 9.0.3, I wish to dynamically reference a column in a table > passed into a PL/PgSQL function as follows: > > -- A table with some values. > DROP TABLE IF EXISTS table1; > CREATE TABLE table1 ( > code INT, > descr TEXT > ); > > INSERT INTO

Re: [GENERAL] EXECUTE USING problem

2011-11-15 Thread Pavel Stehule
Hello 2011/11/15 Graham : > Using PG 9.0.3, I wish to dynamically reference a column in a table passed > into a PL/PgSQL function as follows: > > -- A table with some values. >  DROP TABLE IF EXISTS table1; >  CREATE TABLE table1 ( >     code INT, >     descr TEXT >  ); > > INSERT INTO table1 VALU

Re: [GENERAL] : Postgres installation error on CentOS

2011-11-15 Thread Venkat Balaji
Hi Alban, Thanks for the reply ! I was able to resolve this issue, but, not by removing the older version of zlib (i was unable to do so due to dependencies). I did not have older version of zlib-devel installed, I did that and able to install. Regards, VB On Tue, Nov 15, 2011 at 5:56 PM, Alba

[GENERAL] EXECUTE USING problem

2011-11-15 Thread Graham
Using PG 9.0.3, I wish to dynamically reference a column in a table passed into a PL/PgSQL function as follows: -- A table with some values. DROP TABLE IF EXISTS table1; CREATE TABLE table1 ( code INT, descr TEXT ); INSERT INTO table1 VALUES ('1','a'); INSERT INTO table1 VALUES ('2

[GENERAL] PostgresSQL 8.4 to 9.0 on Windows 7

2011-11-15 Thread Twaha Daudi
Hello all, Iam newbie here and have been trying to install postgresSQL 8.4 to 9.0 on windows 7 home premium (64).I would like to talk with tomcat 6.0.33.Sometimes it works but it does not communicate to tomcat.What could be the problem? thanks in advance cheers

Re: [GENERAL] : Postgres installation error on CentOS

2011-11-15 Thread Alban Hertroys
On 15 November 2011 12:58, Venkat Balaji wrote: > Hello, > We are facing an issue while installing Postgres-9.0.1 on CentOS-5. That name always makes me wonder when they're releasing PennyOS or DollarOS :P > Below is the error we are encountering - > ./configure -- output > checking for inflate

[GENERAL] : Postgres installation error on CentOS

2011-11-15 Thread Venkat Balaji
Hello, We are facing an issue while installing Postgres-9.0.1 on CentOS-5. Below is the error we are encountering - ./configure -- output checking for inflate in -lz... no configure: error: zlib library not found If you have zlib already installed, see config.log for details on the failure. It

Re: [GENERAL] how to adjust auto increment id offset?

2011-11-15 Thread Andrew Sullivan
On Tue, Nov 15, 2011 at 04:44:23PM +0800, Yan Chunlu wrote: > I would like to implement two master db with even-odd id sharding. in > mysql it is fairly easy by using the configuration: > > auto_increment_offset = 1 > auto_increment_increment = 2 > > > but I have searched a lot didn't find any

Re: [GENERAL] how to adjust auto increment id offset?

2011-11-15 Thread John R Pierce
On 11/15/11 12:56 AM, Bèrto ëd Sèra wrote: Hi On 15 November 2011 11:44, Yan Chunlu > wrote: I would like to implement two master db with even-odd id sharding. in mysql it is fairly easy by using the configuration: auto_increment_offset = 1 auto

[GENERAL] all non-PK columns from information schema

2011-11-15 Thread Tarlika Elisabeth Schmitz
I'd like to select all column names for a specific table except those that are part of the PK. I know I need to somehow join information_schema.columns, key_column_usage and table_constraints but how? -- Best Regards, Tarlika Elisabeth Schmitz -- Sent via pgsql-general mailing list (pgsql-ge

Re: [GENERAL] Client SQL Tool

2011-11-15 Thread Robins Tharakan
On 11/15/2011 01:55 PM, bjo...@hillebrandar.de wrote: I don't want to replace the other tools. It's just another client for postgreSQL and there is a long road for a release. And yes, it uses .NET 4.0 and WPF. The implementation is more than a little more than simply ADO.NET. The ADO.NET objects

Re: [GENERAL] how to adjust auto increment id offset?

2011-11-15 Thread Bèrto ëd Sèra
Hi On 15 November 2011 11:44, Yan Chunlu wrote: > I would like to implement two master db with even-odd id sharding. in > mysql it is fairly easy by using the configuration: > > auto_increment_offset = 1 > auto_increment_increment = 2 > > > but I have searched a lot didn't find anything relate

[GENERAL] how to adjust auto increment id offset?

2011-11-15 Thread Yan Chunlu
I would like to implement two master db with even-odd id sharding. in mysql it is fairly easy by using the configuration: auto_increment_offset = 1 auto_increment_increment = 2 but I have searched a lot didn't find anything related to this, some users doing this via trigger like "rubyrep". is

Re: [GENERAL] Client SQL Tool

2011-11-15 Thread bjoern
I don't want to replace the other tools. It's just another client for postgreSQL and there is a long road for a release. And yes, it uses .NET 4.0 and WPF. The implementation is more than a little more than simply ADO.NET. The ADO.NET objects only transfer the results to the view. In the backe