[GENERAL] Tablename.columnname%TYPE in Types On PostgreSQL 9.2

2013-04-09 Thread Adrien Besson
Hello Everyone, Trying to create a type using %Type seems not to work on PostgreSQL 9.2: CREATE TYPE type1 AS (tvar_1 TABLE1. COL1%TYPE , tvar_2 INTEGER); Returns XX ERROR: syntax error at or near "%" Where am I wrong ? Someone has an idea ? Thanks a lot ! BESSON Adrien

[GENERAL] Queries seldomly take >4s while normally take <1ms?

2013-04-09 Thread Christian Hammers
Hello I have a setup with one master and two slaves which are used by a closed source application. The database is asked the same query, a stored procedure, with different parameters about 4 million times per second at a peak rate of 150 times per second using 10 parallel connections. The slaves a

Re: [GENERAL] Backup advice

2013-04-09 Thread Eduardo Morras
On Mon, 8 Apr 2013 10:40:16 -0500 Shaun Thomas wrote: > > Anyone else? > If his db has low inserts/updates/deletes he can use diff between pg_dumps (with default -Fp) before compressing. --- --- Eduardo Morras -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To mak

Re: [GENERAL] Queries seldomly take >4s while normally take <1ms?

2013-04-09 Thread Greg Williamson
Christian -- postgres version ? type of replication ? changes from postgres config defaults ? Do they happen more at peak usage, semi regularly or sporadically ? Possibly some sporadic postgres process such as checkpoints of autovac processes kicking off. Do your logs show anything ? HTH,

Re: [GENERAL] Tablename.columnname%TYPE in Types On PostgreSQL 9.2

2013-04-09 Thread Albe Laurenz
Adrien Besson wrote: > Trying to create a type using %Type seems not to work on PostgreSQL 9.2: > > CREATE TYPE type1 AS (tvar_1 TABLE1. COL1%TYPE , tvar_2 INTEGER); > > Returns > > XX ERROR: syntax error at or near "%" > > Where am I wrong ? Someone has an idea ? I think that the %TYPE synt

Re: [GENERAL] Queries seldomly take >4s while normally take <1ms?

2013-04-09 Thread Christian Hammers
Hello On Tue, 9 Apr 2013 03:53:13 -0700 (PDT) Greg Williamson wrote: > Christian -- > > > > postgres version ? 9.2.3 > type of replication ? As written, one master does streaming replication to two slaves. > changes from postgres config defaults ? max_connections = 1000

Re: [GENERAL] pg_stat_get_last_vacuum_time(): why non-FULL?

2013-04-09 Thread CR Lender
On 2013-04-09 00:09, Kevin Grittner wrote: > I'm not sure that what we're doing now is correct, but updating > things as if a normal vacuum had been done would *not* be the thing > to do. For starters, VACUUM FULL blows away the free space map and > visibility map for a table. Among other things,

Re: [GENERAL] postgresql command line exploit found in the wild

2013-04-09 Thread Christoph Berg
Re: Daniel Verite 2013-04-08 > Merlin Moncure wrote: > > > if you have an internet facing database, patch it immediately! > > By the way: > > People running 9.1 on debian stable (squeeze) typically use this package: > http://packages.debian.org/squeeze-backports/postgresql-9.1 > > Curren

Re: [GENERAL] Queries seldomly take >4s while normally take <1ms?

2013-04-09 Thread Kevin Grittner
Christian Hammers wrote: > 9.2.3 You really need to think about 9.2.4 Real Soon Now; there's a security fix that you probably should not wait on. > max_connections = 1000  # (change requires restart) > shared_buffers = 20GB  # min 128kB Those are both potential

Re: [GENERAL] optimizer's cost formulas

2013-04-09 Thread Sébastien Lorion
The tool to tweak the query planner parameters mentioned in the article sounds very useful. Can we download it somewhere, either as binary or source code ? Sébastien On Mon, Apr 8, 2013 at 2:44 AM, Daniel Bausch wrote: > Hi, > > AFAIK there is no such thing in the code or documentation. > Never

[GENERAL] Disallow SET command in a postgresql server

2013-04-09 Thread Fabio Rueda Carrascosa
Im planning to publish my postgresql server to a few untrusted clients. I dont want them to modify any runtime setting, like work_mem or something risky to my server. In general I assume the pg_catalog schema is public but I don't want to allow updating pg_settings at all. Is it possible?

Re: [GENERAL] Disallow SET command in a postgresql server

2013-04-09 Thread Tom Lane
Fabio Rueda Carrascosa writes: > Im planning to publish my postgresql server to a few untrusted clients. > I dont want them to modify any runtime setting, like work_mem or something > risky to my server. In general I assume the pg_catalog schema is public but > I don't want to allow updating pg_se

Re: [GENERAL] Disallow SET command in a postgresql server

