Re: About mogrify

Oswaldo Hernández <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
Federico Di Gregorio escribió:
> Il giorno mar, 23/09/2008 alle 12.32 +0200, Oswaldo Hernández ha
> scritto:
>> Hi Federico,
>>
>> I have found one solution without using mogrify() directly :)
> [snip]
> 
> Interesting. Sincerely I haven't grasped why exactly you need to invoke
> a stored procedure and if it is possible to do everything using just
> plain queries but that's my fault. 

The procedure don't execute the query and don't return the query data. Its function is:
	1 check if the query is valid (malformed, sintax errors, ...)
	2 return for each query column (without execute it):
		data type
		domain type
		user description
		size
		...

I use it under some situations, before execute the query in a normal way, for check querys that the 
user can modify at run time, or when I need the domain types instead the field types.

I can make a python function to do it, the stored procedure has only have 4/5 queries.  It's only a 
style issue, I prefer do these job in the database side.

> I'll probably add support for unicode queries before next
> release.

Note that .execute() run fine with unicode strings, the problem is only with .mogrify()

Regards.

-- 
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.
_______________________________________________
Psycopg mailing list
[email protected]
http://lists.initd.org/mailman/listinfo/psycopg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.