Re: [HACKERS] Composite GiST indexes?

2004-01-04 Thread Tom Lane
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes:
> Is it possible to make a composite GiST index?  I want to create an 
> index on a txtidx and a timestamp column - is that at all possible?

Yeah.  If you have a problem with that, it's grounds for a bug report.
Note though that GiST can't handle entries with NULL in the first
column, so it's best to put a NOT NULL column first if possible.

regards, tom lane

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

   http://www.postgresql.org/docs/faqs/FAQ.html


[HACKERS] Composite GiST indexes?

2004-01-04 Thread Christopher Kings-Lynne
Is it possible to make a composite GiST index?  I want to create an 
index on a txtidx and a timestamp column - is that at all possible?

Chris

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


Re: [HACKERS] Anything akin to an Evaluate Statement in Postgresql?

2004-01-04 Thread Tom Lane
A E <[EMAIL PROTECTED]> writes:
> I tried to execute a dynamic sql string using the dynamic record
> column name but I getting this error: ERROR: syntax error at or near
> "into" at character 8. Does the execute statement not allow the into
> keyword

It does not :-(.  The best way of getting data back from an EXECUTE'd
select is to use a FOR ... IN EXECUTE loop.  See the docs.

regards, tom lane

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [ADMIN] [HACKERS] IEEE 754

2004-01-04 Thread Michael Glaesemann
On Jan 4, 2004, at 6:51 PM, Bruce Momjian wrote:

Michael Glaesemann wrote:
On Dec 29, 2003, at 11:28 AM, Sai Hertz And Control Systems wrote:
I would like to share my concerns about the IEEE 754 specification 
and
floating point handling by PostgreSQL .
What specifically are your concerns regarding floating point handling
and PostgreSQL? I'm not in a position to address your concerns, but I
would like to know what they are.
Floating point math itself is not precise, but rather an approximation,
usually of 8 or 14 digits.  You can't approximate money.  This isn't a
PostgreSQL issue but rather a general programming issue.
Thanks, Bruce. I assume the arbitrary precision arithmetic Jan 
mentioned which is used for the NUMERIC type takes care of this.

Michael Glaesemann
grzm myrealbox com
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] time format

2004-01-04 Thread Martin Marques
Quoting Tom Lane <[EMAIL PROTECTED]>:

> Martin Marques <[EMAIL PROTECTED]> writes:
> > Look deeper into what Christopher said and use casting to get the right 
> > output:
> > prueba=> select now()::timestamp(0);
> 
> There's also "current_timestamp(0)", which is a more standards-compliant
> way of doing the same thing.

Didn´t know that existed. :-)

Anyway, my observation was not on the now() function, but at the casting. He
wants the output of th select over a timestamp field to come out without the
milliseconds, which is done with the casting.

Now, seeing your mail I realize that what he may want is this:

CREATE TABLE table_name (
  .
  time_field   timestamp(0)
);

Remember you will lose those milliseconds for ever with this table definition.

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [HACKERS] Anything akin to an Evaluate Statement in Postgresql?

