[SQL] how do i provide array parameters for my functions in php

2002-06-13 Thread joseph
= "select functionname($arrvalue[])"; what is the right syntax TIA joseph ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] problem with select where like ']'

2000-10-17 Thread Joseph Shraibman
LIKE is concerned, but > I suspect you may be seeing another variant of the problems that > LIKE index optimization has with peculiar collation rules. > You can find plenty of discussion of this in the mailing list archives > :-( > WHAT mailing list archives? They aren't linked

Re: [SQL] problem with select where like ']'

2000-10-17 Thread Joseph Shraibman
out the URL. > > > Joseph Shraibman <[EMAIL PROTECTED]> writes: > > > WHAT mailing list archives? > > > They aren't linked to anywhere on www.postgresql.org that I can find. > > > > Hmm. My bookmark is > > > > http://www.postgresql.org/list

[SQL] subselects

2000-11-29 Thread Joseph Shraibman
only have one field? Database version: PostgreSQL 7.0.3 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66 -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com

[SQL] alter table question

2000-11-29 Thread Joseph Shraibman
How do I alter a table to set a column to be not null? -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com

Re: [SQL] subselects

2000-12-06 Thread Joseph Shraibman
hubert depesz lubaczewski wrote: > > On Wed, Nov 29, 2000 at 07:03:36PM -0500, Joseph Shraibman wrote: > > I tried to do this: > > SELECT r , a , (SELECT u , re FROM dir WHERE u = a) , cdate FROM rep > > WHERE m IN(190); > > why dont you use simple join?

[SQL] FOREIGN KEY errors.

2000-12-07 Thread Joseph Shraibman
attribute pod Am I just misunderstanding how to use FOREIGN KEY? Then why would it work one time and not the other? http://www.postgresql.org/docs/aw_pgsql_book/node159.html doesn't have any column names after 'refrences '. -- Joseph Shraibman [EMAIL PROTECTED] Increase signal

Re: [SQL] FOREIGN KEY errors.

2000-12-11 Thread Joseph Shraibman
GN KEY (p,o) REFERENCES utable (pk,uk); drop sequence mtable_id_seq; drop table mtable; drop table utable; -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com

Re: [SQL]

2000-12-11 Thread Joseph Shraibman
No. > Peeter Smitt wrote: > > Hi > > Is it somehow possible to join tables from multiple databases into one > query? > > Thanks > > Peeter > > -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com

Re: [SQL] postgres

2000-12-13 Thread Joseph Shraibman
k where they can get a jdk for linux. How did they find the list without knowing about blackdown? -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com

Re: [SQL] PostgreSQL HOWTO

2001-01-29 Thread Joseph Shraibman
ml): "Nuclear weapons and other more powerful divine weapons were used in the battle field in ancient India!" I'm mystified as to why this document is on the linux.org web site. -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com

[SQL] how to do plpgsql?

2001-02-06 Thread Joseph Shraibman
PostgreSQL 7.0.3 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66 -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com

Re: [SQL] how to do plpgsql?

2001-02-06 Thread Joseph Shraibman
Huh. You'd think this would be prominent in the documentation page at http://www.postgresql.org/docs/postgres/c4091.htm Thanks. Josh Berkus wrote: > > Joseph, > > First you need to install plpgsql on a per database > basis, or you can just install it on template1 and it

[SQL] plpgsql error: cache lookup from pg_proc failed

2001-02-06 Thread Joseph Shraibman
pg_proc failed What does this error message mean? -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com

Re: [SQL] RE: plpgsql error: cache lookup from pg_proc failed

2001-02-06 Thread Joseph Shraibman
Michael Davis wrote: > > Setting NEW in an AFTER update or insert trigger is not wise. Try using a before >update trigger instead. > I still get the error message. > -Original Message- > From: Joseph Shraibman [SMTP:[EMAIL PROTECTED]] > Sent: Tuesday, Febr

[SQL] count() and multiple tables

