Re: [GENERAL] Getting a sample data set.

2011-01-19 Thread Raymond O'Donnell
On 19/01/2011 00:04, Alban Hertroys wrote: On 18 Jan 2011, at 23:03, Raymond O'Donnell wrote: I suppose you meant particular? Yes, definitely. Although I'm sure some would find it peculiar as well :) Actually, peculiar to is perfectly correct here, though a bit old-fashioned. According to

[GENERAL] Some problem with the NOTIFY/LISTEN

2011-01-19 Thread lee Richard
HI I am using PG 8.1.4, and my server was stop service, and when I checked the log, I found that some process had locked pg_listener in ExclusiveLock, it blocked all of the following processes which use NOTIFY/LISTEN. Can anyone tell me why pg_listener is locked forever? max

Re: [GENERAL] PostgreSQL 9.0.1 PITR can not copy WAL file

2011-01-19 Thread Christian Ullrich
* tuanhoanganh wrote: My PITR work well from 01/01/2011 to 06/01/2011. At 06/01/2011 postgresql log have issue 2011-01-06 08:27:54 ICT LOG: archive command failed with exit code 1 2011-01-06 08:27:54 ICT DETAIL: The failed archive command was: copy pg_xlog\00010004005E

[GENERAL] Error during a dump (ts_selectivity, not found)

2011-01-19 Thread Ahmed Ossama
Hello all, I am trying to restore a database on a server from a dump taken from a different server, but I get the following error: == # pg_restore -Upgsql -d db14

[GENERAL] Error during a dump (ts_selectivity, not found)

2011-01-19 Thread Ahmed Ossama
Hello all, I am trying to restore a database on a server from a dump taken from a different server, but I get the following error: == # pg_restore -Upgsql -d db14

Re: [GENERAL] Error during a dump (ts_selectivity, not found)

2011-01-19 Thread Adrian Klaver
On Wednesday 19 January 2011 4:57:42 am Ahmed Ossama wrote: Hello all, I am trying to restore a database on a server from a dump taken from a different server, but I get the following error: I searched for the library ts_selectivity, but all in vain. Any advice/hint is very much

Re: [GENERAL] Need help writing exclusion constraint

2011-01-19 Thread Daniel Popowich
Jeff Davis writes: On Sat, 2011-01-15 at 21:32 +0100, Tomas Vondra wrote: ALTER TABLE event ADD CONSTRAINT event_overlap CHECK(overlap_at_dest(destination_id, starts, ends)); There's a race condition ... One way to fix this is locking I do not recommend

[GENERAL] why sometimes checkpoint is too slow????

2011-01-19 Thread Edmundo Robles L.
why sometimes checkpoint is too slow and how can i do to avoid that??? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] 答复: postgresql-9.0.2-1-windows_x64 from EnterpriseDB can't install on Win 7 home basic 64 bit

2011-01-19 Thread XiaoboGu
Hi postgresql-9.0.2-1-windows_x64 installer works on Windows Server 2003 Enterprise R2 SP2 64bit, it seems it's a platform related problem. Regards, Xiaobo Gu -邮件原件- 发件人: Xiaobo Gu [mailto:guxiaobo1...@gmail.com] 发送时间: 2011年1月18日 22:54 收件人: pgsql-general@postgresql.org 主题:

Re: [GENERAL] why sometimes checkpoint is too slow????

2011-01-19 Thread Florian Weimer
* Edmundo Robles L.: why sometimes checkpoint is too slow Checkpoints are deliberately throttled to spread out the disk write load. Is that what you are observing? -- Florian Weimerfwei...@bfk.de BFK edv-consulting GmbH http://www.bfk.de/ Kriegsstraße 100

[GENERAL] debug_print_plan logs table alias used in join, not table name itself

2011-01-19 Thread frank joerdens
I was just experimenting with debug logging on 8.3 and am finding that I can't get it to log the table names involved in a given query, it will always print the table alias used in your join instead, e.g. explaining a query such as woome=# explain select * from webapp_person p join auth_user a on

Re: [GENERAL] Error during a dump (ts_selectivity, not found)

2011-01-19 Thread Tom Lane
Adrian Klaver adrian.kla...@gmail.com writes: On Wednesday 19 January 2011 4:57:42 am Ahmed Ossama wrote: I searched for the library ts_selectivity, but all in vain. Are you by any chance trying to restore a dump taken from a pre-8.3 server with Full Text Search to 8.3+ one? If so in 8.3

[GENERAL] How can I find a schema that a table belong to?

