Bruce Momjian | 1 Sep 01:37 2003
Picon

Re: About GPL and proprietary software

Ron Johnson wrote:
> On Sun, 2003-08-31 at 14:57, Michael Meskes wrote:
> > On Sun, Aug 31, 2003 at 02:26:14PM -0500, Ron Johnson wrote:
> > > IANAL, but according to my understanding
> > > (1) proprietary s/w that dynamically links to "GPL" shared libraries
> > > has not broken the GPL.
> > 
> > Sure? My understanding is that it does break GPL. That's why there's an
> > LGPL.
> 
> Well, there's this:
> http://www.fsf.org/licenses/gpl-faq.html#LinkingWithGPL
> and this:
> http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
> http://lists.gnupg.org/pipermail/gnupg-devel/2000-April/010043.html
> 
> Linus thinks that dynamic linking is ok, RMS doesn't, but gives
> an example boilerplate that says how dynamic linking can be ok
> w/ the GPL.  It's definitely a grey area.

Right, dynamic linking is a case where RMS would like the GPL to spread
the the closed-source binary, but I don't think he can legally do that.

We do have that issue with our linking in of libreadline.  We may adopt
libedit someday for that very reason.

I researched this a little recently for Joe Conway.

--

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
(Continue reading)

Weiping He | 1 Sep 04:43 2003
Picon

how to group by a joined query?

suppose I've got two table:

laser_uni=# \d t1
     Table "public.t1"
 Column | Type | Modifiers
--------+------+-----------
 name   | text |
 addr   | text |

laser_uni=# \d t2
      Table "public.t2"
 Column |  Type   | Modifiers
--------+---------+-----------
 name   | text    |
 len    | integer |
 of     | integer |

and I want to use join to select out data and then group by one column, 
like this:

laser_uni=# select t1.name, t1.addr, t2.name, t2.len, t2.of from t1 
right join t2 on t1.name=t2.name group by t2.name;
ERROR:  Attribute t1.name must be GROUPed or used in an aggregate function

seems the I must gorup all those fields:

laser_uni=# select t1.name as t1name, t1.addr as t1addr, t2.name as 
t2name, t2.len, t2.of from t1 right join t2 on t1.name=t2.name group by 
t1.name, t1.addr, t2.name, t2.len, t2.of;
 t1name | t1addr | t2name | len | of
(Continue reading)

Alex | 1 Sep 04:58 2003

Re: Quetions on Joins

Ron,
the idea is to provide a table where users can define filters. But it 
this table may be as well empty.

Alex

Ron Johnson wrote:

>On Sun, 2003-08-31 at 11:56, Alex wrote:
>  
>
>>Hi,
>>
>>I have a query where I want to filter out records from table_a if a 
>>field in table_a matches in table table_b. Basically table_b defines the 
>>filter.
>>
>>If table_b however is empty i dont get any results
>>
>>SELECT A.value_one FROM table_a AS A, table_b AS B WHERE  A.value_two <> 
>>B.value_two;
>>or
>>SELECT A.value_one FROM table_a AS A, table_b AS B WHERE  A.value_two <> 
>>B.value_two AND B.value_two NOTNULL;
>>
>>Only work if the there is a value in table_b.
>>Could anyone tell me if there is a way to do that ?
>>    
>>
>
(Continue reading)

Alex | 1 Sep 05:07 2003

Prevent from Deletion

Hi,
I have tables that have default records that must not be deleted or 
modified.
Is there an easy way to do this. Like setting a trigger on the Primary 
key value ?

Alex

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo <at> postgresql.org)

Martijn van Oosterhout | 1 Sep 05:13 2003

Re: About GPL and proprietary software

On Sun, Aug 31, 2003 at 07:37:47PM -0400, Bruce Momjian wrote:
> Ron Johnson wrote:
> > Well, there's this:
> > http://www.fsf.org/licenses/gpl-faq.html#LinkingWithGPL
> > and this:
> > http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
> > http://lists.gnupg.org/pipermail/gnupg-devel/2000-April/010043.html
> > 
> > Linus thinks that dynamic linking is ok, RMS doesn't, but gives
> > an example boilerplate that says how dynamic linking can be ok
> > w/ the GPL.  It's definitely a grey area.
> 
> Right, dynamic linking is a case where RMS would like the GPL to spread
> the the closed-source binary, but I don't think he can legally do that.
> 
> We do have that issue with our linking in of libreadline.  We may adopt
> libedit someday for that very reason.

I was under the impression that the GPL only covers distribution, not use
(as seems normal for copyright). In other words, as long as you don't ship
readline with PostgreSQL you're fine. If the user wants to install it on
their machine with readline linked in that's their problem entirely.

