[SQL] procedure help between databases

2010-09-03 Thread Daniel Sobey
Hello list, I need some help in writing a trigger / procedure. I have two databases, one for last.fm and one for musicbrainz. What I would like to do is when i submit a song into last.fm, connect to the musicbrainz and get an id for the song. Both are using postgres and i can use a db link to qu

Re: [SQL] sorry, now with subject... trigger & nextval(seq)

2010-06-01 Thread Daniel Migowski
etween the sequence, will create the sequence and will drop everything if the column gets dropped. Regards, Daniel Migowski <> -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Remove my e-mail

2010-03-15 Thread Daniel Guedes
Hi!, I don't want to receive more emails from postgresql. Please remove my email from your delivery list. Thanks -- Daniel Guedes

[SQL] Recording how a table is used

2009-07-06 Thread Daniel Gordon
I'm trying to record the results of a select statement into a separate table. I need the information selected, the column it was stored in, the table it was stored in, and the query that selected it. Everything I've read so far says that triggers can't trigger from select statements, and they don

Re: [SQL] Join question

2008-08-18 Thread Daniel Hernandez
have you tried a right Join?Daniel Hernndez.San Diego, CA."The more you learn, the more you earn".Fax: (808) 442-0427-Original Message-From: "Edward W. Rouse" [EMAIL PROTECTED]: 08/15/2008 09:48 AMTo: [EMAIL PROTECTED]: Re: [SQL] Join question I have 2

RE: [SQL] function that returns a set of records and int eger(both of them)‏

2008-07-12 Thread daniel blanco
:07 +0200> From: [EMAIL PROTECTED]> To: [EMAIL > PROTECTED]> Subject: Re: [SQL] function that returns a set of records and > integer(both of them)‏> CC: pgsql-sql@postgresql.org> > Hello> > 2008/7/13 > daniel blanco <[EMAIL PROTECTED]>:> > Ok, than

RE: [SQL] function that returns a set of records and int eger(both of them)‏

2008-07-12 Thread daniel blanco
h of them)‏> CC: pgsql-sql@postgresql.org> > 2008/7/11 daniel > blanco <[EMAIL PROTECTED]>:> > Hi Everyone> >> > I would like to know if i > can create a function that returns a set of record> > with the sql statement: > select and a integer, i

[SQL] function that returns a set of records and integer(both of them)‏

2008-07-11 Thread daniel blanco
Hi Everyone I would like to know if i can create a function that returns a set of record with the sql statement: select and a integer, i mean both of them, because i remenber that in sql server (transact sql) i can do that in a stored procedure doing a select statement and a return of a integer

[SQL] What does mod - in "mod statement" - stand for?

2008-04-16 Thread Daniel CAUNE
nlighten me. Thanks, -- Daniel http://www.majormode.com/ -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] SQL stored function inserting and returning data in a row.

2008-01-11 Thread Daniel Caune
tatements to the SQL engine for execution. There is a little overhead between PL/PLSQL and SQL engines. Regards, -- Daniel ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

[SQL] SQL stored function inserting and returning data in a row.

2008-01-10 Thread Daniel Caune
008-01-10 22:08:48 EST CONTEXT: SQL function "create_matchmaking_sesssion" I can easily convert this code into a PL/pgSQL function, but I'm thinking that pure SQL is more natural (and faster?) for such a stored function. Regards, -- Daniel --

Re: [SQL] JOIN a table twice for different values in the same query

2008-01-10 Thread Daniel Hernandez
js=# SELECT departure_date, departure.code AS departure_code, arrival.code as arraival_codeFROM jsjourneys         JOIN jsports as departure ON jsjourneys.departure_port = departure.id        JOIN jsports as arrival on jsjourneys.arraival_port = arraival.id LIMIT4; Regards,Daniel

[SQL] PL/pgsql: function passing argument to IN operator

2007-12-28 Thread Daniel Myers
Can anyone help me out? Thanks, Daniel P.S.: Sorry if capitalizing SQL keywords is bad list etiquette... ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

[SQL] Using schema

2007-11-30 Thread Daniel Caune
, bar WHERE foo.i = bar.i; -- Uses both schemas That is damn flexible! :-) -- Daniel ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your