2004-01-04 Thread A E
Thanks. I searched for it and I found something. It tells me to use the perl module. But Tom Lane mentions using the execute command see(http://archives.postgresql.org/pgsql-general/2001-03/msg01614.php). 
 
Since I have no interest in picking up yet another language, I tried this:
 
   qry := ''select * from ''|| trim(realname) ||'' where ''|| trim(searchfield) ||'' like %''|| trim(searchvalue) ||''%'';   arrayval := string_to_array(coltoparammatch(3, talias, insertparams, insertdelimiter), '','');  for objectdefinition in execute qry loopfor i in array_lower(arrayval, 1)..array_upper(arrayval, 1) loop  qry := ''select into aliasvalue objectdefinition.''|| arrayval[i];  execute qry;  RAISE NOTICE ''field = %'', aliasvalue;end loop;end loop;
 
I tried to execute a dynamic sql string using the dynamic record column name but I getting this error: ERROR:  syntax error at or near "into" at character 8. Does the execute statement not allow the into keyword into or am I not quoting right?
 
TIA
 
AlexChristopher Kings-Lynne <[EMAIL PROTECTED]> wrote:
> Was wondering if there was anything akin to an evaluate statement in > Postgresql for dynamic strings?By dint of tricky programming you can a function that can generate and execute arbitrary strings. I believe there's even an example of this in the docs.Chris

Re: [HACKERS] (Mis?)Behavior of \copy with -f and \i

2004-01-04 Thread Mark Feit
Peter Eisentraut writes:
 >
 > [Patch to make psql's \copy read from the current input, not just
 >  the standard input or a file.]
 > 
 > I'm not sure about the proposed syntax, but the feature sounds quite 
 > reasonable.

I have a patch written for this that uses the "-" syntax:

\copy junk (abbrev, name) FROM - WITH DELIMITER '|' NULL ''

I considered a half-dozen or so different ways to go about it, and
this one fits in without breaking anything that already exists.  The
hyphen seems like the best choice to go with STDIN and STDOUT since
there are already other programs where it implies the default input
stream and it's not something likely to be found alone as a filename.
If you find something you like better, changing it to something else
is a matter of tweaking a string in copy.c.

The patch will be posted to pgsql-patches as soon as I've had a chance
to torture it some more.

- Mark
-- 
"Debugging is twice as hard as writing the code in the first
 place. Therefore, if you write the code as cleverly as possible, you
 are, by definition, not smart enough to debug it."  -- Brian  Kernighan

---(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


Re: [HACKERS] Remote Procedures

2004-01-04 Thread Christopher Kings-Lynne
Try the contrib/dblink module.

Chris

A E wrote:

Hi,
 
I was wondering is there or will there be support for remote 
procedures/functions in Postgresql? Not only server to server, but 
database to database? Such as calling a function in DB "B" from DB "A" 
or Server Gaia DB "B" from Server Zeus DB "A"?
 
Alex
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


Re: [HACKERS] Anything akin to an Evaluate Statement in Postgresql?

2004-01-04 Thread Christopher Kings-Lynne
Was wondering if there was anything akin to an evaluate statement in 
Postgresql for dynamic strings?
By dint of tricky programming you can a function that can generate and 
execute arbitrary strings.  I believe there's even an example of this in 
the docs.

Chris

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
 subscribe-nomail command to [EMAIL PROTECTED] so that your
 message can get through to the mailing list cleanly


Re: [HACKERS] [JDBC] PL/Java issues

2004-01-04 Thread Thomas Hallgren
I think much of the issues should be resolved using JDBC and
java.sql.ResultSet and a couple of interfaces that can be used when mapping
specific types to specific Java objects (SQLData, SQLReader/SQLWriter).

A PL/Java needs a "hook" where a connection is initialized for JDBC access
in the backend. Here, the programmer can register the mappings used for
parameters and return values during the lifetime of the connection the same
way this is done using JDBC in the client.

The SQL standard  (for backend Java mapping) now goes further and suggest
that Java types can be defined "on the fly" in the Database just by
declaring a Type as such with "language Java". Really neat although I think
lots of thought needs to go in to how inheritance and overloading will be
handled for those types. If indeed that should be an SQL concern at all.

A question regarding the "ON COMMIT/ON ROLLBACK". Is there any way to write
backend code that will get called when this happens? Does the SPI include
some XA support or something similar where you can register a listener to
the current transaction? For a PL/Java port that would be really interesting
and the javax.transaction interfaces could be used to map to native Postgres
functionality in a standardized way.

Another question regarding connection = thread in JVM. A Postgres connection
is currently running in its own process. Having each such process
communicate with another process for each call that is made will be fairly
expensive. Consider a "SELECT foo(x) FROM y" where foo() is a Java method
and y contains several thousands of rows. Using a thread in an external JVM,
each foo() call will cause IPC call. IPC calls are expensive (that's partly
why we want to move code to the backend in the first place). Furhter more,
if each connection is in its own thread, how do you maintain connection
isolation? Suddenly connections share volatile and dirty data! Ok, you can
avoid this by having a completely separate ClassLoader chains in each
thread, but that's almost as expensive as having separate JVM's.

Now add that most Java projects uses a J2EE architecture that has a
connection pool that ensures that the number of times a new connection is
established is fairly low and connection reuse is maximized. One might
consider a solution where we let each connection spawn its own internal JVM
(on demand of course). What seems to be costly at first might prove
extremely efficient for the majority of users.

- thomas

"Jan Wieck" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dave Cramer wrote:
>
> > Barry,
> >
> > Ok, so if we drop this limitation then we leave it up to the architect
> > to manage the caching problem themselves.
>
> Maybe I don't understand enough about Java, but isn't this limitation
> (only static methods callable) exactly what avoids having to deal with
> the call->instance association in the PL framework?
>
> I think we still want to go a little further in the framework and
> provide at least the object caches. Since we don't have any ON COMMIT or
> ON ROLLBACK triggers, it'd be hard for the PL programmer to deal with
> cleanup and object dereferencing, especially in the case of transaction
> abort.
>
> >
> > The class loader issue is interesting, this would mean that each object
> > static or otherwise would not be able to overwrite others data.
>
> I think if we would create one thread per backend (on the first call of
> any PL/Java proc of course), and also have one class loader per thread,
> that'd be sufficient at least from a security point of view.
>
>
> Jan
>
> >
> > --dc--
> > On Wed, 2003-12-31 at 19:34, Barry Lind wrote:
> >> Jan,
> >>
> >> In Oracle a call from sql into java (be it trigger, stored procedure or
> >> function), is required to be a call to a static method.  Thus in Oracle
> >> all the work is left for the programmer to manage object instances and
> >> operate on the correct ones.  While I don't like this limitation in
> >> Oracle, I can't see a better way of implementing things.
> >>
> >> Therefore if you want to operate on object instances you (in Oracle)
> >> need to code up object caches that can hold the instances across
> >> function calls so that two or more functions can operate on the same
> >> instance as necessary.  What this implies to the implementation is that
> >> in order to be possible the multiple function calls need to run inside
> >> the same jvm (so you can access the static caches across the different
> >> calls).  If every call created a new jvm instance in Oracle you
couldn't
> >> do very much.  The Oracle jvm essentially gives you one jvm per
> >> connection (although technically it is somewhere between one jvm for
the
> >> whole server and one per connection - i.e. it has the memory and
process
> >> footprint of a single jvm for the entire server, but appears to the
user
> >> as a jvm per connection).  Having one jvm per connection is important
to
> >> limit multiple connections ability to stomp on each o

Re: [ADMIN] [HACKERS] IEEE 754

2004-01-04 Thread Bruce Momjian
Michael Glaesemann wrote:
> 
> On Dec 29, 2003, at 11:28 AM, Sai Hertz And Control Systems wrote:
> > I would like to share my concerns about the IEEE 754 specification and 
> > floating point handling by PostgreSQL .
> 
> What specifically are your concerns regarding floating point handling 
> and PostgreSQL? I'm not in a position to address your concerns, but I 
> would like to know what they are.

Floating point math itself is not precise, but rather an approximation,
usually of 8 or 14 digits.  You can't approximate money.  This isn't a
PostgreSQL issue but rather a general programming issue.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [HACKERS] PL/Java issues

2004-01-04 Thread Thomas Hallgren
I'm working on a pl/java project and have come quite far with it. Triggers
and Functions are both callable, there's support for complex types etc. I
have a project on GBorg (pljava) where I'll post all source in a CVS
repository in a matter of days (the code is ready but my ISP have a router
problem preventing me from anything but slow modem contact right now).

I've glanced at the SQL standard too of course. From what I could find, it
says surprisingly little about triggers. Triggers are, IMO one place where
you very often have a natural row association (ON EACH ROW). Such triggers
would be ideal as instance methods on a type. AFAICS, there no mentioning of
that in the standard. Nor does the standard mention how the "new" and "old"
tuples can be manipulated.

At present, I map complex types to Tuple instances (a Tuple is a Java object
that has a mapping to it's native C structure correspondance, the HeapTuple
and it's associated TupleDesc) both in functions and triggers. I have a
TriggerData java class also from which you can obtain the "trigger tuple"
and the "new tuple" and I follow the postgres model of returning a modified
(or not) tuple from triggers. As this is very Postgres specific, I plan to
add a ResultSet mapping on top later on.

Another thing that surprised me with the SQL standard was that although you
can override default mapping of types on parameters in order to pass NULL
values (a primitive int can be mapped to java.lang.Integer in the parameter
list by explicitly declaring a java parameter list), there's no way to
specify the same explicit mapping of return types.

One place where the SQL standard is talking about instance mapping is when
you map specific types to Java objects. A row that in fact reflects such a
type should of course be mapped to it's respective Java object and not to an
anonymous Tuple.

Stay tuned to GBorg and pljava. I hope my ISP will fix their router problem
real soon.

- thomas

""Andrew Dunstan"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dave Cramer said:
> > Can you explain what you mean by this?
> >
> > On Fri, 2004-01-02 at 20:21, Andrew Dunstan wrote:
> >> Will we need to address this TODO item:
> >>
> >>   . Add capability to create and call PROCEDURES
> >>
> >> before proceding to do PL/Java? It would add to the usefulness
> >> greatly,  I should think. I'm not sure how hard it would be.
> >>
>
> Well, it is syntactically unclean IMNSHO to have to define a return type
> on an SP when you don't really need one, and to have to call it by
> saying "select foo(bar)" rather than "call foo(bar)". Also, IIRC PL/SQL
> lets you bind host language variables to OUT parameters of such SPs, which
> can be quite useful. (It's a year or three since I touched Oracle in
> anger.)
>
> I would be mildly surprised if the SQL/JRT standard didn't expect to be
> able to bind to static methods of type void.
>
> (The item I quoted is on the TODO list - I didn't invent it ;-)
>
> cheers
>
> andrew
>
>
>
> ---(end of broadcast)---
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
>



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] time format

2004-01-04 Thread ivan

i know, but i talking about default time output, it would be for
time, date and date with time, not formating all the time.

On Sun, 4 Jan 2004, Tom Lane wrote:

> Martin Marques <[EMAIL PROTECTED]> writes:
> > Look deeper into what Christopher said and use casting to get the right
> > output:
> > prueba=> select now()::timestamp(0);
>
> There's also "current_timestamp(0)", which is a more standards-compliant
> way of doing the same thing.
>
>   regards, tom lane
>

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

   http://www.postgresql.org/docs/faqs/FAQ.html


[HACKERS] Anything akin to an Evaluate Statement in Postgresql?

2004-01-04 Thread A E





Hi,
 
Was wondering if there was anything akin to an evaluate statement in Postgresql for dynamic strings?
 
Alex

Re: [HACKERS] Remote Procedures

2004-01-04 Thread Joshua D. Drake
A E wrote:

Hi,
 
I was wondering is there or will there be support for remote 
procedures/functions in Postgresql? Not only server to server, but 
database to database? Such as calling a function in DB "B" from DB "A" 
or Server Gaia DB "B" from Server Zeus DB "A"?
 
You could use dblink from contrib.

Sincerely,

Joshua D. Drake



Alex


--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-222-2783 - [EMAIL PROTECTED] - http://www.commandprompt.com
Editor-N-Chief - PostgreSQl.Org - http://www.postgresql.org 

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


[HACKERS] Adding "help" to psql

2004-01-04 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
 
Someone mentioned in passing something on general:
 
> To this day, I have trouble with that in PostgreSQL.
> I'm constantly doing:
>
> psql> help;
> ERROR:  syntax error at or near "help" at character 1
 
I seem to recall some past discussion about making "help"
work in psql, but cannot remember the final outcome. Any
chance we can revisit it? I think it would be a worthwhile
addition.
 
- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200401041442
 
-BEGIN PGP SIGNATURE-
 
iD8DBQE/+G0ivJuQZxSWSsgRAg0NAJ46QakAQVdR8mnP1lm34TajWM1XIACfehGc
Y1OMDnF1VnwES9SgxCYaXgc=
=Y619
-END PGP SIGNATURE-



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] psql \d option list overloaded

2004-01-04 Thread Alex J. Avriette
On Sat, Jan 03, 2004 at 08:25:21PM -0500, Bruce Momjian wrote:

> > I finally figure it out, I just end up forgetting again later.  I still
> > have no clue how I'd find the same data without using psql.  In MySQL
> > I can run those queries from PHP, PERL...etc.  I know you can find that
> > data in system tables in PostgreSQL, but I don't wanna muck around with
> > all that.  I just wanna do something as simple as MySQL.
> 
> [ Moved to hackers.]
> 
> I am starting to agree that our \d* handling is just too overloaded. 
> Look at the option list from \?:

> I like the idea of adding a new syntax to show that information using
> simple SQL command syntax, and putting it in the backend so all
> applications can access it.  I know we have information schema, and
> maybe that can be used to make this simpler.

Bruce, while I agree with you about \d (and all its children), as well
as the querying we talked about on irc, I disagree with the notion of a
"SHOW DATABASES" query. This is one of the things that irritates me
about mysql is the pseudo-sql that everyone has come to accept (through
learning sql on mysql) as "sql". Things such as the '#' comments, and
the various SHOW DATABASES, I feel, detract from the "look and feel" of
the database. That look and feel is one of the reasons I am so loyal to
postgres (and indeed why some people are so loyal to mysql).

It doesn't make sense to create pseudo-sql, when all you're abstracting
is function-macros. I think the backslash syntax is fine. If you really
wanted to change it, you might consider a different syntax for it. Many
of us are familiar with slash/bang/colon/backslash commands in
interfacing with the programs we use regularly (vi, shells, irc
clients). Why not a /functions as a long syntax for \df? Would there be
a direct problem using the forward slash as a command indicator? This
way you could give people like the original poster something they were
looking for, eg:

/functions
/databases

and what I was looking for:

/functions timestamp

It also allows us a lot more freedom in changing the syntax, as the
expression of the commands is english (or, pick your language). I seem
to recall Neil mentioning to me that was a problem with
internationalization, but that's over my head.

I don't have any particular allegiance to the forward slash over anything
else. My chief concern is that what we're abstracting here are macros, and
as such, they should not be treated as sql. Because they aren't sql. If
you want to find out how to show the databases in sql, use psql -E.

Alex

--
[EMAIL PROTECTED]
Alex J. Avriette, Solaris Systems Masseur
"I ... remain against the death penalty because I feel that eternal boredom with no 
hope of parole is a much worse punishment than just ending it all mercifully with that 
quiet needle." - Rachel Mills, NC Libertarian Gubernatorial Candidate

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] psql \d option list overloaded

2004-01-04 Thread Peter Eisentraut
Bruce Momjian wrote:
> I am starting to agree that our \d* handling is just too overloaded.
> Look at the option list from \?:

> Can anyone remember all those?

Yes.

> I like the idea of adding a new syntax to show that information using
> simple SQL command syntax, and putting it in the backend so all
> applications can access it.  I know we have information schema, and
> maybe that can be used to make this simpler.

That's right.


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] Spinlock support for linux-hppa?

