Re: [SQL] execute a query in an other db

2002-11-16 Thread Joe Conway
LR wrote: Thank you for your answer. Do you know the name of this package ? Thx Lilian see contrib/dblink. I'd highly recommend using 7.3 (finishing beta, soon to be a release candidate) if you can. It is much better than the one in 7.2 and the syntax has changed some. Joe ---

Re: [SQL] Proposal of hierarchical queries, a la Oracle

2002-11-16 Thread Joe Conway
Josh Berkus wrote: Evgren, I want to propose the patch for adding the hierarchical queries posibility. It allows to construct queries a la Oracle for ex: SELECT a,b FROM t CONNECT BY a PRIOR b START WITH cond; You'll be thrilled to know that this has already been implemented in PostgreSQL 7.

[SQL] Problems invoking psql. Help please.

2002-11-16 Thread Hugh Esco
One more note: when I first got the error: env: /usr/lib/postgresql/bin/readpgenv: Permission denied I looked and determined that no such file existed, so I created an empty (one character) file by that name with a shell level echo command and set the permissions to match those of every other

[SQL] Problems invoking psql. Help please.

2002-11-16 Thread Hugh Esco
Hey folks: I am able to consistently start and stop the postgreSQL server and to access it across our office network with pgAdmin II. I have had no luck invoking the psql command line prompt, from where I can enter queries and start to surmount the learning curve from background with mySQL to

Re: [SQL] Proposal of hierarchical queries, a la Oracle

2002-11-16 Thread Evgen Potemkin
I was have made a module like ltree, i don't know how you implement it, but mine doesn't fit. The problem : for ex. you need to select a tree, but with childs of each parent is sorted. in my module i've defined a tree path as set of numbers separated by dot ('1.234.456.789'::hier for ex.), a compa

Re: [SQL] execute a query in an other db

2002-11-16 Thread LR
> > Hi, > > > > When I'm connected to a postgreSQL db ( e.g. myDB ), how could I execute > > "select * from myTable;" in an other db (e.g. myOtherDB). > > > > In other words, what is the postgreSQL equivalent of the MS SQL Server > > statement "USE myOtherDB SELECT * FROM myTable" ? > > Stock postg

Re: [SQL] Proposal of hierarchical queries, a la Oracle

2002-11-16 Thread Josh Berkus
Evgren, > I want to propose the patch for adding the hierarchical queries > posibility. > It allows to construct queries a la Oracle for ex: > SELECT a,b FROM t CONNECT BY a PRIOR b START WITH cond; You'll be thrilled to know that this has already been implemented in PostgreSQL 7.3, as a /contrib

Re: [SQL] INDEX PROBLEMS ?

2002-11-16 Thread Josh Berkus
Alex, > On postgres 7.2.3 I have found what follows: > > explain select * from documents where iddoc>1; > > Seq Scan on lotti (cost=0.00..831.79 rows=26783 width=98) > > EXPLAIN > explain select * from documents where iddoc=1; > > Index Scan using lotti_pkey on lotti (cost=0.00..2.26 rows=1

Re: [SQL] DATE TIME INDEX ?

2002-11-16 Thread Tom Lane
PostgreSQL Server <[EMAIL PROTECTED]> writes: > I found that the only way to force postgres to use index is: > explain select id,datarx::date from docs where datarx between '2002-11-13' and >'2002-11-14' ; > Index Scan using idx_documenti_datarx on documenti (cost=0.00..7.86 rows=2 width=12) G

[SQL] INDEX PROBLEMS ?

2002-11-16 Thread PostgreSQL Server
On postgres 7.2.3 I have found what follows: explain select * from documents where iddoc>1; Seq Scan on lotti (cost=0.00..831.79 rows=26783 width=98) EXPLAIN explain select * from documents where iddoc=1; Index Scan using lotti_pkey on lotti (cost=0.00..2.26 rows=1 width=98) Why index is n

[SQL] DATE TIME INDEX ?

2002-11-16 Thread PostgreSQL Server
I have been tring to use index on timestamps: I have a table with a timestamp filed with index on it. I nned to extract all the ids of the table with datarx >= a date <= a date or between 2 dates I found that the only way to force postgres to use index is: explain select id,datarx::da

Re: [SQL] Proposal of hierarchical queries, a la Oracle

2002-11-16 Thread Oleg Bartunov
Evgen, read info about ltree module http://www.sai.msu.su/~megera/postgres/gist/ltree/ Do you have implemented indexed access ? regards, Oleg On Sat, 16 Nov 2002, Evgen Potemkin wrote: > I was have made a module like ltree, i don't know how you implement it, > but mine

Re: [SQL] Chaning locale sorting order for statements

2002-11-16 Thread pginfo
I am not sure about comparation performance. I have big problems with sort performance in pg by comparing varchar. Also I am not sure if it is possible to get this new funktion to replace the standart sort. regards, Ivan. Tomasz Myrta wrote: > Uz.ytkownik Albrecht Berger napisa?: > > In Oracle I

Re: [SQL] Chaning locale sorting order for statements

2002-11-16 Thread Tomasz Myrta
Uz.ytkownik Albrecht Berger napisa?: In Oracle I would use something like that : SELECT * FROM table1 ORDER BY NLSSORT(column1, 'NLS_SORT=FRENCH'); Does postgres has something similar ? I think, you have to create function NLSSORT by your own. C language would be nice for performance. It is poss

[SQL] Chaning locale sorting order for statements

2002-11-16 Thread Albrecht Berger
Hello, is it possible to change the locale sorting order in statements ? I need this for a multilingual web application, where I'm not able to set the locale in the session or elsewhere. In Oracle I would use something like that : SELECT * FROM table1 ORDER BY NLSSORT(column1, 'NLS_SORT=FRENCH');