Re: [SQL] Query Freeze

2002-09-19 Thread Tom Lane
"alexandre :: aldeia digital" <[EMAIL PROTECTED]> writes: > I have 3 applications in windows and they > starts 3 postgres backends. > The 1st app. call the 2nd and this call the 3rd. > In the same place of the 3rd backend, the query freeze. > If I kill the second backend(or app.), the query is rel

[SQL] Two Permance Questions

2002-09-19 Thread CN LIOU
Hi! Q1. Is subquery better or join? For subquery: SELECT t1.c1,(SELECT t2.c2 FROM t2 WHERE t2.c1 = t1.c1) FROM t1 I wonder it will loop n times if t1 returns n rows. If this is the case, is it better to use join like this: SELECT t1.c1,t2.c2 FROM t1,t2 WHERE t2.c1 = t1.c1 Q2. If the query i

Re: [SQL] Effective usage without unique key -- suggestion

2002-09-19 Thread Dima Tkach
Bhuvan A wrote: > Hi, > > I am using postgresql 7.2.1 on redhat linux 7.3 > > I have a table in very high production database which is circulating > several thousands of records per day ie.. count does not exceed several > thousands. Here for some technical reason i dont have unique key on this

Re: [SQL] Table Copy.

2002-09-19 Thread Christopher Kings-Lynne
> As on insert to table one I should get the same insert on table two. > As on delete to table one I should get the same delete on table two. > As on update to table one I should get the same update on table two. > > Can someone provide the examples i can study ? Look up 'CREATE TRIGGER' and 'CR

[SQL] Query Freeze

2002-09-19 Thread alexandre :: aldeia digital
Hi, (sorry for the big mail) I have 3 applications in windows and they starts 3 postgres backends. The 1st app. call the 2nd and this call the 3rd. In the same place of the 3rd backend, the query freeze. If I kill the second backend(or app.), the query is released... Any suggestions? Thank's

Re: [SQL] help w/ constructing a SELECT

2002-09-19 Thread Josh Berkus
Charles, > Having a problem with a query. > I would like to construct a query which will return a list of all > contigs which are comprised of clones whose 'read' = 'x' (read can be > either 'x' or 'y'). It appears that you haven't formulated clearly what you want to get. I can see 3 possibil

Re: [SQL] Table Copy.

2002-09-19 Thread Dmitry Tkach
what about CREATE TABLE one ( fileda INTEGER, filedb INTEGER, filedc INTEGER ); CREATE VIEW two AS SELECT * FROM one; ? Dima PostgreSQL Server wrote: > HI! > > I'm new to postgres. I need to have a table as a copy of another one. > > Example: > > CREATE TABL

[SQL] using rownum as index-counter of nested table or varray

2002-09-19 Thread Damonte Natalia
Hi, In Oracle 8.1.7, I have a problem using rownum as an index-counter of nested table(or varray). I got a "ORA-06532: Subscript outside of limit" for the following code, although rownum is in the correct range. I saw an example to solve this problem, but I haven't got any succesfully result

[SQL]

2002-09-19 Thread Ricardo Javier Aranibar León
Hi list, I need your colaboration,I like a table or view with this information from 2 tables "ticket" and "orden_respuesta". Note, that the tti (TTI0208) doesn't have links or relations to "numorden" in the table orden_respuesta, if someone can help me i will thankfull numtti | num

[SQL] problem with query

2002-09-19 Thread Ricardo Javier Aranibar León
Hi list, First sorry if this message arrive in your box mail twice, I need your colaboration,I like a table or view with this information from 2 tables "ticket" and "orden_respuesta". Note, that the tti (TTI0208) doesn't have links to "numorden" in the table orden_respuesta, if someone can

[SQL] problem with query

2002-09-19 Thread Ricardo Javier Aranibar León
Hi list, I need your help, I need a table or view with this information that show down,I have two tables "ticket" and "orden_respuesta" and I like this table. Note, that some tti for example (TTI0208) of ticket it isn't in the table orden_respuesta, if somone can help me i will thank full

Re: [SQL] Table Copy.

2002-09-19 Thread Michael Paesold
Alex wrote: > HI! > > I'm new to postgres. I need to have a table as a copy of another one. > > Example: > > CREATE TABLE one ( > fileda INTEGER, > filedb INTEGER, > filedc INTEGER ); > > CREATE TABLE two ( > fileda INTEGER, > filedb INTEGER, > f

Re: [SQL] Stripping white-space in SELECT statments

