[GENERAL] Tuning for a tiny database

2011-06-20 Thread CSS
Hello, I couldn't find much information in the archives on this -- perhaps this is a bit of a specialized need, but I was hoping for some input from some experienced postgres admins. I'm moving some DNS servers from djbdns/tinydns to PowerDNS. While it supports many backends, postgresql seems li

Re: [GENERAL] Help needed with PostgreSQL clustering/switching from MySQL

2011-06-20 Thread David Fetter
On Tue, Jun 21, 2011 at 05:07:10AM +, Vikram Vaswani wrote: > > Hello > > I'm new to PostgreSQL, coming at it from a MySQL background. I'm > currently looking at switching one of our applications (which > currently uses MySQL) over to PostgreSQL and had some questions. > > We're considering

[GENERAL] Help needed with PostgreSQL clustering/switching from MySQL

2011-06-20 Thread Vikram Vaswani
Hello I'm new to PostgreSQL, coming at it from a MySQL background. I'm currently looking at switching one of our applications (which currently uses MySQL) over to PostgreSQL and had some questions. We're considering the switch because of issues we have faced when using MySQL in a clustered sc

Re: [GENERAL] how to find a tablespace for the table?

2011-06-20 Thread hyelluas
I've got it now - it will be 0/empty for a table in "default tablespace", if the table has been created in a different tablespace - it will show the name. thank you!. Helen -- View this message in context: http://postgresql.1045698.n5.nabble.com/how-to-find-a-tablespace-for-the-table-tp450020

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-06-20 Thread Alexander Farber
PDO::ATTR_EMULATE_PREPARES => true kills my server too... On Mon, Jun 20, 2011 at 7:34 PM, Alexander Farber wrote: > Nope, pool_mode = session kills my site... > -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [GENERAL] how to find a tablespace for the table?

2011-06-20 Thread hyelluas
that is exactly the case - application_category table is in "profiler1" tablespace as well as all tables in my "profilre1" database. I'm not sure how to "update catalog"... vacuum ? -- View this message in context: http://postgresql.1045698.n5.nabble.com/how-to-find-a-tablespace-for-the-t

Re: [GENERAL] insert a SYSTIMESTAMP value in postgres

2011-06-20 Thread Jaime Casanova
El 20/06/2011 14:33, "Leon Match" escribió: > > Hello, > > > > I am trying to re-create few objects from oracle into postgres. > > > > I have a problem inserting a timestamp value into the table: > > > > insert into request_queue (request_id, received_time > >

Re: [GENERAL] how to find a tablespace for the table?

2011-06-20 Thread Raghavendra
Actually to say, everything looks ok to me, until unless you say the table * '**application_category'* on other tablespace ... :) profiler1=# select relname,reltablespace from pg_class where >> relname='application_category'; >> relname| reltablespace >> --+-

Re: [GENERAL] how to find a tablespace for the table?

2011-06-20 Thread Raghavendra
Can you give a try updating the catalogs with ANALYZE command and re-check ? --- Best Regards, Raghavendra EnterpriseDB Corporation Blog: http://raghavt.blogspot.com/ On Tue, Jun 21, 2011 at 2:22 AM, hyelluas wrote: > profiler1=# select relname,reltablespace from pg_class where > relname='app

Re: [GENERAL] insert a SYSTIMESTAMP value in postgres