2004-01-04 Thread Peter Eisentraut
Oliver Elphick wrote:
> I can't very easily get cvs tip built on linus-hppa, because I
> couldn't make a package of that except for experimental, but
> experimental doesn't get processed by the autobuilders.

Time to break out the old configure; make; make install...


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [HACKERS] [COMMITTERS] pgsql-server/doc/src/sgml Tag: REL7_4_STABLE r ...

2004-01-04 Thread Peter Eisentraut
Tom Lane wrote:
> (It might be good if we had a more standardized way of generating
> HISTORY though.  I tried a couple different versions of lynx and
> got a couple different outputs, none perfectly matching whatever
> version Bruce is using ...)

There lies the problem.  Making these text files is still guesswork 
and/or manual polishing, because the tools always change and no one 
tool works well on at least HISTORY and INSTALL at the same time.  The 
HISTORY generatation has a makefile rule that appears to work well for 
Bruce, but I actually wrote it to work on my machine, but now I get the 
same problem that you state.  For INSTALL, lynx gives terrible results, 
and for the past few releases I've been using a tool named html2txt, 
but that still requires manual cleanup.  In short, automatic generation 
of text files that works every time is still an open problem.


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

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] (Mis?)Behavior of \copy with -f and \i

2004-01-04 Thread Peter Eisentraut
Mark Feit wrote:
> Peter Eisentraut declared that from that point on, stdin would be
> whatever stream the \copy command came from.  I'd like to propose a
> variant on the "FROM" clause which makes good on Peter's declaration
> without breaking anything already using FROM STDIN and expecting it
> to really read from stdin.  (I think this is for the better because
> there are lots of good uses for "psql -f foo.sql < foo.dat".)
>
> I'd be more than happy to write and test a patch if folks think this
> would be a good thing.  I'm leaning toward "FROM -" as the syntax but
> am open to other ideas (i.e., "FROM HERE" or "FROM INPUT").