2011-01-19 Thread Jerry LeVan
Hi, I am trying to tidy up my perl script that runs as a cgi and allows remote users (aka me) to interact with my Pg database. I primarily want to use this tool as a way for my iPad to browse my data base. It seems to be working quite well but one certainly does not want to 'select * from

Re: [GENERAL] How can I find a schema that a table belong to?

2011-01-19 Thread Thomas Kellerer
Jerry LeVan, 19.01.2011 17:35: So I guess the question is: Given a bare table name, how can I recover the schema qualified name with whatever the current search path happens to be? SELECT table_schema FROM information_schema.tables WHERE table_name = 'your_table' ; -- Sent via

[GENERAL] get referential values

2011-01-19 Thread Esmin Gracic
Knowing only tablename (schema_name.table_name) how to retrieve foreign keys and related values. (using pg_catalog is preferred). I developing framework for adobe flex (on php and postgresql). Already figured out how to get primary key, not null columns and column types, but kinda stuck here. I

Re: [GENERAL] PostgreSQL 9.0.1 PITR can not copy WAL file

2011-01-19 Thread tuanhoanganh
I have checked your solution. - Target disk full : No - PostgreSQL user does not have write privilege for the target directory : No - Target file exists already (then you have a bigger problem) : Last file in D:/3SDATABACKUP/PITR/WAL is 00010004005D - PostgreSQL user does not have full

[GENERAL] possible error in documentation for 9.1

2011-01-19 Thread Andreas Kretschmer
http://developer.postgresql.org/pgdocs/postgres/catalog-pg-class.html Column relpersistence, type bool, can contain values 'p','u' and 't'. whot, a BOOL? Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect.

Re: [GENERAL] Error during a dump (ts_selectivity, not found)

2011-01-19 Thread Ahmed Ossama
Thanks a lot Adrian and Tom. Like Tom said, I suspected that I was dealing with a third party extension. I have no problems with the restore without them, and the restore goes fine, but it stops and the point: WARNING: errors ignored on restore: 6 The database is 60GB and it stops at 47GB.

Re: [GENERAL] Need help writing exclusion constraint

2011-01-19 Thread Jeff Davis
On Wed, 2011-01-19 at 10:15 -0500, Daniel Popowich wrote: Anyway...Jeff, all your answers depend on using new features in 9.0. What would you recommend for folk still using 8.4? Without 9.0 exclusion constraints, what else can you do besides using functions in check constraints (or triggers)

Re: [GENERAL] Some problem with the NOTIFY/LISTEN

2011-01-19 Thread Tom Lane
lee Richard clipper.ken...@gmail.com writes: I am using PG 8.1.4, and my server was stop service, and when I checked the log, I found that some process had locked pg_listener in ExclusiveLock, it blocked all of the following processes which use NOTIFY/LISTEN. Can anyone tell me why pg_listener

Re: [GENERAL] debug_print_plan logs table alias used in join, not table name itself

2011-01-19 Thread Tom Lane
frank joerdens fiskad...@gmail.com writes: I was just experimenting with debug logging on 8.3 and am finding that I can't get it to log the table names involved in a given query, it will always print the table alias used in your join instead, e.g. I don't know why you think that

Re: [GENERAL] How can I find a schema that a table belong to?

2011-01-19 Thread Tom Lane
Thomas Kellerer spam_ea...@gmx.net writes: Jerry LeVan, 19.01.2011 17:35: So I guess the question is: Given a bare table name, how can I recover the schema qualified name with whatever the current search path happens to be? SELECT table_schema FROM information_schema.tables WHERE

Re: [GENERAL] PostgreSQL 9.0.1 PITR can not copy WAL file

2011-01-19 Thread Christian Ullrich
* tuanhoanganh wrote: I have checked your solution. - Target disk full : No - PostgreSQL user does not have write privilege for the target directory : No - Target file exists already (then you have a bigger problem) : Last file in D:/3SDATABACKUP/PITR/WAL is 00010004005D -

[GENERAL] Using copy for WAL archiving on Windows

2011-01-19 Thread Christian Ullrich
Hello all, the PostgreSQL manual, section 24.3.1, has an example archive_command for Windows. It is copy %p C:\\server\\archivedir\\%f . The next sentence disclaims this as an example, not a recommendation. I just had occasion to do some tests with that, and it appears to me that

[GENERAL] Anyone use PG with kvm/virtio? Any gotchas or recommended settings?

