Re: Calling a PostgreSQL function via DBI
- From: louis.gonzales@xxxxxxxxxxxxxx (Louis Gonzales)
- Date: Thu, 23 Feb 2006 17:11:51 -0500
Christian Stalp wrote:
A couple of things come to mind at this point:Bitte kannst du das probieren fuer spass? ( English: Could you just try this for fun :)
$arg5 = "\'2001-11-11 11:11:11\'" . "::timestamp";
Was werde denn passiert? (what would happen then? )
The same effect,
this is the dump on the website:
Software error:
[quote]
Abfrage nicht ausfuehrbar -suchprofil! FEHLER: Spalte »startzeit« hat Typ
timestamp without time zone, aber der Ausdruck hat Typ text
HINT: Sie müssen den Ausdruck umschreiben oder eine Typumwandlung
vornehmen.
CONTEXT: SQL-Anweisung »INSERT INTO auktionen ( kid, name, beschreibung,
startzeit, endzeit, startpreis, preis, katid ) VALUES ( $1 , $2 , $3 , $4 , $5 , $6 , $7 , $8 )«
PL/pgSQL function "neue_auktion" line 13 at SQL statement
[/quote]
Is it something wrong with the function? But it works with psql!
Ich habe zwei semestern Duetsch gelmacht bei die Universitait. Meine frau ist high school Deutsch lehrerin.
Ahh, ok. Thats explains a lot. :-)
Gruss Christian
One, the datatype that you are trying to insert the constructed "$arg5" into, what are the constraints on that? Is it necessary to identify a timezone, as seems to be complained about from the above output? It looks like this might be the strongest clue to the 'root cause.'
Two, you didn't actually put ( $1, $2, ... ) , Did you? In your code, that still needs to remain as the question marks.
I truly think at this juncture, based on doing: $arg5 = "\'2001-11-11 11:11:11\'" . "::timestamp"
and the erroneous output, stating that there needs to be a timezone identified, that perhaps the table attribute of timestamp, of your TIMESTAMP datatype, is asking for - and i'm just speculating here - something of the form:
$arg5 = "\'2001-11-11 11:11:11-5:00\'" . "::timestamp" # this would be for an EST timezone....
I think the quoting is acceptable, but please let me know how you are declaring the target datatype? that makes all the world of difference... ;)
I'm looking up the different timestamp datatypes in the posgreSQL documentation and I've used these several times before, they can take many different formats.
- Follow-Ups:
- Re: Calling a PostgreSQL function via DBI
- From: Greg Sabino Mullane
- Re: Calling a PostgreSQL function via DBI
- References:
- Re: Calling a PostgreSQL function via DBI
- From: Christian Stalp
- Re: Calling a PostgreSQL function via DBI
- Prev by Date: Re: Calling a PostgreSQL function via DBI
- Next by Date: RE: Calling a PostgreSQL function via DBI
- Previous by thread: Re: Calling a PostgreSQL function via DBI
- Next by thread: Re: Calling a PostgreSQL function via DBI
- Index(es):