On Fri, Aug 05, 2011 at 10:55:08AM -0400, Tom Lane wrote:
> Also, you can change the priority if you have a mind to, by adding
> "pg_temp" to the search_path explicitly, for example
Hey, that's cool, and it never occurred to me. The current text in
the 9.0 manual says this:
Likewise, the cur
Andrew Sullivan writes:
> On Fri, Aug 05, 2011 at 08:35:37AM -0400, JJ wrote:
>> I was recently looking at the way "create temp table as" works and the
>> manual specifies that temp tables given the same name as an existing table
>> will be used instead of the permanent table. It also states th
On Fri, Aug 05, 2011 at 08:35:37AM -0400, JJ wrote:
> Hello all,
>
> I was recently looking at the way "create temp table as" works and the manual
> specifies that temp tables given the same name as an existing table will be
> used instead of the permanent table. It also states that the permane
Hello all,
I was recently looking at the way "create temp table as" works and the manual
specifies that temp tables given the same name as an existing table will be
used instead of the permanent table. It also states that the permanent table
can be accessed via its schema-qualified name. I ma
On Thu, Aug 20, 2009 at 2:43 PM, Jasen Betts wrote:
> On 2009-08-19, Stephen Cook wrote:
>
>> Let's say I have a function that needs to collect some data from various
>> tables and process and sort them to be returned to the user.
>
> plpgsql functions don't play well with temp tables IME.
> there
On 20 Aug 2009 13:43:10 GMT
Jasen Betts wrote:
> On 2009-08-19, Stephen Cook wrote:
>
> > Let's say I have a function that needs to collect some data from
> > various tables and process and sort them to be returned to the
> > user.
>
> plpgsql functions don't play well with temp tables IME.
W
On Wed, Aug 19, 2009 at 03:03:28AM -0400, Stephen Cook wrote:
> Let's say I have a function that needs to collect some data from various
> tables and process and sort them to be returned to the user.
>
> In general, would it be better to create a temporary table in that
> function, do the work
On 2009-08-19, Stephen Cook wrote:
> Let's say I have a function that needs to collect some data from various
> tables and process and sort them to be returned to the user.
plpgsql functions don't play well with temp tables IME.
there are work-arounds and they are ugly. if you caus use a differ
On Wed, Aug 19, 2009 at 08:10:14PM -0400, Stephen Cook wrote:
> I've decided on some type of table storage because basically I'm
> combining information from several different tables (some of which need
> to recursively get other rows) and massaging it and sorting it in ways
> far too convoluted
Peter Hunsberger wrote:
On Wed, Aug 19, 2009 at 2:03 AM, Stephen Cook wrote:
Let's say I have a function that needs to collect some data from various
tables and process and sort them to be returned to the user.
In general, would it be better to create a temporary table in that function,
do the
Let's say I have a function that needs to collect some data from various
tables and process and sort them to be returned to the user.
In general, would it be better to create a temporary table in that
function, do the work and sorting there, and return it... or keep a
permanent table for prett
On Feb 19, 2008 10:37 PM, serafin segador <[EMAIL PROTECTED]> wrote:
>
> hello list,
>
> i am a newbie in postgresql.
Why are you posting the same request twice?
> i ported a small application to postgresql 8.2 originally written to store
> data in maxdb. since stored procedures are not supporte
hello list,
i am a newbie in postgresql.
i ported a small application to postgresql 8.2 originally written to store
data in maxdb. since stored procedures are not supported in postgresql
and since postgresql functions cannot return cursor to the calling
applications, i rewrote the maxdb
On Feb 1, 2008 9:06 PM, Kevin Kempter <[EMAIL PROTECTED]> wrote:
> Hi list;
>
> If I create a temp table (i.e. create temp table xyz as select from ...) is
> the scope of this table limited to a session. Meaning, can several sessions
> all run the above create temp table statement all referencing
Kevin Kempter wrote:
Hi list;
If I create a temp table (i.e. create temp table xyz as select from
...) is the scope of this table limited to a session. Meaning, can
several sessions all run the above create temp table statement all
referencing the same temp table name at the same time?
Yes
Hi list;
If I create a temp table (i.e. create temp table xyz as select from ...) is
the scope of this table limited to a session. Meaning, can several sessions
all run the above create temp table statement all referencing the same temp
table name at the same time?
Thanks in advance
---
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 10/19/07 11:39, Bob Pawley wrote:
> When I fetch a row, as in the following, how do I copy the row's data into a
> temporary table so that I can process it??
>
> begin work;
> Declare loop_set Cursor
>for Select one, two, three,
When I fetch a row, as in the following, how do I copy the row's data into a
temporary table so that I can process it??
begin work;
Declare loop_set Cursor
for Select one, two, three, four, five, six, seven from loop_import
order by loop_id ;
fetch next From loop_set
It appears that what is happening is PL/pgSQL is caching the table
definition (it appears to do this on first execution), testing it with
dynamic SQL via the EXECUTE clause doesn't exhibit the same issue:
CREATE OR REPLACE FUNCTION test_fxn() RETURNS SETOF RECORD AS $$
DECLARE
test_rec RECORD;
On Tuesday 16 January 2007 10:10, "Lenorovitz, Joel"
<[EMAIL PROTECTED]> wrote:
> Greetings,
>
> I am trying to work with a TEMP TABLE within a plpgsql function and I
> was wondering if anyone can explain why the function below, which is
> fine syntactically, will work as expected the first time i
On Tue, Jan 16, 2007 at 11:10:25AM -0700, Lenorovitz, Joel wrote:
> Greetings,
>
> I am trying to work with a TEMP TABLE within a plpgsql function and I
> was wondering if anyone can explain why the function below, which is
> fine syntactically, will work as expected the first time it is called,
>
Greetings,
I am trying to work with a TEMP TABLE within a plpgsql function and I
was wondering if anyone can explain why the function below, which is
fine syntactically, will work as expected the first time it is called,
but will err out as shown on subsequent calls. The DROP TABLE line
seems to
SELECT oid,relname FROM pg_class WHERE oid>=1;
gives me this output.
oid| relname . . .
-
125538806 | tmp_table1 . . .
125538808 | pg_toast_125538806
125538810 | pg_toast_125538806_index . .
Leveraging Open Source for a better Internet"
> From: "Emmanuel SARACCO" <[EMAIL PROTECTED]>
> Organization: Hub.Org Networking Services (http://www.hub.org)
> Reply-To: "Emmanuel SARACCO" <[EMAIL PROTECTED]>
> Date: Tue, 25 Sep 2001 16:14:56 +0200
>
Hello!
I am trying to create a sql function that returns 2
values using temporary table as the "media":
database1=# CREATE FUNCTION SaveNumeric(int2,int2)
RETURNS INTEGER AS '
database1'# CREATE TEMP TABLE mytemp(a int2,b int2);
database1'# INSERT INTO mytemp VALUES ($1+1,$2+100);
database1'#
Alfonso Peniche <[EMAIL PROTECTED]> writes:
> What's wrong with this function? The syntax is supposed to be right,
> isn't it?
No, it isn't right, not for plpgsql. SELECT INTO means something
different to plpgsql than it does in normal Postgres SQL.
regards, tom lane
What's wrong with this function? The syntax is supposed to be right,
isn't it?
Create function UsaTablaTemporal()
RETURNS integer
AS '
BEGIN
SELECT p.apellidos, p.nombres, u.username
INTO TEMP TABLE mitabla
FROM persona p, usuario u
WHERE p.idpersona = u.idusuario
27 matches
Mail list logo