[SQL] select with function per row

2000-10-30 Thread Marcin Mazurek

Hi,
I have a table with FQDN. I'm trying to take from it the second part which
desribed a city. Query isn't too clear but with what is important that
whole substr was counted once and applied to every row. Can I (how?) force
executor to run this substr on every row of my table?

mtldb=# select substr(substr(s.nazwa,strpos(s.nazwa,'a.')+2),1,
textlen(s.nazwa)-strpos(s.nazwa,+'.m'))
from serwery_old s;
 substr

 poznan
 mtl.pl
 ka.kie

tia
maz

Marcin Mazurek

--  
Kierownik Dziau Systemowego
MULTINET SA o/Poznan
http://www.multinet.pl/



[SQL]

2000-10-30 Thread Lengyel Ferenc

Hello everybody!
I need some help with a simple query.
I've got a problem with getting a maximum value from a very large table
(1000+ rows):
I have table:
CREATE TABLE TABLE_A
(
COL1 INT,
COL2 INT,
CONSTRAINT PK PRIMARY KEY (COL1, COL2)
)

and when I want to get the maximum value for col1:
SELECT MAX(COL1) FROM TABLE_A WHERE COL2 = 1
it takes a large amount of time.
I created an index on column COL1, but it doesn't work.

Bc. Ferenc Lengyel

Address:Prievozsk 6/A, Bratislava 821 09,
Slovakia
Phone Number:   +421 (7) 58222 222, +421 (7) 58222 407
E-mail address: mailto:[EMAIL PROTECTED]




Re: [SQL]

2000-10-30 Thread Yury Don

Hello Lengyel,

Once, Monday, October 30, 2000, 5:36:23 PM, you wrote:

LF Hello everybody!
LF I need some help with a simple query.
LF I've got a problem with getting a maximum value from a very large table
LF (1000+ rows):
LF I have table:
LF CREATE TABLE TABLE_A
LF (
LF COL1 INT,
LF COL2 INT,
LF CONSTRAINT PK PRIMARY KEY (COL1, COL2)
LF )

LF and when I want to get the maximum value for col1:
LF SELECT MAX(COL1) FROM TABLE_A WHERE COL2 = 1
LF it takes a large amount of time.
LF I created an index on column COL1, but it doesn't work.

You need to create index on COL2.

-- 
Best regards,
 Yury  ICQ 11831432
 mailto:[EMAIL PROTECTED]





[SQL] Large Object dump ?

2000-10-30 Thread Alessandro Rossi


I need to move a DB from Pg 6.5 to 7 haw can i export Large Object to the
new DB ? 

Pg_dumpall seems non to export LArge Object.

Please Help

Alex





RE: [SQL]

2000-10-30 Thread Schlobohm, Jack