Re: [SQL] Strang behaviour SELECT ... LIMIT n FOR UPDATE

2007-11-28 Thread Daniel Caune
> De : Tom Lane [mailto:[EMAIL PROTECTED] > > "Daniel Caune" <[EMAIL PROTECTED]> writes: > > I did the following test, removing all the where-clause from the SELECT > statement. Every statement completes immediately, i.e. it doesn't block. > > I

Re: [SQL] Strang behaviour SELECT ... LIMIT n FOR UPDATE

2007-11-28 Thread Daniel Caune
> -Message d'origine- > De : Tom Lane [mailto:[EMAIL PROTECTED] > Envoyé : mardi, novembre 27, 2007 23:46 > À : Daniel Caune > Cc : pgsql-sql@postgresql.org > Objet : Re: [SQL] Strang behaviour SELECT ... LIMIT n FOR UPDATE > > "Daniel Caune" <[

[SQL] Strang behaviour SELECT ... LIMIT n FOR UPDATE

2007-11-27 Thread Daniel Caune
e | value | isLocked | timestamp | type | tokenName -+--+--+--+----- ---+--+--- 104 |2 | RegressionTestClanName13 | f| 2007-11-27 20:40:25.208074 |2 | clanName 40 |2 | Regressio

[SQL] How to have a unique primary key on two tables

2007-11-22 Thread Daniel "bodom_lx" Graziotin
vice versa. A sort of primary key in common for both tables. Any hints? Thank you very much -- Daniel "bodom_lx" Graziotin - http://daniel.graziotin.net - http://daniel.graziotin.net/bodom_lx.asc - GPG public key ---(end of broadcast)---

[SQL] Erlang & PostgreSQL native driver

2007-11-15 Thread Daniel Caune
u use? Does someone use the PostgreSQL driver from Erlang Consulting? Are there other native PostgreSQL driver? Thanks, -- Daniel ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail co

[SQL] Accessing field of OLD in trigger

2007-10-12 Thread Daniel Drotos
Hi, I'm working on a row level plpgsql trigger running after delete, using a 8.0.3 server. It gets a parameter which is a field name of the OLD record. How can that field be accessed? I'd like to do something like: for recvar in 'select OLD.'||quote_ident(TG_ARGV[0])..

[SQL] Accessing field of OLD in trigger

2007-10-11 Thread Daniel Drotos
Hi, I'm working on a row level plpgsql trigger running after delete, using a 8.0.3 server. It gets a parameter which is a field name of the OLD record. How can that field be accessed? I'd like to do something like: for recvar in 'select OLD.'||quote_ident(TG

Re: [SQL] Computed table name in function

2007-10-10 Thread Daniel Drotos
On Wed, 10 Oct 2007, Ray Madigan wrote: I thought that the documentation said I couldn't use EXECUTE on a SELECT INTO? Try "for record_var in select ..." Look for 36.7.4 Looping Through Query Results in the docs. Daniel ---(e

Re: [SQL] array handling on 8.0.3

2007-10-09 Thread Daniel Drotos
Hi, I found my bug, please forget my (stupid) question! Daniel ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] array handling on 8.0.3

2007-10-09 Thread Daniel Drotos
On Tue, 9 Oct 2007, Daniel Drotos wrote: I have to run a function on a 9.0.3 server. Following part (of a bigger ^ I mean 8.0.3 sorry Daniel ---(end of broadcast)--- TIP 6: explain

[SQL] array handling on 8.0.3

2007-10-09 Thread Daniel Drotos
): INFO: splitted=b INFO: a={a,b} INFO: splitted= INFO: a= INFO: a= ready It looks that value of the array `a' is lost after the loop. Is this normal? What do I do wrong? Daniel ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] pg & Delphi

2007-08-28 Thread Daniel Drotos
well, but it is too slow. Daniel ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

Re: [SQL] Calling void functions

2007-04-02 Thread Daniel CAUNE
> PERFORM works only in plpgsql, Peter wrote a pl/sql-function... > Oups, sorry! I missed the point. ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Calling void functions

2007-04-02 Thread Daniel Caune
> I'm informed that the last statement of a function that returns void > cannot be > a SELECT. How else is one supposed to call another function which also > returns void? > PERFORM ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[SQL] Sequence vs Serial

2007-03-31 Thread Daniel CAUNE
S (v_mycolumn1, v_mycolumn2); SELECT INTO v_mytable_id currval('seq_mytable_id'); RETURN v_mytable_id; -- Daniel

Re: [SQL] help with version checking

2006-12-28 Thread Daniel CAUNE
ACE FUNCTION check_version() RETURNS void AS $$ DECLARE v_version VARCHAR; BEGIN SELECT version INTO v_version FROM version WHERE id = 1; IF v_version <> '1.0.0.0' THEN RAISE EXCEPTION 'This script needs Agenda version 1.0.0.0, detected version %&#

[SQL] DELETE RETURNING

2006-10-21 Thread Daniel CAUNE
FROM b RETURNING x, current_timestamp; IF NOT FOUND THEN -- No data were deleted actually END IF; Thanks, -- Daniel ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] conversion of numeric field from MSSQL to postgres

2006-10-20 Thread Daniel CAUNE
stgres. How would i migrate > this: > > [Id] [numeric](18, 0) IDENTITY (1, 1) > It seems that you've already asked for this question last Sunday, and because your question is somewhat deterministic, the answers are more likely to be the same. Check your previous e-mails. --

Re: [SQL] migrating numeric to serial from MSSQL to postgres

2006-10-15 Thread Daniel CAUNE
reason?): CREATE TABLE my_table ( Id INTEGER NOT NULL, ... ); [DTS process here] CREATE SEQUENCE my_sequence INCREMENT BY 1 MINVALUE 1 NO MAXVALUE START WITH CACHE 1 NO CYCLE; ALTER TABLE m_table ALTER COLUMN Id SET DEFAULT NEXTVAL('my_sequence'); Does that make

Re: [SQL] migrating numeric to serial from MSSQL to postgres

2006-10-15 Thread Daniel CAUNE
XVALUE START WITH 1 CACHE 1 NO CYCLE; Then you should be able to migrate your code to something like: Id INTEGER NOT NULL DEFAULT NEXTVAL(my_sequence') -- Daniel ---(end of broadcast)--- TIP 1: if posting/reading through Usenet,

Re: [SQL] deleting rows in specific order

2006-10-11 Thread Daniel Drotos
is a little bit more dificult which I would be able to simplify if rows are deleted in date order. Now I'm doing it in a plpgsql function using a `for in select loop' to delete rows one by one. Daniel ---(end of broadcast)--- TIP 6: explain analyze is your friend

[SQL] deleting rows in specific order

2006-10-09 Thread Daniel Drotos
Hi, What is the best way to do something like: delete from tablename where something order by somefield... Daniel ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[SQL] Evaluation of if conditions

2006-09-06 Thread Daniel CAUNE
, which let me think that PL/PGSQL evaluates all the conditions: IF (TG_OP = 'INSERT') OR (OLD.bar = ...) THEN statement END IF; Should be rewritten as (for example): IF (TG_OP = 'INSERT') THEN statement ELSIF (OLD.bar = ...) THEN statement END IF;

[SQL] SQL92 compliance

2006-08-22 Thread Daniel CAUNE
y a client application, at the end of a several data marshalling processes, doesn't get the right data... For instance MySQL doesn't require it and sometimes that sucks: SELECT my_column1 my_column2, my_column3 FROM my_table Regards, -- Daniel --

[SQL] viewing the description of tables from python DB-API

2006-08-01 Thread Daniel Joo
Hi all,   Is there a way to view the list of all tables from python (or any other languages for that matter) DB-API?  What I’m looking for is a command similar to the meta-command ‘\d’ that works with the psql client.    Thanks very much!   Dan  

Re: [SQL] PostgreSQL server terminated by signal 11

2006-07-28 Thread Daniel Caune
> De : Tom Lane [mailto:[EMAIL PROTECTED] > Envoyé : vendredi, juillet 28, 2006 09:38 > À : Daniel Caune > Cc : pgsql-admin@postgresql.org; pgsql-sql@postgresql.org > Objet : Re: [SQL] PostgreSQL server terminated by signal 11 > > "Daniel Caune" <[EMAIL PROTEC

Re: [SQL] PostgreSQL server terminated by signal 11

2006-07-28 Thread Daniel Caune
> -Message d'origine- > De : Tom Lane [mailto:[EMAIL PROTECTED] > Envoyé : jeudi, juillet 27, 2006 19:26 > À : Daniel Caune > Cc : pgsql-admin@postgresql.org; pgsql-sql@postgresql.org > Objet : Re: [SQL] PostgreSQL server terminated by signal 11 > > &qu

Re: [SQL] PostgreSQL server terminated by signal 11

2006-07-27 Thread Daniel CAUNE
> -Message d'origine- > De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > De la part de D'Arcy J.M. Cain > Envoyé : jeudi 27 juillet 2006 19:49 > À : Daniel Caune > Cc : [EMAIL PROTECTED]; pgsql-admin@postgresql.org; pgsql- > [EMAIL PROTECTED] > O

Re: [SQL] PostgreSQL server terminated by signal 11

2006-07-27 Thread Daniel CAUNE
> -Message d'origine- > De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > De la part de Tom Lane > Envoyé : jeudi 27 juillet 2006 19:26 > À : Daniel Caune > Cc : pgsql-admin@postgresql.org; pgsql-sql@postgresql.org > Objet : Re: [SQL] PostgreSQL server terminated

Re: [SQL] PostgreSQL server terminated by signal 11

2006-07-27 Thread Daniel Caune
> -Message d'origine- > De : Tom Lane [mailto:[EMAIL PROTECTED] > Envoyé : jeudi, juillet 27, 2006 16:06 > À : Daniel Caune > Cc : pgsql-sql@postgresql.org > Objet : Re: [SQL] PostgreSQL server terminated by signal 11 > > "Daniel Caune" <[E

Re: [SQL] PostgreSQL server terminated by signal 11

2006-07-27 Thread Daniel Caune
> De : Tom Lane [mailto:[EMAIL PROTECTED] > Envoyé : jeudi, juillet 27, 2006 16:06 > À : Daniel Caune > Cc : pgsql-sql@postgresql.org > Objet : Re: [SQL] PostgreSQL server terminated by signal 11 > > "Daniel Caune" <[EMAIL PROTECTED]> writes: > > My Post

[SQL] PostgreSQL server terminated by signal 11

2006-07-27 Thread Daniel Caune
dy dropped the table, inserted data, and tried to create all the indexes.  The server systematically crashed when creating some specific indexes.  The only idea I have for the moment would be to setup another machine with the same database environment.  Other idea(s)?   Thanks     -- Daniel CAUNE Ubisoft Online Technology (514) 490 2040 ext. 3613  

[SQL] Trigger, record "old" is not assigned yet

2006-07-13 Thread Daniel Caune
,     -- Daniel CAUNE Ubisoft Online Technology (514) 490 2040 ext. 3613  

[SQL] Invalid memory alloc request size

2006-07-11 Thread Daniel Caune
earched for some similar cases in the pgsql-sql archive but nothing really similar. Any idea? Regards, P.S.: I don't have this problem on other tables containing less data. -- Daniel CAUNE Ubisoft Online Technology (514) 490 2040 ext. 3613 ---(end of broadcast)-

[SQL] Local variable and column name conflict

2006-07-03 Thread Daniel Caune
; For instance, Ingres suggests prefixing local variable/parameter with ":" in the query: UPDATE bar SET i = :i; I can continue using the de facto Oracle's naming convention (P_parameter and V_local_variable) anyway. That's not a big deal. Regards, -- Daniel

Re: [SQL] Constraint UNIQUE on a column not case sensitive

2006-07-01 Thread Daniel CAUNE
> -Message d'origine- > De : Michael Glaesemann [mailto:[EMAIL PROTECTED] > Envoyé : samedi 1 juillet 2006 10:01 > À : Daniel CAUNE > Cc : pgsql-sql@postgresql.org > Objet : Re: [SQL] Constraint UNIQUE on a column not case sensitive > > > On Jul 1, 200

[SQL] Constraint UNIQUE on a column not case sensitive

2006-07-01 Thread Daniel CAUNE
in MyTable. Is there better and more efficient way to do that? Regards, -- Daniel ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

[SQL] Documentation Generator for pl/pgsql

2006-06-29 Thread Daniel Caune
?   Thanks,   -- Daniel CAUNE Ubisoft Online Technology (514) 490 2040 ext. 3613  

Re: [SQL] keeping last 30 entries of a log table

2006-06-19 Thread Daniel CAUNE
log > > WHERE account_id = 1 > >AND id < ( > > SELECT MIN(id) > >FROM log > >WHERE account_id = 1 > >ORDER BY timestamp DESC > > LIMIT 30); > > > > I think there will be a performance difference with your me

Re: [SQL] keeping last 30 entries of a log table

2006-06-17 Thread Daniel CAUNE
your method when the number of records to be deleted is huge. -- Daniel ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] "could not open file" issue

2006-04-24 Thread Daniel Caune
> De : [EMAIL PROTECTED] [mailto:pgsql-sql- > [EMAIL PROTECTED] De la part de Andrew Sullivan > > On Mon, Apr 24, 2006 at 12:17:07PM -0400, Daniel Caune wrote: > > Hi, > > > > Is there any way to solve the following issue without dropping the > > table? >

Re: [SQL] "could not open file" issue

2006-04-24 Thread Daniel Caune
> De : Alvaro Herrera [mailto:[EMAIL PROTECTED] > > Daniel Caune wrote: > > > > > De : Alvaro Herrera [mailto:[EMAIL PROTECTED] > > > > > > Daniel Caune wrote: > > > > > > > > select count(*) from eventplayerleaveroom; &

Re: [SQL] "could not open file" issue

2006-04-24 Thread Daniel Caune
> De : Alvaro Herrera [mailto:[EMAIL PROTECTED] > > Daniel Caune wrote: > > Hi, > > > > Is there any way to solve the following issue without dropping the > > table? > > > > select count(*) from eventplayerleaveroom; > > ERROR: could not a

[SQL] "could not open file" issue

2006-04-24 Thread Daniel Caune
rver 8.1.3 -- Daniel CAUNE Ubisoft Online Technology (514) 4090 2040 ext. 5418 ---(end of broadcast)--- TIP 6: explain analyze is your friend

[SQL] Modeling trees with Nested Sets and Nested Intervals

2006-04-07 Thread Daniel Browning
ee, or connect by. Other resources that have been helpful: http://troels.arvin.dk/db/rdbms/links/#hierarchical http://groups.google.com/group/comp.databases.theory/msg/7b772060322df739 Maybe all this would make a good project on pgfoundry. -- Daniel Browning - Kavod Technologies. Random

Re: [SQL] Index on nullable column

2006-03-25 Thread Daniel CAUNE
index fooi on foo(f2) where f1 is null > > but it's still a very specialized index. > Thanks Tom. I will use such an index even if it's very specialized; OLAP world is somewhat full of specialized index anyway... :-) -- Daniel ---(end of broadcast)--- TIP 6: explain analyze is your friend

[SQL] Index on nullable column

2006-03-24 Thread Daniel Caune
Hi, Is an index on a nullable column useful for retrieving rows having that column null? SELECT PlayerID FROM PlayerLoginSession WHERE EndTime IS NULL; Regards, -- Daniel CAUNE Ubisoft Online Technology (514) 4090 2040 ext. 5418 ---(end of broadcast

Re: [SQL] OUT parameter

2006-03-23 Thread Daniel Caune
support pass-by-reference > > parameters and are unlikely to start doing so. There isn't any way > > that you can affect locals of a calling procedure before you return. > > Then I've misunderstood the semantics of OUT and more importantly INOUT > parameters. Th

[SQL] OUT parameter

2006-03-22 Thread Daniel Caune
, b2 OUT int) AS $$ V_b1 int; V_b2 int; BEGIN FOR (...) LOOP V_b1 = (...); V_b2 = (...); END LOOP; b1 = V_b1; b2 = V_b2; END; $$ LANGUAGE PLPGSQL; Thanks, -- Daniel CAUNE Ubisoft Online Technology (514) 4090 2040 ext. 5418

Re: [SQL] Custom type

2006-03-22 Thread Daniel Caune
each custom type I create. > > > > Thanks, > > > > > > -- > > Daniel CAUNE > > Ubisoft Online Technology > > (514) 4090 2040 ext. 5418 > > > > Daniel, > > From the \h command in psql: > > rnd=# \h comment > Command: COMMENT &

[SQL] Custom type

2006-03-22 Thread Daniel Caune
Hi, How can I enter description for my custom types? \dT provides information such as schema, name, and description for all the registered types and custom types. I would like to provide a description for each custom type I create. Thanks, -- Daniel CAUNE Ubisoft Online Technology (514) 4090

Re: [SQL] Power cut and performance problem

2006-03-21 Thread Daniel Caune
the most efficient way, but it's okay because this is a data stage table. It seems that it fixes my performance problem. As you said, perhaps the problem was more related to index corruption. Truncating data and inserting new data recreate the index and therefore fix the problem. Thanks, --

Re: [SQL] Power cut and performance problem

2006-03-21 Thread Daniel Caune
ole performance would be degraded when a problem occurs with RAID disks. Am I wrong? Could it be something else? Are there some tools that check the state of a PostgreSQL database? -- Daniel ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] Update counter when row SELECT'd ... ?

2006-03-20 Thread Daniel CAUNE
t_url(P_Limit IN int) RETURNS SETOF table AS $$ BEGIN FOR V_Record IN SELECT * FROM table ORDER BY counter LIMIT P_Limit LOOP UPDATE table SET counter = counter + 1 WHERE name = V_Record.name /* AND url = V_Record.url */; -- if needed RETURN V_Record;

Re: [SQL] Power cut and performance problem

2006-03-20 Thread Daniel Caune
> I see you're running autovacuum. What's your disk subsytem look like? By > chance is it sitting on a RAID 5 that's running in degraded mode right now > while it scrubs? > Yes, that should be the problem. I will check that tomorrow morning with a Linux administrator. Thanks.

[SQL] Power cut and performance problem

2006-03-20 Thread Daniel Caune
OG: incomplete startup packet Where can I check, please? Is it more likely a hardware problem (the machine seems ok, no error detected)? Regards, -- Daniel CAUNE Ubisoft Online Technology (514) 4090 2040 ext. 5418 ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] help with function

2006-03-16 Thread Daniel Caune
> Hello, > > I have 2 tables where each table has a column named "comments" and the > tables are related as a one to many. I want to concatenate all the > comments of the many side to the one side so I wrote the following > plpgsql function to do so. > > > CREATE OR REPLACE FUNCTION fixcomment

Re: [SQL] connectby documentation

2006-03-13 Thread Daniel Caune
> -Message d'origine- > De : Michael Fuhr [mailto:[EMAIL PROTECTED] > Envoyé : lundi, mars 13, 2006 19:26 > À : Daniel Caune > Cc : [EMAIL PROTECTED]; postgresql sql list > Objet : Re: [SQL] connectby documentation > > On Mon, Mar 13, 2006 at 06:38:14PM -05

Re: [SQL] connectby documentation

2006-03-13 Thread Daniel Caune
ctby | setof record | text, text, text, text, integer, text public | connectby | setof record | text, text, text, text, text, integer, text I hope that will help another PostgreSQL newbie. -- Daniel ---(end of broadcast)--- TIP 1:

Re: [SQL] connectby documentation

2006-03-13 Thread Daniel Caune
tablefunc. > You are right. The documentation is located in /usr/share/doc/postgresql-contrib-8.1/ . Wow, that was the quest for the Holy Grail! :-) -- Daniel ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] connectby documentation

2006-03-13 Thread Daniel Caune
; :-) And you'll see, that you can install newer versions than 7.4 :-) > Sorry, this is not my day: "apt-get install postgresql-contrib-8.1" works fine... Just a link on the documentation that fully explains how connectby() works would be great! :-) Thanks, --

Re: [SQL] connectby documentation

2006-03-13 Thread Daniel Caune
> -Message d'origine- > De : Michael Fuhr [mailto:[EMAIL PROTECTED] > Envoyé : lundi, mars 13, 2006 11:12 > À : Daniel Caune > Cc : postgresql sql list > Objet : Re: [SQL] connectby documentation > > On Mon, Mar 13, 2006 at 10:37:37AM -0500, Daniel Caune wr

[SQL] connectby documentation

2006-03-13 Thread Daniel Caune
3 2 6 3 7 6 Regards, -- Daniel ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [SQL] Ask a PostgreSql question (about select )

2006-03-13 Thread Daniel Caune
> 3 a3 5 > > 4 > > 5 > > . > > . > > . > > > > > > in PostgreSql > > > > How to wirte Statement ( Rownum -> change ??) > > PostgreSQL doesn't have the Oracle ROWNUM feature. But if you were usi

Re: [SQL] pgsql aggregate: conditional max

2006-03-12 Thread Daniel CAUNE
AS tablemaxweight WHERE table.aid = tablemaxweight.aid AND table.weight = tablemaxweight.aid; There is a limit case you don't specify how to deal with, when two or more categories have the same maximum weight. The query I wrote retrieves all the categories that

[SQL] how to add primary key to existing table with multiple primary keys

2006-02-28 Thread Daniel Joo
Hi there,   I am trying to add another primary key to an existing table with two other primary keys.  I got the following error when I tried this command:   alter table extprobe2tissue ADD primary key (expid); ERROR:  multiple primary keys for table "extprobe2tissue" are not allowed  

[SQL] plsql / time statement

2006-02-28 Thread Daniel Caune
Hi,   Is there any option to set so that psql provides the execution time of each SQL statement executed?   Regards,   -- Daniel CAUNE Ubisoft Online Technology (514) 4090 2040 ext. 5418  

Re: [SQL] Missing fields on Query result.

2006-02-24 Thread Daniel Hernandez
Never Mind, it's solved now,Thanx any way, regards,Daniel Hernández.Tijuana, BC, México."More you learn, more you earn". --- On Fri 02/24, Daniel Hernandez < [EMAIL PROTECTED] > wrote:From: Daniel Hernandez [mailto: [EMAIL PROTECTED]To: pgsql-sql@postgresql.orgDate: Fri,

[SQL] Missing fields on Query result.

2006-02-24 Thread Daniel Hernandez
Hi Guys,   I have another question, but in this time is regarding to a query that supose to return son char fields, but they don't show up, I'm using ODBC Driver 7.03.02.00 with Delphi 6.Thanks in advanced, and regards,Daniel Hernández.Tijuana, BC, México."More you learn, more

Re: [SQL] Sum If

2006-02-23 Thread Daniel Hernandez
Hi Jim,   Thanks for the tip, It worked!Thanks a lot!!!Daniel Hernández.Tijuana, BC, México."More you learn, more you earn".try select ...,sum(case when sales.itemname = 'some' then sales.count else 0 end) as "Sales Candies"from your_table_heregroup by ...

[SQL] Sum If

2006-02-23 Thread Daniel Hernandez
', sum(sales.count)) as "Sales Some"from ...join ...where .group by customers.custid ...Thanks in advanced, and best regards,Daniel Hernández.Tijuana, BC, México."More you learn, more you earn".Join Excite! - http://www.excite.comThe most personalized portal on the Web!

Re: [SQL] How to force PostgreSQL using an index

2006-02-16 Thread Daniel Caune
> -Message d'origine- > De : Tom Lane [mailto:[EMAIL PROTECTED] > Envoyé : mercredi, février 15, 2006 17:47 > À : Daniel Caune > Cc : Andrew Sullivan; pgsql-sql@postgresql.org > Objet : Re: [SQL] How to force PostgreSQL using an index > > "Daniel

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Daniel Caune
> "Owen Jacobson" <[EMAIL PROTECTED]> writes: > > On Wed, Feb 15, 2006 at 04:58:54PM -0500, Daniel Caune wrote: > >> I see, but that doesn't explain whether it is possible to specify the > >> index to use. It seems that those options just force

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Daniel Caune
for experimenting > with indexing schemes, but then, so is DROP INDEX. > Yes, indeed, such a feature could be badly used. However it may happen sometimes that the planner is wrong; I already encountered such situations with both Oracle 9i and SQL Server 2000, even with statistics

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Daniel Caune
> On Wed, Feb 15, 2006 at 04:58:54PM -0500, Daniel Caune wrote: > > Hi, > > > > > > > > Is there a way to force PostgreSQL using an index for a SELECT > > statement? I just want to confirm that the index PostgreSQL decides to > > use is better than

[SQL] How to force PostgreSQL using an index

2006-02-15 Thread Daniel Caune
Hi,   Is there a way to force PostgreSQL using an index for a SELECT statement?  I just want to confirm that the index PostgreSQL decides to use is better than the index I supposed PostgreSQL would use (I already analyze the table).   Regards,   -- Daniel CAUNE Ubisoft Online

Re: [SQL] Does PostgreSQL support job?

2006-02-02 Thread Daniel Caune
> Daniel Caune wrote: > >>> I'm not sure to understand. Why calling a function from a script is > >>> different from executing a series of SQL commands? > > [snip] > >>>Does that make sense? > >>It does make sense if myjob() does

Re: [SQL] Does PostgreSQL support job?

2006-02-02 Thread Daniel Caune
> > I'm not sure to understand. Why calling a function from a script is > different from executing a series of SQL commands? I mean, I can run a > script defined as follows: > > > > SELECT myjob(); > > > > where myjob is a stored procedure such as: > > > > CREATE OR REPLACE FUNCTION myjob() > >

Re: [SQL] Does PostgreSQL support job?

2006-02-01 Thread Daniel CAUNE
> -Message d'origine- > De : [EMAIL PROTECTED] [mailto:pgsql-sql- > [EMAIL PROTECTED] De la part de Alvaro Herrera > Envoyé : mercredi 1 février 2006 19:28 > À : Daniel Caune > Cc : Owen Jacobson; pgsql-sql@postgresql.org > Objet : Re: [SQL] Does PostgreSQL supp

Re: [SQL] Does PostgreSQL support job?

2006-02-01 Thread Daniel Caune
> -Message d'origine- > De : Owen Jacobson [mailto:[EMAIL PROTECTED] > Envoyé : mercredi, février 01, 2006 18:00 > À : Daniel Caune; pgsql-sql@postgresql.org > Objet : RE: [SQL] Does PostgreSQL support job? > > Daniel Caune wrote: > > Hi, > >

Re: [SQL] Does PostgreSQL support job?

2006-02-01 Thread Daniel Caune
> -Message d'origine- > De : [EMAIL PROTECTED] [mailto:pgsql-sql- > [EMAIL PROTECTED] De la part de Bruce Momjian > Envoyé : mercredi, février 01, 2006 17:57 > À : Daniel Caune > Cc : pgsql-sql@postgresql.org > Objet : Re: [SQL] Does PostgreSQL support jo

[SQL] Does PostgreSQL support job?

2006-02-01 Thread Daniel Caune
-scripts on Linux.   Thanks (Tom Lane J)   -- Daniel CAUNE  

[SQL] CREATE INDEX with order clause

2006-02-01 Thread Daniel Caune
lly, I’m not sure that is useful; perhaps PostgreSQL handles pretty well such query using an index such as:   CREATE INDEX IDX_GSLOG_EVENT_PLAYER_EVENT_TIME_DESC   ON GSLOG_EVENT(PLAYER_USERNAME, EVENT_NAME, EVENT_DATE_CREATED);   Any idea?   -- Daniel CA

Re: [SQL] Function with default value?

2006-01-29 Thread Daniel CAUNE
> -Message d'origine- > De : Tom Lane [mailto:[EMAIL PROTECTED] > Envoyé : dimanche 29 janvier 2006 10:48 > À : Daniel CAUNE > Cc : pgsql-sql@postgresql.org > Objet : Re: [SQL] Function with default value? > > Daniel CAUNE <[EMAIL PROTECTED]> wri

[SQL] Function with default value?

2006-01-29 Thread Daniel CAUNE
exist! J   Thanks,     Daniel

[SQL] [HELP] Defining a function as a procedure

2006-01-26 Thread Daniel Caune
n patch my function so that it compiles but that won’t be really nice:   CREATE OR REPLACE FUNCTION foo()   RETURNS int AS $$ BEGIN     RETURN 1; END; $$ LANGUAGE 'plpgsql';   Is there any other prettier way to do that?   Thanks,     -- Daniel  

  1   2   >