[GENERAL] Function results written to memory, then sent?

2005-03-14 Thread Steve - DND
I was reading through the docs today, and came across a paragraph that indicated when plpgsql queries are executed on the server, the results are all written to memory(or disk if necessary), and not streamed as available. I can't find the doc page which said it, but does anyone know if this applies

[GENERAL] Iterate OLD/NEW columns in a trigger?

2005-04-07 Thread Steve - DND
Is there a way to iterate the columns contained on the OLD/NEW. I want to do some work in a function in a trigger, but I want it to be generic. I don't want to have to create a separate trigger for each table, since the work performed in the trigger is essentially the same for all of them. I just n

Re: [GENERAL] Iterate OLD/NEW columns in a trigger?

2005-04-07 Thread Steve - DND
> > try pltcl, it's supposed to be pretty good at this. > > > > As is plperl and likely plpython, and maybe others. Does anyone have an example of this at work? I tried a few Google searches, but couldn't get any results showing iterating over the columns of a record. Thanks, Steve ---

[GENERAL] Can't install plpython on Windows 8.0

2005-04-07 Thread Steve - DND
I just tried using createlang to install plpython into a database on my Windows 8.0 installation and continue to receive the error below. The file plpython.dll is in exactly the location specified below as well. What exactly am I doing wrong here? createlang -e -U postgres plpythonu junk Password:

Re: [GENERAL] Can't install plpython on Windows 8.0

2005-04-08 Thread Steve - DND
> I just tried using createlang to install plpython into a database on my > Windows 8.0 installation and continue to receive the error below. The file > plpython.dll is in exactly the location specified below as well. What > exactly am I doing wrong here? > > createlang -e -U postgres plpythonu jun

Re: [GENERAL] Can't install plpython on Windows 8.0

2005-04-08 Thread Steve - DND
> >> createlang: language installation failed: ERROR: could not > load library > >> "C:/Program Files/PostgreSQL/8.0/lib/plpython.dll": dynamic load error > > > Actually I just tried createlang with all of the pls(except > plpgsql which is > > already installed). All of them fail with the same err

[GENERAL] Table inheritance or LIKE table?

2005-04-09 Thread Steve - DND
What is the general consensus on using table inheritance? I know it's there, but is it good, bad, or just dependent on how it's used? I need to track creation/update information for a large number of tables in my current DB. I was just going to create a table with the template of fields I was looki

[GENERAL] Can't install pltcl on Windows 8.0

2005-04-14 Thread Steve - DND
Originally posted in win32-hackers, but could not get a solution. Maybe someone here has an idea? I am currently trying to install pltcl on my Win32 8.0 version of PG, and am receiving the incredibly generic message: createlang: language installation failed: ERROR: could not load library "C:/Pro g

[GENERAL] PG utilities won't prompt for password after Win32 8.0.2 upgrade

2005-04-18 Thread Steve - DND
I accidentally posted this to win32-hackers first, instead of here originally as I meant to. Just when everything looked good, it went to crap again. I was able to successfully install pltclu into one database with the command "createlang -U postgres pltclu dbname". Upon hitting enter, I was promp

[GENERAL] Raise exception from regular SQL?

2005-04-21 Thread Steve - DND
I'm trying to add some clarity to the rules I have on my tables. When a rule is broken, I want to give a more informative message, so that the client side can deal with it in a nicer manner. Right now I'm creating plpgsql functions, and raising an exception in there with the customized text. Is th

[GENERAL] Get timestamp as UTC

2005-04-21 Thread Steve - DND
I was under the impression that using timezone('UTC', now())::timestamptz would give me the current UTC time, with timezone offset. Instead I am getting the UTC time, but with an offset of -07(my local time). How do I get UTC time, with the 0 offset that it should be? Thanks, Steve

[GENERAL] timezone() with timeofday() converts the wrong direction?

