Gibson | 1 Sep 07:21 2006

Fatal error while installing

I seem to get this error "user postgres could not be created, user 
account already exists" when trying to install postgres. Anyone knows 
how to fix this?

Erik Jones wrote:
> Erik Jones wrote:
>> Ok, consider the following table definition:
>>
>> CREATE TABLE stats (
>> id SERIAL PRIMARY KEY,
>> hits bigint default 0,
>> clickthrus bigint default 0,
>> referrals bigint default 0);
>>
>>
>> Now, this table has a lot of rows that are constantly being updated 
>> by queries of the following form:
>>
>> UPDATE stats
>> SET clickthrus = clickthrus + #
>> WHERE id = blah;  -- sub various values for # and blah
>>
>> There can be, and often are,  multiple updates for the same row 
>> coming in at the same time,  but never for the same field.  My 
>> understanding of the locking involved is that updates take out 
>> row-exclusive locks to prevent other transactions from modifying the 
>> data and to serialize with other updates.  So, multiple update 
>> statements to the same row come in, the first to arrive is granted a 
>> row-exclusive lock and the other wait.  When the first is finished 
>> and commits, the second to have arrived get the lock, and so forth.  
(Continue reading)

Gibson | 1 Sep 08:31 2006

Re: Fatal error while installing

How do i remove this user?I am running on Win XP here.

Joshua D. Drake wrote:
> Gibson wrote:
>> I seem to get this error "user postgres could not be created, user 
>> account already exists" when trying to install postgres. Anyone knows 
>> how to fix this?
>
> Sounds to me like the user postgres on the OS already exists.
>
> Joshua D. Drake
>
>
>

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo <at> postgresql.org so that your
       message can get through to the mailing list cleanly

Randall Lucas | 1 Sep 03:54 2006

Re: Dependency graph of all tuples relied upon in a query answer

On Thu, Aug 31, 2006 at 09:17:54AM -0400, Merlin Moncure wrote:
> On 8/30/06, Randall Lucas <rlucas <at> tercent.com> wrote:
> 
> >An inverted way of thinking about the problem is the notion of getting a
> >source document (say, a "company registration form") and parsing and
> >storing it in a normalized format.  How do you "tag" the origin of each
> >and every row in every table that resulted from that source document?
> 
> your form should have a code, either entered by the customer or by the
> preparer who enters it into the database, which becomes the key that
> identifies the registration document.  Put that key into other tables.

Yes -- I have flirted with this idea for the case of importing a set of
facts from a single source.  But where it breaks down is in being able
to do the reverse -- ex post facto, to certify the results of a query
as being accurate, and thereby attesting to the underlying facts.

> be careful, you are flirting with EAV thinking.  I think EAV designs
> are terrible.

(Though religion is not at issue here, I am pretty devoutly relational.
I just want a good way to perform audits and other functions on my
relations.)

> > It seems to me that the elegant way to do this would be to get the
> >entire graph of dependencies for not only all tables that reference the
> >entity, but only those rows within those tables that refer specifically
> >to my entity.
> >
> >The query engine should have a pretty good idea about which tables and
(Continue reading)

Alvaro Herrera | 1 Sep 05:15 2006

Re: [GENERAL] Thought provoking piece on

Bruce Momjian wrote:
> Tom Lane wrote:

> > It's pointless to suppose that individual developers would really be
> > answerable to any project-wide management, since that's not who they're
> > paid by.  So I tend to think that a project roadmap would be more of an
> > exercise in wishful thinking than a useful management tool.  OTOH it
> > *could* be useful, if there are any developers out there wondering what
> > they should work on next.  Are there any ... and would they listen to a
> > roadmap if they had one, rather than scratching their own itches?

I would certainly listen to a roadmap if it talked to me ...

> I think the longer someone is with the project the more they start
> working on what is good for the project, rather than what interests
> them.  I think we have seen many cases of that.

On my particular case, I generally grab some problem that I perceive as
important and unhandled, and try to do something to remedy it.  This is
how I got here in the first place, by fixing some problems in the
CLUSTER implementation.  This is how I got to doing shared dependencies,
shared row locks and autovacuum -- neither of them were problems that
affected me in any way.  Savepoints were a different matter.  I chose to
work on them because Bruce and other people on this list suggested them
to me, back when I was looking for something to do my undergrad project
in.

So yes, I'd probably work on something "the community" considered
important.

(Continue reading)

Jasbinder Bali | 1 Sep 08:24 2006
Picon

SPI_execute (result of a select statement)