2001-03-19 Thread Joseph Shraibman
= u.dkey and u.status = 2 and not u.b and u.akey = a.key and a.status = 3; /* that returns 2 when I want it to return 1 */ drop table d; drop table a; drop table u; -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com ---(end of

Re: [SQL] Select very slow...

2001-03-19 Thread Joseph Shraibman
ANALYZE person; > > 2: That 'count(*)' is going to be slow. >Try counting a column that's indexed (p.doc might work?) > I don't think that is true. -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com --

Re: [SQL] count() and multiple tables

2001-03-19 Thread Joseph Shraibman
Stephan Szabo wrote: > > On Mon, 19 Mar 2001, Joseph Shraibman wrote: > > > I want to select all the entries from d that have at least one > > corresponding entry in u that meets my conditions. The problem is that > > count(*) is returning the number of corres

Re: [SQL] VACUUM kills Index Scans ?!

2001-03-19 Thread Joseph Shraibman
CREATE TABLE > > CREATE INDEX > > load data > no, the correct sequence is to create the index last, which will create statistics that will tell postgres if it really wants to use an index or not. Don't try and second guess postgres. Even better do a VAC

[SQL] user defined function question

2001-08-20 Thread Joseph Syjuco
how do i return a resultset from a user defined function. pls show a simple structure ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

[SQL] exists

2001-08-20 Thread Joseph Shraibman
ror. What is the proper way? -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] exists

2001-08-21 Thread Joseph Shraibman
Thank you, I was missing the parens. If I do an explain I see: -> Index Scan using m_u_and_p_key on m (cost=0.00..3035.22 rows=1363 width=12) even if I put a limit 1 on the select. Why is that? Stephan Szabo wrote: > On Mon, 20 Aug 2001, Joseph Shraibman wrote: > > >>

Re: [SQL] exists

2001-08-21 Thread Joseph Shraibman
t;width=44) >> > > At least, what was the query that generated this and is it running > slowly or otherwise giving problems? The total explain doesn't seem > unreasonable to my relatively untrained eyes in the absense of knowing the > query :) > Well the total cost

Re: [SQL] exists

2001-08-21 Thread Joseph Shraibman
Stephan Szabo wrote: > On Tue, 21 Aug 2001, Joseph Shraibman wrote: > > >>Thank you, I was missing the parens. >> >>If I do an explain I see: >> >>-> Index Scan using m_u_and_p_key on m (cost=0.00..3035.22 rows=1363 width=12) >> >>

Re: [SQL] exists

2001-08-21 Thread Joseph Shraibman
Then why does the explain say rows=1363 ? I don't mean to nitpick here, but maybe this is the symptom of a larger problem. Tom Lane wrote: > Joseph Shraibman <[EMAIL PROTECTED]> writes: > >>Well the total cost should be at least as big as the sub-costs, no? >>

Re: [SQL] exists

2001-08-21 Thread Joseph Shraibman
Why does explain show more than one row, even if there is a LIMIT = 1? -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to

Re: [SQL] exists

2001-08-21 Thread Joseph Shraibman
I'm running 7.1.3. What does 'rows=1' mean? The number of rows returned or the number postgres has to look through? Tom Lane wrote: > Joseph Shraibman <[EMAIL PROTECTED]> writes: > >>Why does explain show more than one row, even if there is a LIMIT

[SQL] WHERE on an alias

2001-08-24 Thread Joseph Shraibman
playpen=# select a, sum(b) as dsum from taba where dsum > 5 group by(a); ERROR: Attribute 'dsum' not found Why can we GROUP BY on an alias but not do a WHERE on an alias? I have a subselect that explain shows is being run twice if I have to put it in the WHERE clause. -- Jos

Re: [SQL] WHERE on an alias

2001-08-27 Thread Joseph Shraibman
How do you do a subselect in the from clause? Tom Lane wrote: > Joseph Shraibman <[EMAIL PROTECTED]> writes: > >>playpen=# select a, sum(b) as dsum from taba where dsum > 5 group by(a); >>ERROR: Attribute 'dsum' not found >> > >>Why can we

