Re: Reviewing temp_tablespaces GUC patch

From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: "Bernd Helmle" <mailings(at)oopsware(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Reviewing temp_tablespaces GUC patch
Date: 2007-05-25 19:02:50
Message-ID: c2d9e70e0705251202v465e2302pf671db27f3e50695@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/25/07, Bernd Helmle <mailings(at)oopsware(dot)de> wrote:
> --On Freitag, Mai 25, 2007 00:02:06 +0000 Jaime Casanova
> <systemguards(at)gmail(dot)com> wrote:
> >>
> >
> > sounds good. can we see the new patch?
>
> Attached tablespace.c.diff shows my current changes to use an OID lookup
> list.
>
> >

+ if (source >= PGC_S_INTERACTIVE && IsTransactionState())
+ {
+ /*
+ * Verify that all the names are valid tablespace names
+ * We do not check for USAGE rights should we?
+ */
+ Oid cur_tblspc = get_tablespace_oid(curname);
+ if (cur_tblspc == InvalidOid)
+ {
+ ereport((source == PGC_S_TEST) ? NOTICE : ERROR,
+ (errcode(ERRCODE_UNDEFINED_OBJECT),
+ errmsg("tablespace \"%s\" does not exist", curname)));
+ }
+ else
+ {
+ /*
+ * Append new OID to temporary list. We can't
+ * use the lookup table directly, because there could
+ * be an ereport() in subsequent loops.
+ */
+ oidlist = lappend_oid(oidlist, cur_tblspc);
+ }
+ }

the list of oid's is only filled when you execute
SET temp_tablespaces = 'somelist'

but if you use the GUC in postgresql.conf at startup then not, so the
temp_tablespaces are not used even if they are setted

can you do that outside
+ if (source >= PGC_S_INTERACTIVE && IsTransactionState())

--
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Akmal Akmalhojaev 2007-05-25 22:22:14 Role privileges in PostgreSQL.
Previous Message Tom Lane 2007-05-25 17:54:25 pgsql: Create hooks to let a loadable plugin monitor (or even replace)