[GENERAL] create table sintax

2011-04-19 Thread Júlio Almeida
Hello, If I run create table newtable (like oldtable including constraints); in the SQL window with works just file. But if i execute execute 'create table '||newtable||' (LIKE '||oldtable||' including constraints)'; inside a function, in a LOOP, the constraints aren't created. What is the

Re: [GENERAL] REASSIGN OWNED doesn't for all objects, ALTER FUNCTION seems to fix it

2011-04-19 Thread Frank van Vugt
Hi Tom, Op maandag 18 april 2011, schreef Tom Lane: Hmmm look into pg_shdepend to see if there are entries linking those functions to an owner. mmm, indeed it seems that some things are our of sync here the following is coming from the production database, thus after the 'reassign from

[GENERAL] Feature request psql

2011-04-19 Thread Wim Bertels
Hallo, i have a possible feature request. It is not possible to get the sql statement itself and the output of the statement in a user-friendly way to an output file (option \o psql), this is only possible outside of psql, when calling this function with an option -L (psql -L log.txt). The nice

Re: [GENERAL] How to configure a read-only database server and session? (Was: read-only UNLOGGED tables)

2011-04-19 Thread mark
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- ow...@postgresql.org] On Behalf Of Stefan Keller Sent: Sunday, April 17, 2011 2:04 PM To: pgsql-general List Subject: [GENERAL] How to configure a read-only database server and session? (Was:

Re: [GENERAL] create table sintax

2011-04-19 Thread Taras Kopets
2011/4/19 Júlio Almeida julio.augusto.alme...@gmail.com If I run create table newtable (like oldtable including constraints); in the SQL window with works just file. But if i execute execute 'create table '||newtable||' (LIKE '||oldtable||' including constraints)'; inside a function, in a 

Re: [GENERAL] pg_reorg

2011-04-19 Thread Jens Wilke
On Tue, Apr 19, 2011 at 04:02:01AM +0530, Vibhor Kumar wrote: IIRC vacuum full mode rewrites the indexes as well. Till 8.4 no. From 9.0 onwards yes. However VACUUM FULL still locks the table. Don't be confused with the vacuum full term. This has nothing to do with the postgresql vacuum full

Re: [GENERAL] pg_reorg

2011-04-19 Thread Merlin Moncure
On Tue, Apr 19, 2011 at 8:48 AM, Jens Wilke j...@wilke.org wrote: On Tue, Apr 19, 2011 at 04:02:01AM +0530, Vibhor Kumar wrote: IIRC vacuum full mode rewrites the indexes as well. Till 8.4 no. From 9.0 onwards yes. However VACUUM FULL still locks the table. Don't be confused with the

[GENERAL] how to force an insert before Raise Exception?

2011-04-19 Thread giova
Hi. I made a function that Raise exception with some conditions. No problem with that, it is the goal. My problem is that i want to do an INSERT into a log table before to raise the exception. But RAISE EXCEPTION cancels my Insert. How to force the insert to not being cancelled please? Note

Re: [GENERAL] how to force an insert before Raise Exception?

2011-04-19 Thread Adrian Klaver
On Tuesday, April 19, 2011 6:39:23 am giova wrote: Hi. I made a function that Raise exception with some conditions. No problem with that, it is the goal. My problem is that i want to do an INSERT into a log table before to raise the exception. But RAISE EXCEPTION cancels my Insert. How

Re: [GENERAL] how to force an insert before Raise Exception?

2011-04-19 Thread Taras Kopets
On Tue, Apr 19, 2011 at 4:39 PM, giova giovainsta...@yahoo.fr wrote: My problem is that i want to do an INSERT into a log table before to raise the exception. But RAISE EXCEPTION cancels my Insert. That's the point of transaction, if it failed the data and any other changes are rolled back. You

[GENERAL] Questions about Partitioning

2011-04-19 Thread Phoenix Kiula
While I fix some bigger DB woes, I have learned a lesson. Huge indexes and tables are a pain. Which makes me doubly keen on looking at partitioning. Most examples I see online are partitioned by date. As in months, or quarter, and so on. This doesn't work for me as I don't have too much logic

Re: [GENERAL] SSDs with Postgresql?

2011-04-19 Thread Benjamin Smith
On Sunday, April 17, 2011 01:55:02 AM Henry C. wrote: On Thu, April 14, 2011 18:56, Benjamin Smith wrote: After a glowing review at AnandTech (including DB benchmarks!) I decided to spring for an OCX Vertex 3 Pro 120 for evaluation purposes. It cost about $300 with shipping, etc and

[GENERAL] If block half-executing even though condition is false

2011-04-19 Thread Rob Richardson
I'm getting some really weird behavior in a function I swear was working a couple of weeks ago. For reasons I do not agree with, the database our main application relies on stores times without time zones. Instead, we store each time twice, once as a timestamp containing wallclock time and

Re: [GENERAL] SSDs with Postgresql?

2011-04-19 Thread Yeb Havinga
On 2011-04-19 19:07, Benjamin Smith wrote: On Sunday, April 17, 2011 01:55:02 AM Henry C. wrote: Exactly. Be aware of the risks, plan for failure and reap the rewards. Just curious what your thoughts are with respect to buying SSDs and mirroring them with software RAID 1. (I use

[GENERAL] Service user account 'postgres' could not be created -- 8.4.2-1 and Active Directory on Windows08 R2

2011-04-19 Thread Greg Corradini
Hello, I'm getting 'service user account 'postgres' could not be created' when using the postgresql-8.4.2-1 one-click installer (i also get the same error with a new version of postgresql 8.4.8-1) So i know in the past (version 8.3.x) there were problems with Windows Server 2008 R2 running Active

Re: [GENERAL] Service user account 'postgres' could not be created -- 8.4.2-1 and Active Directory on Windows08 R2

2011-04-19 Thread Michael Gould
With R2, I had to install using the admin account.  I got those errors before.  It worked once I used a admin account.  If that doesn't work you might want to try turning UAC off, do the install and then turn back on.   Best Regards Michael Gould   Greg Corradini gregcorrad...@gmail.com

Re: [GENERAL] Service user account 'postgres' could not be created -- 8.4.2-1 and Active Directory on Windows08 R2

2011-04-19 Thread John R Pierce
On 04/19/11 11:48 AM, Greg Corradini wrote: Hello, I'm getting 'service user account 'postgres' could not be created' when using the postgresql-8.4.2-1 one-click installer (i also get the same error with a new version of postgresql 8.4.8-1) So i know in the past (version 8.3.x) there were

[GENERAL] setting connection/ query timeout

2011-04-19 Thread tamanna madaan
Hi All I am using postgres-8.1.2 . In postgresql.conf I have set : #statement_timeout = 0 I am executing the below query just to check if postgres is allowing connections or not . psql -Uslon -ddb_name -h IP -c select 1; Sometimes this query gets stuck for unknown reason . So, for this

Re: [GENERAL] setting connection/ query timeout

2011-04-19 Thread Daniele Varrazzo
On Tue, Apr 19, 2011 at 8:09 PM, tamanna madaan tamanna.ma...@globallogic.com wrote: Sometimes this query gets stuck for unknown reason . So, for this particular query I want to set a timeout . I dont want to change statement_timeout in postgresql.conf as this would affect all the

Re: [GENERAL] Questions about Partitioning

2011-04-19 Thread Steve Crawford
On 04/19/2011 08:56 AM, Phoenix Kiula wrote: While I fix some bigger DB woes, I have learned a lesson. Huge indexes and tables are a pain. Which makes me doubly keen on looking at partitioning. Before jumping into partitioning it would be useful to know specifically what pain you are having

Re: [GENERAL] Using column aliasses in the same query

2011-04-19 Thread Andrej
On 18 April 2011 22:06, Tore Halvorsen tore.halvor...@gmail.com wrote: Well, refering to the computed value may be nonsensical, but couldn't it be some sort of query rewrite? So that...    SELECT x/y AS z FROM tab WHERE y 0 AND z 2 ... is a shorthand for    SELECT x/y AS z FROM tab

[GENERAL] Needs Suggestion

2011-04-19 Thread SUBHAM ROY
Suppose Postgres is installed in two computers C1 C2. C1 have some database tables. How can I copy these database tables from C1 to C2. I mean to say that can I copy tables from postgres installed in one m/c to another m/c. Is there any command in postgres to do so or any other short cut

Re: [GENERAL] Needs Suggestion

2011-04-19 Thread Scott Marlowe
On Tue, Apr 19, 2011 at 5:06 PM, SUBHAM ROY subham@gmail.com wrote: Suppose Postgres is installed in two computers C1 C2. C1 have some database tables. How can I copy these database tables from C1 to C2. I mean to say that can I copy tables from postgres installed in one m/c to another

[GENERAL] Re: Are Update rights on the target table of a do instead update rule necessary ?

2011-04-19 Thread Geraldo Lopes de Souza
Hi, Apologies for flooding the list. I was updating the table when I should update the view. That's the price for working after a regular day job. Regards, Geraldo Lopes de Souza 2011/4/16 Geraldo Lopes de Souza geraldo...@gmail.com Hi, I'm trying to implement tenant view filter with

[GENERAL] Transport Compression (whatever became of that discussion?)

2011-04-19 Thread bubba postgres
In this discussion there was a lot of talk of transport compression in Postgres, (also specifically wondering about JDBC as well) did anything ever come of that discussion? http://postgresql.1045698.n5.nabble.com/Compression-on-SSL-links-td2261205.html

Re: [GENERAL] SSDs with Postgresql?

2011-04-19 Thread Toby Corkindale
On 20/04/11 04:28, Yeb Havinga wrote: On 2011-04-19 19:07, Benjamin Smith wrote: On Sunday, April 17, 2011 01:55:02 AM Henry C. wrote: Exactly. Be aware of the risks, plan for failure and reap the rewards. Just curious what your thoughts are with respect to buying SSDs and mirroring them