Now, I think that people have tried to argue that if a library is the *only*
implementation of the interface then it should be considered linked in
because otherwise you're just using dynamic linking to get around the GPL.

But since PostgreSQL doesn't depend on readline (it is optional after all) I
don't see the issue. However, for the MySQL client library since the
software strictly depends on that library, the fact that it's distributed as
(Continue reading)

Doug McNaught | 1 Sep 05:29 2003

Re: Prevent from Deletion

Alex <alex <at> meerkatsoft.com> writes:

> Hi,
> I have tables that have default records that must not be deleted or
> modified.
> Is there an easy way to do this. Like setting a trigger on the Primary
> key value ?

You could do this--create ON UPDATE and ON DELETE triggers that look
for distinguishing features of the default records (primary key value
or whatever) and RAISE ERROR if they match.  They'll be executed for
every UPDATE and DELETE on the table, which may or may not be a
performance issue for you...

-Doug

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

mgarriss | 1 Sep 05:40 2003
Picon
Picon

Getting last inserted SERIAL

Given this table:

CREATE TABLE test ( id SERIAL, example TEXT );

An implicit sequence is created as show in this message:

NOTICE:  CREATE TABLE will create implicit sequence 'test_id_seq' for 
SERIAL column 'test.id'

How do I retrieve the last 'id' that was inserted?  I have a process 
that does an insert and then needs the value of the id column of the row 
it just inserted so that that row can be used later in processing.  
First thought is "SELECT CURRVAL('test_id_seq');" but this assumes that 
there is only one connection inserting into this table, bad assumption.  
Next idea is the make 'id' an INT4 and set it explicitly with a value 
that I select from an explicitly created sequence.  This method seems a 
bit inelegant.  Any ideas?

TIA
Michael Garriss

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Weiping He | 1 Sep 05:38 2003
Picon

Re: how to group by a joined query?

Weiping He wrote:

> suppose I've got two table:
>
> laser_uni=# \d t1
>     Table "public.t1"
> Column | Type | Modifiers
> --------+------+-----------
> name   | text |
> addr   | text |
>
> laser_uni=# \d t2
>      Table "public.t2"
> Column |  Type   | Modifiers
> --------+---------+-----------
> name   | text    |
> len    | integer |
> of     | integer |
>
> and I want to use join to select out data and then group by one 
> column, like this:
>
> laser_uni=# select t1.name, t1.addr, t2.name, t2.len, t2.of from t1 
> right join t2 on t1.name=t2.name group by t2.name;
> ERROR:  Attribute t1.name must be GROUPed or used in an aggregate 
> function
>
> seems the I must gorup all those fields:
>
> laser_uni=# select t1.name as t1name, t1.addr as t1addr, t2.name as 
(Continue reading)

Bruce Momjian | 1 Sep 05:57 2003
Picon

Re: About GPL and proprietary software

Martijn van Oosterhout wrote:
> > Right, dynamic linking is a case where RMS would like the GPL to spread
> > the the closed-source binary, but I don't think he can legally do that.
> > 
> > We do have that issue with our linking in of libreadline.  We may adopt
> > libedit someday for that very reason.
> 
> I was under the impression that the GPL only covers distribution, not use
> (as seems normal for copyright). In other words, as long as you don't ship
> readline with PostgreSQL you're fine. If the user wants to install it on
> their machine with readline linked in that's their problem entirely.
> 
> Now, I think that people have tried to argue that if a library is the *only*
> implementation of the interface then it should be considered linked in
> because otherwise you're just using dynamic linking to get around the GPL.
> 
> But since PostgreSQL doesn't depend on readline (it is optional after all) I
> don't see the issue. However, for the MySQL client library since the
> software strictly depends on that library, the fact that it's distributed as
> a separate tarball does not absolve you of the GPL requirement.
> 
> Obviously MySQL wouldn't have done their license this way if they didn't
> think it was enforceable. Maybe they have themselves an exception or
> variation on the GPL? But it's still confusing.

The FSF would _like_ dynamic linking to pass the GPL to the
closed-source binary, but that doesn't make it so --- I would like a lot
of things but wanting it to happen isn't enough.

Their FAQ says (http://www.gnu.org/licenses/gpl-faq.html):
(Continue reading)

Dennis Björklund | 1 Sep 06:02 2003

Re: Getting last inserted SERIAL

On Sun, 31 Aug 2003, mgarriss wrote:

> First thought is "SELECT CURRVAL('test_id_seq');" but this assumes that 
> there is only one connection inserting into this table, bad assumption.  

That is what you should use, and it works for concurrent sessions. It's 
all described in the manual:

http://www.postgresql.org/docs/7.3/static/functions-sequence.html

--

-- 
/Dennis

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Gmane