Re: [SQL] Finding Max Value in a Row

2012-05-11 Thread Viktor Bojović
which is just INTEGER, right? > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] Finding Max Value in a Row

2012-05-11 Thread Viktor Bojović
set it's value to maximal value max(users_id), and then insert by selecting nextvalue as this nextval('sequenceName'::regclass) also you can alter user_id field of table users (if permissions are granted) and set default value to be nextval('sequenceName'::regclass) -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] Is there a way to remove every character but numbers?

2012-02-05 Thread Viktor Bojović
sql<http://www.postgresql.org/mailpref/pgsql-sql> > try regexp_replace -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] Subselects to Joins? Or: how to design phone calls database

2011-12-10 Thread Viktor Bojović
way I could use join here? I can do something like: > > SELECT ... FROM calls JOIN prefixes ON calls.phone_number LIKE prefix || > '%' > > but I'd get duplicate rows there (for instance, for New Zeland calls, > from my test data). > > Or should I add 'prefix' field to the calls table, and then do a inner > join with prefixes table? > >Mario > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] function based index problem

2011-08-31 Thread Viktor Bojović
LAN > > Seq Scan on entry (cost=0.00..5400995.21 rows=5415049 width=1382) >Filter: (length((sequence)::text) >= 36805) > (2 rows) > > Thanx in advance > -- > --- &g

[SQL] function based index problem

2011-08-31 Thread Viktor Bojović
gt;= 36805) (2 rows) Thanx in advance -- ----------- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] which is better: using OR clauses or UNION?

2011-08-16 Thread Viktor Bojović
;::character varying) >-> Bitmap Heap Scan on dba_data_base a > (cost=32.88..3786.62 rows=964 width=62) (actual time=0.255..1.676 rows=318 > loops=1) > Filter: (lower(identifier) ~~ 'sptigr4-2210 > (6f24)'::text) > -> Bitmap Index Scan on &

Re: [SQL] Max column number.

2011-07-12 Thread Viktor Bojović
ike: > "If I'm not going to exceed the size limit, then I can add a new column" > > Thanks in advance, > Miguel. > -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] overload

2011-07-11 Thread Viktor Bojović
$patterns{$patt}=1; }else{ $patterns{$patt}++; } } } foreach $patt (keys %patterns){ my $sql="insert into patterns values('".$patt."',".$patterns{$patt}.")"; spi_exec_query($sql); } return ''; $BODY$

Re: [SQL] overload

2011-07-11 Thread Viktor Bojović
;{rows}[$rn]; > > > > my $seq = $row->{sequence}; > > > > for (my $x = 1;$x<=length($seq) - $patLen;$x++){ > > > > $patt=substr($seq,$x,$patLen); > > > > if (! defined $patterns{$patt}) { > > > > $patterns{$patt}=1; > > > > }else{ > > > > $patterns{$patt}++; > > > > } > > > > } > > > > } > > > > foreach $patt (keys %patterns){ > > > > my $sql="insert into patterns > > > values('".$patt."',".$patterns{$patt}.")"; > > > > spi_exec_query($sql); > > > > } > > > > return ''; > > > > $BODY$ > > > > LANGUAGE plperl VOLATILE > > > > COST 100; > > > > > > > > > > > > > > > > -- > > > > --- > > > > Viktor Bojovi?? > > > > --- > > > > Wherever I go, Murphy goes with me > > > > > > > > > > > -- > > --- > > Viktor Bojovi?? > > --- > > Wherever I go, Murphy goes with me > -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] overload

2011-07-08 Thread Viktor Bojović
t; > if (! defined $patterns{$patt}) { > > $patterns{$patt}=1; > > }else{ > > $patterns{$patt}++; > > } > > } > > } > > foreach $patt (keys %patterns){ > >

[SQL] overload

2011-07-05 Thread Viktor Bojović
$sql="insert into patterns values('".$patt."',".$patterns{$patt}.")"; spi_exec_query($sql); } return ''; $BODY$ LANGUAGE plperl VOLATILE COST 100; -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] Sqlite to postgres database conversion.swedish chararacter issue

2011-06-16 Thread Viktor Bojović
elp regarding this would be appriciated. > > Thanks, > Sara > > > -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

[SQL] function timeout

2011-05-03 Thread Viktor Bojović
that function. -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] PLpgSQL variables persistance between several functions calls

2011-05-03 Thread Viktor Bojović
in different calls just using memory (not tables or other > methods). > > If it is really possible ? > > Thanks in advance, > > Chuck > -- ------- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] is there a refactor

2011-04-05 Thread Viktor Bojović
e search string. > > Thanks in advance, > Johnf > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > -- ------- Viktor Bojović

Re: [SQL] pg_attributte, data types

2011-03-24 Thread Viktor Bojović
type examples: > > > _char > > _float4 > > _int2 > > _oid > > _regtype > > _text > > _varchar > > Those are array types. The normal convention is that foo[] is named > "_foo" under the surface. > >

[SQL] pg_attributte, data types

2011-03-23 Thread Viktor Bojović
DER BY a.attnum ) as foo -- ------- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] How to workaround DROP CONSTRAINT [ IF EXISTS ] in Postgres version 8.1?

2011-02-04 Thread Viktor Bojović
at Nabble.com. > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] aggregation of setof

