Re: is there an immutable function to switch from date to character?

2024-04-24 Thread Celia McInnis
table language sql as $$ select to _char(i_date, '-Mon-DD') $$; Thanks! On Wed, Apr 24, 2024 at 5:54 PM Tom Lane wrote: > Celia McInnis writes: > > create temporary table junk as select now()::date as evtdate; > > alter table junk add column chardate text GENERATED ALWAYS

is there an immutable function to switch from date to character?

2024-04-24 Thread Celia McInnis
create temporary table junk as select now()::date as evtdate; alter table junk add column chardate text GENERATED ALWAYS AS (to_char(evtdate,'-Mon-DD')) STORED; ERROR: generation expression is not immutable

altering a column to to make it generated

2024-04-22 Thread Celia McInnis
Can I alter a table column to now make it generated? I tried this unsuccessfully: create temp table tmp1 as select 15::numeric(6,1) as distance,'24:30'::interval,0::numeric(7,3) as avgspd; alter table tmp1 alter column avgspd type numeric(7,3) generated always as ((3600.*distance)/EXTRACT (EPOCH F

adding a generated column to a table?

2024-04-22 Thread Celia McInnis
If I have a table containing a date field, say: create temporary table tmp1 as select now()::date as evtdate; SELECT 1 select DATE_PART('year', evtdate)::integer as year from tmp1; year -- 2024 (1 row) Is there some way of doing something like the following?: alter table tmp1 add column ye

Re: Dropping a temporary view?

2024-03-20 Thread Celia McInnis
On Wed, Mar 20, 2024 at 2:15 PM Adrian Klaver wrote: > > On 3/20/24 10:54 AM, Celia McInnis wrote: > > Comments below more to sort out the process in my head then anything else. > > Hi Adrian > > The only behaviour changed for the debugging was to make the view > non

Re: Dropping a temporary view?

2024-03-20 Thread Celia McInnis
dn't do an explain on the slow query - and it's too late now since the views are removed. However, I never had a delay when waiting for the view to be created in my web software, so, I'll just proceed being more careful and hope that the delay seen was due to some big mess I created. Than

Re: Dropping a temporary view?

2024-03-20 Thread Celia McInnis
problem in psql, I'll re-ask. Meanwhile I'll also change my software to use different view names when using non-temporary iviews for debugging. Thanks, Celia McInnis On Wed, Mar 20, 2024 at 12:33 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wednesday, Marc

Re: Dropping a temporary view?

2024-03-20 Thread Celia McInnis
is not web-crawl-able) when I'm trying to debug things, and I guess I have to be careful to clean those up when I switch back to the temporary tables/views. On Wed, Mar 20, 2024 at 11:46 AM Adrian Klaver wrote: > On 3/20/24 08:39, Celia McInnis wrote: > > Ok, thanks - so I gu

Re: Dropping a temporary view?

2024-03-20 Thread Celia McInnis
e doing to clean up any temporary messes I am creating? Thanks, Celia McInnis On Wed, Mar 20, 2024 at 11:12 AM Erik Wienhold wrote: > On 2024-03-20 15:58 +0100, Celia McInnis wrote: > > I am using postresql 16, am trying to use temporary views in a piece of > > software that I a

Dropping a temporary view?

2024-03-20 Thread Celia McInnis
hat name that was created by my software when I was not creating a temporary view?). I really wasn't expecting this, so if someone can explain, that would be great. Thanks, Celia McInnis

Re: How to store in hours:minutes:seconds where hours may be bigger than 24

2024-03-19 Thread Celia McInnis
Thank goodness and thanks! Celia On Tue, Mar 19, 2024 at 11:01 PM Christophe Pettus wrote: > > > > On Mar 19, 2024, at 19:56, Celia McInnis > wrote: > > > > Thanks for the suggestion, Steve, but No - when I insert > 25:17:07::interval into my table I get 01:17:07 into

Re: How to store in hours:minutes:seconds where hours may be bigger than 24

2024-03-19 Thread Celia McInnis
make a composite type to get what I want??? Thanks, Celia McInnis On Tue, Mar 19, 2024 at 10:44 PM Steve Baldwin wrote: > Could you use an interval data type? For example: > > b2bcreditonline=# create table interval_example (i interval); > CREATE TABLE > b2bcreditonlin

How to store in hours:minutes:seconds where hours may be bigger than 24

2024-03-19 Thread Celia McInnis
Hi: I want to store times in a database as hours:minutes:seconds where hours can be greater than 24. How do I do this? I will want to be able to add such times. Thanks, Celia McInnis

Re: Uppercase version of ß desired

2023-03-14 Thread Celia McInnis
s! But at least postgresql and python do far better with unicode than mysql and perl did! :-) Celia McInnis On Tue, Mar 14, 2023 at 9:12 AM Philip Semanchuk < phi...@americanefficient.com> wrote: > > > > On Mar 13, 2023, at 5:38 PM, Celia McInnis > wrote: > > >

Re: Uppercase version of ß desired

2023-03-13 Thread Celia McInnis
to have a lower case letter which has the same value for its upper cased one. Thanks, Celia McInnis . On Mon, Mar 13, 2023 at 6:54 PM Tom Lane wrote: > "Peter J. Holzer" writes: > > On 2023-03-13 17:38:51 -0400, Celia McInnis wrote: > >> I would be really happy

Uppercase version of ß desired

2023-03-13 Thread Celia McInnis
nd the successful letter substitution submissions in lower case - so I need the upper and lower case versions of each letter to be different! Thanks for any assistance! Maybe I can hack what I want in python (which is what I am using for the puzzle). Celia McInnis

Re: spiexceptions.UndefinedFile: could not open file "base/16482/681830": No such file or directory

2021-09-08 Thread Celia McInnis
8:56 PM Thomas Munro wrote: > On Thu, Sep 9, 2021 at 9:19 AM Celia McInnis > wrote: > > Note that the file does exist:! (How do I know if it is looking under > the correct directory? Other times I have done similar temporary table > creations with no problems!): > > Po

spiexceptions.UndefinedFile: could not open file "base/16482/681830": No such file or directory

2021-09-08 Thread Celia McInnis
Help - I don't know why I am getting this message, and I don't know how to fix it. Any advice will be greatly appreciated. Note that the file does exist:! (How do I know if it is looking under the correct directory? Other times I have done similar temporary table creations with no problems!): *l

Treating float arrays as vectors?

2021-06-17 Thread Celia McInnis
do these kinds of operations. Is there a better way I can get this functionality? Celia McInnis

normalizing a float array?

2018-03-06 Thread Celia McInnis
Hi - I can write a stored procedure to normalize float arrays, but is there a nicer way of doing this in postgresql?

Re: creating a table in plpython?

2018-01-10 Thread Celia McInnis
part of the problem... On Wed, Jan 10, 2018 at 6:34 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wed, Jan 10, 2018 at 4:27 PM, Celia McInnis > wrote: > >> Hi - Is it possible to create a table inside a plpython stored procedure? >> If so, can you give

creating a table in plpython?

2018-01-10 Thread Celia McInnis
Hi - Is it possible to create a table inside a plpython stored procedure? If so, can you give an example of how to do so? Many thanks, Celia McInnis