2011-06-20 Thread Condor
On Mon, 20 Jun 2011 15:32:31 -0400, Leon Match wrote: > Hello, > > I am trying to re-create few objects from oracle into postgres. > > I have a problem inserting a timestamp value into the table: > > insert into request_queue (request_id, received_time > > ) > > values (new.request_

Re: [GENERAL] how to find a tablespace for the table?

2011-06-20 Thread hyelluas
profiler1=# select relname,reltablespace from pg_class where relname='application_category'; relname| reltablespace --+--- application_category | 0 (1 row) -- View this message in context: http://postgresql.1045698.n5.nabble.com/how-to-

Re: [GENERAL] how to find a tablespace for the table?

2011-06-20 Thread Raghavendra
> > profiler1=# select * from pg_catalog.pg_tables where > tablename='application_category'; > schemaname | tablename | tableowner | tablespace | hasindexes | > hasrules | hastrigge > rs > > +--++++--+-

Re: [GENERAL] how to find a tablespace for the table?

2011-06-20 Thread hyelluas
here it is : profiler1=# select oid,* from pg_tablespace; oid | spcname | spcowner | spclocation | spcacl ---++--+--+ 1663 | pg_default | 10 | | 1664 | pg_global | 10 | |

Re: [GENERAL] insert a SYSTIMESTAMP value in postgres

2011-06-20 Thread David Johnston
Please look at the section on Date/Time Functions in the PostgreSQL documentation (Section 9.9 in Version 9.0 documentation) for a full listing of the date and time functions available in PostgreSQL and how they work. There is a sub-section (9.9.4) that specifically details functions that return th

Re: [GENERAL] insert a SYSTIMESTAMP value in postgres

2011-06-20 Thread Scott Ribe
On Jun 20, 2011, at 1:32 PM, Leon Match wrote: > How can I insert a dynamic timestamp value in postgress, please? < http://www.postgresql.org/docs/9.0/static/functions-datetime.html> -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice -- Sent via p

Re: [GENERAL] how to find a tablespace for the table?

2011-06-20 Thread Raghavendra
hmmmStrange.. What is the output of select oid,* from pg_tablespace; and select relname,reltablespace from pg_class where relname=' application_category'; --- Best Regards, Raghavendra EnterpriseDB Corporation Blog: http://raghavt.blogspot.com/ On Tue, Jun 21, 2011 at 12:48 AM, hyellua

[GENERAL] insert a SYSTIMESTAMP value in postgres

2011-06-20 Thread Leon Match
Hello, I am trying to re-create few objects from oracle into postgres. I have a problem inserting a timestamp value into the table: insert into request_queue (request_id, received_time ) values (new.request_id, SYSTIME

Re: [GENERAL] how to find a tablespace for the table?

2011-06-20 Thread Raghavendra
let me correct on this query, it shows only those tables which wont belong to default_tablespace... select relname,reltablespace from pg_class where reltablespace in(select oid from pg_tablespace where spcname not in ('pg_default','pg_global')); --- Best Regards, Raghavendra EnterpriseDB Corpor

Re: [GENERAL] how to find a tablespace for the table?

2011-06-20 Thread hyelluas
well, here is the query : profiler1=# select relname,reltablespace from pg_class where reltablespace in(select oid from pg_tablespace where spcname not in ('pg_default','pg_global')); relname | reltablespace -+--- why it shows no records? profiler1=# select * from pg_cat

Re: [GENERAL] Forward referencing of table aliases in subqueries does not work in 9.1 beta2 ( works in 9.0 and 8.4.2 )

2011-06-20 Thread Tom Lane
BangarRaju Vadapalli writes: > create table a(x int); > create table b(x int, y int); > create table c(x int, y int, z int); > This query fails with ERROR: JOIN qualification cannot refer to other > relations - select a.x from a, b where a.x = b.x and not exists ( select 1 > from c where b.y = c

Re: [GENERAL] how to find a tablespace for the table?

2011-06-20 Thread Raghavendra
That's right, if the tables are in default tablespace, those columns will be blank, if any of the table created under any of the tablespace then it will show up. Eg:- postgres=# show default_tablespace ; (this would be blank becz am in pg_default/pg_global) default_tablespace

Re: [GENERAL] unique across two tables

2011-06-20 Thread Tarlika Elisabeth Schmitz
On Mon, 20 Jun 2011 19:42:20 +0200 Alban Hertroys wrote: >On 20 Jun 2011, at 17:03, Tarlika Elisabeth Schmitz wrote: > >> I have two tables, town and townalias, the latter containing >> alternative town names. >> I would like to ensure that a town name is unique per >> country-region across the t

Re: [GENERAL] how to find a tablespace for the table?

2011-06-20 Thread hyelluas
thank you Greg, here is what I get, I createed view as you suggested. I'm not sure why tablespace column is empty profiler1=# select * from pg_tables where schemaname ='public' limit 10; schemaname |tablename| tableowner | tablespace | hasindexes | hasrules | hastri ers

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-06-20 Thread Alexander Farber
Nope, pool_mode = session kills my site... -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] unique across two tables

2011-06-20 Thread Alban Hertroys
On 20 Jun 2011, at 17:03, Tarlika Elisabeth Schmitz wrote: > I have two tables, town and townalias, the latter containing alternative > town names. > I would like to ensure that a town name is unique per > country-region across the two tables. > > Can I do this with a constraint ot do I need to i

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-06-20 Thread Alexander Farber
Hell Marko and others, On Mon, Jun 20, 2011 at 4:08 PM, Marko Kreen wrote: >> Maybe I should try session mode of pgbouncer >> again, now that I've got rid of the persistent >> PHP connections? > > You could, but try to turn off prepared > statements in PDO first. isn't having prepared statements

Re: [GENERAL] connection time out

2011-06-20 Thread salah jubeh
Hello Guys, It was about some firewall rules setup by the system administrator. Thanks From: salah jubeh To: pgsql Sent: Mon, June 20, 2011 12:39:51 PM Subject: [GENERAL] connection time out Hello Guys, I have a database server and I have create

Re: [GENERAL] unique across two tables

2011-06-20 Thread tv
> I have two tables, town and townalias, the latter containing alternative > town names. > I would like to ensure that a town name is unique per > country-region across the two tables. > > Can I do this with a constraint ot do I need to implement the logic via > trigger? You can't have a constrain

[GENERAL] unique across two tables

2011-06-20 Thread Tarlika Elisabeth Schmitz
I have two tables, town and townalias, the latter containing alternative town names. I would like to ensure that a town name is unique per country-region across the two tables. Can I do this with a constraint ot do I need to implement the logic via trigger? = PostgreSQl 8.4 CREATE TABL

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-06-20 Thread Marko Kreen
On Mon, Jun 20, 2011 at 9:36 AM, Alexander Farber wrote: > I've added > >  $db->beginTransaction(); >   >  $db->commit(); > > around _all_ statements, but now get: I don't think that was a good idea. >  SQLSTATE[25P02]: In failed sql transaction: >  7 ERROR: current   transaction is aborted,

Re: [GENERAL] Forward referencing of table aliases in subqueries does not work in 9.1 beta2 ( works in 9.0 and 8.4.2 )

2011-06-20 Thread BangarRaju Vadapalli
Hi Tom, Self contained test case attached... When executing the query below in 9.1 beta 2 we are getting the error ERROR: JOIN qualification cannot refer to other relations. The same query is executing fine in 8.4.2 and 9.0. SELECT dbai.dim_base_agg_instr_key AS instr_key, dba.dim_base_

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-06-20 Thread Alexander Farber
I've added $db->beginTransaction(); $db->commit(); around _all_ statements, but now get: SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block quite often. I don't understand why would transaction

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-06-20 Thread Marko Kreen
On Mon, Jun 20, 2011 at 5:08 AM, Amitabh Kant wrote: > On Mon, Jun 20, 2011 at 1:43 AM, Alexander Farber > wrote: >> >> Hello Cedric and others, >> >> On Sun, Jun 19, 2011 at 9:56 PM, Cédric Villemain >> wrote: >> > 2011/6/19 Alexander Farber : >> >> [pgbouncer] >> >> logfile = /var/log/pgbounce

Re: [GENERAL] Port forwarding via iptables to postgres listening locally

2011-06-20 Thread David Resnick
I've turned on connection logging in postgres; there is no indication of > any connection attempt. There don't seem to be any additional rules >> configured in iptables that would drop the packets. >> > > Are the tables set to drop by default, or allow by default? > They are set to drop by defaul

[GENERAL] connection time out

2011-06-20 Thread salah jubeh
Hello Guys, I have a database server and I have created another replica of it on another machine. The new replica is running fine locally, but I can not access it from another clients, the pg_hba.conf file is the same as the original database server. when I try to connect to the server I

Re: [GENERAL] Forward referencing of table aliases in subqueries does not work in 9.1 beta2 ( works in 9.0 and 8.4.2 )

2011-06-20 Thread Craig Ringer
On 20/06/11 13:59, Tom Lane wrote: > BangarRaju Vadapalli writes: >> The select query for creating the view is executing fine in 8.4.2. But >> not in 9.1 beta2. The issue is forward referencing of table aliases in >> subqueries is not working fine in 9.1 beta2. > > This complaint is unintelligibl

Re: [GENERAL] Postgres service refuses to start on windows

2011-06-20 Thread Craig Ringer
On 20/06/11 14:45, Roman Isitua wrote: > hello ! > > I having an issue with my postgres database installed on a windows xp. > For some reason, I can no longer start the postgres service through > pgadmin or the services window. I get the following error: > Error 1053: The service did not respond t

Re: [GENERAL] Location Data

2011-06-20 Thread Christian Ullrich
* Adarsh Sharma wrote: Christian Ullrich wrote: Write a set of functions to get the higher-level structures (country for states, etc.) for any given record, and put a trigger on the table that populates the fields on insert and update. All the world data is populated in the places table