Re: some questions : psql

From: "FERREIRA, William (COFRAMI)" <William(dot)FERREIRA(at)airbus(dot)com>
To: "Pavel Stehule" <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: some questions : psql
Date: 2005-05-03 14:25:14
Message-ID: 414D259CE29DE54DAD534037C83CE4B7269579@FR0-MAILMB20.res.airbus.corp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


the search_path works well

thanks a lot

-----Message d'origine-----
De : Pavel Stehule [mailto:stehule(at)kix(dot)fsv(dot)cvut(dot)cz]
Envoyé : mardi 3 mai 2005 16:09
À : FERREIRA, William (COFRAMI)
Cc : pgsql-general(at)postgresql(dot)org
Objet : Re: [GENERAL] some questions : psql

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

This mail has originated outside your organization,
either from an external partner or the Global Internet.
Keep this in mind if you answer this message.

This mail has originated outside your organization, either from an external partner or the Global Internet. Keep this in mind if you answer this message.

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2005-05-03 14:29:00 Re: Dynamically access to field on a RECORD variable
Previous Message Thomas Hallgren 2005-05-03 14:22:37 Re: Deep integration of PostgreSQL with Apache