[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

Re: [GENERAL] Backup advice

2013-04-09 Thread Eduardo Morras
On Mon, 8 Apr 2013 10:40:16 -0500 Shaun Thomas stho...@optionshouse.com 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 emorr...@yahoo.es -- Sent via pgsql-general mailing

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

2013-04-09 Thread Greg Williamson
Christian -- original text snip because this POS editor won't let me properly edit 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

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 syntax is

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 gwilliamso...@yahoo.com wrote: Christian -- original text snip because this POS editor won't let me properly edit postgres version ? 9.2.3 type of replication ? As written, one master does streaming replication to two

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 cd81d201-e9fa-4567-ac49-e3e762935747@mm 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:

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

2013-04-09 Thread Kevin Grittner
Christian Hammers c...@lathspell.de 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

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 bau...@dvs.tu-darmstadt.dewrote: Hi, AFAIK there is no such thing in the code

[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 avances...@gmail.com 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

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 t...@sss.pgh.pa.us Fabio Rueda Carrascosa avances...@gmail.com writes: Im planning to publish my postgresql server to a few untrusted clients. I dont want them to modify any runtime setting, like

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 avances...@gmail.com 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

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 mmonc...@gmail.com wrote: On Tue, Apr 9, 2013 at 10:57 AM, Fabio Rueda Carrascosa avances...@gmail.com wrote: My grant/revoke architecture is fine, you mean about costly cpu/ram queries? it has nothing to do with grant/revoke. There are

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

[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

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 kiran.peddire...@cmegroup.com 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.,

[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

Re: [GENERAL] Inconsistent query performance

2013-04-09 Thread Ramsey Gurley
On Apr 8, 2013, at 7:09 PM, Kevin Grittner wrote: Ramsey Gurley rgur...@smarthealth.com 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

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 run

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 kgri...@ymail.com wrote: Christian Hammers c...@lathspell.de 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

[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 scott.marl...@gmail.com 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

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 ste...@likeness.comwrote: On Apr 9, 2013, at 11:25 AM, Scott Marlowe scott.marl...@gmail.com 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

[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

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

[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,

Re: [GENERAL] Facing difficulty in PITR

2013-04-09 Thread Jerry Sievers
chiru r chir...@gmail.com 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

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 gsiever...@comcast.netwrote: chiru r chir...@gmail.com writes: Hello, We are facing?difficulty?in PITR. Case : Production server backups are happening every day at

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 kiran.peddire...@cmegroup.comwrote: 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