Re: [SQL] WHERE on an alias

2001-08-27 Thread Joseph Shraibman
Josh Berkus wrote: > Joseph, > > >>How do you do a subselect in the from clause? >> > > Assuming that you are using 7.1.0 or higher: > > SELECT tbla.a, tbla.b, total_b > FROM tbla, >(SELECT b, sum(f) as total_b FROM tblb GROUP BY b) b_tot >

Re: [SQL] WHERE on an alias

2001-08-27 Thread Joseph Shraibman
Josh Berkus wrote: > Joseph, > > Please take a look at my example again: > > >>>SELECT tbla.a, tbla.b, total_b >>>FROM tbla, >>> (SELECT b, sum(f) as total_b FROM tblb GROUP BY b) b_tot >>>WHERE tbla.b = b_tot.b >>> >

Re: [SQL] WHERE on an alias

2001-08-27 Thread Joseph Shraibman
res actually use a temporary table behind the scenses? It appears not. -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

Re: [SQL] WHERE on an alias

2001-08-27 Thread Joseph Shraibman
Except I want ml.field, which is a data field, not a key. So I can't group by it. Bascially the point of the subselect is to get the field value where serial is hightest and the two keys match. Josh Berkus wrote: > Joseph, > > >>select d.field1, d.field2, u.field

Re: [SQL] WHERE on an alias

2001-08-27 Thread Joseph Shraibman
#x27;t know why the planner thought the sort would be so expensive. Stephan Szabo wrote: > On Mon, 27 Aug 2001, Joseph Shraibman wrote: > > >>Stephan Szabo wrote: >> >>>I think you'd want to move the entire query excepting the lastml where >>>cond

Re: [SQL] WHERE on an alias

2001-08-27 Thread Joseph Shraibman
Josh Berkus wrote: > Joseph, > > >>select d.field1, d.field2, u.field1, u.field2, (select ml.field from >>mltable where ml.key1 >>= u.key1 and ml.key2 = u.key2 order by ml.serial desc limit 1) from >>utable u, dtable d, >>where u.key1 = d.k

Re: [SQL] WHERE on an alias

2001-08-27 Thread Joseph Shraibman
Josh Berkus wrote: > Joseph, > > >>Actually I do it all the time, in the select part. >> > > Hmm. Frankly, I didn't know that Subselects in the field list were > supported, so this is a new one on me. > > > >>Well that is the problem.

Re: [SQL] WHERE on an alias

2001-08-27 Thread Joseph Shraibman
I'm not clear how this helps. I want to get the last entry of ml. The distinct on means I won't get duplicate entries with the same key values, but what specifies that I'm getting the last ml value, or even one ml value at all? Tom Lane wrote: > Joseph Shraibman <[EMA

Re: [SQL] WHERE on an alias

2001-08-28 Thread Joseph Shraibman
If I try to put a distinct on in my subselect int the from I get: ERROR: SELECT DISTINCT ON expressions must match initial ORDER BY expressions what does that mean? Tom Lane wrote: > Joseph Shraibman <[EMAIL PROTECTED]> writes: > >>Basically there is the utable, which has

[SQL]

2001-09-03 Thread Joseph Syjuco
im new in postgresql (actually came from SQL Server) and i was trying a script like this insert into table1(field1,field2) values (select field1, field2 from table 2); i dont know if this is possible (inserting a set of entries via resultset from a select stmt in one command). If anyone has any

[SQL] group by weirdness

2001-09-10 Thread Joseph Shraibman
en=# drop table ml; DROP -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL

Re: [SQL] group by weirdness

2001-09-13 Thread Joseph Shraibman
Josh Berkus wrote: > Joseph, > > The subject line could describe a lot of what I see outside my house > every day (I live in San Francisco CA). > > >>Could someome explain these error messages to me? Why am I being >>asked to group by j.id? >> >

Re: [SQL] group by weirdness

