Re: [GENERAL] weird empty return from select problem; periodically get no data returned - could it be a network issue?

2010-07-08 Thread Craig Ringer
On 9/07/2010 2:58 AM, Susan Cassidy wrote: This is a pg cluster installation, using version 8.3.5. "Pg cluster"? There are quite a few different clustering setups for Pg. Do you mean PgCluster from http://pgfoundry.org/projects/pgcluster/ ? If so, which version and how is it set up? Or so

Re: [GENERAL] JDBC Postgres problem

2010-07-08 Thread Craig Ringer
On 9/07/2010 5:24 AM, Tyler Hains wrote: We are having a very strange issue where for certain records, queries sent via JDBC return no results when the identical query via command line or pgadmin return non-null (expected) results. Example below. We are running 8.3.9. Can you post a compilable,

[GENERAL] problem with table structure

2010-07-08 Thread Miguel Vaz
Hi, I am having some uncertainty while designing the following structure: I have two sets of data: * arqueology sites (can be natural): id name description id_category id_period x y * natural sites (can be arqueological also - bear with me -, so there will be duplicate records in the above t

Re: [GENERAL] getting the last N tuples of a query

2010-07-08 Thread Kenichiro Tanaka
Hello. I agree Ben. But,I try your question as an SQL puzzle. Doses this SQL meet what you want? select * from wantlast offset (select count(*)-10 from wantlast); --test case create table wantlast(col1 int); insert into wantlast select g from generate_series(1,1000) as g; postgres=# select * f

Re: [GENERAL] GSS Authentication

2010-07-08 Thread Stephen Frost
Bryan, * Bryan Montgomery (mo...@english.net) wrote: > After that I spent a bit of time on my windows client fiddling trying to get > it to work. I had set PGSRVKRBNAME, tried setting PGGSSAPI however, I wasn't > using the FQDN of my database server. When I went from dbhost to > dbhost.lab2k.net,

Re: [GENERAL] GSS Authentication

2010-07-08 Thread Bryan Montgomery
Hope you don't mind me resurrecting this thread - but I have made a fair bit of headway in my endeavours. So, the big issue I had was a bug in Microsoft's ktpass ( http://support.microsoft.com/kb/919557) that was on the server. After that I spent a bit of time on my windows client fiddling trying

Re: [GENERAL] getting the last N tuples of a query

2010-07-08 Thread Ben Chobot
On Jul 8, 2010, at 4:17 PM, Edmundo Robles L. wrote: > Hi! > > if a want the first 5,10,N tuples of a query (even without order) > i just have to do a: > select * from table limit 10; That does not get the first 10 tuples, it merely gets 10 tuples. The database is free to return whiche

[GENERAL] getting the last N tuples of a query

2010-07-08 Thread Edmundo Robles L.
Hi! if a want the first 5,10,N tuples of a query (even without order) i just have to do a: select * from table limit 10; but, What can i do to get the last 10 tuples ??? i try to do: select * from table limit -10; :-D but that query return 0 tuples . So, what is the right way to

Re: [GENERAL] No PL/PHP ? Any reason?

2010-07-08 Thread Carlo Stonebanks
Obviously we need to improve our documentation. What led you to believe it does not exist? This is my fault entirely. When I Googled for this, I flailed around with fancy terms that didn't connect. And, as you pointed out, its not in the core distibution or the foundry. But I didn't consider the

[GENERAL] Wrote a proc for massive updates - will I have problems?

2010-07-08 Thread Carlo Stonebanks
Hi gang, I wrote a PL/Tcl stored proc to do paging updates (we have very large tables, and updates are these frustrating things that we stare at, not knowing if they are in a deadlock, or progressing, or when they will finish). So, I wrote a tcl proc that runs like this: SELECT paging_updat

[GENERAL] JDBC Postgres problem

2010-07-08 Thread Tyler Hains
We are having a very strange issue where for certain records, queries sent via JDBC return no results when the identical query via command line or pgadmin return non-null (expected) results. Example below. We are running 8.3.9. >> SELECT client_id FROM locations WHERE external_id = '278'; >>

Re: [GENERAL] Problems with Vista and Windows 7

2010-07-08 Thread Andrew Maclean
I should add that I have no problems running Postgres in Windows 7. The Windows installer works Ok for me. In this thread I am not clear about whether it is postgres data (data written and read by PostgreSQL) or user data that is being discussed. Regards Andrew On Thu, Jul 8, 2010 at 5:53 PM

Re: [GENERAL] optimizer choosing the wrong index

2010-07-08 Thread Adrian von Bidder
Heyho! On Wednesday 07 July 2010 13.42:59 Martin Below wrote: > I'm facing a strange problem where the optimizer does pick the wrong > index. What's not clear to me is why you want pg to chose a particular index. Are you having performance issues? (The case you show is a table with 200k rows -

[GENERAL] weird empty return from select problem; periodically get no data returned - could it be a network issue?

2010-07-08 Thread Susan Cassidy
I have a number of Perl programs of similar form to this: $dbh=DBI->connect("dbi:Pg:dbname=$dbname;host=${dbserver};", $dbuser, $dbpasswd, {PrintError => 0, PrintWarn => 0, AutoCommit => $autocommit}) or errexit( "Unable to connect to dbname $dbname, err: $DBI::errstr"); errexit("No d

Re: [GENERAL] optimizer choosing the wrong index

2010-07-08 Thread Tom Lane
Merlin Moncure writes: > I think so too, but suppose we wanted to force the other plan anyways: > select * from ps where (client_id, expires_on) >= > ('123', '24.11.2010'::timestamp) and (client_id, expires_on) < ('123', > null) order by client_id, expires_on; A simpler way to force use of the ot

Re: [GENERAL] optimizer choosing the wrong index

2010-07-08 Thread Merlin Moncure
On Thu, Jul 8, 2010 at 10:11 AM, Tom Lane wrote: > Martin Below writes: >> test=# select count(*) total, count(distinct client_id) ids, >> count(distinct expires_on) dates from ps; >>  total  |  ids   | dates >> ++ >>  213645 | 123366 | 213549 > > That says the expires_on

[GENERAL] DataArchitect version 4.2 Now Available

2010-07-08 Thread smga3000
Rancho Santa Margarita, CA -- 6 July 2010 -- theKompany.com, producers and distributors of high-quality open source and commercial Linux software, are pleased to announce the release of DataArchitect 4.2. DataArchitect is a powerful tool that provides ERD capability like PowerDesigner as well as t

Re: [GENERAL] Problems with Vista and Windows 7

2010-07-08 Thread Igor Neyman
> -Original Message- > From: el dorado [mailto:do_ra...@mail.ru] > Sent: Thursday, July 08, 2010 3:47 AM > To: pgsql-general@postgresql.org > Subject: Re[2]: Problems with Vista and Windows 7 > > > > I've notice that in some special cases PG uses folder > %APPDATA% for > > > Windows

Re: [GENERAL] optimizer choosing the wrong index

2010-07-08 Thread Tom Lane
Martin Below writes: > test=# select count(*) total, count(distinct client_id) ids, > count(distinct expires_on) dates from ps; > total | ids | dates > ++ > 213645 | 123366 | 213549 That says the expires_on column is practically unique, which makes me think the plann

Re: [GENERAL] optimizer choosing the wrong index

2010-07-08 Thread Martin Below
Hello Merlin, thanks for your help. > can you supply the plans on the actual tables?  the 'wrong' index > might actually be the 'right' one if expires_on is of high cardinality > (perhaps it's distributed badly and the table needs a stats tweak to > make it correct). test=# select count(*) total

Re: [GENERAL] CREATE PROCEDURAL LANGUAGE plpythonu on windows, with EDB's 8.4.2 installer causes error

2010-07-08 Thread Peter Geoghegan
Thanks guys; I've installed Python 2.6.4 from the official MSI installer, and everything works fine. -- Regards, Peter Geoghegan -- 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] CREATE PROCEDURAL LANGUAGE plpythonu on windows, with EDB's 8.4.2 installer causes error

2010-07-08 Thread Dave Page
On Thu, Jul 8, 2010 at 12:30 PM, Sim Zacks wrote: > Postgresql 8.4 on windows (stackbuilder install) is compiled against > Python 2.6, it is probably looking for the dll python26.dll and can't > find it. > To get it to work, you need to  install python 2.6. Correct. We use the ActiveState distros

Re: [GENERAL] CREATE PROCEDURAL LANGUAGE plpythonu on windows, with EDB's 8.4.2 installer causes error

2010-07-08 Thread Sim Zacks
Postgresql 8.4 on windows (stackbuilder install) is compiled against Python 2.6, it is probably looking for the dll python26.dll and can't find it. To get it to work, you need to install python 2.6. Sim On 7/8/2010 1:47 PM, Peter Geoghegan wrote: > When attempting to restore a dump of a database

[GENERAL] CREATE PROCEDURAL LANGUAGE plpythonu on windows, with EDB's 8.4.2 installer causes error

2010-07-08 Thread Peter Geoghegan
When attempting to restore a dump of a database with a pl/pythonu function, I encountered the following error (recreated here with psql): postgres=# \c lustre psql (8.4.2) WARNING: Console code page (850) differs from Windows code page (1252) 8-bit characters might not work correctly. See

Re: [GENERAL] \COPY ... CSV with hex escapes

2010-07-08 Thread Alban Hertroys
On 8 Jul 2010, at 4:21, Craig Ringer wrote: > Yes, that's ancient. It is handled quite happily by \copy in csv mode, > except that when csv mode is active, \xnn escapes do not seem to be > processed. So I can have *either* \xnn escape processing *or* csv-style > input processing. > > Anyone know

Re[2]: [GENERAL] Problems with Vista and Windows 7

2010-07-08 Thread el dorado
Thank you, Andrew, it's very interesting and cognitive article. Though it couldn't resolve my problem now. It looks like recommendations - where to put your application data. But I put my data in some definite location and postgres looks for it in another one - that's the strangeness of situatio

Re: [GENERAL] Problems with Vista and Windows 7

2010-07-08 Thread Dave Page
2010/7/8 el dorado : > Thank you for your answers. > Well, the beginning of the story in details is here > (http://archives.postgresql.org/pgsql-general/2010-06/msg01135.php). Shortly, > I tried to use functions from my own dll, but got an error "Could not open > relation base\16123\16222: No su

Re[2]: [GENERAL] Problems with Vista and Windows 7

2010-07-08 Thread el dorado
> > I've notice that in some special cases PG uses folder > > %APPDATA% for Windows user 'postgres', instead of the > > PostgreSQL-specific application data folder (f.e., > > C:\PostgreSQL\8.4\data). It results in some unexpected bugs. > > Could you please be more specific in describing what