postgre...@get-experience.com writes:
> Den 15. juli 2017 23:15, skrev Tom Lane:
>> Perhaps you could make your PK be on (id, valid_from, valid_to).
> Doesn't really work because valid_to would change on UPDATE. I'd need to
> update foreign relations with another trigger which would be very ugly.
Den 15. juli 2017 23:15, skrev Tom Lane:
> postgre...@get-experience.com writes:
>> I'm having a problem with the timetravel extension. Following simple schema:
>> ...
>> What am I doing wrong here? According to the function comment in
>> timetravel.c it should:
>> a) set last-version row to NEW d
postgre...@get-experience.com writes:
> I'm having a problem with the timetravel extension. Following simple schema:
> ...
> What am I doing wrong here? According to the function comment in
> timetravel.c it should:
> a) set last-version row to NEW data; valid_from=now()
> b) insert a new row with
Hey,
I'm having a problem with the timetravel extension. Following simple schema:
CREATE EXTENSION timetravel;
CREATE TABLE entries (
id SERIAL NOT NULL,
value INT NOT NULL,
valid_from ABSTIME NOT NULL,
valid_to ABSTIME NOT NULL,
PRIMARY KEY (id, valid_f
> >>SPI_exec("BEGIN",...) returns error SPI_ERROR_TRANSACTION. As expected.
> >>SPI_exec("SAVEPOINT xyz",...) returns error SPI_ERROR_TRANSACTION. Not
> > expected.
>
> The docs say that this is expected:
> https://www.postgresql.org/docs/devel/static/spi-spi-execute.html
> SPI_ERROR_TRANSACTION
>
On Tue, May 24, 2016 at 9:55 PM, dandl wrote:
> A plandl (language handler for Andl) function is called as follows:
>
> BEGIN;
> SELECT plandl_compile($1); // argument is Andl code
> COMMIT;
>
> Inside:
>
>>SPI_exec("BEGIN",...) returns error SPI_ERROR_TRANSACTION. As expected.
>
A plandl (language handler for Andl) function is called as follows:
BEGIN;
SELECT plandl_compile($1); // argument is Andl code
COMMIT;
Inside:
>SPI_exec("BEGIN",...) returns error SPI_ERROR_TRANSACTION. As expected.
>SPI_exec("SAVEPOINT xyz",...) returns error SPI_ERROR_TRANSAC
>
> James Harper wrote:
> > The docs say I'm supposed to call BackgroundWorkerInitializeConnection in
> a bgworker and then I can start using spi functions, but they aren't clear on
> if
> I should call SPI_connect too.
> >
> > If I call BackgroundWorkerInitializeConnection and then SPI_execute I
James Harper wrote:
> The docs say I'm supposed to call BackgroundWorkerInitializeConnection in a
> bgworker and then I can start using spi functions, but they aren't clear on
> if I should call SPI_connect too.
>
> If I call BackgroundWorkerInitializeConnection and then SPI_execute I get a
> r
The docs say I'm supposed to call BackgroundWorkerInitializeConnection in a
bgworker and then I can start using spi functions, but they aren't clear on if
I should call SPI_connect too.
If I call BackgroundWorkerInitializeConnection and then SPI_execute I get a
return code of SPI_ERROR_UNCONNEC
(pls, include me in the reply, i am resending this from here since the one sent
from achill(at)matrix(dot)gatewaynet(dot)com didn't make it for some reason)
Hello, we are using and still maintaining a heavily modified version of
DBMirror in our infrastructure,
involving one master and 80 (and
Thanks for answering:
I am a member of the PostgreSQL development community here in Cuba. My proposal
is to develop an extension to PostgreSQL that allows query execution using
multiple threads. The central idea is to get the execution plan ready to run,
but send him to run with the same postgr
Osmel Barreras =?utf-8?Q?Pi=C3=B1era?= writes:
> I need to develop for my diploma thesis an extension that allows me to travel
> the implementation plan once you pass through the phase of planning and
> optimization. SPI functions that could be used to obtain and work with the
> plan?
SPI is n
I need to develop for my diploma thesis an extension that allows me to travel
the implementation plan once you pass through the phase of planning and
optimization. SPI functions that could be used to obtain and work with the plan?
Fin a la injusticia, LIBERTAD AHORA A NUESTROS CINCO COMPATRIOT
Is there any C libs out there that will abstract the SPI interface?
I have a number of functions that do input process output and
they are all almost identical (tablename fields, change)
I could abstract the code but would prefer to re-use an exissting abstraction
layer
as the less code I write
On Feb 19, 2008 12:12 AM, Alvaro Herrera <[EMAIL PROTECTED]> wrote:
> Mikko Partio escribió:
>
> > Now, I was wondering if a c function would be faster, and with the help
> of
> > the manual I have written a function that can insert tuples from one
> table
> > to another. As the manual states (
>
Mikko Partio escribió:
> Now, I was wondering if a c function would be faster, and with the help of
> the manual I have written a function that can insert tuples from one table
> to another. As the manual states (
> http://www.postgresql.org/docs/8.3/interactive/spi.html), there is no way to
> cat
Hello list
I am trying to write a function in c that would 'merge' two tables together.
The idea is that we insert rows from one table to another, and if there is a
constraint violation, update the old row with the new row. I have done this
succesfully with plpgsql, but alas, the tables are so b
"Merlin Moncure" <[EMAIL PROTECTED]> writes:
> Am I doing anything wrong here?
Returning an already-pfree'd hunk of memory. I gather you are not
testing your code in an enable-cassert build (tut tut), else you'd
not think this worked for small allocations either. See
http://developer.postgresql.
I'm having an issue inside a SPI routine that is giving me crashes.
I'm curious if this is a backend problem or something that I am doing
improperly. The following SPI routine dumps core for large, but
reasonable allocations:
/* testing function. just makes bytea a of input len */
Datum _genbytes
Alex Vinogradovs <[EMAIL PROTECTED]> writes:
> Yes, I'd like to get some memory of my own, so that it can
> be shared between functions executing in different connections.
> Is there an existent API, or should I just straight use Unix IPC ?
As of (I think) 8.2, there's RequestAddinShmemSpace and R
Yes, I'd like to get some memory of my own, so that it can
be shared between functions executing in different connections.
Is there an existent API, or should I just straight use Unix IPC ?
Thanks!
Alex.
On Fri, 2007-09-21 at 16:33 -0700, Jeff Davis wrote:
> On Fri, 2007-09-21 at 12:50 -0700, Al
On Fri, 2007-09-21 at 12:50 -0700, Alex Vinogradovs wrote:
> Guys,
>
>
> Is there any exposed PG-specific API to utilize shared memory while
> working with SPI ? Thanks!
>
What are you trying to do?
The available SPI functions don't include any shared memory access, do
you actually want access
Guys,
Is there any exposed PG-specific API to utilize shared memory while
working with SPI ? Thanks!
Best regards,
Alex Vinogradovs
---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an in
Jasbinder Singh Bali wrote:
my $query = "SELECT sp_insert(" . $a . "," . $b . "," . $c . ")";
my $exec_query = spi_exec_query($query);
here i'm calling a function sp_insert and passing parameters a,b,c to it.
Is this the right usage to spi_exec_query?
http://www.postgresql.org/docs/8.2/static
my $query = "SELECT sp_insert(" . $a . "," . $b . "," . $c . ")";
my $exec_query = spi_exec_query($query);
here i'm calling a function sp_insert and passing parameters a,b,c to it.
Is this the right usage to spi_exec_query?
Thanks,
~Jas
On 6/22/07, Joshua D. Drake <[EMAIL PROTECTED]> wrote:
Jasbinder Singh Bali wrote:
Hi
I was wondering if its necessary to download DBI::PgSPI package from
CPAN to use spi_exec_query in perl
No. Using plperl is the way to go. See the docs there are examples under
plperl.
Joshua D. Drake
or it can be used without downloading the above mentioned
Hi
I was wondering if its necessary to download DBI::PgSPI package from CPAN to
use spi_exec_query in perl
or it can be used without downloading the above mentioned package. I've
tried using spi_exec_query without that package
but doesn't work.
Thanks,
Jas
> Hi all,
>
> I have some doubts about SPI (Server Programming Interface). In
> fact, I must create Stored Procedures in Postgres (8.0). The problem is:
> all stored procedures and, may be, some triggers must be compiled 'cause
> the clients can't access the source code of them.
> To solve
Hi all,
I have some doubts about SPI (Server Programming Interface). In
fact, I must create Stored Procedures in Postgres (8.0). The problem
is: all stored procedures and, may be, some triggers must be compiled
'cause the clients can't access the source code of them.
To solve this prob
Hi All,
I've been working on a small module that I will be pluging into my
local PostreSQL 8.x database and am in need of doing some table locking.
At this time, I've used various other examples to no avail and was
wondering what the proper method for aquiring a table lock within the
module w
Hi,
I need to verify something.
I use spi cursors in a C function (which return a SETOF).
I am using the spi cursors to run the following query:
"SELECT DISTINCT * FROM mytable".
Each time the system gets back to the function
spi cursor can give me the next tuple which I can return.
Q1:My question
Hi,
I am trying to determine if there is a difference in
I/O cost between SPI functions and low level functions
like heap_fetch, heap_getnext, etc...
I want to decide if there is any merit for using the low
level functions instead of the easier SPI.
My guess is that they both use the same underlyin
"Katsaros Kwn/nos" <[EMAIL PROTECTED]> writes:
> I read in the documentation of SPI functions that an SPI_cursor is used
> to avoid memory overrun in cases where a query returns many rows. I'd
> like to learn more about this. Is their any place that I could find more
> detailed information (e.g. ma
Hi,
I read in the documentation of SPI functions that an SPI_cursor is used
to avoid memory overrun in cases where a query returns many rows. I'd
like to learn more about this. Is their any place that I could find more
detailed information (e.g. max size of results, threshold - available
memory et
[EMAIL PROTECTED]
Objet : Re: [GENERAL] SPI memory managment issue
[EMAIL PROTECTED] writes:
> The thing is that I do another spi_connect inside all subqueries (query1
> ... query10) and the memory allocated inside all "subcontext" doesn't
> seems to be free
David Helgason <[EMAIL PROTECTED]> writes:
> These internal functions (loread/lowrite) have quite different
> signatures from their C equivalents (as opposed to lo_lseek). Found out
> from the sources that I was using it very incorrectly.
I had just realized from reading your last message that y
Sorry for spamming I'm getting the hang of this, and figured this
one out myself :)
These internal functions (loread/lowrite) have quite different
signatures from their C equivalents (as opposed to lo_lseek). Found out
from the sources that I was using it very incorrectly. But discovered
l
Thank you very much,
I figured I needed to open my own using SPI_connect(). I had assumed
that there was sth like a
the-connection-this-functions-is-begin-run-through.
Now I'm having problems with
size_t inBufSize = 8192;
char* inBuffer = (char*)palloc(inBufSize);
int bytes_read = DatumGetInt3
David Helgason <[EMAIL PROTECTED]> writes:
> I'm having trouble finding out how to find the current PGconn
> connection inside a C function.
What makes you think that "*the* current PGconn" is a valid concept?
libpq has always supported multiple active connections.
regard
What:
I'm having trouble finding out how to find the current PGconn
connection inside a C function. Looking through the documentation
didn't give this up. Could anyone suggest where to look? I didn't even
see anything similar to this in the SPI_* documentation. Perhaps I am
totally mislead here
Do I save memory using a cursor from a SPI-connected procedure ?
I'm working on a table containing geometric objects and I'd like
to keep a geometry in memory just for the time it is needed, and
one at time, otherwise my machine is in permanent swapping.
--strk;
---(end o
Lamar Owen <[EMAIL PROTECTED]> writes:
> /lib/cpp -M -I. -I../backend executor/spi.h |xargs -n 1|grep \\W|grep -v ^/|grep -v
>spi.h | sort |cpio -pdu $RPM_BUILD_ROOT/usr/include/pgsql
> This could easily enough be included in the make install, couldn't it?
> (Tom? Anyone?) I realize that GNU g
On Fri, 26 May 2000, Tom Lane wrote:
> Ron Peterson <[EMAIL PROTECTED]> writes:
> > After installation, shouldn't everything you need be in
> > /usr/local/pgsql?
> Yeah, it should really. We've had this discussion before. The real
> problem is that no one wants to install the entire pgsql incl
On Fri, 26 May 2000, Mike Mascari wrote:
> Ron Peterson wrote:
> > After installation, shouldn't everything you need be in
> > /usr/local/pgsql?
Too many assumptions are in the source that the source will always be there.
Not necessarily true!
> I too have run into this dependency problem. The
I'm installing v6.4.2 on Solaris 2.5.1. Everything goes well until I run
the regression test. Some of the test fails with an error message like:
+ ERROR: Load of file
/bytek/postgres/postgresql-6.4.2/src/test/regress/input/.
./regress.so failed: ld.so.1: /bytek/postgres/bin/postmaster: fatal:
rel
SPI - Server Programming Interface is for coding C functions in the
backend. Thus triggers can reference functions created using SPI..
Libpq is a front-end (or client side) API.
Anand Surelia wrote:
> Hi,
> Can anyone tell me what is the difference between the SPI and the Libpq
> interfaces
Hi,
Can anyone tell me what is the difference between the SPI and the Libpq
interfaces and when to use what?
I am writing some functions that will be used by triggers. What
interface should I use to implement those functions?
Thanks,
Anand
48 matches
Mail list logo