Re: [pgeu-general] [GENERAL] Call for design: PostgreSQL mugs

2013-09-05 Thread Marc Balmer
Am 05.09.13 09:00, schrieb Heikki Linnakangas:
 Put a small elephant logo *inside* the mug. With a text: also for
 embedded systems

For german speaking folks, just a mug with an elephant an the text
ProstgreSQL.





-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [pgeu-general] [GENERAL] Call for design: PostgreSQL mugs

2013-09-05 Thread Marc Balmer
ACID. Actually Coffee Inside, Drinkable.

Am 05.09.2013 um 20:49 schrieb Steve Crawford scrawf...@pinpointresearch.com:

 org)


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [pgeu-general] [GENERAL] Call for design: PostgreSQL mugs

2013-09-05 Thread Marc Balmer
My SQL is PostgreSQL


Atri Sharma atri.j...@gmail.com schrieb:

On Fri, Sep 6, 2013 at 12:35 AM, Marc Balmer m...@msys.ch wrote:
 ACID. Actually Coffee Inside, Drinkable.

 Am 05.09.2013 um 20:49 schrieb Steve Crawford 
 scrawf...@pinpointresearch.com:

 org)

Something of the lines of evolution?

A small elephant, growing more powerful?

-- 
Regards,

Atri
l'apprenant

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Dynamic SQL in Lua

2013-06-15 Thread Marc Balmer
The PostgreSQL Lua binding found on https://github.com/mbalmer/luapgsql
has been extended to make it a bit easier to create SQL commands
dynamically and still be able to use execParams().

Imagine a table with user information that contains usernames,
hostnames, locations (e.g. building a user works in) and more data.  In
a web application, a HTML form field could be set to a location name or
'all', indicating that we want information for all locations.

The simple approach would then be to create the SQL on the fly and pass
it to the db:exec() function:

sql = {
string.format('select * from userinfo where name = '%s' and host = %s',
name, host }
}

if location ~= 'all' then
sql[#sql + 1] = string.format(' and location = '%s', location)
end

sql = table.concat(sql, '\n')
db:exec(sql)

Constructing SQL this way is bad thing (SQL injection...), so
db:execParams() is what should be used.  As it is now possible to pass
tables as parameter values to the db:execParams() function, this can now
be done in a halway sane form by using a table for the parameters and
creating the placeholders ('$1', '$2' etc.) based on the current size of
the parameter array:

p = { 'mbalmer', 'localhost' } -- parameter array

sql = { 'select * from userinfo where name = $1 and host = $2' }

if location ~= 'all' then
p[#p + 1] = location
sql[#sql + 1] = string.format(' and location = $%d', #p)
end

sql = table.concat(sql, '\n')
db:execParams(sql, p)


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Passing a PGconn * between two processes on Unix like systems

2010-07-22 Thread Marc Balmer
I two Unix/ process related questions:

Is there a documented way to pass around an (opened) PGconn * structure
between two processes on Unix?

When a process forks() and both the parent and child process continue to
use a previously opened PGconn * structure, is that behaviour defined?

Thanks,
Marc Balmer

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] psql vs. pgadmin3 was:can't get UPDATE ... RETURNING ... INTO ... to compile successfully

2008-08-23 Thread Marc Balmer
* Ivan Sergio Borgonovo wrote:
 On Fri, 22 Aug 2008 18:34:53 -0600
 Scott Marlowe [EMAIL PROTECTED] wrote:
 
  Glad you got your problem resolved.  I have to admit I tend to
  mostly use psql to interact with postgres.  Nothing against
  PGAdmin III, it's good software.  I just tend to feel more comfy
  scripting things than clicking things.  Whether you're using
  pgadmin III or psql, it's important that you have the right
  version.  For pgadmin it's usually best to always have the latest
  version, and with psql the one that matches your db.
 
 Is there any secret I don't know?
 I mostly use pgadmin because:
 1) It is easier to cut and paste code and results
 2) It's easier to open several connections
 3) you've the object structure to navigate

The pgadmin3 version I use has some annoying bugs:  If I want to
add privileges to an object, it does not show me all roles in
the corresponding drop down box.

I am using version 1.8.2.  Is that fixed in a newer version?

 
 But I miss psql auto completion.
 
 I know I can call an external editor that would make cutpaste
 easier in psql but I'll lose autocompletion and I've had some issues
 with pgadmin searchreplace and regexp, so I definitively would
 enjoy psql more... but what about the rest?
 
 -- 
 Ivan Sergio Borgonovo
 http://www.webthatworks.it
 
 
 -- 
 Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgsql-general

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Granting privileges on views to group roles

2007-05-17 Thread Marc Balmer
I am having a hard time here with PostgreSQL 8.2.4...  What I want to do
is rather simple:

I have two login roles, user_A and admin_A, and a group role, group_A.
user_A is member of group_A

I create a table t_data, owned by admin_A
I create a view v_data, owned by admin_A
Now I grant SELECT privilege on view v_data to group_A

I would by now assume that user_A can SELECT data on v_data, but he can
not.

What am I doing wrong here?  According to the docs, I should be able to
GRANT on views to group roles.

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq