[GENERAL] Zero-length character breaking query?

2012-03-16 Thread Doug Gorley
G'day, I believe I've got some bad data in a table, but I'm not sure how it got there, or how this scenario is possible. The table is called tdt_unsent. The field is str_name_l. For demonstration purposes, the value is "SMITH". "select * from tdt_unsent where str_name_l = 'SMITH'" returns 0

Re: [GENERAL] A 154 GB table swelled to 527 GB on the Slony slave. How to compact it?

2012-03-16 Thread Greg Williamson
Filip Rembiałkowski suggested: >> On Thu, Mar 15, 2012 at 6:43 AM, Aleksey Tsalolikhin >> wrote: >> >> >> Is there any way to consolidate the pages on the slave without taking >> replication offline? >> >> >maybe CLUSTER? > <...> > >Of course events destined to this table will be queued by

[GENERAL] Problem for restoure data base Postgre

2012-03-16 Thread BrunoSteven
I am trying restoure data base from Postgre running on Windows Server 2003 32bits with Postgre with 9.0.3 for a Linux running Centos 6 with Postgre 9.0.7 , but wasn´t working very well . I post follow link for paste bin with some message error http://pastebin.com/94qnc8Hj I don´t understan

Re: [GENERAL] Problem for restoure data base Postgre

2012-03-16 Thread Alban Hertroys
On 16 Mar 2012, at 24:53, BrunoSteven wrote: > I am trying restoure data base from Postgre running on Windows Server 2003 > 32bits with Postgre with 9.0.3 for a Linux running Centos 6 with Postgre > 9.0.7 , but wasn´t working very well . > > I post follow link for paste bin with some message

Re: [GENERAL] Optimise PostgreSQL for fast testing

2012-03-16 Thread Simon Riggs
On Fri, Mar 16, 2012 at 4:38 AM, Dmytrii Nagirniak wrote: > To "fix" it I open a transaction before each test and roll it back at the > end. > > Some numbers for ~700 tests. > > - Truncation: SQLite - 34s, PG - 76s. > - Transaction: SQLite - 17s, PG - 18s. > > 2x speed increase for SQLite. > 4x s

Re: [GENERAL] how to measure wal_buffer usage

2012-03-16 Thread Albe Laurenz
Lonni J Friedman wrote: > After reading this interesting article on shared_buffers and wal_buffers: > http://rhaas.blogspot.com/2012/03/tuning-sharedbuffers-and-walbuffers.html > > it got me wondering if my settings were ideal. Is there some way to > measure wal_buffer usage in real time, so that

Re: [GENERAL] Zero-length character breaking query?

2012-03-16 Thread David Johnston
On Mar 15, 2012, at 19:09, Doug Gorley wrote: > G'day, > > I believe I've got some bad data in a table, but I'm not sure how it got > there, or how this scenario is possible. > > The table is called tdt_unsent. The field is str_name_l. For demonstration > purposes, the value is "SMITH". >

Re: [GENERAL] Zero-length character breaking query?

2012-03-16 Thread Tom Lane
Doug Gorley writes: > The table is called tdt_unsent. The field is str_name_l. For demonstration > purposes, the value is "SMITH". > "select * from tdt_unsent where str_name_l = 'SMITH'" returns 0 rows. > "select * from tdt_unsent where str_name_l ~ '^SMITH'" returns 3 rows. > "select * from

Re: [GENERAL] Problem for restoure data base Postgre

2012-03-16 Thread Tom Lane
Alban Hertroys writes: > On 16 Mar 2012, at 24:53, BrunoSteven wrote: >> I am trying restoure data base from Postgre running on Windows Server 2003 >> 32bits with Postgre with 9.0.3 for a Linux running Centos 6 with Postgre >> 9.0.7 , but wasn´t working very well . >> >> I post follow link f

[GENERAL] serial- sequence priveleges

2012-03-16 Thread salah jubeh
Hello, When creating a serial, a sequence is created automatically. CREATE TABLE tablename ( colname SERIAL ); CREATE SEQUENCE tablename_colname_seq; CREATE TABLE tablename ( colname integer NOT NULL DEFAULT nextval('tablename_colname_seq') ); ALTER SEQUENCE tablename_colname_seq OWNED BY tablen

Re: [GENERAL] Temporal foreign keys

2012-03-16 Thread Andreas Kretschmer
Jeff Davis wrote: > On Fri, 2012-02-03 at 07:58 +0100, Matthias wrote: > > Hey, > > > > how can I implement temporal foreign keys with postgresql? Is writing > > triggers the only way to enforce temporal referential integrity > > currently? > > Yes, currently that's the only way. Look at CREATE

Re: [GENERAL] how to measure wal_buffer usage

2012-03-16 Thread Lonni J Friedman
On Fri, Mar 16, 2012 at 2:45 AM, Albe Laurenz wrote: > Lonni J Friedman wrote: >> After reading this interesting article on shared_buffers and wal_buffers: >> http://rhaas.blogspot.com/2012/03/tuning-sharedbuffers-and-walbuffers.html >> >> it got me wondering if my settings were ideal.  Is there s

Re: [GENERAL] serial- sequence priveleges

2012-03-16 Thread Adrian Klaver
On 03/16/2012 07:06 AM, salah jubeh wrote: Hello, When creating a serial, a sequence is created automatically. CREATE TABLEtablename ( colname SERIAL ); CREATE SEQUENCE tablename_colname_seq; CREATE TABLE tablename ( colname integer NOT NULL DEFAULT nextval('tablename_colname_seq')

Re: [GENERAL] how to measure wal_buffer usage

2012-03-16 Thread Albe Laurenz
Lonni J Friedman wrote: >>> After reading this interesting article on shared_buffers and wal_buffers: >>> http://rhaas.blogspot.com/2012/03/tuning-sharedbuffers-and-walbuffers.html >>> >>> it got me wondering if my settings were ideal.  Is there some way to >>> measure wal_buffer usage in real time

Re: [GENERAL] serial- sequence priveleges

2012-03-16 Thread Adrian Klaver
On 03/16/2012 08:00 AM, salah jubeh wrote: Hello Adrian, Sorry, I was not clear. what I meant is that. GRANT INSERT, UPDATE ON tablenaem TO USER; -- leads to GRANT ALL ON TABLE tablename_colname_seq TO USER CCing the list. Still not following. What version of Postgres are you using? Using 9.

Re: [GENERAL] serial- sequence priveleges

2012-03-16 Thread Adrian Klaver
On 03/16/2012 08:00 AM, salah jubeh wrote: Hello Adrian, Sorry, I was not clear. what I meant is that. GRANT INSERT, UPDATE ON tablenaem TO USER; -- leads to GRANT ALL ON TABLE tablename_colname_seq TO USER Another thought you do not happen to have DEFAULT PRIVILEGES set up for sequences:

[GENERAL] Windows 7 Compatibility

2012-03-16 Thread Wong, Beverly
I work with Philadelphia Gas Works & would like to know if Postgresql v8.0.3 is compatible with Windows 7 OS. Thank You Beverly T. Wong I Ext: 6026 Technical Writing Intern Philadelphia Gas Works

Re: [GENERAL] Problem for restoure data base Postgre

2012-03-16 Thread aspenbr
Alban, Fist Was installed postgre 8 on Centos after I remove this version and install postgre 9 . Maybe there are rest of installation of version 8 . Thank you Sent from my iPhone On 16/03/2012, at 05:07, Alban Hertroys wrote: > On 16 Mar 2012, at 24:53, BrunoSteven wrote: > >> I am tryin

Re: [GENERAL] Problem for restoure data base Postgre

2012-03-16 Thread Scott Marlowe
On Fri, Mar 16, 2012 at 5:21 AM, wrote: > Alban, > > Fist Was installed postgre 8 on Centos after I remove this version and > install postgre 9 . Maybe there are rest of installation of version 8 . That doesn't explain how you wound up with a dump created by 9.1 though. (assuming you installed

Re: [GENERAL] Windows 7 Compatibility

2012-03-16 Thread m...@trausch.us
On 03/16/2012 10:08 AM, Wong, Beverly wrote: > I work with Philadelphia Gas Works & would like to know if Postgresql > v8.0.3 is compatible with Windows 7 OS. First, you shouldn't be considering the user of PostgreSQL version 8.0; starting with the release of PostgreSQL 8.3, versions 8.0 and 8.1 a

Re: [GENERAL] Windows 7 Compatibility

2012-03-16 Thread m...@trausch.us
On 03/16/2012 10:08 AM, Wong, Beverly wrote: > I work with Philadelphia Gas Works & would like to know if > Postgresql v8.0.3 is compatible with Windows 7 OS. Oops, forgot to address the Windows 7 component of your question in the previous reply. According to [0], PostgreSQL is not supported on W

Re: [GENERAL] Zero-length character breaking query?

2012-03-16 Thread Peter Bex
On Thu, Mar 15, 2012 at 05:09:32PM -0600, Doug Gorley wrote: > G'day, > > "select * from tdt_unsent where str_name_l = 'SMITH'" returns 0 rows. > "select * from tdt_unsent where str_name_l ~ '^SMITH'" returns 3 rows. > "select * from tdt_unsent where str_name_l ~ '^SMITH$'" returns 0 rows. > "sele

[GENERAL] Authenticating from a web service call

2012-03-16 Thread Bryan Montgomery
Hello, We are looking at implementing a web service that basically makes calls to the database. I have been thinking about ways to secure the web service based on the database. I initially thought about just connecting to the database as the user with parameters passed through the web service - h

Re: [GENERAL] Authenticating from a web service call

2012-03-16 Thread Raymond O'Donnell
On 16/03/2012 18:39, Bryan Montgomery wrote: > Hello, > We are looking at implementing a web service that basically makes calls > to the database. > > I have been thinking about ways to secure the web service based on the > database. > > I initially thought about just connecting to the database a

Re: [GENERAL] Zero-length character breaking query?

2012-03-16 Thread Bosco Rama
Doug Gorley wrote: > > "select * from tdt_unsent where str_name_l = 'SMITH'" returns 0 rows. > "select * from tdt_unsent where str_name_l ~ '^SMITH'" returns 3 rows. > "select * from tdt_unsent where str_name_l ~ '^SMITH$'" returns 0 rows. > "select length(str_name_l) from tdt_unsent where str_nam

Re: [GENERAL] A 154 GB table swelled to 527 GB on the Slony slave. How to compact it?

2012-03-16 Thread Aleksey Tsalolikhin
On Thu, Mar 15, 2012 at 6:43 AM, Aleksey Tsalolikhin wrote: > Is there any way to consolidate the pages on the slave without taking > replication offline? Filip Rembiałkowski suggested: maybe CLUSTER? Greg Williamson suggested: pg_reorg Thank you, Filip and Greg. They would both work IF I h

Re: [GENERAL] A 154 GB table swelled to 527 GB on the Slony slave. How to compact it?

2012-03-16 Thread Steve Crawford
I'm coming into this conversation *way* late so forgive me if this has been hashed out already On 03/16/2012 12:20 PM, Aleksey Tsalolikhin wrote: CLUSTER requires free space at least equal to the sum of the tablesize and the index sizes. Although it is not documented in an absolutely clear

Re: [GENERAL] Temporal foreign keys

2012-03-16 Thread Jeff Davis
On Fri, 2012-03-16 at 15:13 +0100, Andreas Kretschmer wrote: > > On Fri, 2012-02-03 at 07:58 +0100, Matthias wrote: > > > how can I implement temporal foreign keys with postgresql? Is writing > > > triggers the only way to enforce temporal referential integrity > > > currently? > > > It works in 9

Re: [GENERAL] A 154 GB table swelled to 527 GB on the Slony slave. How to compact it?

2012-03-16 Thread Alban Hertroys
On 16 Mar 2012, at 20:20, Aleksey Tsalolikhin wrote: > CLUSTER requires free space at least equal to the sum of the table > size and the index sizes. > > pg_reorg rquires amount of space twice larger than target table and indexes. > > Too bad I can't say "CLUSTER TABLE tablename USING_ARRAY > /d

[GENERAL] Query

2012-03-16 Thread prem tolani
Hi, I am using postgresql-8.1 in my application. When I restart the application, I am getting error PG "FATAL:� could not reattach to shared memory (key=5432001, addr=0210): Invalid argument. I would appreciate, if you can provide some inputs. Regards, Prem -- Sent via pgsql-general m

Re: [GENERAL] A 154 GB table swelled to 527 GB on the Slony slave. How to compact it?

2012-03-16 Thread Scott Marlowe
On Fri, Mar 16, 2012 at 1:20 PM, Aleksey Tsalolikhin wrote: > On Thu, Mar 15, 2012 at 6:43 AM, Aleksey Tsalolikhin > wrote: >> Is there any way to consolidate the pages on the slave without taking >> replication offline? > > Filip Rembiałkowski suggested:   maybe CLUSTER? > > Greg Williamson sugg

Re: [GENERAL] Query

2012-03-16 Thread Adrian Klaver
On 03/16/2012 02:38 PM, prem tolani wrote: Hi, I am using postgresql-8.1 in my application. When I restart the application, I am getting error PG "FATAL:� could not reattach to shared memory (key=5432001, addr=0210): Invalid argument. I would appreciate, if you can provide some inputs.

[GENERAL] pg_upgrade and statistics generation

2012-03-16 Thread Bruce Momjian
I have posted a blog entry about how to get pg_upgrade to generate useful optimizer statistics more quickly once it finishes: http://momjian.us/main/blogs/pgblog/2012.html#March_16_2012 I have also provided scripts that can be used with pg_upgrade 9.1 and earlier, so feel free to try them

Re: [GENERAL] A 154 GB table swelled to 527 GB on the Slony slave. How to compact it?

2012-03-16 Thread Aleksey Tsalolikhin
On Fri, Mar 16, 2012 at 2:03 PM, Steve Crawford wrote: > > > I *think* you can get away with only sufficient free space to store the > *new* table and indexes Yeah; I don't have that much free space. Just 30 GB short. :( > Depending on your schema and which tables are using space, you might b

Re: [GENERAL] Query

2012-03-16 Thread Tom Lane
prem tolani writes: > I am using postgresql-8.1 in my application. When I restart the application, > I am getting error > PG "FATAL:� could not reattach to shared memory (key=5432001, > addr=0210): Invalid > argument. This was fixed in 8.3.something. 8.1 has been out of support for awhi