2001-09-13 Thread Joseph Shraibman
Putting the selects in the SELECT solved both problems. I took out the 'AND ml.jid = j.id' from the outer WHERE (would have also excluded cases where there were zero entries in ml) and only refrenced ml in the subselect. Thanks for your help. -- Joseph Shraibman [EMAIL PR

Re: [SQL] When will vacuum go away?

2001-10-18 Thread Joseph Shraibman
if > the doc/TODO file doesn't contain a date in October, it's stale). > I think the only thing we're still waiting on is some datetime fixes > from Tom Lockhart... > > regards, tom lane > > -------(end of broadcast)

[SQL] index question

2001-10-18 Thread Joseph Shraibman
Lets say I have a table with columns a and b. I want to do a query like SELECT count(distinct b) WHERE a = 2; Should I have an index on a or an index on (a,b)? -- Joseph Shraibman [EMAIL PROTECTED] Increase signal to noise ratio. http://www.targabot.com ---(end of

[SQL] dropping foreign key

2001-10-23 Thread Joseph Shraibman
I have to drop a froeign key from one of my tables. The problem is that I have another table that has a foreign key on the first one, so I can't do the select to temp-table thing and move it back. Is there any way I can remove it by mucking with pg's internal tables? -- Joseph

Re: [SQL] dropping foreign key

2001-10-24 Thread Joseph Shraibman
Can I just set tgenabled to false? Stephan Szabo wrote: > On Tue, 23 Oct 2001, Joseph Shraibman wrote: > > >>I have to drop a froeign key from one of my tables. The problem is that I have >another >>table that has a foreign key on the first one, so I can't

[SQL] variance aggregate function incorrect? Reference Materials regcreate aggregate

2002-06-24 Thread Joseph Syjuco
hi i needed the variance function ... i dont know if i introduced the wrong parameters or maybe this variance is not the variance that im looking for but it doesnt provide the right results variance=(nEx^2 - (Ex)^2)/(n(n-1)) my sql statement select variance(answer) from tbl_answer (where answer i

[SQL] assign count() result to a declared variable in plpgsql

2002-06-24 Thread Joseph Syjuco
i want to put my count() result in a plpgsql declared integer variable declare f_count_var integer; begin select into f_count_var count(empno) from employee end; tried this one but it doesnt work ---(end of broadcast)--- TIP 3:

[SQL] transaction in plpgsql

2002-06-27 Thread Joseph Syjuco
how can i implement transactions inside my plpgsql functions ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] export plpgsql function to file

2002-07-09 Thread Joseph Syjuco
how can i export my postgresql function to a file? ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

[SQL] how do i import my sql query result to a file

2002-07-18 Thread Joseph Syjuco
how do i import results of my select query to a file thanks ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] how do i import my sql query result to a file

2002-07-18 Thread Joseph Syjuco
thanks for the tips !!! actually i used \g . Again thanks On Thu, 2002-07-18 at 20:34, Ludwig Lim wrote: > > --- Joseph Syjuco <[EMAIL PROTECTED]> wrote: > > how do i import results of my select query to a file > > thanks > > > > in the psql command promp

[SQL] determine if a table exists

2002-08-01 Thread Joseph Syjuco
how do i determine if a table exists using select statement i want to find out if it exists if not ill create it if yes then ill do some editing with it TIA ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] select case problem

2002-09-24 Thread Joseph Syjuco
i have a table with the fields empno (not null) and division_no (null allowed) what i wanted to do is to do a select case statement such that when division_no is null itll output 'No division' if its not null itll output 'with division' unfortunately this statement doesnt work ... i need help on t

[SQL] getting the current date

2002-10-16 Thread Joseph Syjuco
how can i get the current date (without the time part) in sql. I tried doing a select now() but it also gives me the time part TIA joseph ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] joining from multiple tables