2002-09-19 Thread Andreas Joseph Krogh
On Thursday 19 September 2002 13:41, Thorbjörn Eriksson wrote: > By "our system" I mean the software that uses the database. It is a quit > old software written in C that has been ported a couple of times to > different *NIX platforms using different DBMS's. It uses in-house developed > functions

Re: [SQL] How To Get Bytea Data Instead Of Its Oid

2002-09-19 Thread Tom Lane
"CN LIOU" <[EMAIL PROTECTED]> writes: > SELECT * FROM test LIMIT 1 > returns, I guess, the OID of c2 instead of the binary data to which the OID points. I don't think so... regression=# create table test (c1 text,c2 bytea); CREATE TABLE regression=# insert into test values ('some text', 'some b

[SQL] Table Copy.

2002-09-19 Thread PostgreSQL Server
HI! I'm new to postgres. I need to have a table as a copy of another one. Example: CREATE TABLE one ( fileda INTEGER, filedb INTEGER, filedc INTEGER ); CREATE TABLE two ( fileda INTEGER, filedb INTEGER, filedc INTEGER ); As on insert to table o

Re: [SQL] Stripping white-space in SELECT statments

2002-09-19 Thread Mathieu Arnold
--On jeudi 19 septembre 2002 13:20 +0200 Thorbjörn Eriksson <[EMAIL PROTECTED]> wrote: > Hello, > > I've encountered a strange behavior in postgres 7.2.1 regarding how psql > handles strings ending with space characters. > > If I want to search for records where the first column (artnrgrpmtrl

[SQL] help w/ constructing a SELECT

2002-09-19 Thread Charles Hauser
Greetings, Having a problem with a query. I would like to construct a query which will return a list of all contigs which are comprised of clones whose 'read' = 'x' (read can be either 'x' or 'y'). Details: A contig may be comprised of more than 1 clone, so in TABLE clone_contig, there

Re: [SQL] Stripping white-space in SELECT statments

2002-09-19 Thread Stephan Szabo
On Thu, 19 Sep 2002, [iso-8859-1] Thorbjörn Eriksson wrote: > Hello, > > I've encountered a strange behavior in postgres 7.2.1 regarding how psql > handles strings ending with space characters. > What locale did you initdb with? Some locales on some systems have behavior like that. To test, y

Re: [SQL] Stripping white-space in SELECT statments

2002-09-19 Thread Tom Lane
=?iso-8859-1?Q?Thorbj=F6rn_Eriksson?= <[EMAIL PROTECTED]> writes: > I've encountered a strange behavior in postgres 7.2.1 regarding how psql > handles strings ending with space characters. Perhaps you are running in a non-C locale? A lot of locales have sorting rules that are pretty weird about

Re: [SQL] Index usage on date feild , differences in '>' and '>='

2002-09-19 Thread Stephan Szabo
On Thu, 19 Sep 2002, Rajesh Kumar Mallah. wrote: > Thanks very much for the response. > set enable_seqscan=off; Definitely helps. > and for wide date ranges it usees indexes. > > > But with default value of enable_sequence changing date range seems to have effect. > can you explain me a bit mor

[SQL] How To Get Bytea Data Instead Of Its Oid

2002-09-19 Thread CN LIOU
Greetings! I must have missed lesson 1 of postgresql! create table test (c1 text,c2 bytea); Then, I probably have successfullyi nserted several records into test using C++Builder. Now I am trying to retrieve back the binary data in c2 I just inserted. However, the SQL statement issued by both

Re: [SQL] Stripping white-space in SELECT statments

2002-09-19 Thread Thorbjörn Eriksson
By "our system" I mean the software that uses the database. It is a quit old software written in C that has been ported a couple of times to different *NIX platforms using different DBMS's. It uses in-house developed functions that, depending on parameters, creates a variety of SQL statements that

Re: [SQL] Stripping white-space in SELECT statments

2002-09-19 Thread dima
> If I want to search for records where the first column (artnrgrpmtrln_1) > begins with > '201901 ', our system that uses the database creates the following SQL > statement: > > select artnrgrpmtrln_1 from sr where (artnrgrpmtrln_1>='201901 ' and > artnrgrpmtrln_1<='201901 ÿ' what does "our s

[SQL] Stripping white-space in SELECT statments

2002-09-19 Thread Thorbjörn Eriksson
Hello, I've encountered a strange behavior in postgres 7.2.1 regarding how psql handles strings ending with space characters. If I want to search for records where the first column (artnrgrpmtrln_1) begins with '201901 ', our system that uses the database creates the following SQL statement: s