I'm not sure about the proposed syntax, but the feature sounds quite 
reasonable.


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


Re: [HACKERS] time format

2004-01-04 Thread Tom Lane
Martin Marques <[EMAIL PROTECTED]> writes:
> Look deeper into what Christopher said and use casting to get the right 
> output:
> prueba=> select now()::timestamp(0);

There's also "current_timestamp(0)", which is a more standards-compliant
way of doing the same thing.

regards, tom lane

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [HACKERS] PL/Java issues

2004-01-04 Thread Andrew Dunstan
Joe Conway said:
> Andrew Dunstan wrote:
>> AFAIK it is not available except for $$$. It looks like the relevant
>> standards are parts 1 and 2 of the SQLJ standard (Part 0 covers
>> embedded SQL).
>>
>
> For working drafts try:
>
> http://www.wiscorp.com/sql/sql_2003_standard.zip
> (5WD-13-JRT-2003-09.pdf)
>
[snip]

Cool. Specifically, try this one and have a look at Appendices E and F.

cheers

andrew



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


Re: [HACKERS] *sigh*

2004-01-04 Thread Neil Conway
"Simon Riggs" <[EMAIL PROTECTED]> writes:
> Select count(*) could be evaluated against any available index
> sub-tables, since all that is required is to count the rows. That would
> be significantly faster than a full file scan and accurate too.

