Search Postgresql Archives

Variable in PostgreSQL 7.4.x

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I am programming web portal. I have table c_language with attributes
i_language_id INT4 PK
c_code CHAR(2) NOT NULL UNIQUE
v_name VARCHAR(32)

and tables referenced to c_language. I need create some variable, which contain value of i_language_id during one web request.

at start of request I create temporary table f.e.:
SELECT i_language_id INTO lang FROM c_language WHERE c_code='EN';

There is stored procedure get_lang(); which only do
SELECT i_language_id FROM land;

Every view is build like f.e.:
SELECT * FROM TABLE WHERE i_language_id=get_lang();

this create, that on my application layer I need not write language condition into every query.

but creating of temporary table in every web request is IMHO slow. Is there another way, how to store temporary variable into postgres.

thanx, hlavki

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux