Re: Creating a session variable in Postgres

From: "Nagib Abi Fadel" <nagib(dot)abi-fadel(at)usj(dot)edu(dot)lb>
To: "Manfred Koizar" <mkoi-pg(at)aon(dot)at>
Cc: "Mike Mascari" <mascarm(at)mascari(dot)com>, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "generalpost" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Creating a session variable in Postgres
Date: 2004-06-04 09:23:30
Message-ID: 00a801c44a15$9d544210$f664a8c0@nagib
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Wait i did the following test:

SELECT count(*) from pg_class ;
count
-------
894

SELECT count(*) from pg_attribute ;
count
-------
7264

CREATE temp table temp_test (id integer);
CREATE TABLE

SELECT count(*) from pg_class ;
count
-------
895

SELECT count(*) from pg_attribute ;
count
-------
7272

I DISCONNECTED AND RECONNECTED TO THE DATABASE:

NOW

SELECT count(*) from pg_class ;
count
-------
894

SELECT count(*) from pg_attribute ;
count
-------
7264

According to those results the meta_data for a temp table are automatically
removed when the table is destroyed

So ........

----- Original Message -----
From: "Nagib Abi Fadel" <nagib(dot)abi-fadel(at)usj(dot)edu(dot)lb>
To: "Manfred Koizar" <mkoi-pg(at)aon(dot)at>
Cc: "Mike Mascari" <mascarm(at)mascari(dot)com>; "Bruce Momjian"
<pgman(at)candle(dot)pha(dot)pa(dot)us>; "generalpost" <pgsql-general(at)postgresql(dot)org>
Sent: Friday, June 04, 2004 11:14 AM
Subject: Re: [GENERAL] Creating a session variable in Postgres

> So considering those facts, it would be better to use the Sequence Method,
> since it would only require cleaning up one table ....
> Or is there anything else i am missing ???
>
>
> ----- Original Message -----
> From: "Manfred Koizar" <mkoi-pg(at)aon(dot)at>
> To: "Nagib Abi Fadel" <nagib(dot)abi-fadel(at)usj(dot)edu(dot)lb>
> Cc: "Mike Mascari" <mascarm(at)mascari(dot)com>; "Bruce Momjian"
> <pgman(at)candle(dot)pha(dot)pa(dot)us>; "generalpost" <pgsql-general(at)postgresql(dot)org>
> Sent: Friday, June 04, 2004 08:32 AM
> Subject: Re: [GENERAL] Creating a session variable in Postgres
>
>
> > On Fri, 4 Jun 2004 08:25:38 +0200, "Nagib Abi Fadel"
> > <nagib(dot)abi-fadel(at)usj(dot)edu(dot)lb> wrote:
> > >The use of sequence would require to clean up the table every N hour .
> >
> > Right.
> >
> > >The use of temporary table wouldn't require any cleanup.
> >
> > Wrong. You would have to clean up the meta data, at least pg_class and
> > pg_attribute, maybe pg_index also. For the price of one temp table you
> > can have several rows in a permanent table.
> >
> > Servus
> > Manfred
>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message mike 2004-06-04 10:39:53 Insert increment based on a group by?
Previous Message Mike Mascari 2004-06-04 09:21:52 Re: Creating a session variable in Postgres