Re: some questions : psql

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: some questions : psql
Дата
Msg-id Pine.LNX.4.44.0505031559210.7037-100000@kix.fsv.cvut.cz
обсуждение исходный текст
Ответ на Re: some questions : psql  ("FERREIRA, William (COFRAMI)" <william.ferreira@airbus.com>)
Список pgsql-general
On Tue, 3 May 2005, FERREIRA, William (COFRAMI) wrote:

> sorry, i badly explain my second problem (and it make me think about an other question :) )
> what i really want to say is :
> i would like to declare a global variable :

There is one big difference. PostgreSQL don't know global variables. There
is only local variables in stored procedures or local variables of sql
monitor ~ psql. You cannot directly read psql's variables.

>
> and my new question is :) :
> i wrote a first file :
>     \set databaseName 'base1'
>     \set createMDXML '/home/toto/MDXML/execCreateMDXML.sql'
>     \i :createMDXML
> and in my second file, i need the name af the database but if i wrote this :
>     SET search_path TO :databaseName;
> it doesn't work....
>

I am sorry. I can't help.

create schema fx;
create table fx.foo(i integer);
select * from foo;
ERROR:  relation "foo" does not exist
\set sp fx
set search_path to :sp
intra=# \set sp 'fx'
intra=# set search_path to :sp;
SET
Time: 9,349 ms
intra=# select * from foo;
 i
---
(0 rows)

look to /home/toto/MDXML/execCreateMDXML.sql sqlscript. Works really well?

Pavel


В списке pgsql-general по дате отправления:

Предыдущее
От: Ricardo Vaz Mannrich
Дата:
Сообщение: Dynamically access to field on a RECORD variable
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Deep integration of PostgreSQL with Apache