2013-04-09 Thread Fabio Rueda Carrascosa
My grant/revoke architecture is fine, you mean about costly cpu/ram queries? 2013/4/9 Tom Lane > Fabio Rueda Carrascosa writes: > > Im planning to publish my postgresql server to a few untrusted clients. > > I dont want them to modify any runtime setting, like work_mem or > something > > risky

Re: [GENERAL] Disallow SET command in a postgresql server

2013-04-09 Thread Alvaro Herrera
Fabio Rueda Carrascosa escribió: > My grant/revoke architecture is fine, you mean about costly cpu/ram queries? Sure. The SQL dialect supported by Postgres is Turing-complete, so people can write statements that consume arbitrary amounts of RAM and diskspace, and run for arbitrary amounts of time

Re: [GENERAL] Disallow SET command in a postgresql server

2013-04-09 Thread Merlin Moncure
On Tue, Apr 9, 2013 at 10:57 AM, Fabio Rueda Carrascosa wrote: > My grant/revoke architecture is fine, you mean about costly cpu/ram queries? it has nothing to do with grant/revoke. There are multiple trivial things a user can do to DOS you server. You can prevent a lot of them, but it's defin

Re: [GENERAL] Disallow SET command in a postgresql server

2013-04-09 Thread Merlin Moncure
On Tue, Apr 9, 2013 at 11:13 AM, Merlin Moncure wrote: > On Tue, Apr 9, 2013 at 10:57 AM, Fabio Rueda Carrascosa > wrote: >> My grant/revoke architecture is fine, you mean about costly cpu/ram queries? > > it has nothing to do with grant/revoke. There are multiple trivial > things a user can do

Re: [GENERAL] Disallow SET command in a postgresql server

2013-04-09 Thread Joshua D. Drake
On 04/09/2013 09:06 AM, Alvaro Herrera wrote: Fabio Rueda Carrascosa escribió: My grant/revoke architecture is fine, you mean about costly cpu/ram queries? Sure. The SQL dialect supported by Postgres is Turing-complete, so people can write statements that consume arbitrary amounts of RAM an

[GENERAL] Create a DBLink from PostrgeSQL 9.2 to Oracle 11g

2013-04-09 Thread kiran
Hello, I am looking for an example on creating a DBLink from PostrgeSQL 9.2 to Oracle 11g. I tried the below link and for some reason the ODBC_Link installation is failing. FYI., http://vibhork.blogspot.com/2011/05/postgresql-database-link-to-oracle.html I have the Heterogeneous DB Connection B

Re: [GENERAL] Create a DBLink from PostrgeSQL 9.2 to Oracle 11g

2013-04-09 Thread Merlin Moncure
On Tue, Apr 9, 2013 at 11:07 AM, kiran wrote: > Hello, > > I am looking for an example on creating a DBLink from PostrgeSQL 9.2 to > Oracle 11g. > I tried the below link and for some reason the ODBC_Link installation is > failing. > > FYI., > http://vibhork.blogspot.com/2011/05/postgresql-database

[GENERAL] What is pg backend using memory for?

2013-04-09 Thread hubert depesz lubaczewski
Hi, So, I checked a backend on Linux, and found such thing: 2ba63c797000-2ba63fa68000 rw-p 2ba63c797000 00:00 0 Size: 52036 kB Rss: 51336 kB Shared_Clean: 0 kB Shared_Dirty: 0 kB Private_Clean:0 kB Private_Dirty:51336 kB Swap: 0 k

Re: [GENERAL] Inconsistent query performance

2013-04-09 Thread Ramsey Gurley
On Apr 8, 2013, at 7:09 PM, Kevin Grittner wrote: > Ramsey Gurley wrote: > >> I'm having issues with slow queries using postgres, and I'm >> finding some of the issues difficult to reproduce. My application >> logs slow queries for me, but often, when I go back to run explain >> analyze on the

Re: [GENERAL] Inconsistent query performance

2013-04-09 Thread Ramsey Gurley
On Apr 8, 2013, at 8:46 PM, Jeff Janes wrote: > On Monday, April 8, 2013, Ramsey Gurley wrote: > Hi all, > > I'm having issues with slow queries using postgres, and I'm finding some of > the issues difficult to reproduce. My application logs slow queries for me, > but often, when I go back to

Re: [GENERAL] Queries seldomly take >4s while normally take <1ms?

2013-04-09 Thread Christian Hammers
On Tue, 9 Apr 2013 07:25:16 -0700 (PDT) Kevin Grittner wrote: > Christian Hammers wrote: > > > 9.2.3 > > You really need to think about 9.2.4 Real Soon Now; there's a > security fix that you probably should not wait on. Is scheduled (no access from outside to that network segment at least) >

[GENERAL] Character set display

2013-04-09 Thread AI Rumman
Hi, I got a data like: AHrühn And I need the output like: AHrühn The DB is running with UTF8 on Postgresql 9.2. Any help will be appreciated. Thanks.

