trouble writing plpgsql

From: hamann(dot)w(at)t-online(dot)de
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: trouble writing plpgsql
Date: 2022-12-22 11:37:22
Message-ID: wolfgang-1221222123722.A0128333@linux-tuxedo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I want to make a function to parsetext and return key-value pairs
create or replace function extractinfo (text) returns table (key char[1], val text)
language plpgsql as $$

I first tried
declare
xx record;
begin
....
xx.key = ....; xx.val = ....;
return next xx:

This is not possible because xx needs to know its structure before the fields can be assiged to.
Could I declare xx as having these fields in the first place, do Ineedto create a type for key, val
first?

Wolfgang Hamann

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2022-12-22 11:43:30 Re: trouble writing plpgsql
Previous Message Rainer Duffner 2022-12-22 10:15:57 Re: Regd. the Implementation of Wallet (in Oracle) config equivalent in postgreSQL whilst the database migration