2003-01-15 Thread Joseph Shraibman
I have a table I want to join on, but the conditions that restrict it span more than one table. For example: create table num_tab (thekey int primary key, val int, class char); create table class_tab (class char primary key, tkey int); create table txt_tab (thekey int primary key, class int, txt

[SQL] Group By Error Text

2003-01-19 Thread Joseph Healy
Hi with the following query: select jobno, count(jobno) from drawing_register; I get the following error: ERROR: Attribute drawing_register.jobno must be GROUPed or used in an aggregate function Is this correct? Getting rid of the error is easy: select jobno, count(jobno) from drawing_regist

[SQL] How to join from two tables at once?

2003-08-26 Thread Joseph Shraibman
How can I join on one table with join conditions refering to two tables? In this example p is missing an entry that corresponds to u. I want to select from u and p, but have entries in u that don't have an entry in p. The problem is I need to go through table a to get the corresponding value

Re: [SQL] How to join from two tables at once?

2003-08-28 Thread Joseph Shraibman
Stephan Szabo wrote: Probably you want something like: SELECT u.uid, u.txt, p.val FROM u INNER JOIN a ON (a.id=u.aid) LEFT JOIN p ON (p.uid=u.uid AND p.pkey=a.pkey); From the docs: A CROSS JOIN or INNER JOIN is a simple Cartesian product, the same as you get from listing the two items at the

[SQL] Selecting "sample" data from large tables.

2004-06-03 Thread Joseph Turner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have a table with a decent number of rows (let's say for example a billion rows). I am trying to construct a graph that displays the distribution of that data. However, I don't want to read in the complete data set (as reading a billion rows would

[SQL] sorting by day of the week

2006-01-24 Thread Joseph Shraibman
p8:owl=>SELECT to_char( logtime, 'Dy'),count(*) FROM logtab WHERE date_trunc('day', logtime) > current_date + '7 day ago'::interval group by to_char( logtime, 'Dy') ORDER BY to_char( logtime, 'Dy') DESC; to_char | count -+--- Wed | 1447 Tue | 618 Thu | 1161 Sun

Re: [SQL] sorting by day of the week

2006-01-24 Thread Joseph Shraibman
7;),to_char( logtime, 'D') ORDER BY to_char( logtime, 'D') DESC; It is interesting that I can't put to_char( logtime, 'D') in the the group by without putting it in the select. Joseph Shraibman wrote: p8:owl=>SELECT to_char( logtime, 'Dy'),co

[SQL] ERROR: function expression in FROM may not refer to other relations of same query level

2009-07-08 Thread Joseph S
I've seen this asked in the archives, but there was never any answer. Supposed I have this table: create temp table tempa (ids int[]); insert into tempa SELECT ARRAY[1 , 2, 3]; Now how do I get output from that? None of these work: (xunnest is my version of unnest since I'm using 8.2.x) se

[SQL] How do I search a two dimensional array?

2010-03-29 Thread Joseph S
I can search a one dimensional array with SELECT value = ANY(array), but how do I search two dimensional array for a particular row? ANY seems to flatten out a two dimensional array. [local]:playpen=> select 2 = any (ARRAY[[1,7],[4,2]]); ?column? -- t (1 row) Time: 52.451 ms [local

[SQL] possible bug with group by?

2000-05-24 Thread Joseph Shraibman
Is this a bug or am I just misunderstanding something? playpen=> create table tablea ( a int,b int , c int ); CREATE playpen=> insert into tablea(a, b) values (1 ,2); INSERT 28299 1 playpen=> insert into tablea(a, b, c) values (2 ,3, 4); INSERT 28300 1 playpen=> select a, b, case when c is null t

Re: [SQL] possible bug with group by?

2000-05-24 Thread Joseph Shraibman
Julie Hunt wrote: > > Joseph Shraibman wrote: > > > > > > > playpen=> select a, b, case when c is null then 'not set' else 'set' end > > as z from tablea group by a, b, z; > > ERROR: Unable to identify an operator '<'

Re: [SQL] possible bug with group by?

2000-05-24 Thread Joseph Shraibman
Stephan Szabo wrote: > > > Is this a bug or am I just misunderstanding something? > > > > playpen=> create table tablea ( a int,b int , c int ); > > CREATE > > playpen=> insert into tablea(a, b) values (1 ,2); > > INSERT 28299 1 > > playpen=> insert into tablea(a, b, c) values (2 ,3, 4); > > INSE

[SQL] aliases break my query

2000-05-25 Thread Joseph Shraibman
These two queries are exactly alike. The first one uses aliases except for the order by. The second uses aliases also for the order by. The third uses whole names. The third has the behavior I want. Someone please tell me what I am doing wrong. I don't want to have to use whole names for my quer

Re: [SQL] aliases break my query

2000-05-26 Thread Joseph Shraibman
Peter Eisentraut wrote: > > > > playpen=> select ta.a,ta.b,ta.c, (select count (tb.zz) where tb.yy = > > > ta.a) from tablea ta, tableb tb order by tablea.a; > > [ produces 80 rows ] > > > > playpen=> select ta.a,ta.b,ta.c, (select count (tb.zz) where tb.yy = > > > ta.a) from tablea ta, tableb t

Re: [SQL] aliases break my query

2000-05-26 Thread Joseph Shraibman
Tom Lane wrote: > > Joseph Shraibman <[EMAIL PROTECTED]> writes: > > These two queries are exactly alike. The first one uses aliases except > > for the order by. The second uses aliases also for the order by. The > > third uses whole names. The third has the beh

[SQL] counting distinct values

2000-06-07 Thread Joseph Shraibman
Using the example from http://www.postgresql.org/docs/aw_pgsql_book/node59.html, what would I do if I wanted to know the number of different cities where I had a friend in each state? select count(city) group by state; would not work because if you had two friends in the same city it would be cou

Re: [SQL] counting distinct values

2000-06-07 Thread Joseph Shraibman
Bruce Momjian wrote: > > > Using the example from > > http://www.postgresql.org/docs/aw_pgsql_book/node59.html, what would I > > do if I wanted to know the number of different cities where I had a > > friend in each state? select count(city) group by state; would not work > > because if you had

Re: [SQL] counting distinct values

2000-06-07 Thread Joseph Shraibman
Tom Lane wrote: > > Joseph Shraibman <[EMAIL PROTECTED]> writes: > >>>> Using the example from > >>>> http://www.postgresql.org/docs/aw_pgsql_book/node59.html, what would I > >>>> do if I wanted to know the number of different cities wher

[SQL] BETWEEN

2000-06-20 Thread Joseph Shraibman
Why is BETWEEN inclusive? I had assumed that it was like the english between, which is exclusive. playpen=# create table numbs ( a int); CREATE playpen=# insert into numbs values(1); INSERT 35913 1 playpen=# insert into numbs values(2); INSERT 35914 1 playpen=# insert into numbs values(3); INSE

[SQL] Referencing named attribute in where clause doesn't work with 7.1.2?

2001-08-08 Thread Andreas Joseph Krogh
; ERROR: Attribute 'title_text_value' not found Issuing the same query without the where-clause does work tho, but return tupples with null in them which I don't want. -- Andreas Joseph Krogh <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Referencing named attribute in where clause doesn't workwith 7.1.2?

2001-08-08 Thread Andreas Joseph Krogh
Thomas Good wrote: > > On Wed, 8 Aug 2001, Andreas Joseph Krogh wrote: > > > Hi, this is my first post to this list so please... > > I have problems getting this query to work, any ideas? > > > > select article.title_text_key, > > (selec

Re: [SQL] RE: Referencing named attribute in where clause doesn't work with7.1.2?

2001-08-08 Thread Andreas Joseph Krogh
N on_text.lang_id = code.id AND code_group.description = 'lang' AND code.code_key = 'lang.NO') ON article.title_text_key = on_text.text_key WHERE on_text.text_value IS NOT NULL; And now it works! Thank you for helping me out. -- Andreas Joseph Krogh <[EMAIL PROTECTED]>

Re: [SQL] Trigger Problem

2001-09-20 Thread Andreas Joseph Krogh
es are sql,c,internal and > the created procedure languages. > > NOTE: > > I have studied in documenatation that only plpgsql > functions are written to be used in triggers. You need to issue: $ createlang plpgsql to create the plpgsql language on your database. -- Andreas Josep

Re: [SQL] graphical interface - admin

2002-07-01 Thread Andreas Joseph Krogh
h Berkus Take a look at TOra - Toolkit For Oracle: http://www.globecom.se/tora/ It has excellent PostgreSQL support. -- Andreas Joseph Krogh (Senior Software Developer) <[EMAIL PROTECTED]> "Everything should be made as simple as possible, but not simpler" - Albert Einst

Re: [SQL] graphical interface - admin

2002-07-01 Thread Andreas Joseph Krogh
On Monday 01 July 2002 13:29, you wrote: > On Mon, 1 Jul 2002, Andreas Joseph Krogh wrote: > > Take a look at TOra - Toolkit For Oracle: http://www.globecom.se/tora/ > > > > It has excellent PostgreSQL support. > > I tried 1.2.4 but didn't found how to configur

Re: [SQL] graphical interface - admin

2002-07-01 Thread Andreas Joseph Krogh
On Monday 01 July 2002 15:00, Oleg Bartunov wrote: > On Mon, 1 Jul 2002, Andreas Joseph Krogh wrote: > > On Monday 01 July 2002 13:29, you wrote: > > > On Mon, 1 Jul 2002, Andreas Joseph Krogh wrote: > > > > Take a look at TOra - Toolkit For Oracle: >

Re: [SQL] Editor for pgsql

2002-07-23 Thread Andreas Joseph Krogh
ight now(on Mandrake-8.1 with KDE-3.0.2 ant qt-3.0.4) with the following options to configure: ./configure --without-oracle --without-kde make su -c "make install" This compiles and installes just fine to /usr/local/bin with PostgreSQL support. -- Andreas Joseph Krogh (Senior Software

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

2002-09-19 Thread Andreas Joseph Krogh
7; terminate its strings proparly and some random byte gets in the query. -- Andreas Joseph Krogh <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

[SQL] 7.3 schemas

2002-09-27 Thread Andreas Joseph Krogh
d. -- Andreas Joseph Krogh <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

[SQL] Problems with to_char(created, 'WW')

2002-10-24 Thread Andreas Joseph Krogh
ek 43? -- Andreas Joseph Krogh <[EMAIL PROTECTED]> - There are 10 kinds of people in the world, those that can do binary arithmetic and those that can't. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] importing a 7.2 db with contrib/tsearch to 7.3

2002-11-21 Thread Andreas Joseph Krogh
n the table, the following error occures: e4u=> CREATE INDEX t_idx ON on_article_searchable USING gist (content); ERROR: data type txtidx has no default operator class for access method "gist" You must specify an operator class for the index or define a default operator

Re: [SQL] Need Postgresql Help

2002-12-02 Thread Andreas Joseph Krogh
w to create stored procedure in postgresql? > 2)How can i use it from perl script with parameters. ? > 3)How to return resultset from that Stored Procedure ? You need 7.3 to do 3). Infor on stored procedures: $INSTALLDIR/doc/html/plpgsql.html -- Andreas Joseph Krogh <[EM

Re: Upgrade question - was Re: [SQL] join and dynamic view

2002-12-17 Thread Andreas Joseph Krogh
1-5 > > over > > > christmas in fact. > > > > Will I need to dump/restore the database for this upgrade? As allways when version-upgrading(and not patch-level), you need to dump/restore as the binary on-disk format changes. - -- Andreas Joseph Krogh <[EMAIL PROTECTED]&

[SQL] index on to_char(created, 'YYYY') doesn't work

2003-01-15 Thread Andreas Joseph Krogh
lt of that funtion? Do anyone have an example of such a function? - -- Andreas Joseph Krogh <[EMAIL PROTECTED]> There will always be someone who agrees with you but is, inexplicably, a moron. gpg public_key: http://dev.officenet.no/~andreak/public_key.asc -BEGIN PGP SIGNA

Re: [SQL] index on to_char(created, 'YYYY') doesn't work

2003-01-15 Thread Andreas Joseph Krogh
-- But it failes with: ERROR: DefineIndex: index function must be marked isImmutable Now the question is how do I mark an index function isImmutable? - -- Andreas Joseph Krogh <[EMAIL PROTECTED]> There will always be someone wh

Re: [SQL] index on to_char(created, 'YYYY') doesn't work

2003-01-15 Thread Andreas Joseph Krogh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wednesday 15 January 2003 16:12, you wrote: > On Wed, 15 Jan 2003, Andreas Joseph Krogh wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > On Wednesday 15 January 2003 11:37, you wrote: > &

Re: [SQL] index on to_char(created, 'YYYY') doesn't work

2003-01-15 Thread Andreas Joseph Krogh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wednesday 15 January 2003 18:55, Achilleus Mantzios wrote: > On Wed, 15 Jan 2003, Andreas Joseph Krogh wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > On Wednesday 15 January 2003 16:12, you wrote

Re: [SQL] index on to_char(created, 'YYYY') doesn't work

2003-01-15 Thread Andreas Joseph Krogh
achment. Can anyone explain to me how to reed the output from ANALYZE. It seems most of the time is spent sorting and grouping. Are there any ways to optimize this? - -- Andreas Joseph Krogh <[EMAIL PROTECTED]> There will always be someone who agrees with you but is

[SQL] Backup of multiple tables

2003-09-19 Thread Andreas Joseph Krogh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. I usually backup my database with pg_backup without the -t option. But now I need to only backup certain tables(say tab1 and tab2), is this possible with pg_dump? I've tried with "pg_dump -t tab1 -t tab2" without success. - --

Re: [SQL] Backup of multiple tables

2003-09-22 Thread Andreas Joseph Krogh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Friday 19 September 2003 17:38, Tom Lane wrote: > Andreas Joseph Krogh <[EMAIL PROTECTED]> writes: > > I usually backup my database with pg_backup without the -t option. But > > now I need to only backup certain tables(say ta

Re: [SQL] Inserting data in a table using sub-selects]

2004-03-10 Thread Andreas Joseph Krogh
iption, '') > FROM table1 t1) > WHERE id NOT IN ( > SELECT id > FROM table1); > > With Oracle there is a slick way to do a partial outer join that allowed > you to do this without creating a complete list of table1.id in the last > subquery, but I dunno if

