[GENERAL] Dynamic/polymorphic record/composite return types for C user-defined-functions

2013-04-01 Thread Stephen Scheck
Hi, I'm trying to write some user-defined functions in C which operate on a large object (so their common first argument will be an OID referencing an object in the pg_largeobject catalog table created with lo_create()) and return either a single row or a set depending on the function. Depending o

Re: [GENERAL] Using varchar primary keys.

2013-04-01 Thread Gavin Flower
On 02/04/13 08:35, jesusthefrog wrote: On the topic of 'natural' versus 'synthetic' primary keys, I am generally in the camp that an extra ID field won't cost you too much, and while one may not need it for a simple table (i.e. id, name) one might add any number of columns later, and you'll be

[GENERAL] O_O

2013-04-01 Thread CauBa
http://www.ortopediabolivianoaleman.com/iuvniebs/udci.msbep?gl CauBa

[GENERAL] Trigger of Transaction

2013-04-01 Thread Juan Pablo Cook
Hi everyone! I need your help with this problem. I'm using PostgreSQL *9.2 Server* & the latest jdbc driver: postgresql-9.2-1002.jdbc4.jar I have a many to one relation. I have this piece of code: con.setAutoCommit(false); //transaction block start // Make an insert to one table (Vector) // Aft

Re: [GENERAL] Money casting too liberal?

2013-04-01 Thread Jeff Davis
On Sat, 2013-03-30 at 09:52 -0400, D'Arcy J.M. Cain wrote: > That's why I suggested that operations between money(2) and money(3) > should raise an error. Treat them as distinct types. I don't think typmod is currently powerful enough to do that. It's lost in many different types of expressions.

Re: [GENERAL] Using varchar primary keys.

2013-04-01 Thread Julian
On 02/04/13 06:35, jesusthefrog wrote: > On the topic of 'natural' versus 'synthetic' primary keys, I am > generally in the camp that an extra ID field won't cost you too much, > and while one may not need it for a simple table (i.e. id, name) one > might add any number of columns later, and you'll

Re: [GENERAL] Using varchar primary keys.

2013-04-01 Thread Tim Uckun
On Tue, Apr 2, 2013 at 8:35 AM, jesusthefrog wrote: > On the topic of 'natural' versus 'synthetic' primary keys, I am generally > in the camp that an extra ID field won't cost you too much, and while one > may not need it for a simple table (i.e. id, name) one might add any number > of columns la

Re: [GENERAL] Using varchar primary keys.

2013-04-01 Thread jesusthefrog
On the topic of 'natural' versus 'synthetic' primary keys, I am generally in the camp that an extra ID field won't cost you too much, and while one may not need it for a simple table (i.e. id, name) one might add any number of columns later, and you'll be glad to have it. I am, however, against us

Re: [GENERAL] Regular function

2013-04-01 Thread Yuriy Rusinov
Hello ! One's more question arises. In my function sometimes I have to init random number generator via gsl_rng * r = gsl_rng_alloc (gsl_rng_taus); see http://www.gnu.org/software/gsl/manual/html_node/Random-number-generator-initialization.html, may I keep this generator between connections to da

Re: [GENERAL] Current Schema for Functions called within other Functions

2013-04-01 Thread Lee Hachadoorian
Merlin, Perfect. Thank you. Best, --Lee On Mon, Apr 1, 2013 at 10:04 AM, Merlin Moncure wrote: > On Sun, Mar 31, 2013 at 5:32 PM, Lee Hachadoorian > wrote: > > I'm working on some PL/pgSQL functions to generate dynamic SQL. The > > functions live in the public schema, but the SQL generated w

Re: [GENERAL] Current Schema for Functions called within other Functions

2013-04-01 Thread Merlin Moncure
On Sun, Mar 31, 2013 at 5:32 PM, Lee Hachadoorian wrote: > I'm working on some PL/pgSQL functions to generate dynamic SQL. The > functions live in the public schema, but the SQL generated will vary > depending on what schema they are called from. Something is going on which I > cannot figure out.

Re: [GENERAL] Using varchar primary keys.

2013-04-01 Thread Merlin Moncure
On Mon, Apr 1, 2013 at 1:22 AM, Jasen Betts wrote: > On Mon, Apr 01, 2013 at 07:08:15PM +1300, Tim Uckun wrote: >> > >> > how about using an enum instead of this table? >> > >> > >> That's an interesting idea. Are enums mutable? > > > since 9.1 you can add values. > > http://www.postgresql.org/

Re: [GENERAL] Problem with pg_basebackup and streaming replication. (9.2.3 / win64)

2013-04-01 Thread Adrian Klaver
On 03/31/2013 04:47 PM, Tore Halvorsen wrote: Good idea, but both master and the two slaves are separate machines. CCing the list. On the second machine does the tablespace path already exist and does it already have files in it? On Mar 31, 2013 10:21 PM, "Adrian Klaver" mailto:adrian.kla.

Re: [GENERAL] in C trigger function find out if column is part of primary key

2013-04-01 Thread Marko Kreen
On Mon, Apr 01, 2013 at 12:06:25AM +0200, Enke, Dr., Michael wrote: > I have to find out if a column ( i = 0, ..., tupdesc->natts-1 ) is part of a > primary key > but for performance reasons I do not want to execute another query via SPI. > Is this possible? Simpler and probably even faster appro