Re: [GENERAL] Queries seldomly take >4s while normally take <1ms?

2013-04-09 Thread Scott Marlowe
One of the most common causes I've seen for this is linux's vm.*dirty* settings to get in the way. Like so many linux kernel "optimizations" this one looks good on paper but gives at best middling improvements with occasional io storms that block everything else. On big mem machines doing a lot of

Re: [GENERAL] Character set display

2013-04-09 Thread John R Pierce
On 4/9/2013 10:37 AM, AI Rumman wrote: Hi, I got a data like: AHrühn And I need the output like: AHrühn The DB is running with UTF8 on Postgresql 9.2. Any help will be appreciated. Thanks. when/where are you getting this? in a terminal session? from a web app? is your terminal

Re: [GENERAL] Queries seldomly take >4s while normally take <1ms?

2013-04-09 Thread Steven Schlansker
On Apr 9, 2013, at 11:25 AM, Scott Marlowe wrote: > One of the most common causes I've seen for this is linux's vm.*dirty* > settings to get in the way. Like so many linux kernel "optimizations" this > one looks good on paper but gives at best middling improvements with > occasional io storms

Re: [GENERAL] Queries seldomly take >4s while normally take <1ms?

2013-04-09 Thread Scott Marlowe
On Tue, Apr 9, 2013 at 12:37 PM, Steven Schlansker wrote: > > On Apr 9, 2013, at 11:25 AM, Scott Marlowe > wrote: > > > One of the most common causes I've seen for this is linux's vm.*dirty* > settings to get in the way. Like so many linux kernel "optimizations" this > one looks good on paper but

[GENERAL] After dump/restoring from 32bit 8.4-windows to 64bit 9.2.4-linux experiencing 10x slowdown on queries

2013-04-09 Thread Giovanni Martina
Hi, I'm trying to upgrade our database server from postgresql 32-bit 8.2.4 running on Windows Server 2008 to postgresql 64-bit 9.2.4 on ubuntu server 12.04.02 LTS. I have dumped one of our databases from our windows server and restored it on the postgres server running on ubuntu in order to test

Re: [GENERAL] After dump/restoring from 32bit 8.4-windows to 64bit 9.2.4-linux experiencing 10x slowdown on queries

2013-04-09 Thread Rob Sargent
On 04/09/2013 02:29 PM, Giovanni Martina wrote: Hi, I'm trying to upgrade our database server from postgresql 32-bit 8.2.4 running on Windows Server 2008 to postgresql 64-bit 9.2.4 on ubuntu server 12.04.02 LTS. I have dumped one of our databases from our windows server and restored it on the p

Re: [GENERAL] After dump/restoring from 32bit 8.4-windows to 64bit 9.2.4-linux experiencing 10x slowdown on queries

2013-04-09 Thread Rob Sargent
On 04/09/2013 02:29 PM, Giovanni Martina wrote: Hi, I'm trying to upgrade our database server from postgresql 32-bit 8.2.4 running on Windows Server 2008 to postgresql 64-bit 9.2.4 on ubuntu server 12.04.02 LTS. I have dumped one of our databases from our windows server and restored it on the p

[GENERAL] Facing difficulty in PITR

2013-04-09 Thread chiru r
Hello, We are facing difficulty in PITR. *Case :* Production server backups are happening every day at 12:00AM mid night and we are refreshing Test server with the backup and applying wal archives up to 10:00AM. *Issue:* * * While transferring wal archives from Production to Test server, unfort

Re: [GENERAL] Facing difficulty in PITR

2013-04-09 Thread Jerry Sievers
chiru r writes: > Hello, > > We are facing?difficulty?in PITR. > > Case : > > Production server backups are happening every day at 12:00AM mid night and we > are refreshing Test server with the > backup and applying wal?archives up to?10:00AM. > > Issue: > > While?transferring?wal archives from

Re: [GENERAL] Facing difficulty in PITR

2013-04-09 Thread chiru r
Thanks Jerry,it worked for me and saved my time. Regards, Chiru On Wed, Apr 10, 2013 at 4:57 AM, Jerry Sievers wrote: > chiru r writes: > > > Hello, > > > > We are facing?difficulty?in PITR. > > > > Case : > > > > Production server backups are happening every day at 12:00AM mid night > and we

Re: [GENERAL] Create a DBLink from PostrgeSQL 9.2 to Oracle 11g

2013-04-09 Thread wd
You can try http://oracle-fdw.projects.postgresql.org/ On Wed, Apr 10, 2013 at 12:07 AM, kiran wrote: > Hello, > > I am looking for an example on creating a DBLink from PostrgeSQL 9.2 to > Oracle 11g. > I tried the below link and for some reason the ODBC_Link installation is > failing. > > FYI.,