[SQL] Problem with LATIN1 characters from Perl-DBI

2004-09-07 Thread Andreas Joseph Krogh
Linux system. I first had the problem printing out LATIN1 chars to stdout too, but solved that by using the pragma use encoding 'ISO-8859-1'; I've tried: $dbh->do("set CLIENT_ENCODING TO 'ISO-8859-1'") or die("Couldn't set encoding to ISO-8859-1

Re: [SQL] Problem with LATIN1 characters from Perl-DBI

2004-09-07 Thread Andreas Joseph Krogh
rinting it out to stdout, the 'use encoding' pragma took care of the conversion, but that didn't work for inserting the contents of $plain_text into the database. So I must convert it to latin1 using the from_utf8 su

[SQL] Making NULL entries appear first when ORDER BY ASC

2005-02-15 Thread Andreas Joseph Krogh
I would like to make all entries where start_time IS NULL apear *before* all the others. Any idea how to achieve this? -- Andreas Joseph Krogh <[EMAIL PROTECTED]> Senior Software Developer / Manager gpg public_key: http://dev.officenet.

Re: [SQL] Making NULL entries appear first when ORDER BY ASC

2005-02-16 Thread Andreas Joseph Krogh
r > date. Otherwise change the order in the ORDER BY clause. Thanks! This si, IMO, the cleanest solution as it doesn't involve any COALESCE. -- Andreas Joseph Krogh <[EMAIL PROTECTED]> Senior Software Developer

  1   2   >