PostgreSQL stores MVCC information in heap tuples only, so index-only
plans such as you're suggesting can't be used (i.e. we need to check
the heap tuple to see if a particular index entry is visible to the
current transaction).

-Neil


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


Re: [HACKERS] Need a good .

2004-01-04 Thread Neil Conway
"Thomas Hallgren" <[EMAIL PROTECTED]> writes:
> I'm working on a pljava module. In it, I'd like to cache some allocated
> structures (allocated using TopMemoryContext) using a string as the key. I
> need a hash or binary-search table with dynamic size where I can store
> arbitrary structures and then find them using strings.

Take a look at src/backend/utils/hash/dynahash.c

-Neil


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


[HACKERS] Remote Procedures

2004-01-04 Thread A E
Hi,
 
I was wondering is there or will there be support for remote procedures/functions in Postgresql? Not only server to server, but database to database? Such as calling a function in DB "B" from DB "A" or Server Gaia DB "B" from Server Zeus DB "A"?
 
Alex

Re: [HACKERS] ecpg's minor bug

2004-01-04 Thread Michael Meskes
On Thu, Jan 01, 2004 at 01:59:45PM +0800, William ZHANG wrote:
> in preproc.y:2021:
> ...

Thanks for the report. I just fixed it in HEAD and 7.4.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: [EMAIL PROTECTED]
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---(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


Re: [HACKERS] time format

2004-01-04 Thread Martin Marques
El Sáb 03 Ene 2004 18:20, ivan escribió:
> ok, bat each time where i want to do select .. a nie tu use to_char,
> but it should be in function timestamp_out to convert time to string
> it would be easer and faster.

Look deeper into what Christopher said and use casting to get the right 
output:

prueba=> select now();
  now
---
 2004-01-04 09:53:41.131079-03
(1 row)

prueba=> select now()::timestamp(0);
 now
-
 2004-01-04 09:53:43
(1 row)


Get the difference?

-- 
 09:52:01 up 39 days, 16:08,  2 users,  load average: 0.60, 0.71, 0.72
-
Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
  del Litoral
-


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] psql \d option list overloaded

2004-01-04 Thread Mark Kirkwood
Couldn't agree more - syntax like

SHOW TABLES;

is inituitive and somehow "right" - [chuckles] - Mysql does not have 
*everything* wrong!

regards

Mark

Bruce Momjian wrote:

I like the idea of adding a new syntax to show that information using
simple SQL command syntax, and putting it in the backend so all
applications can access it.  I know we have information schema, and
maybe that can be used to make this simpler.
 



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