[SQL] Postgres 7.0.X and arrow keys

2000-11-20 Thread Antti Linno
Morning. I installed new Mandrake 7.2 and was eager to try new postgres. So I installed it and used pgsql. What surprised me was that the arrow keys wouldn't work anymore as history, instead I get those ascii codes. I was wondering is it the matter of configuration or is it a new feature that one

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-20 Thread Marten Feldtmann
Steve Wampler schrieb: > > Yes, but... > > (1) The application I have is composed of about 50 processes > running on 3 different OS/architectures (Linux/intel, > Solaris/sparc, and VxWorks/ppc). The IDs I need must be > unique across all processes (I suppose one solution would >

[SQL] Re: MySQL -> Postgres dump converter

2000-11-20 Thread Clayton Cottingham
On Tue, 21 Nov 2000 00:01:33 +0200, Max Fonin said: > Hi. > > MySQL->Postgres dump converter is now available at >http://ziet.zhitomir.ua/~fonin/code/my2pg.pl. > Still beta and bugsome version but working, supports MySQL ENUMs, near the end are >SET emulation. > Please help me to test. >

RE: [SQL] how to continue a transaction after an error?

2000-11-20 Thread Mikheev, Vadim
> I would like to insert a bunch of rows in a table in a > transaction. Some of > the insertions will fail due to constraints violation. When > this happens, > Postgres automatically ends the transaction and rolls back > all the previous > inserts. I would like to continue the transaction and i

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-20 Thread Marten Feldtmann
Steve Wampler schrieb: > > Poet/Joshua Drake wrote: > ? > ? ?However, I also use Postgres (7.0.2) throughout this > ? ?application and it seems cleaner to me to keep the current > ? ?id value in a table and just use postgres to provide access > ? ?(with a trigger function to increment the id on

[SQL] Bug or feature

2000-11-20 Thread Kyle
Here's an interesting test of referential integrity.  I'm not sure if this is working the way it should or if it is a bug. I'm trying to update the primary key in records that are linked together from the two different tables.  My initial assumption was that because of the cascade, I could update

Re: [SQL] pgpl-problem, what's wrong with my loop?

2000-11-20 Thread Kovacs Zoltan Sandor
On Mon, 20 Nov 2000, Bruno Boettcher wrote: > On Mon, Nov 20, 2000 at 06:06:52PM +0100, Kovacs Zoltan Sandor wrote: > > > FOR arow IN SELECT currency,amount FROM journal WHERE col=sumup LOOP > > My opinion is the problem that you cannot give a column name as a > > parameter. But I'm not sure. T

Re: [SQL] pgpl-problem, what's wrong with my loop?

2000-11-20 Thread Bruno Boettcher
On Mon, Nov 20, 2000 at 06:06:52PM +0100, Kovacs Zoltan Sandor wrote: > > FOR arow IN SELECT currency,amount FROM journal WHERE col=sumup LOOP > My opinion is the problem that you cannot give a column name as a > parameter. But I'm not sure. This never worked for me. The thing here :( can somebo

Re: [SQL] pgpl-problem, what's wrong with my loop?

2000-11-20 Thread Kovacs Zoltan Sandor
> FOR arow IN SELECT currency,amount FROM journal WHERE col=sumup LOOP My opinion is the problem that you cannot give a column name as a parameter. But I'm not sure. This never worked for me. The thing here happens that you get all rows if and only if $1=$2 (as strings) and if they are not equal

Re: [SQL] pgpl-problem, what's wrong with my loop?

2000-11-20 Thread Tom Lane
Bruno Boettcher <[EMAIL PROTECTED]> writes: > CREATE FUNCTION accSum(text,text) RETURNS int4 AS ' > DECLARE > col ALIAS FOR $1; > sumup ALIAS FOR $2; > ... > FOR arow IN SELECT currency,amount FROM journal WHERE col=sumup LOOP Looks like the WHERE condition is testing for equality betwe

[SQL] pgpl-problem, what's wrong with my loop?

2000-11-20 Thread Bruno Boettcher
Hello, once more, i ran into a problem i got no syntax error, i don't know how to debug, except for raising exceptions the loop never executes making the select call by hand with fixed values, returns a result... but the second raise is never passed with the function...so something

Re: [SQL] numeric conversions?

2000-11-20 Thread Jonathan Ellis
> is the type casting done automaticly? how? can i have an influence of > the cast order? is there an easy way to doing the rounding? bf2=# select 1 / 2 from dual; ?column? -- 0 (1 row) bf2=# select 1::float / 2 from dual; ?column? -- 0.5 (1 row) bf2=# select (1:

Re: [SQL] Like seems to fail !

2000-11-20 Thread Tom Lane
Yves Martin <[EMAIL PROTECTED]> writes: > base=# select * from persistent_config where key like '/%'; > key | type | value > -+--+--- > (0 rows) What LOCALE are you running in? There are some known problems with LIKE index optimization in some non-ASCII locales. If you drop the in

[SQL] Return number of rows update in query

2000-11-20 Thread Shane McEneaney
Hi, can anybody tell me how to capture the number of rows updated in an update query inside a stored procedure? This doesn't work but hopefully you will see what I mean. CREATE FUNCTION "test" () RETURNS int AS ' DECLARE v_number_of_rows int; BEGIN select into v_number_of_ro

[SQL] numeric conversions?

2000-11-20 Thread Bruno Boettcher
Hello, me again :( i just ran into another problem didn't found it neither in the doc nor in the FAQ. the currencies conversion factors i use are stored as float4 in a table, the values to apply on are stores as int4 is the type casting done automaticly? how? can i have an influenc

Re: [SQL] More stupid questions: prettyprinting of ints??

2000-11-20 Thread Bruno Boettcher
yeah forgot another thing i want also to write a SQL trigger to parse incoming fields for preprocessing before DB insertion in perl i would do a thing like that: $format = ".999.999,99"; #took out of DB... #inserting a number into the db $theval =~ s/\.//g; if($theval =~/\S+,\d{2

[SQL] More stupid questions: prettyprinting of ints??

2000-11-20 Thread Bruno Boettcher
hello, the thing i am making is a bookkepping program. This program handles multiple currencies, each currency is formatted a bit differently on from the other. I do store the amounts as int's in the DB... In another table i have sample format strings that could be used to format them... but if