2011-01-19 Thread bubba postgres
Looks like the recommended settings are using the virtio interface, cache=none, and raw partitions (not qcow2). Anyone else run into any problems with kvm or virtio? We currently have a setup using qcow2, virtio, and the default cache settings, and experienced some data corruption (not preceded

Re: [GENERAL] How can I find a schema that a table belong to?

2011-01-19 Thread Thomas Kellerer
Tom Lane, 19.01.2011 19:19: SELECT table_schema FROM information_schema.tables WHERE table_name = 'your_table' ; That's not going to work, at least not in the interesting case where you have more than one candidate table --- that SELECT will list all of 'em. Ah, right. I was a buit too

Re: [GENERAL] Anyone use PG with kvm/virtio? Any gotchas or recommended settings?

2011-01-19 Thread Lonni J Friedman
I'm using it with Fedora14 inside the VM. No problems, although we've only been using it for a few months. You sure that your host HW isn't at fault? On Wed, Jan 19, 2011 at 10:58 AM, bubba postgres bubba.postg...@gmail.com wrote: Looks like the recommended settings are using the virtio

[GENERAL] How can I find the schema that a table belongs to?

2011-01-19 Thread Jerry LeVan
Hi, I am trying to tidy up my perl script that runs as a cgi and allows remote users (aka me) to interact with my Pg database. I primarily want to use this tool as a way for my iPad to browse my data base. It seems to be working quite well but one certainly does not want to 'select * from

Re: [GENERAL] Error during a dump (ts_selectivity, not found)

2011-01-19 Thread Tom Lane
Ahmed Ossama ah...@aossama.net writes: I have no problems with the restore without them, and the restore goes fine, but it stops and the point: WARNING: errors ignored on restore: 6 Well, those are exactly the errors you showed us, no? The database is 60GB and it stops at 47GB. Where are

Re: [GENERAL] Error during a dump (ts_selectivity, not found)

2011-01-19 Thread Ahmed Ossama
On 19/01/2011 21:51, Tom Lane wrote: Ahmed Ossamaah...@aossama.net writes: I have no problems with the restore without them, and the restore goes fine, but it stops and the point: WARNING: errors ignored on restore: 6 Well, those are exactly the errors you showed us, no? Yes, these are the

Re: [GENERAL] How can I find the schema that a table belongs to?

2011-01-19 Thread DM
one of the way to find out schema name is like below select * from pg_tables where tablename like '%xyz%'; schemaname | tablename | tableowner | tablespace | hasindexes | hasrules | hastriggers +---++++--+- (0 rows)

Re: [GENERAL] How can I find a schema that a table belong to?

2011-01-19 Thread Thomas Kellerer
Tom Lane, 19.01.2011 19:19: Given a bare table name, how can I recover the schema qualified name with whatever the current search path happens to be? SELECT table_schema FROM information_schema.tables WHERE table_name = 'your_table' ; That's not going to work, at least not in the

Re: [GENERAL] Error during a dump (ts_selectivity, not found)

2011-01-19 Thread Vick Khera
On Wed, Jan 19, 2011 at 3:00 PM, Ahmed Ossama ah...@aossama.net wrote: Am I making an accurate comparison between the original db and the one i am trying to dump by comparing their sizes? No. What you might want to do is take a pg_dump of the newly restored DB and see if its size is

Re: [GENERAL] Error during a dump (ts_selectivity, not found)

2011-01-19 Thread Tom Lane
Ahmed Ossama ah...@aossama.net writes: Am I making an accurate comparison between the original db and the one i am trying to dump by comparing their sizes? No. If I am wrong and this size difference is just a bloat (which I hope) how do I make sure of that? Maybe count the rows in some of

[GENERAL] Group by with insensitive order

2011-01-19 Thread Aram Fingal
Suppose I'm doing a group by query like the following: SELECT drug1, drug2, AVG(response) FROM data GROUP BY drug1, drug2 The problem is that the same drug may appear sometimes as drug1 and sometimes as drug2. So, for example, the combination aspirin, acetaminophen may also appear as

Re: [GENERAL] PostgreSQL 9.0.1 PITR can not copy WAL file

2011-01-19 Thread Magnus Hagander
On Wed, Jan 19, 2011 at 19:20, Christian Ullrich ch...@chrullrich.net wrote: * tuanhoanganh wrote: I have checked your solution. - Target disk full : No - PostgreSQL user does not have write privilege for the target directory : No - Target file exists already (then you have a bigger

Re: [GENERAL] PostgreSQL 9.0.1 PITR can not copy WAL file

2011-01-19 Thread John R Pierce
On 01/19/11 9:23 AM, tuanhoanganh wrote: 2011-01-06 08:27:54 ICT LOG: archive command failed with exit code 1 2011-01-06 08:27:54 ICT DETAIL: The failed archive command was: copy pg_xlog\00010004005E

Re: [GENERAL] Group by with insensitive order

2011-01-19 Thread hubert depesz lubaczewski
On Wed, Jan 19, 2011 at 03:37:58PM -0500, Aram Fingal wrote: Suppose I'm doing a group by query like the following: SELECT drug1, drug2, AVG(response) FROM data GROUP BY drug1, drug2 The problem is that the same drug may appear sometimes as drug1 and sometimes as drug2. So, for example,

Re: [GENERAL] debug_print_plan logs table alias used in join, not table name itself

2011-01-19 Thread frank joerdens
On Wed, Jan 19, 2011 at 7:10 PM, Tom Lane t...@sss.pgh.pa.us wrote: frank joerdens fiskad...@gmail.com writes: I was just experimenting with debug logging on 8.3 and am finding that I can't get it to log the table names involved in a given query, it will always print the table alias used in

Re: [GENERAL] Group by with insensitive order

2011-01-19 Thread Tom Lane
Aram Fingal fin...@multifactorial.com writes: Suppose I'm doing a group by query like the following: SELECT drug1, drug2, AVG(response) FROM data GROUP BY drug1, drug2 The problem is that the same drug may appear sometimes as drug1 and sometimes as drug2. So, for example, the combination

[GENERAL] undefined symbol PQconnectionNeedsPassword referenced by file pg_ctl.o

2011-01-19 Thread Edmundo Robles L.
Hi, i tried to compile postgres 8.3.13 but i got the next error: Undefined first referenced symbol in file PQconnectionNeedsPassword pg_ctl.o ERROR: Symbol referencing errors. No output written to pg_ctl cc -b elf -O pg_ctl.o

Re: [GENERAL] How can I find the schema that a table belongs to?

2011-01-19 Thread DM
or you could use the below query * QUERY ** SELECT n.nspname as Schema, c.relname as Name, CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'i' THEN 'index' WHEN 'S' THEN 'sequence' WHEN 's' THEN 'special' END as Type, pg_catalog.pg_get_userbyid(c.relowner) as

[GENERAL] How to fire triggers just on top level DML

2011-01-19 Thread Kevin Grittner
We've been running for about ten years on a framework which fires triggers similar to database triggers in a Java tier close to the database, and we're now trying to convert these to actual PostgreSQL database triggers. Our biggest hitch at the moment is that we defined a class of triggers we

[GENERAL] ERROR: index row requires 9984 bytes, maximum size is 8191

2011-01-19 Thread akp geek
Hi all - I have added a column to a table is which of datatype text. I am trying to create an index CREATE OR REPLACE FUNCTION reverse(varchar) RETURNS varchar AS $$ $reversed = reverse $_[0]; return $reversed; $$ LANGUAGE plperlu IMMUTABLE; CREATE INDEX rev_email ON users(

Re: [GENERAL] How to fire triggers just on top level DML

2011-01-19 Thread Adrian Klaver
On Wednesday 19 January 2011 1:59:48 pm Kevin Grittner wrote: We've been running for about ten years on a framework which fires triggers similar to database triggers in a Java tier close to the database, and we're now trying to convert these to actual PostgreSQL database triggers. Our biggest

Re: [GENERAL] Group by with insensitive order

2011-01-19 Thread Aram Fingal
Easy way is something like SELECT LEAST(drug1, drug2), GREATEST(drug1, drug2), AVG(response) FROM data GROUP BY 1, 2 though it'd be a PITA to scale that to more than 2 drugs. regards, tom lane Thanks, Tom and Hubert, who said the same thing. For the foreseeable

Re: [GENERAL] How to fire triggers just on top level DML

2011-01-19 Thread Kevin Grittner
Adrian Klaver adrian.kla...@gmail.com wrote: TG_ARGV[] Data type array of text; the arguments from the CREATE TRIGGER statement. Thanks for the suggestion, but I don't think this does what I need. I need to know whether the trigger was *fired* from inside another trigger, not

Re: [GENERAL] How to fire triggers just on top level DML

2011-01-19 Thread A.M.
On Jan 19, 2011, at 4:59 PM, Kevin Grittner wrote: We've been running for about ten years on a framework which fires triggers similar to database triggers in a Java tier close to the database, and we're now trying to convert these to actual PostgreSQL database triggers. Our biggest hitch at

Re: [GENERAL] undefined symbol PQconnectionNeedsPassword referenced by file pg_ctl.o

2011-01-19 Thread Tom Lane
Edmundo Robles L. erob...@sensacd.com.mx writes: Hi, i tried to compile postgres 8.3.13 but i got the next error: Undefined first referenced symbol in file PQconnectionNeedsPassword pg_ctl.o ERROR: Symbol referencing errors. No

Re: [GENERAL] How to fire triggers just on top level DML

2011-01-19 Thread Kevin Grittner
A.M. age...@themactionfaction.com wrote: Most PLs include some session-specific storage. In PL/Perl, it is %_SHARED. Setting a flag there should do the trick. If you are using a PL which does not have such a notion (like plpgsql), you can add a call in your triggers to a function written in

Re: [GENERAL] How to fire triggers just on top level DML

2011-01-19 Thread A.M.
On Jan 19, 2011, at 5:36 PM, Kevin Grittner wrote: A.M. age...@themactionfaction.com wrote: Most PLs include some session-specific storage. In PL/Perl, it is %_SHARED. Setting a flag there should do the trick. If you are using a PL which does not have such a notion (like plpgsql), you

Re: [GENERAL] How to fire triggers just on top level DML

2011-01-19 Thread Adrian Klaver
On Wednesday 19 January 2011 2:20:35 pm Kevin Grittner wrote: Adrian Klaver adrian.kla...@gmail.com wrote: TG_ARGV[] Data type array of text; the arguments from the CREATE TRIGGER statement. Thanks for the suggestion, but I don't think this does what I need. I need to know

Re: [GENERAL] How to fire triggers just on top level DML

2011-01-19 Thread Tom Lane
Kevin Grittner kevin.gritt...@wicourts.gov writes: A.M. age...@themactionfaction.com wrote: Most PLs include some session-specific storage. In PL/Perl, it is %_SHARED. Setting a flag there should do the trick. If you are using a PL which does not have such a notion (like plpgsql), you can

Re: [GENERAL] ERROR: index row requires 9984 bytes, maximum size is 8191

2011-01-19 Thread Bill Moran
In response to akp geek akpg...@gmail.com: Hi all - I have added a column to a table is which of datatype text. I am trying to create an index CREATE OR REPLACE FUNCTION reverse(varchar) RETURNS varchar AS $$ $reversed = reverse $_[0]; return $reversed; $$ LANGUAGE

Re: [GENERAL] How to fire triggers just on top level DML

2011-01-19 Thread Kevin Grittner
A.M. age...@themactionfaction.com wrote: If you do implement TG_DEPTH, I am curious as to what the difference between TG_DEPTH==34 and TG_DEPTH==35 could mean. I think it might cause poor coding practice in making decisions based off assumed trigger order execution. Since you only care to

Re: [GENERAL] How to fire triggers just on top level DML

2011-01-19 Thread Kevin Grittner
Tom Lane t...@sss.pgh.pa.us wrote: Correctly resetting such a value after a transaction/subtransaction abort might be a bit problematic. Good point. Definitely an area to pay particularly close attention. Thanks, -Kevin -- Sent via pgsql-general mailing list

[GENERAL] key=value imports

2011-01-19 Thread Robert Fitzpatrick
I was wondering if someone could help with my new task of trying to import from an API into PostgreSQL 9.0. An example query would respond like this... transactid=164d8355b0f4fc2eb051344d3b6b0b5f status=SUCCESS domaincount=3 domain_0_name=example1.com domain_0_expiration=2011/06/16

Re: [GENERAL] PostgreSQL 9.0.1 PITR can not copy WAL file

2011-01-19 Thread Christian Ullrich
* Magnus Hagander wrote: On Wed, Jan 19, 2011 at 19:20, Christian Ullrichch...@chrullrich.net wrote: So when PostgreSQL runs copy 000...5E D:\..., it fails, and when you do the same thing as the PostgreSQL user, it works. Interesting. Try increasing the log level in postgresql.conf to see

Re: [GENERAL] possible error in documentation for 9.1

2011-01-19 Thread Josh Kupershmidt
On Wed, Jan 19, 2011 at 12:43 PM, Andreas Kretschmer akretsch...@spamfence.net wrote: http://developer.postgresql.org/pgdocs/postgres/catalog-pg-class.html Column relpersistence, type bool, can contain values 'p','u' and 't'. whot, a BOOL? FYI, this got fixed today already: commit

Re: [GENERAL] get referential values

2011-01-19 Thread Josh Kupershmidt
On Wed, Jan 19, 2011 at 12:08 PM, Esmin Gracic esmin.gra...@gmail.com wrote: Knowing only tablename (schema_name.table_name) how to retrieve foreign keys and related values. (using pg_catalog is preferred). I developing framework for adobe flex (on php and postgresql). Already figured out how