Re: [GENERAL] Why security-definer functions are executable by public by default?

2011-04-05 Thread Sim Zacks
On 04/05/2011 09:41 AM, hubert depesz lubaczewski wrote: hi was pointed to the fact that security definer functions have the same default privileges as normal functions in the same language - i.e. if the language is trusted - public has the right to execute them. maybe i'm missing something im

[GENERAL] Integrating New Data Type

2011-04-05 Thread Nick Raj
Hi all, I have defined a new data type. I have defined in and out function for that data type. But i want to know how to integrate this data type with postgres (how postgres compile my code or know my datatype) ? Thanks, Nirmesh

Re: [GENERAL] Integrating New Data Type

2011-04-05 Thread Pavel Stehule
Hello 2011/4/5 Nick Raj : > Hi all, > I have defined a new data type. I have defined in and out function for that > data type. > But i want to know how to integrate this data type with postgres (how > postgres compile my code or know my datatype) ? you have to register in, out functions, you have

[GENERAL] Database "gnu make" equivalent

2011-04-05 Thread pasman pasmański
Hello. I search a tool to send queries to database when specific rows contain null or not exist. What can be used for this purpose ? pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mail

Re: [GENERAL] Database "gnu make" equivalent

2011-04-05 Thread Gabriele Bartolini
Hi Pasman, On Tue, 5 Apr 2011 11:14:16 +0200, pasman pasmański wrote: I search a tool to send queries to database when specific rows contain null or not exist. What can be used for this purpose ? Could you please elaborate this and provide us with more information? I am afraid I have not

[GENERAL] Named advisory locks

2011-04-05 Thread rihad
Hi, all. I'm looking for a way to lock on an arbitrary string, just how MySQL allows doing with GET_LOCK('foo.123') / RELEASE_LOCK('foo.123'). I know that at least Postgres 8.3 has pg_advisory_lock() / pg_advisory_unlock() but they seem to accept integer values only, and we're already using int

Re: [GENERAL] Database "gnu make" equivalent

2011-04-05 Thread John R Pierce
On 04/05/11 2:14 AM, pasman pasmański wrote: Hello. I search a tool to send queries to database when specific rows contain null or not exist. What can be used for this purpose ? A perl script, perhaps? You would of course have to make a query to determine that the specific row you are loo

[GENERAL] Out of memory

2011-04-05 Thread Jeremy Palmer
Hi, I've been having repeated troubles trying to get a PostgreSQL app to play nicely on Ubuntu. I recently posted a message on this list about an out of memory error and got a resolution by reducing the work_mem setting. However I'm now getting further out of memory issues during the same stage

Re: [GENERAL] PostgreSQL documentation on kindle - best practices?

2011-04-05 Thread ray
On Apr 4, 4:00 am, jayadevan.maym...@ibsplc.com (Jayadevan M) wrote: > > So my question: has anyone found a best practice solution to convert > > the PostgreSQL documentaiton into a kindle-friendly format? Or has > > even an .azw file downloadable somewhere? > > > Best wishes, > > > Harald > > You

Re: [GENERAL] schema access privs