2011-01-31 Thread Viktor Bojović
tof anyarray) > > RETURNS anyarray AS > > $BODY$ > > SELECT $1 LIMIT 1; > > $BODY$ > > LANGUAGE 'sql' STABLE; > > > > à > > ERROR: functions cannot accept set arguments > > > > > > > > *Von:* Viktor Bojović [mailt

Re: [SQL] Automating PostgreSql table partition using triggers

2011-01-27 Thread Viktor Bojović
g to achieve is use > the new testing_id to create a table name for use in the insert statement. > If I am able to use the variable in the table name, I would not have to > re-declare the function each time with modified conditions for each separate > testing_id. > > > With regards > > Amitabh > > -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] failing to connect to postgresql with php

2011-01-17 Thread Viktor Bojović
the server running locally and accepting > connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? > can someone help me out please > if not started start it using /etc/init.d/postgresql-8.3 start -- --- Viktor Bojović

Re: [SQL] data import

2010-12-28 Thread Viktor Bojović
t; and at the prompt: > \h copy > > > > On Dec 21, 2010, at 06:34 , Viktor Bojović wrote: > > > Hi, > > > > can anyone recommend me a windows and linux free tools for importing data > into postgre. > > Source files are CSV or excel. > > > >

[SQL] data import

2010-12-21 Thread Viktor Bojović
Hi, can anyone recommend me a windows and linux free tools for importing data into postgre. Source files are CSV or excel. Thanx in advance -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] How to convert string to integer

2010-12-15 Thread Viktor Bojović
> > Please anyone can guide me.. > > Thanks > > > select SUM(pan_1::integer) from customers1 where name='101' also you can use conversion functions described here http://www.postgresql.org/docs/8.2/static/functions-formatting.html -- -

[SQL] constraint with check

2010-12-13 Thread Viktor Bojović
1") REFERENCES "wg"."entities"("Id"), check (node=true) thanx in advance -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] large xml database

2010-10-31 Thread Viktor Bojović
On Sun, Oct 31, 2010 at 10:26 PM, Rob Sargent wrote: > Viktor Bojović wrote: > >> >> >> On Sun, Oct 31, 2010 at 9:42 PM, Rob Sargent > robjsarg...@gmail.com>> wrote: >> >> >> >> >>Viktor Bojovic' wrote: >> >&g

Re: [SQL] large xml database

2010-10-31 Thread Viktor Bojović
too much time in database no matter if it is stored >> as varchar lines, varchar nodes or XML data type. >> >> -- >> --- >> Viktor Bojovic' >> >> --- >> Wherever I go

Re: [SQL] large xml database

2010-10-31 Thread Viktor Bojović
On Sun, Oct 31, 2010 at 2:26 AM, James Cloos wrote: > >>>>> "VB" == Viktor Bojović writes: > > VB> i have very big XML documment which is larger than 50GB and want to > VB> import it into databse, and transform it to relational schema. > > Were I

Re: [SQL] large xml database

2010-10-31 Thread Viktor Bojović
On Sun, Oct 31, 2010 at 7:08 AM, Lutz Steinborn wrote: > On Sat, 30 Oct 2010 23:49:29 +0200 > Viktor Bojović wrote: > > > > > many tries have failed because 8GB of ram and 10gb of swap were not > enough. > > also sometimes i get that more than 2^32 operations wer

[SQL] large xml database

2010-10-30 Thread Viktor Bojović
ask if someone knows how to speed this up. thanx in advance -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] insert into table from list or array ?

2010-10-18 Thread Viktor Bojović
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] get attribute from XML

2010-10-12 Thread Viktor Bojović
fied="2009-07-07" dataset="S" created="2009-06-16" />' ); >xpath > -- > {2009-07-07} > (1 row) > > HTH > > M.S. > > On Tue, Oct 12, 2010 at 1:03 AM, Viktor Bojović > wrote: > > Hi, > > while parsi

[SQL] get attribute from XML

2010-10-11 Thread Viktor Bojović
hanx in advance -- ------- Viktor Bojović --- Wherever I go, Murphy goes with me

[SQL] naming arguments in aggregate function

2010-09-05 Thread Viktor Bojović
ric, z numeric, rad numeric, pigment varchar) ( i get syntax error. Thanx in advance -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

[SQL] aggregate function

2010-08-03 Thread Viktor Bojović
grafika"."agg_pov_sphere" (NUMERIC, NUMERIC, NUMERIC, NUMERIC, VARCHAR) ( SFUNC = "grafika"."pov_sphere", STYPE = "varchar", FINALFUNC = "public"."grp_concat" ); Thanx in advance. -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] strangest thing happened

2010-07-07 Thread Viktor Bojović
rns null (doesn't insert) then the sequence will increment, but no data will be inserted. If needed I will send you some code examples where it happened to me many times. Sincerely -- --- Viktor Bojović --- Wherever I go, Murphy goes with me

Re: [SQL] How to Get Column Names from the Table

2010-07-07 Thread Viktor Bojović
\d tableName On Wed, Jul 7, 2010 at 11:08 AM, venkat wrote: > Dear All, > >How to get Column Names from Table in PostgreSQL. > > Thanks and Regards, > > Venkat > -- ------- Viktor Bojović --- Wh