[SQL] Commit every processed record

2008-04-07 Thread [EMAIL PROTECTED]
Hi, I have to execute commit for evey record that i processed during a cursor fetch in a function. There is a way to do it? Thanks in advance. Luke. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Problem commit in function

2008-04-07 Thread [EMAIL PROTECTED]
Hi, I need to execute COMMIT in a function pgsql, there is a way? Can I have any example? Thanks in advance. Luke. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Problem with now() in function pgsql

2008-04-05 Thread [EMAIL PROTECTED]
Hi, I have a problem in a function pgsql with Reading TIMESTAMP calling the function now() the problem is this: At the begin of function I read timestamp... select now() into TS_BEGIN; the function execute some statement... Many seconds after I reread the timestamp select now() into TS_END; and

Re: [SQL] Failing join with set returning function

2007-09-07 Thread [EMAIL PROTECTED]
Please, remove my address from this Mailing List. thanks -- Leggi GRATIS le tue mail con il telefonino i-mode™ di Wind http://i-mode.wind.it/

[SQL] Serial number of a record

2007-05-15 Thread [EMAIL PROTECTED]
Hi List, I have one table something like this Name Age = tom 20 ram 25 shyam 30 balram15 hari 10 Now i want serial number of a record. Suppose if i will fire a query "select Name from tablename where age=30". it will give outp

Re: [SQL] join on a like

2006-05-01 Thread [EMAIL PROTECTED]
If you use a btree index on the column, you should be able to use it in the like: http://www.postgresql.org/docs/8.1/interactive/indexes-types.html. ---(end of broadcast)--- TIP 6: explain analyze is your friend

R: Re: R: Re: R: R: Re: [SQL] schema inspection

