Re: [SQL] using string functions on plpgsql

2008-04-16 Thread Tom Lane
Craig Ringer <[EMAIL PROTECTED]> writes: > i = length(texto) >> ^^^ >> >> i := length(texto) > Whoops, I spoke too soon - it seems both are valid for assignment. Has > that always been true? Yeah, it's not documented, but AFAIK plpgsql has always taken both. regards, t

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

2008-04-16 Thread Craig Ringer
Daniel CAUNE wrote: > Hi, > > Could you please tell me what does mod - in "mod statement" - stand for? `mod' is shorthand for "modify" or "modifying", ie statements that modify the data. -- Craig Ringer -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subsc

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

2008-04-16 Thread Daniel CAUNE
Hi, Could you please tell me what does mod - in "mod statement" - stand for? "log_statement (string) Controls which SQL statements are logged. Valid values are none, ddl, mod, and all. (...). mod logs all ddl statements, plus data-modifying statements such as INSERT, UPDATE, DELETE, TRUNCATE, an

Re: [SQL] using string functions on plpgsql

2008-04-16 Thread Craig Ringer
Craig Ringer wrote: Marcelo Edgardo Paniagua Lizarraga wrote: declare i integer; begin ... i = length(texto) ^^^ i := length(texto) Whoops, I spoke too soon - it seems both are valid for assignment. Has that always been true? The one time I don't write a small test before

Re: [SQL] using string functions on plpgsql

2008-04-16 Thread Craig Ringer
Marcelo Edgardo Paniagua Lizarraga wrote: declare i integer; begin ... i = length(texto) ^^^ i := length(texto) -- Craig Ringer -- 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] using string functions on plpgsql

2008-04-16 Thread Tom Lane
"Marcelo Edgardo Paniagua Lizarraga" <[EMAIL PROTECTED]> writes: > I'm starting to create my firsts plpgsql functions, and I was > wondering how to use the string function 'length' in the code of the > fuction. I have tried so far and I get an error. There's nothing obviously wrong with what you p

[SQL] using string functions on plpgsql

2008-04-16 Thread Marcelo Edgardo Paniagua Lizarraga
I'm starting to create my firsts plpgsql functions, and I was wondering how to use the string function 'length' in the code of the fuction. I have tried so far and I get an error. I'm trying this: declare i integer; begin ... i = length(texto) ... where texto is a varchar(200) I pass a

[SQL] SQL/XML Multi table join question

2008-04-16 Thread Mina R Waheeb
Hi all, I have the following tables (parent and two children) CREATE SEQUENCE person_seq; CREATE TABLE person( _id integer DEFAULT nextval('person_seq') NOT NULL, _timestamp TIMESTAMP NOT NULL, _lastModified TIMESTAMP NOT NULL, name VARCHAR(255) NOT NULL,

Re: [SQL] Data Comparison Single Table Question

2008-04-16 Thread Osvaldo Rosario Kussama
Bryan Emrys escreveu: I can handle this outside sql, but it seems like I should be able to do this in sql as well. 1 table: countries. 3 columns: id, name, price What I'm trying to get is a result of the price differences between every country. So if the data looks like (ignoring the id fie

Re: [SQL] How to find double entries

2008-04-16 Thread Craig Ringer
Vivek Khera wrote: > > On Apr 15, 2008, at 11:23 PM, Tom Lane wrote: >> What's really a duplicate sounds like a judgment call here, so you >> probably shouldn't even think of automating it completely. > > I did a consulting gig about 10 years ago for a company that made > software to normalize st

Re: [SQL] How to find double entries

2008-04-16 Thread Vivek Khera
On Apr 15, 2008, at 11:23 PM, Tom Lane wrote: What's really a duplicate sounds like a judgment call here, so you probably shouldn't even think of automating it completely. I did a consulting gig about 10 years ago for a company that made software to normalize street addresses and names. Lit

[SQL] Data Comparison Single Table Question

2008-04-16 Thread Bryan Emrys
I can handle this outside sql, but it seems like I should be able to do this in sql as well. 1 table: countries. 3 columns: id, name, price What I'm trying to get is a result of the price differences between every country. So if the data looks like (ignoring the id field) Taiwain 30 UK 50 U

Re: [SQL] Multiple databases

2008-04-16 Thread Gerardo Herzig
Sumaya wrote: Hi, I am converting sql code from sql server to postgresql. Data is currently being retrieved from multiple databases, how do I do this using postgresql. I have tried using eg. select * from datbasename.tablename but this does not work. Any ideas? Thanks, Sumaya Are you

[SQL] Index on elements of an array

2008-04-16 Thread Florian Weimer
Is it possible to create an index on the elements of an array, or a functional index on a set-returning function? The index only needs to speed up queries for specific elements (using a simple membership test, position in the array does not matter) and perhaps range queries. The indexed types inc

Re: [SQL] Multiple databases

2008-04-16 Thread A. Kretschmer
am Wed, dem 16.04.2008, um 8:59:46 +0200 mailte Sumaya folgendes: > Hi, > > I am converting sql code from sql server to postgresql. Data is currently > being retrieved from multiple databases, how do I do this using postgresql. I > have tried using eg. select * from datbasename.tablename but

[SQL] Multiple databases

2008-04-16 Thread Sumaya
Hi, I am converting sql code from sql server to postgresql. Data is currently being retrieved from multiple databases, how do I do this using postgresql. I have tried using eg. select * from datbasename.tablename but this does not work. Any ideas? Thanks, Sumaya