I would do something like this (not tested, but conceptually working):
CREATE or replace FUNCTION sanitize_text(webtext IN text, cleantext OUT text) AS
$body$
BEGIN
cleantext = translate(webtext, E'\x92\x96', '''-');
cleantext = regexp_replace(cleantext, E'\x9c', 'oe', 'g');
cleantext = regexp_re
I was doing some tests to see if I could find a max size for an argument
of type TEXT in a PL/PgSQL function (BTW, which it that limit if it
exists?).
So I made the function to test:
CREATE OR REPLACE FUNCTION datoGrande(TEXT) RETURNS BOOLEAN AS $body$
BEGIN
EXECUTE $ins1$
INSERT INTO funcdatogra
On Nov 21, 2007 8:23 AM, Martin Marques <[EMAIL PROTECTED]> wrote:
> (BTW, which it that limit if it exists?).
"In any case, the longest possible character string that can be stored
is about 1 GB."
See:
http://www.postgresql.org/docs/8.2/static/datatype-character.html
> So I made the function to
Rodrigo De León escribió:
On Nov 21, 2007 8:23 AM, Martin Marques <[EMAIL PROTECTED]> wrote:
(BTW, which it that limit if it exists?).
"In any case, the longest possible character string that can be stored
is about 1 GB."
See:
http://www.postgresql.org/docs/8.2/static/datatype-charact
Martin Marques <[EMAIL PROTECTED]> writes:
> Rodrigo De León escribió:
>> "In any case, the longest possible character string that can be stored
>> is about 1 GB."
>>
> I was asking about the limit in the argument. Is it the same as the
> limits the types have in table definition?
Yeah, ultima
Hi,
I'd like to update a table efficiently where the relevant select-info
is in another table that is foreign-linked.
Stupid example. 2 tables:
things (thing_id integer, name varchar(100), color varchar(100))
inventory (item_id integer, thing_fk integer references things
(thing_id), number)
Andreas wrote:
I'd like to update a table efficiently where the relevant select-info
is in another table that is foreign-linked.
Stupid example. 2 tables:
things (thing_id integer, name varchar(100), color varchar(100))
inventory (item_id integer, thing_fk integer references things
(thing_id
--- On Wed, 11/21/07, Andreas <[EMAIL PROTECTED]> wrote:>
> UPDATE inventory
> SET number = 0
> WHERE thing_fk IN (SELECT thing_id FROM things WHERE color
> = 'red')
This is a perfectly acceptable ANSI-SQL update statement.
Here is non-ANSI update statement that you are probably after:
UPDATE
> I tried
>
> UPDATE things JOIN inventory ON things.thing_id = inventory.thing_fk
> SET number = 0
> WHERE color = 'red'
>
use the cool "from" clause in the update
update things t
set number = 0
from inventory i
where t.thing_id = i.thing_fk
and i.color = 'red';
_
Below I've included sample table definitions for a vertically partitioned
disjunctive table hierarchy. I wanted to point out the use of the composite
primary key declaration that is applied to two columns that are clearly not a
candidate key. However, using the badly defined primary key allows
10 matches
Mail list logo