2006-03-18 Thread [EMAIL PROTECTED]
>Well thats it if you use only *single column* Foreign keys. >In the general case the above will need extra work. Are you sure? I have tested query with 3 table with multiple FK and it works (see below) [as you can see "C" table have two FK to A and B] test=> SELECT test-> (SELECT relname FRO

R: Re: R: R: Re: [SQL] schema inspection

2006-03-18 Thread [EMAIL PROTECTED]
> >SELECT c1.relname,c2.relname from pg_constraint cons,pg_class c1, pg_class >c2 where cons.conrelid=c1.oid and cons.confrelid = c2.oid; > >for column(s) names you will have to do extra homework. Thanks! I have obtained my query! Here is: SELECT (SELECT relname FROM pg_catalog.pg_class WHE

R: R: Re: [SQL] schema inspection

2006-03-16 Thread [EMAIL PROTECTED]
> pg_catalog.pg_constraint is your (only?) friend. I have already examintated this table without results. Seem not to be a "human-readable" table :( TIA Roberto Colmegna Tiscali ADSL 4 Mega Flat Naviga senza limiti con l'unica Adsl a 4 Mega di velocità a soli 19,95

[SQL] schema inspection

2006-03-16 Thread [EMAIL PROTECTED]
Hi, supposing to have a small DB: TABLE a ( id SERIAL PRIMARY KEY ); TABLE b ( id SERIAL PRIMARY KEY, idA INTEGER NOT NULL REFERENCES a(id) ); How can I inspect pg_schema/information_schema to "detect" the relation between "b" and "a" via "idB"? TIA Roberto Colmegna

[SQL] Copy Views From Database?

2005-09-22 Thread [EMAIL PROTECTED]
http://mail2web.com/ . ---(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] timestamp precision - can I control precision at select time

2005-03-26 Thread [EMAIL PROTECTED]
thanks, christoph. i did go ahead and retool all the tables, but glad to know about the casting option. ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

[SQL] timestamp precision - can I control precision at select time or set for all time?

2005-03-20 Thread [EMAIL PROTECTED]
I have a database with several tables that use timestamp without time zone type. I upgraded from an older pgsql and have code that does not expect the precision in the select output. Is there a way I can get the effect of zero precision without modifying all the tables? The docs say it usees "defa

Re: [SQL] max timestamp

2004-05-29 Thread boyd (remove_) [EMAIL PROTECTED]
Michael Sterling wrote: i'm trying to get the max time stamp, from each day, of a range of dates, not just the max time stamp for the complete range dates but for each day. I don't trust the news client I was using. So will answer again from the Netscape version; This worked for me: I have a ta

[SQL] a wierd query

2004-05-13 Thread [EMAIL PROTECTED]
hi i have a wierd problem and i require an equally weird query. 1) backgound Table test: CREATE TABLE main_table ( string_A varchar( 20), string_B varchar( 20), ); -- both columns are identical in nature and usage INSERT INTO main_table

[SQL] typecasting numeric(18,4) to varchar/text

2004-05-04 Thread [EMAIL PROTECTED]
hi how can i typecast a numeric(18,4) value (that i'm extracting from a table) into a a varchar (which i'll be inserting into another table) that is: create table a (a numeric(18,4)); create table b (b varchar(25)); insert into a values(12000.43); insert into b select (a.a)::varchar; the above

Re: [SQL] INHERITS and Foreign keys

2003-12-13 Thread [EMAIL PROTECTED]
At 20:55 12/13/2003, you wrote: On Sat, 13 Dec 2003, [EMAIL PROTECTED] wrote: > Hi > > I have some problem with INHERITS and foreign keys. I do not know if I have > not got the clue or not. Anyway I have tried to simplify the problem so > that you can guide me on the right trac

[SQL] INHERITS and Foreign keys

2003-12-13 Thread [EMAIL PROTECTED]
through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

[SQL] database broken ?

2003-01-14 Thread [EMAIL PROTECTED]
eko? Hacé click aquí: http://www.keko.com.ar ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] save data from views

2002-12-23 Thread [EMAIL PROTECTED]
On Mon, 23 Dec 2002, [iso-8859-1] [EMAIL PROTECTED] wrote: > > > > first of all, thanx for anyone who answered my previous question... i've understood >what was wrong... > now, i've got another question, i know it could sound stupid, but i have not such a &

[SQL] save data from views

2002-12-23 Thread [EMAIL PROTECTED]
first of all, thanx for anyone who answered my previous question... i've understood what was wrong... now, i've got another question, i know it could sound stupid, but i have not such a great practice with postgres. i'm asking you: is it that a way to save values from a view? i'm

[SQL] error in copy table from file

2002-12-11 Thread [EMAIL PROTECTED]
can i do to solve this problem? thanx in advance for your help massimo ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

[SQL] can i decrease the query time?

2002-11-26 Thread [EMAIL PROTECTED]
i created index already. how can i decrease the query time more. number of record is over 1 million. the following is the query plan. Group (cost=34082.59..34085.62 rows=61 width=112) -> Sort (cost=34082.59..34082.59 rows=607 width=112) -> Nested Loop (cost=0.00..34054.51 rows=607 width=112) ->

[SQL] create index

2002-11-19 Thread [EMAIL PROTECTED]
1 AND c.is_active = 1 GROUP BY b.screen_id, b.name ORDER BY b.screen_id many thx! ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

[SQL] psql history

2002-10-28 Thread [EMAIL PROTECTED]
Hi everibody, i have installed Postgres 7.2.2 from a tarball, but using psql i can not have the history of the last command. When i used Postgres from rpm this useful element worked very well! Why that? Best Regards Massimo Arnaudo ---(end of broadcast)--

[SQL] Update help

2002-09-03 Thread [EMAIL PROTECTED]
Hi, Let say I have 2 Product table, both of them has columns ProductID and Price What is the update command if I want to update all Prices of first table to be equal with Price in second table?   Please Help.   Yudie

[SQL] Update Help

2002-09-03 Thread [EMAIL PROTECTED]
Hi, Let say I have 2 Product table, both of them has columns ProductID and Price What is the update command if I want to update all Prices of first table to be equal with Price in second table?   Please Help.   Yudie

[SQL]maximum parameters limit to function & manipulating array in plpgsql

2001-10-03 Thread [EMAIL PROTECTED]
Hi,   I have 2 major problems bothering me and probably u are the best person to help me out :-   1) Well I read one of ur solutions to sending more tham 16 parameters to a function in plpgsql. I have changed the value of FUNC_MAX_ARGS (a/k/a INDEX_MAX_KEYS) in \usr\local\plpgsql\include\c

[SQL] Implicit v Explicit joins...

2001-09-19 Thread [EMAIL PROTECTED]
-- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

[SQL] Urgent: How to set autocommit off in postgres.........

2001-09-14 Thread [EMAIL PROTECTED]
Hi , I read one of solution to andreas problem of how to set autocommit off but my problem still persists. I am basically writing a function in plpgsql language which performs a number of update and insert statements but on a failing condition it rollbacks inorder to maintain integrity in the d

Re: [SQL] Large Objects - lo_export

2001-06-06 Thread [EMAIL PROTECTED]
t; thanx in advance. > > guru. > bk SYSTEMS (P) Ltd. > P . N . G U R U P R A S A D > --- > > > > > >

Re: [SQL] Case Insensitive Queries

2001-05-30 Thread [EMAIL PROTECTED]
< len1; i++) { c = p2[i]; if (isupper(c) || (c >= upper_min && c <= upper_max && c != 0xD0 && c != 0xD7)) p[i] = c + 0x20; else p[i] = c; } VARSIZE(result) = len1 + VARHDRSZ; return result; } Troy > &q

Re: [SQL] Case Insensitive Queries

2001-05-30 Thread [EMAIL PROTECTED]
broadcast)--- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Case Insensitive Queries

2001-05-29 Thread [EMAIL PROTECTED]
ted. > > Thanks, > > Mark > > > ---(end of broadcast)--- > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED] > -------(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] SQL specified sort

2001-05-28 Thread [EMAIL PROTECTED]
adcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] Calculating the age of a person

2001-05-18 Thread [EMAIL PROTECTED]
t; When I use age() I don't get full years. Is there an easy way to round > ::reltime off or up without writing a function. Is there any possibility > to use plain SQL only? > > Hans > > > ---(end of broadcast)----

Re: [SQL] Re: Need help with search-and-replace