Can I be removed from this mailing list?

 -Original Message-
 From: Yury Don [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, October 30, 2000 6:55 AM
 To:   [EMAIL PROTECTED]
 Subject:  Re: [SQL]
 
 Hello Lengyel,
 
 Once, Monday, October 30, 2000, 5:36:23 PM, you wrote:
 
 LF Hello everybody!
 LF I need some help with a simple query.
 LF I've got a problem with getting a maximum value from a very large
 table
 LF (1000+ rows):
 LF I have table:
 LF CREATE TABLE TABLE_A
 LF (
 LF COL1 INT,
 LF COL2 INT,
 LF CONSTRAINT PK PRIMARY KEY (COL1, COL2)
 LF )
 
 LF and when I want to get the maximum value for col1:
 LF SELECT MAX(COL1) FROM TABLE_A WHERE COL2 = 1
 LF it takes a large amount of time.
 LF I created an index on column COL1, but it doesn't work.
 
 You need to create index on COL2.
 
 -- 
 Best regards,
  Yury  ICQ 11831432
  mailto:[EMAIL PROTECTED]
 
 




Re: [SQL] Large Object dump ?

2000-10-30 Thread [EMAIL PROTECTED]

Large objects are not dumped. It should be 
in the documentation for large objects.

You need to write a script which writes them to
disk and then imports them back in after you have
installed your dbs.


Troy


 
 
 I need to move a DB from Pg 6.5 to 7 haw can i export Large Object to the
 new DB ? 
 
 Pg_dumpall seems non to export LArge Object.
 
 Please Help
 
 Alex
 
 
 




[SQL]

2000-10-30 Thread Petr Jezek


Hi I'll ask for help.
I have had used MySQL and the syntax of INSERT have a switch
IGNORE if You try to insert a row that in the table already is.

I'll ask if exist something like this in postgre SQL syntax.

Petr Jezek





Re: [SQL]

2000-10-30 Thread Philip Warner

At 13:36 30/10/00 +0100, Lengyel Ferenc wrote:
Hello everybody!
I need some help with a simple query.
I've got a problem with getting a maximum value from a very large table
(1000+ rows):

Unfortunately PGSQL does not use indexes for min  max. One approach that
should work is:

select col1 from TABLE_A WHERE COL2 = 1 order by col2, col1 desc limit 1;

and you will need an index on (col2, col1).



Philip Warner| __---_
Albatross Consulting Pty. Ltd.   |/   -  \
(A.B.N. 75 008 659 498)  |  /(@)   __---_
Tel: (+61) 0500 83 82 81 | _  \
Fax: (+61) 0500 83 82 82 | ___ |
Http://www.rhyme.com.au  |/   \|
 |----
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/



Re: [SQL] Large Object dump ?

2000-10-30 Thread Alessandro Rossi



On Mon, 30 Oct 2000, [EMAIL PROTECTED] wrote:

Large objects are not dumped. It should be 
in the documentation for large objects.

You need to write a script which writes them to
disk and then imports them back in after you have
installed your dbs.


Troy

CREATE TABLE news   -- { chiave: id news ,newarchivio, newsnuove}
(
"idnews"SERIAL primary key, 
"oidnotizia"OID,-- news as large object 
"autore"TEXTx   -- author
);

How should be done the script for this table ?

I found something about large object only onthe programmesg guide are they
present in other docs?

Thanks in advance 

Alex






[SQL] unsubscribe

2000-10-30 Thread Vadim Govorov

unsubscribe



[SQL] Synonyms

2000-10-30 Thread Carl Shelbourne



HELP!!!

* Is there a way of creating synonyms of tables within one database in another
database in Postgres similar to the Informix CREATE SYNONYM?
* If not and related to the post on 2000-10-28 by Sivagami, is there a way,
within a select I can make a query from mulitple databases.  ( the usual
DB.Table or DB:table or DB@table dont seem to work)

Thanks

Carl





[SQL] unsubscribe

2000-10-30 Thread Schlobohm, Jack

unsubscribe



 application/ms-tnef


Re: [SQL] Synonyms

2000-10-30 Thread Peter Eisentraut

Carl Shelbourne writes:

 * Is there a way of creating synonyms of tables within one database in another
 database in Postgres similar to the Informix CREATE SYNONYM?

Nope.

 * If not and related to the post on 2000-10-28 by Sivagami, is there a way,
 within a select I can make a query from mulitple databases.  ( the usual
 DB.Table or DB:table or DB@table dont seem to work)

Nope.

It's not really planned either in case you wanted to ask.

-- 
Peter Eisentraut  [EMAIL PROTECTED]   http://yi.org/peter-e/




Re: [SQL] fetching rows

2000-10-30 Thread K Parker

I hate to be the bearer of bad news, but if you're using PHP and you wanted to fetch 
just 25 rows at a time for a single page, and then fetch more when the user clicks on 
a NEXT button or link, you're completely out of luck.  Each http transaction is 
completely separate and so you can't maintain a cursor between pages.  Perhaps LIMIT 
would help you here; but I've found it more useful to make sure there is a unique key 
for the order I'm displaying, and then say "WHERE key  
highest_key_value_on_current_page"




Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at 
http://www.eudoramail.com



Re: [SQL] fetching rows

2000-10-30 Thread Martin Christensen

 "Jeff" == Jeff Hoffmann [EMAIL PROTECTED] writes:
Jeff you can't do that with a cursor, but you can use they mysql-ism
Jeff called a limit clause.  for example, to fetch rows 26-50 from
Jeff that query, you'd do:
Jeff select * from films limit 25,26;
Jeff or
Jeff select * from files limit 25 offset 26;

Since there's no particular ordering of the output of such a query it
is necessary to explicitly state an ordering key. Otherwise you'll
quickly find that the phase of the moon has very significant influence
on the produced results. :-) Especially in 7.*, as I understand it.

Martin

-- 
GPG public key: http://home1.stofanet.dk/factotum/gpgkey.txt