Hi,

While using SPI_execute for a select statement, how do we store the result returned by select statement (say a C variable)?
SPI_execute returns different values for success or failure only as per the postgres manual.

Thanks,
Jas

Martijn van Oosterhout | 1 Sep 08:32 2006

Re: SPI_execute (result of a select statement)

On Fri, Sep 01, 2006 at 02:24:32AM -0400, Jasbinder Bali wrote:
> Hi,
> 
> While using SPI_execute for a select statement, how do we store the result
> returned by select statement (say a C variable)?
> SPI_execute returns different values for success or failure only as per the
> postgres manual.

Did you read the whole page?

http://www.postgresql.org/docs/8.1/interactive/spi-spi-execute.html

Especially the bit where it says:

  If the return value of the function is SPI_OK_SELECT then you may use
  the global pointer SPITupleTable *SPI_tuptable to access the result
  rows.

From there you can get the data. There's also the helper functions like
SPI_getvalue().

http://www.postgresql.org/docs/8.1/interactive/spi-interface-support.html

Hope this helps,
--

-- 
Martijn van Oosterhout   <kleptog <at> svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.
Harpreet Dhaliwal | 1 Sep 08:51 2006
Picon

Trigger (Transaction related)

Hi,
I've written a trigger after insert on a table (parser) and the trigger calls a function that dynamically loads a shared object written in C.

This shared object intends to use the newly inserted row in the table on which trigger is written and insert values in another table, something like this,

sprintf(buffer, "INSERT INTO headers (id, header_content) VALUES ( %d, SELECT contents FROM parser WHERE id = %d ), id, id);
SPI_exec(buffer,0).

Above line of code is not able to read the values of newly inserted code i.e
SELECT contents FROM parser WHERE id = %d
and throws an error.

Is it because its still the same transaction going on and the insert fired on parser talbe won't be reflected in the select query in the shared object which is a part of the same transaction???

Regards,

~Harpreet


Martijn van Oosterhout | 1 Sep 09:00 2006

Re: Trigger (Transaction related)

On Fri, Sep 01, 2006 at 02:51:59AM -0400, Harpreet Dhaliwal wrote:
> Hi,
> I've written a trigger after insert on a table (parser) and the trigger
> calls a function that dynamically loads a shared object written in C.
> 
> This shared object intends to use the newly inserted row in the table on
> which trigger is written and insert values in another table, something like
> this,

<snip>

> Above line of code is not able to read the values of newly inserted code i.e
> SELECT contents FROM parser WHERE id = %d
> and throws an error.

The new values are in the "NEW" pseudo-tuple. See the trigger
documentation on how to access it. In the pl/sql and pl/pgsql languages
you just say "NEW.<fieldname>". Not sure about C though.

> Is it because its still the same transaction going on and the insert fired
> on parser talbe won't be reflected in the select query in the shared object
> which is a part of the same transaction???

I don't think its visible in the table yet for a BEFORE INSERT trigger.
AFTER INSERT maybe, but in either case, the NEW tuple has the actual
values.

Hope this helps,
--

-- 
Martijn van Oosterhout   <kleptog <at> svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.
Jeroen T. Vermeulen | 1 Sep 09:02 2006
Picon
Picon

GBorg down?

Is gborg.postgresql.org having trouble?  I just got a warning from a user
that he couldn't get to the mailing lists, and sure enough, the site seems
to be completely down.

Jeroen

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Anton de Wet | 1 Sep 09:20 2006
Picon

Re: Thought provoking piece on NetBSD

On Thu, 31 Aug 2006, Josh Berkus wrote:

> In general, I think that people who harp on PostgreSQL's lack of a
> benevolent dictator as an inhibitor to progress are people who are not
> comfortable with democracy and are looking for excuses why company X needs
> to "take over the project for its own good."

One problem I see the postresql at the moment (and I'm porbably touching a 
can of worms here) is the lack of some sort of certification.

One thing linux (or Red Hat) is doing well is supplying the things that 
corporates are looking for. And the first thing they look for when they 
seriously start looking at a new technology is training. When they look at 
training, they go for certifications (as we see all the time with the 
RHCE).

We have a number of large corporate clients here in South Africa, 
including some of the biggest banks, of which a few are asking for 
training at the moment. It would be really nice to have some form of 
certification available that we could present that had some international 
credentials.

Anton

--
Forgiveness is giving up all hope for a better past

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo <at> postgresql.org so that your
       message can get through to the mailing list cleanly


Gmane