2001-05-07 Thread [EMAIL PROTECTED]
; to eliminate the column). > > > > RIght now, I'm copying the file to a Win32 machine and using MS Word > > for the search-and-replace, but I'm sure there's got to be a better way > > ... *without* learning VI or Emacs. Help? > > > >

Re: [SQL] outer joins

2001-04-04 Thread [EMAIL PROTECTED]
3 | Sam > > result: > a.id | b.name > - > 1 | Tom > 2 | NULL > > thank you in advance > > Algirdas ©akmanas > IT manager > +370 99 90369 > [EMAIL PROTECTED] > Grafton Entertainment > http://www.tvnet.lt > > >

Re: [SQL] Re: Still don't know how to build this string ? how to concat ??

2001-03-27 Thread [EMAIL PROTECTED]
and noticed your comment about having tried || already > - I must learn to read messages fully... > > But, I did wonder if the semicolon ";" at the end of the for loop is > what is causing your problem? The syntax explanation I have does not > show the ";", therefore it

Re: [SQL] MultiByte strings

2001-03-19 Thread [EMAIL PROTECTED]
nction" > > where i must enable MultiByte strings (MB) ?? > > Nizomi > > ---(end of broadcast)--- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to [EMAIL PROTECT

Re: [SQL] handling special characters in sql strings

2001-03-19 Thread [EMAIL PROTECTED]
nsert a "\" before each special character? And what range > of characters will need this handling? > > Thanks, > > Markus > > -------(end of broadcast)--- > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECT

Re: [SQL] How can i escape a '+' or a '+' in a regexp ?

2001-02-23 Thread [EMAIL PROTECTED]
Gabriel, Two backslashes. > select * from areas where titulo ~ '\\+' or titulo ~ '\\*' Troy > > Hi fellows, > > I'm trying to the following query: > > select * from areas where titulo ~ '+' or titulo ~ '*' > > and the answer is: > > ERROR: regcomp failed with error repetition-operato

Re: [SQL] Select 'Sunday' in month ??

2001-01-17 Thread [EMAIL PROTECTED]
E.g. create table mytable (created datetime); insert into mytable values ('01-01-2001'); ... insert into mytable values ('01-31-2001'); select created from mytable where date_part('dow', created) = 7 and date_part('month', created) = 1; Troy > > i want to select date in january where day='S

Re: [SQL] 7.0.3 BUG

2000-11-24 Thread [EMAIL PROTECTED]
Just a wild guess, but I would imagine a corrupt (old) index on the userid field would cause this kind of behavior. You could test this by dropping the index and then rebuilding it. Troy > > "pgsql-sql" <[EMAIL PROTECTED]> writes: > > migrate=# select us

[SQL] Meaning of "REMINDER from pgsql..."

2000-11-04 Thread [EMAIL PROTECTED]
What's the meaning of the "REMINDER from pgsql ..." message? I checked the page, and apparently everybody on the list got the message. Should we accept or reject the action? Troy

Re: [SQL] Large Object dump ?

2000-10-30 Thread [EMAIL PROTECTED]
Large objects are not dumped. It should be in the documentation for large objects. You need to write a script which writes them to disk and then imports them back in after you have installed your dbs. Troy > > > I need to move a DB from Pg 6.5 to 7 haw can i export Large Object to the > ne

Re: [SQL] benchmarks

2000-10-29 Thread [EMAIL PROTECTED]
MTcW: Pick the database which allows your programmers to get the job done. If the system is too slow, find out if there are ways you could speed it up, and then if that doesn't make you happy, get a faster server. In my opinion it's not worth making the programmer's life more difficult to go w

Re: [SQL] Help: Using a regular expression match as a value

2000-10-24 Thread [EMAIL PROTECTED]
Richard, Please correct me if I am wrong. You want to do something like: select $1 from captives where firstname ~ '^(R[^ \t,]*d)$'; And get as result: lastname Richard Richard Richard Ricard Richard Rolland Richard In this case, the above query is same as: select firstname from captives whe

Re: [SQL] GROUP by finish&&last day of month

2000-07-05 Thread [EMAIL PROTECTED]
Not quite sure what you mean, but how about this: select date_part('day', 'Jul 01 00:00:00 2000 PDT'::datetime-1); You must specify Jul for June, i.e. always the following month. You could get around that too, but since I don't know why you need to do what you asked, I'll leave it at this. Tr

Re: [SQL] Group BY ...(cont.)

2000-07-05 Thread [EMAIL PROTECTED]
E.g. select workgroup from job group by workgroup; will that do? Troy > > Ok, if I want to use group by, then I have to put every select field > afterwards to group by. But I do want to group by one field. > Hence > select workgroup,id from job group by workgroup,id; > would create groups o

Re: [SQL] case insensitive search

2000-07-02 Thread [EMAIL PROTECTED]
Joern, select myfield from tablea where lower(myfield) = 'mysearch'; or select myfield from tablea where myfield ~* 'mysearch'; Troy > > Hello together, > > how can I handle case insensitive search in a table? > > > > -- > Linux is like wigwam - no windows, no gates, apache inside. > In