2005-04-21 Thread Steve - DND
These attempts were run at 4/21/2005 13:15:00 -07. UTC: 4/21/2005 20:15:00 SELECT timeofday()::timestamp 04/21/2005 13:15:00 SELECT timezone('UTC', now()) 04/21/2005 20:15:00 PM SELECT timezone('UTC', timeofday()::timestamp)::timestamp without time zone 04/21/2005 06:15:00 <- What the heck is th

Re: [GENERAL] timezone() with timeofday() converts the wrongdirection?

2005-04-21 Thread Steve - DND
> > What version of PostgreSQL are you running? I seem to remember a few > versions ago the offset having the wrong sign. I'm running 8.0.2 Win32. Steve ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] timezone() with timeofday() converts the wrong direction?

2005-04-21 Thread Steve - DND
> > Perhaps this is what you want: > > SELECT timezone('UTC', timeofday()::timestamptz); That did it. Strangely, I thought I had tried that already, but I must not have. My next question would be if I did: SELECT timezone('UTC', timeofday()::timestamptz):timestamptz; Why do I get the t

Re: [GENERAL] timezone() with timeofday() converts the wrong direction?

2005-04-21 Thread Steve - DND
> > Again looking at the documentation, we see that "timestamp with > time zone AT TIME ZONE zone" means "Convert UTC to local time in > given time zone" and has a return type of "timestamp without time > zone". So if we run the above command without the final cast > around 16:25 PDT / 23:25 UTC,

[GENERAL] plruby on Windows

2005-04-26 Thread Steve - DND
Does anyone know if it's possible to build plruby for the native version of PostgreSQL 8? If so, can you please let me know where you obtained the sourcecode, and build instructions, if any? Thanks, Steve ---(end of broadcast)--- TIP 2: you can ge

[GENERAL] Current transaction ID?

2005-06-14 Thread Steve - DND
Simple question I'm sure, but how can I get the transaction ID that a query is currently running in? I can find all kinds of documentation talking about transaction ids, but nothing about how to get the current one. Thanks, Steve ---(end of broadcast)

Re: [GENERAL] Current transaction ID?

2005-06-14 Thread Steve - DND
> Steve - DND wrote: > > Simple question I'm sure, but how can I get the transaction ID > that a query > > is currently running in? I can find all kinds of documentation > talking about > > transaction ids, but nothing about how to get the current one. > > Y

Re: [GENERAL] Current transaction ID?

2005-06-14 Thread Steve - DND
> > Let's pretend I don't know how to do that. :) Do you have a > link to a page > > in the manual that describes this process, or can you give me a quick > > runthrough of what you're talking about? > > Every row has an invisible xmin/xmax columns that represent the xid of > the row inserted, upda

Re: [GENERAL] Current transaction ID?

2005-06-14 Thread Steve - DND
> > Well, you can take the xmin of a row and look for other rows with the > same xmin, either in the same table or in different tables. Do these columns appear inside the NEW/OLD variables for triggers, or from some other method within a trigger? Steve ---(end of broadc

[GENERAL] Connection local variables?

2005-06-28 Thread Steve - DND
Is there a way to create a variable specific to the current working connection? Like a connection context or some such? I'm trying to take a variable in a query, and allow it to be used by a rule. Thanks, Steve ---(end of broadcast)--- TIP 4: Don'

[GENERAL] Transparent i18n?

2005-06-30 Thread Steve - DND
I've recently been trying to implement some i18n functionality as simply as possible into my application. I have a lot of lookup values and such in the DB that need to be translated, and I would rather not do it in the calling client. A friend and I put our heads together, and came up which seemed

[GENERAL] MultiByte columns

2003-11-18 Thread Steve - DND
I currently have a DB setup with ENCODING = UNICODE. Are all char, and varchars stored as UNICODE? I predominantly work in a SQL Server environment, and there we have varchar for regular ASCII, and nvarchar for Unicode, so the extra space is used only when necessary. I just wanted to find out if PG