2011-04-05 Thread Vibhor Kumar
[ Please don't overpost the list. Adding PG General List] On Apr 5, 2011, at 3:30 AM, Ray Stell wrote: > On Tue, Apr 05, 2011 at 02:42:30AM +0530, Vibhor Kumar wrote: >> >> On Apr 5, 2011, at 2:31 AM, Ray Stell wrote: >> >>> What does the results in col 'List of schemas Access privileges' >>> i

[GENERAL] Trigger vs web service

2011-04-05 Thread Marc-André Goderre
I receive a long string (about 1 per second) than content many information. For the moment it is directly inserted in the database (1 column). I have to treat the hole string every time i need information in it. Now, I want split the sting and save the informations in differents fields. I have 2

Re: [GENERAL] schema access privs

2011-04-05 Thread Ray Stell
On Tue, Apr 05, 2011 at 03:58:46PM +0530, Vibhor Kumar wrote: > > Following are details: > postgres=UC/postgres+ > [user] [privs] /[ ROLE who granted privs. What's the logic for reporting the U priv twice? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chang

Re: [GENERAL] schema access privs

2011-04-05 Thread Vibhor Kumar
On Apr 5, 2011, at 6:07 PM, Ray Stell wrote: > On Tue, Apr 05, 2011 at 03:58:46PM +0530, Vibhor Kumar wrote: >> >> Following are details: >> postgres=UC/postgres+ >> [user] [privs] /[ ROLE who granted privs. > > What's the logic for reporting the U priv twice? If you are talking about fol

Re: [GENERAL] Named advisory locks

2011-04-05 Thread Craig Ringer
On 5/04/2011 5:42 PM, rihad wrote: Hi, all. I'm looking for a way to lock on an arbitrary string, just how MySQL allows doing with GET_LOCK('foo.123') / RELEASE_LOCK('foo.123'). I know that at least Postgres 8.3 has pg_advisory_lock() / pg_advisory_unlock() but they seem to accept integer values

[GENERAL] Memory leak in SPI_finish call

2011-04-05 Thread Jorge Arévalo
Hello, I'm having problems with a PostgreSQL server side C-function. It's not an aggregate function (operates over a only row of data). When the function is called over tables with ~4000 rows, it causes postgres backend crash with SEGFAULT. I know the error is a kind of "cumulative", because with

Re: [GENERAL] Foreign key and locking problem

2011-04-05 Thread Vick Khera
On Mon, Apr 4, 2011 at 4:18 PM, Edoardo Serra wrote: > At this point, client1 gives the following error: > ERROR: could not serialize access due to concurrent update > CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"."people" x WHERE "id" > OPERATOR(pg_catalog.=) $1 FOR SHARE OF x" > > Is th

Re: [GENERAL] Plpgsql function to compute "every other Friday"

2011-04-05 Thread Merlin Moncure
On Mon, Apr 4, 2011 at 7:12 PM, C. Bensend wrote: > > Hey folks, > >   So, I'm working on a little application to help me with my > budget.  Yeah, there are apps out there to do it, but I'm having > a good time learning some more too.  :) > >   I get paid every other Friday.  I thought, for schedu

Re: [GENERAL] Trigger vs web service

2011-04-05 Thread Jorge Godoy
If I was Yoda, I would say "The answer you seek is... it depends" If I were you, I would test both solutions and check which one performs better and impacts the least on your environment. For example, if you have no logic at all on the database then I would code that in the frontend. If you have

Re: [GENERAL] Named advisory locks

2011-04-05 Thread rihad
On 5/04/2011 5:42 PM, rihad wrote: Hi, all. I'm looking for a way to lock on an arbitrary string, just how MySQL allows doing with GET_LOCK('foo.123') / RELEASE_LOCK('foo.123'). I know that at least Postgres 8.3 has pg_advisory_lock() / pg_advisory_unlock() but they seem to accep

Re: [GENERAL] Why security-definer functions are executable by public by default?

2011-04-05 Thread Tom Lane
hubert depesz lubaczewski writes: > was pointed to the fact that security definer functions have the same > default privileges as normal functions in the same language - i.e. if > the language is trusted - public has the right to execute them. > maybe i'm missing something important, but given th

Re: [GENERAL] schema access privs

2011-04-05 Thread Ray Stell
On Tue, Apr 05, 2011 at 06:33:46PM +0530, Vibhor Kumar wrote: > > On Apr 5, 2011, at 6:07 PM, Ray Stell wrote: > > > On Tue, Apr 05, 2011 at 03:58:46PM +0530, Vibhor Kumar wrote: > >> > >> Following are details: > >> postgres=UC/postgres+ > >> [user] [privs] /[ ROLE who granted privs. > > > >

Re: [GENERAL] Named advisory locks

2011-04-05 Thread Ben Chobot
On Apr 5, 2011, at 7:35 AM, rihad wrote: > No, what I meant was that we're already using ints for a different purpose in > another app on the same server, so I cannot safely reuse them. Aren't > advisory lock ID's unique across the whole server? The sole purpose of the > string ID is to be abl

Re: [GENERAL] Named advisory locks

2011-04-05 Thread rihad
On 04/05/2011 08:29 PM, Ben Chobot wrote: On Apr 5, 2011, at 7:35 AM, rihad wrote: No, what I meant was that we're already using ints for a different purpose in another app on the same server, so I cannot safely reuse them. Aren't advisory lock ID's unique across the whole server? The sole pur

Re: [GENERAL] Named advisory locks

2011-04-05 Thread Vick Khera
On Tue, Apr 5, 2011 at 10:35 AM, rihad wrote: > No, what I meant was that we're already using ints for a different purpose > in another app on the same server, so I cannot safely reuse them. Aren't > advisory lock ID's unique across the whole server? The sole purpose of the > string ID is to be a

[GENERAL] Seeking Postgres users, DBAs and developers in areas where we don't have conferences or user groups

2011-04-05 Thread Selena Deckelmann
Hi! I'm trying to find people who use, administrate or develop PostgreSQL and live in regions that our community doesn't currently serve. By "doesn't currently serve", I mean that: * You don't know many other people that use PostgreSQL in your town, nearby city or country, * You've never been to

[GENERAL] Is index rebuilt upon updating table with the same values as already existing in the table?

2011-04-05 Thread Zeev Ben-Sender
Hi, Having the update statement like this: UPDATE my_table SET (COL1 = '05cf5219-38e6-46b6-a6ac-5bbc3887d16a', COL2 = 28) WHERE COL3 = 35; Will this statement result indexes rebuild if COL1 and COL2 already equal '05cf5219-38e6-46b6-a6ac-5bbc3887d16a' and 28? Thank you

Re: [GENERAL] ..horribly documented, inefficient, user-hostile, impossible to maintain interpreted language..

2011-04-05 Thread Merlin Moncure
On Mon, Apr 4, 2011 at 2:20 PM, John R Pierce wrote: > On 04/04/11 12:07 PM, Martin Gainty wrote: >> >> ..horribly documented, inefficient, user-hostile, impossible to maintain >> interpreted language.. >> to whom might you be alluding to > > I only used a few of those adjectives, and prefixed the

[GENERAL] Problem with multiple action rule on modifiable view

2011-04-05 Thread Chris Oldfield
Hi, I'm trying to implement a modifiable view and have run into a road block. A DELETE rule attached to my view refuses to execute any commands after the first delete on one of views the component tables. Examining the output of EXPLAIN, it seems that the view is constructed for every action i

Re: [GENERAL] Is index rebuilt upon updating table with the same values as already existing in the table?

2011-04-05 Thread Vick Khera
On Tue, Apr 5, 2011 at 11:22 AM, Zeev Ben-Sender wrote: > Hi, > > > > Having the update statement like this: > > UPDATE my_table SET (COL1 = ‘05cf5219-38e6-46b6-a6ac-5bbc3887d16a’, COL2 = > 28) WHERE COL3 = 35; > > > > Will this statement result indexes rebuild if COL1 and COL2 already equal > ‘0

Re: [GENERAL] Plpgsql function to compute "every other Friday"

2011-04-05 Thread C. Bensend
> By making this function sql and immutable, you give the database more > ability to inline it into queries which can make a tremendous > performance difference in some cases. You can also index based on it > which can be useful. Very nice, Merlin. These aren't really a concern in my case as I'

Re: [GENERAL] ..horribly documented, inefficient, user-hostile, impossible to maintain interpreted language..

2011-04-05 Thread John R Pierce
On 04/05/11 9:40 AM, Merlin Moncure wrote: On Mon, Apr 4, 2011 at 2:20 PM, John R Pierce wrote: I only used a few of those adjectives, and prefixed them by hypothetical. to be honest, I would expect most languages commonly used in web service environments to be more efficient at string processi

Re: [GENERAL] ..horribly documented, inefficient, user-hostile, impossible to maintain interpreted language..

2011-04-05 Thread Merlin Moncure
On Tue, Apr 5, 2011 at 1:04 PM, John R Pierce wrote: > On 04/05/11 9:40 AM, Merlin Moncure wrote: >> >> On Mon, Apr 4, 2011 at 2:20 PM, John R Pierce  wrote: >>> >>> I only used a few of those adjectives, and prefixed them by hypothetical. >>> to be honest, I would expect most languages commonly u

Re: [GENERAL] Named advisory locks

2011-04-05 Thread rihad
On Tue, Apr 5, 2011 at 10:35 AM, rihad wrote: No, what I meant was that we're already using ints for a different purpose in another app on the same server, so I cannot safely reuse them. Aren't advisory lock ID's unique across the whole server? The sole purpose of the string ID is to be able to

Re: [GENERAL] Out of memory

2011-04-05 Thread Jeff Davis
On Tue, 2011-04-05 at 21:50 +1200, Jeremy Palmer wrote: > Hi, > > I've been having repeated troubles trying to get a PostgreSQL app to play > nicely on Ubuntu. I recently posted a message on this list about an out of > memory error and got a resolution by reducing the work_mem setting. However

Re: [GENERAL] Named advisory locks

2011-04-05 Thread Vick Khera
On Tue, Apr 5, 2011 at 2:49 PM, rihad wrote: > Can't do that, because I'm simply using some table's serial value as the > lock ID, which is itself a bigint. > So you assigned the entire namespace to the other purpose seems to be programmer's bad planning :(

Re: [GENERAL] Named advisory locks

2011-04-05 Thread rihad
On 04/06/2011 12:20 AM, Vick Khera wrote: On Tue, Apr 5, 2011 at 2:49 PM, rihad mailto:ri...@mail.ru>> wrote: Can't do that, because I'm simply using some table's serial value as the lock ID, which is itself a bigint. So you assigned the entire namespace to the other purpose seem

Re: [GENERAL] Out of memory

2011-04-05 Thread John R Pierce
On 04/05/11 2:50 AM, Jeremy Palmer wrote: I've been having repeated troubles trying to get a PostgreSQL app to play nicely on Ubuntu. I recently posted a message on this list about an out of memory error and got a resolution by reducing the work_mem setting. However I'm now getting further out

[GENERAL] unique amount more than one table

2011-04-05 Thread Perry Smith
I have five tables each with a "name" field. Due to limitations in my user interface, I want a name to be unique amoung these five tables. I thought I could first create a view with something like: SELECT name, 'table1' as type from table1 UNION ALL SELECT name, 'table2' as type from table2

Re: [GENERAL] unique amount more than one table

2011-04-05 Thread Jeff Davis
On Tue, 2011-04-05 at 17:02 -0500, Perry Smith wrote: > CREATE OR REPLACE FUNCTION unique_xxx ( ) RETURNS boolean AS $$ >SELECT ( SELECT max(cnt) FROM ( SELECT count(*) AS cnt FROM xxx GROUP > BY name ) AS foo ) = 1; > $$ LANGUAGE SQL; > > Next I added a check constraint with: > > ALTER

Re: [GENERAL] unique amount more than one table

2011-04-05 Thread David Johnston
You can try restricting all name insertions (on any of the tables) to go through one or more functions that serialize amongst themselves. Basically lock a common table and check the view for the new name before inserting. On Apr 5, 2011, at 18:02, Perry Smith wrote: > I have five tables each

Re: [GENERAL] Out of memory

2011-04-05 Thread Jeremy Palmer
Hi John, > Does that all really have to be a single transaction? Yes - I need to ensure that of the changesets and denormalised tables are created in the same transaction, so that if an error occurs the database is rolled back to the last successfully applied changeset. I don't want to get int

Re: [GENERAL] unique amount more than one table

2011-04-05 Thread Rob Sargent
On 04/05/2011 04:02 PM, Perry Smith wrote: I have five tables each with a "name" field. Due to limitations in my user interface, I want a name to be unique amoung these five tables. I thought I could first create a view with something like: SELECT name, 'table1' as type from table1 UNION

[GENERAL] Dumping functions with pg_dump

2011-04-05 Thread Greg Corradini
Hello, Is it possible yet in 8.4 to pg_dump specific functions without having to do the whole pg_restore thing? If it is possible, what is the syntax to dump a specific function? If not possible, then how does one use pg_restore to target a specific function? thx

Re: [GENERAL] Dumping functions with pg_dump

2011-04-05 Thread Raymond O'Donnell
On 06/04/2011 00:15, Greg Corradini wrote: Hello, Is it possible yet in 8.4 to pg_dump specific functions without having to do the whole pg_restore thing? If I understand correctly what you're trying to do, a handy alternative is to use pgAdmin, right click on the function in the tree view, an

Re: [GENERAL] Dumping functions with pg_dump

2011-04-05 Thread Greg Corradini
Thanks for the reply Raymond! This is all through remote terminal so I can't use pg_admin ;( Maybe some more quick context I don't want to dump whole database b/c the thing is 12GB and for the application we're building we only access certain tables in the DB. There's one table that has two t

Re: [GENERAL] Dumping functions with pg_dump

2011-04-05 Thread Jerry Sievers
Greg Corradini writes: > Hello, > Is it possible yet in 8.4 to pg_dump specific functions without having to do > the whole pg_restore thing? > > If it is possible, what is the syntax to dump a specific function? > > If not possible, then how does one use pg_restore to target a specific > function

Re: [GENERAL] Dumping functions with pg_dump

2011-04-05 Thread Adrian Klaver
On Tuesday, April 05, 2011 4:19:56 pm Raymond O'Donnell wrote: > On 06/04/2011 00:15, Greg Corradini wrote: > > Hello, > > Is it possible yet in 8.4 to pg_dump specific functions without having > > to do the whole pg_restore thing? > > If I understand correctly what you're trying to do, a handy al

Re: [GENERAL] unique amount more than one table

2011-04-05 Thread Perry Smith
On Apr 5, 2011, at 5:50 PM, Rob Sargent wrote: > > > On 04/05/2011 04:02 PM, Perry Smith wrote: >> I have five tables each with a "name" field. Due to limitations in my user >> interface, I want a name to be unique amoung these five tables. >> >> I thought I could first create a view with so

Re: [GENERAL] Dumping functions with pg_dump

2011-04-05 Thread Greg Corradini
On Tue, Apr 5, 2011 at 4:30 PM, Adrian Klaver wrote: > On Tuesday, April 05, 2011 4:19:56 pm Raymond O'Donnell wrote: > > On 06/04/2011 00:15, Greg Corradini wrote: > > > Hello, > > > Is it possible yet in 8.4 to pg_dump specific functions without having > > > to do the whole pg_restore thing? > >

Re: [GENERAL] Dumping functions with pg_dump

2011-04-05 Thread Adrian Klaver
On Tuesday, April 05, 2011 5:24:13 pm Greg Corradini wrote: > On Tue, Apr 5, 2011 at 4:30 PM, Adrian Klaver wrote: > > Thx for the replies Adrian and Jerry, > > Those are both options. Jerry, your suggestion is the work around I've > already used. Adrian, I did not know you could do that. Still.

Re: [GENERAL] Out of memory

2011-04-05 Thread Jeremy Palmer
Hi Jeff, < Where is the source to the function?  The source is located here: https://github.com/linz/linz_bde_uploader The main function LDS_MaintainSimplifiedLayers that is being called is on line 37 is in https://github.com/linz/linz_bde_uploader/blob/master/sql/lds_layer_functions.sql. T

Re: [GENERAL] Database "gnu make" equivalent

2011-04-05 Thread pasman pasmański
> > A perl script, perhaps? You would of course have to make a query to > determine that the specific row you are looking for is either null or > nonexistant, then send your additional queries. > > Yes, it is simplest. I try to do it pasman -- Sent via pgsql-general mailing list (