This is a discussion on Re: plpgsql-function with timestamp within the pgsql Novice forums, part of the PostgreSQL category; --> Christian Stalp <christian.stalp@gmx.de> schrieb: [ problem ] Which version? test=# create table foo (ts timestamp); CREATE TABLE test=# insert ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Christian Stalp <christian.stalp@gmx.de> schrieb: [ problem ] Which version? test=# create table foo (ts timestamp); CREATE TABLE test=# insert into foo values ('1999-01-08 04:05:06'); INSERT 0 1 test=# CREATE OR REPLACE FUNCTION neue_auktion (TIMESTAMP) returns text AS $$ DECLARE my_startzeit ALIAS FOR $1; BEGIN INSERT INTO foo (ts) VALUES ( my_startzeit); RETURN 'OK'; END; $$ LANGUAGE plpgsql; CREATE FUNCTION test=# SELECT neue_auktion ('1999-01-08 04:05:06'); neue_auktion -------------- OK (1 row) test=# select version(); version -------------------------------------------------------------------------------------------------------------- PostgreSQL 8.1.2 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.3 20060104 (prerelease) (Debian 4.0.2-6) (1 row) Btw.: we have a german mailinglist ;-) HTH, Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) "If I was god, I would recompile penguin with --enable-fly." (unknow) Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889° ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings |
| |||
| The problem is solfed: I called the function with this arguments: SELECT neue_auktion ( 1::numeric, 'robot'::text, 'robot'::text, '1999-01-08 04:05:06'::timestamp, '1999-01-08 04:05:06'::timestamp, 10::numeric, 10::numeric, 1::numeric); And this works. Thank you... Gruss Christian -- DSL-Aktion wegen großer Nachfrage bis 28.2.2006 verlängert: GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |
| |||
| Hello! Does the :: do a data type conversion? On Wednesday 22 February 2006 13:22, Christian Stalp wrote: > The problem is solfed: > I called the function with this arguments: > > SELECT neue_auktion ( 1::numeric, 'robot'::text, 'robot'::text, '1999-01-08 > 04:05:06'::timestamp, '1999-01-08 04:05:06'::timestamp, 10::numeric, > 10::numeric, 1::numeric); > > And this works. > > Thank you... > > Gruss Christian -- Regards, Richard Kut Database Administrator Research & Development Intelerad Medical Systems Inc. 460 Ste-Catherine West, Suite 210 Montreal, Quebec, Canada H3B 1A7 Tel: 514.931.6222 x7733 Fax: 514.931.4653 rkut@intelerad.com www.intelerad.com This email or any attachments may contain confidential or legally privileged information intended for the sole use of the addressees. Any use, redistribution, disclosure, or reproduction of this information, except as intended, is prohibited. If you received this email in error, please notify the sender and remove all copies of the message, including any attachments. ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |
| ||||
| > Hello! > > Does the :: do a data type conversion? > Yes, that right. It seemes to be the only way to tell the function, that this is the right type?!? Gruss Christian -- Telefonieren Sie schon oder sparen Sie noch? NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings |